mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 04:39:33 +01:00
Add 'delta edit cursor' option to primary and secondary clocks. When in this mode, the clocks display the absolute difference between the playhead and the edit cursor
git-svn-id: svn://localhost/ardour2/trunk@1838 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
90f3128d73
commit
9383499ce6
11 changed files with 84 additions and 14 deletions
|
|
@ -77,6 +77,8 @@ AudioClock::AudioClock (std::string clock_name, bool transient, std::string widg
|
|||
{
|
||||
session = 0;
|
||||
last_when = 0;
|
||||
last_pdelta = 0;
|
||||
last_sdelta = 0;
|
||||
key_entry_state = 0;
|
||||
ops_menu = 0;
|
||||
dragging = false;
|
||||
|
|
@ -383,17 +385,41 @@ AudioClock::on_realize ()
|
|||
}
|
||||
|
||||
void
|
||||
AudioClock::set (nframes_t when, bool force)
|
||||
AudioClock::set (nframes_t when, bool force, nframes_t offset, int which)
|
||||
{
|
||||
|
||||
if ((!force && !is_visible()) || session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (when == last_when && !force) {
|
||||
if (when == last_when && !offset && !force) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool pdelta = Config->get_primary_clock_delta_edit_cursor();
|
||||
bool sdelta = Config->get_secondary_clock_delta_edit_cursor();
|
||||
|
||||
if (offset && which == 1 && pdelta) {
|
||||
when = (when > offset) ? when - offset : offset - when;
|
||||
} else if (offset && which == 2 && sdelta) {
|
||||
when = (when > offset) ? when - offset : offset - when;
|
||||
}
|
||||
|
||||
if (which == 1 && pdelta && !last_pdelta) {
|
||||
cout << "set_widget_name() called" << endl;
|
||||
set_widget_name("TransportClockDisplayDelta");
|
||||
last_pdelta = true;
|
||||
} else if (which == 1 && !pdelta && last_pdelta) {
|
||||
set_widget_name("TransportClockDisplay");
|
||||
last_pdelta = false;
|
||||
} else if (which == 2 && sdelta && !last_sdelta) {
|
||||
set_widget_name("SecondaryClockDisplayDelta");
|
||||
last_sdelta = true;
|
||||
} else if (which == 2 && !sdelta && last_sdelta) {
|
||||
set_widget_name("SecondaryClockDisplay");
|
||||
last_sdelta = false;
|
||||
}
|
||||
|
||||
switch (_mode) {
|
||||
case SMPTE:
|
||||
set_smpte (when, force);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue