if actively recording, prevent interaction between mouse and audio clock widget(s)

This commit is contained in:
Paul Davis 2017-05-31 13:04:03 -04:00
parent d35dfa9c93
commit 82cb046fa3

View file

@ -1520,6 +1520,11 @@ AudioClock::index_to_field (int index) const
bool bool
AudioClock::on_button_press_event (GdkEventButton *ev) AudioClock::on_button_press_event (GdkEventButton *ev)
{ {
if (!_session || _session->actively_recording()) {
/* swallow event, do nothing */
return true;
}
switch (ev->button) { switch (ev->button) {
case 1: case 1:
if (editable && !_off) { if (editable && !_off) {
@ -1563,6 +1568,11 @@ AudioClock::on_button_press_event (GdkEventButton *ev)
bool bool
AudioClock::on_button_release_event (GdkEventButton *ev) AudioClock::on_button_release_event (GdkEventButton *ev)
{ {
if (!_session || _session->actively_recording()) {
/* swallow event, do nothing */
return true;
}
if (editable && !_off) { if (editable && !_off) {
if (dragging) { if (dragging) {
gdk_pointer_ungrab (GDK_CURRENT_TIME); gdk_pointer_ungrab (GDK_CURRENT_TIME);
@ -1636,7 +1646,7 @@ AudioClock::on_scroll_event (GdkEventScroll *ev)
int index; int index;
int trailing; int trailing;
if (editing || _session == 0 || !editable || _off) { if (editing || _session == 0 || !editable || _off || _session->actively_recording()) {
return false; return false;
} }
@ -1700,7 +1710,7 @@ AudioClock::on_scroll_event (GdkEventScroll *ev)
bool bool
AudioClock::on_motion_notify_event (GdkEventMotion *ev) AudioClock::on_motion_notify_event (GdkEventMotion *ev)
{ {
if (editing || _session == 0 || !dragging) { if (editing || _session == 0 || !dragging || _session->actively_recording()) {
return false; return false;
} }