time::Control Integration First Commit
This commit is contained in:
parent
ca634bdd9c
commit
c9671b654e
1 changed files with 18 additions and 8 deletions
|
|
@ -47,7 +47,10 @@ IBeamTool::IBeamTool(TimelineBody &timeline_body) :
|
|||
dragType(None),
|
||||
pinnedDragTime(),
|
||||
scrollSlideRate(0)
|
||||
{ }
|
||||
{
|
||||
// Connect the timlinebody selection to the selectionControl
|
||||
this->get_state()->get_selection().accept(selectionControl);
|
||||
}
|
||||
|
||||
IBeamTool::~IBeamTool()
|
||||
{
|
||||
|
|
@ -117,9 +120,14 @@ IBeamTool::on_button_press_event(GdkEventButton* event)
|
|||
// User began the drag in clear space, begin a Select drag
|
||||
dragType = Selection;
|
||||
pinnedDragTime = time;
|
||||
state->setSelection (Mutation::changeTime(time));
|
||||
state->setSelection (Mutation::changeDuration(Duration::NIL));
|
||||
//////////////////////////////////////////////////////TICKET #797 : this is cheesy. Should provide a single Mutation to change all
|
||||
selectionControl (TimeSpan(time, Duration::NIL));
|
||||
state->selection_changed_signal().emit();
|
||||
std::cout << "\n" << std::string(time) << "\n";
|
||||
std::cout << std::string(state->get_selection().start()) << "\n\n";
|
||||
|
||||
//state->setSelection (Mutation::changeTime (time));
|
||||
//state->setSelection (Mutation::changeDuration (Duration::NIL));
|
||||
////////////"//////////////////////////////////////////TICKET #797 : this is cheesy. Should provide a single Mutation to change all
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -193,12 +201,14 @@ IBeamTool::set_leading_x(const int x)
|
|||
const bool set_playback_period = dragType == Selection;
|
||||
TimeVar newStartPoint (state->get_view_window().x_to_time(x));
|
||||
Offset selectionLength (pinnedDragTime, newStartPoint);
|
||||
|
||||
|
||||
if (newStartPoint > pinnedDragTime)
|
||||
newStartPoint=pinnedDragTime; // use the smaller one as selection start
|
||||
|
||||
state->setSelection (Mutation::changeTime(newStartPoint) , set_playback_period);
|
||||
state->setSelection (Mutation::changeDuration(selectionLength), set_playback_period);
|
||||
|
||||
// selectionControl (TimeSpan(newStartPoint, Duration(selectionLength)));
|
||||
|
||||
//state->setSelection (Mutation::changeTime(newStartPoint) , set_playback_period);
|
||||
// state->setSelection (Mutation::changeDuration(selectionLength), set_playback_period);
|
||||
//////////////////////////////////////////////////////TICKET #797 : this is cheesy. Should provide a single Mutation to change all at once
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue