13
0

locate when clicking on start/end fields in time info box

git-svn-id: svn://localhost/ardour2/branches/3.0@9683 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-06-07 18:20:22 +00:00
parent f6e67fa3dd
commit 7e2b86dc83
3 changed files with 48 additions and 29 deletions

View File

@ -889,6 +889,7 @@ AudioClock::button_press (GdkEventButton *ev, CairoCell* cell)
{ {
switch (ev->button) { switch (ev->button) {
case 1: case 1:
if (editable) {
if (cell) { if (cell) {
editing_field = (Field) cell->id (); editing_field = (Field) cell->id ();
display->start_editing (cell); display->start_editing (cell);
@ -904,6 +905,7 @@ AudioClock::button_press (GdkEventButton *ev, CairoCell* cell)
drag_accum = 0; drag_accum = 0;
drag_start_y = ev->y; drag_start_y = ev->y;
drag_y = ev->y; drag_y = ev->y;
}
break; break;
default: default:
@ -917,6 +919,7 @@ AudioClock::button_press (GdkEventButton *ev, CairoCell* cell)
bool bool
AudioClock::button_release (GdkEventButton *ev, CairoCell* cell) AudioClock::button_release (GdkEventButton *ev, CairoCell* cell)
{ {
if (editable) {
if (dragging) { if (dragging) {
gdk_pointer_ungrab (GDK_CURRENT_TIME); gdk_pointer_ungrab (GDK_CURRENT_TIME);
dragging = false; dragging = false;
@ -925,13 +928,6 @@ AudioClock::button_release (GdkEventButton *ev, CairoCell* cell)
return true; return true;
} }
} }
if (!editable) {
if (ops_menu == 0) {
build_ops_menu ();
}
ops_menu->popup (1, ev->time);
return true;
} }
if (Keyboard::is_context_menu_event (ev)) { if (Keyboard::is_context_menu_event (ev)) {
@ -942,7 +938,7 @@ AudioClock::button_release (GdkEventButton *ev, CairoCell* cell)
return true; return true;
} }
return true; return false;
} }
bool bool

View File

@ -125,6 +125,12 @@ TimeInfoBox::TimeInfoBox ()
punch_start->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_punch_mode), punch_start)); punch_start->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_punch_mode), punch_start));
punch_end->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_punch_mode), punch_end)); punch_end->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_punch_mode), punch_end));
selection_start->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), selection_start), true);
selection_end->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), selection_end), true);
punch_start->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), punch_start), true);
punch_end->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), punch_end), true);
Editor::instance().get_selection().TimeChanged.connect (sigc::mem_fun (*this, &TimeInfoBox::selection_changed)); Editor::instance().get_selection().TimeChanged.connect (sigc::mem_fun (*this, &TimeInfoBox::selection_changed));
} }
@ -138,6 +144,21 @@ TimeInfoBox::~TimeInfoBox ()
delete punch_end; delete punch_end;
} }
bool
TimeInfoBox::clock_button_release_event (GdkEventButton* ev, AudioClock* src)
{
if (!_session) {
return false;
}
if (ev->button == 1) {
_session->request_locate (src->current_time ());
return true;
}
return false;
}
void void
TimeInfoBox::sync_selection_mode (AudioClock* src) TimeInfoBox::sync_selection_mode (AudioClock* src)
{ {

View File

@ -72,6 +72,8 @@ class TimeInfoBox : public Gtk::Table, public ARDOUR::SessionHandlePtr
void sync_selection_mode (AudioClock*); void sync_selection_mode (AudioClock*);
void sync_punch_mode (AudioClock*); void sync_punch_mode (AudioClock*);
bool clock_button_release_event (GdkEventButton* ev, AudioClock* src);
}; };