mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
show slave info in Min:Sec mode - fill empty space
git-svn-id: svn://localhost/ardour2/branches/3.0@13438 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
797ac9ef91
commit
3f2e8fe305
2 changed files with 49 additions and 37 deletions
|
|
@ -963,8 +963,8 @@ AudioClock::set (framepos_t when, bool force, framecnt_t offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (when == last_when && !force) {
|
if (when == last_when && !force) {
|
||||||
if (_mode != Timecode) {
|
if (_mode != Timecode && _mode != MinSec) {
|
||||||
/* timecode may need to force display of TC source
|
/* may need to force display of TC source
|
||||||
* time, so don't return early.
|
* time, so don't return early.
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
|
|
@ -989,6 +989,9 @@ AudioClock::set (framepos_t when, bool force, framecnt_t offset)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MinSec:
|
case MinSec:
|
||||||
|
if (_right_layout) {
|
||||||
|
_right_layout->set_alignment(Pango::ALIGN_RIGHT);
|
||||||
|
}
|
||||||
set_minsec (when, force);
|
set_minsec (when, force);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1002,6 +1005,46 @@ AudioClock::set (framepos_t when, bool force, framecnt_t offset)
|
||||||
last_when = when;
|
last_when = when;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AudioClock::set_slave_info ()
|
||||||
|
{
|
||||||
|
if (!_left_layout || !_right_layout) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SyncSource sync_src = Config->get_sync_source();
|
||||||
|
|
||||||
|
if (_session->config.get_external_sync()) {
|
||||||
|
Slave* slave = _session->slave();
|
||||||
|
|
||||||
|
switch (sync_src) {
|
||||||
|
case JACK:
|
||||||
|
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
|
||||||
|
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
|
||||||
|
_right_layout->set_text ("");
|
||||||
|
break;
|
||||||
|
case LTC:
|
||||||
|
case MTC:
|
||||||
|
case MIDIClock:
|
||||||
|
if (slave) {
|
||||||
|
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"green\">%2</span>",
|
||||||
|
INFO_FONT_SIZE, dynamic_cast<TimecodeSlave*>(slave)->approximate_current_position()));
|
||||||
|
_right_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
|
||||||
|
INFO_FONT_SIZE, slave->approximate_current_delta()));
|
||||||
|
} else {
|
||||||
|
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
|
||||||
|
INFO_FONT_SIZE, _("--pending--")));
|
||||||
|
_right_layout->set_text ("");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">INT/%2</span>",
|
||||||
|
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
|
||||||
|
_right_layout->set_text ("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClock::set_frames (framepos_t when, bool /*force*/)
|
AudioClock::set_frames (framepos_t when, bool /*force*/)
|
||||||
{
|
{
|
||||||
|
|
@ -1100,6 +1143,7 @@ AudioClock::set_minsec (framepos_t when, bool /*force*/)
|
||||||
}
|
}
|
||||||
|
|
||||||
_layout->set_text (buf);
|
_layout->set_text (buf);
|
||||||
|
set_slave_info();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1133,40 +1177,7 @@ AudioClock::set_timecode (framepos_t when, bool /*force*/)
|
||||||
|
|
||||||
_layout->set_text (Timecode::timecode_format_time(TC));
|
_layout->set_text (Timecode::timecode_format_time(TC));
|
||||||
|
|
||||||
if (_left_layout && _right_layout) {
|
set_slave_info();
|
||||||
|
|
||||||
SyncSource sync_src = Config->get_sync_source();
|
|
||||||
|
|
||||||
if (_session->config.get_external_sync()) {
|
|
||||||
Slave* slave = _session->slave();
|
|
||||||
|
|
||||||
switch (sync_src) {
|
|
||||||
case JACK:
|
|
||||||
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
|
|
||||||
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
|
|
||||||
_right_layout->set_text ("");
|
|
||||||
break;
|
|
||||||
case LTC:
|
|
||||||
case MTC:
|
|
||||||
case MIDIClock:
|
|
||||||
if (slave) {
|
|
||||||
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"green\">%2</span>",
|
|
||||||
INFO_FONT_SIZE, dynamic_cast<TimecodeSlave*>(slave)->approximate_current_position()));
|
|
||||||
_right_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
|
|
||||||
INFO_FONT_SIZE, slave->approximate_current_delta()));
|
|
||||||
} else {
|
|
||||||
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
|
|
||||||
INFO_FONT_SIZE, _("--pending--")));
|
|
||||||
_right_layout->set_text ("");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">INT/%2</span>",
|
|
||||||
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
|
|
||||||
_right_layout->set_text ("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2086,7 +2097,7 @@ AudioClock::set_mode (Mode m)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MinSec:
|
case MinSec:
|
||||||
mode_based_info_ratio = 1.0;
|
mode_based_info_ratio = 0.5;
|
||||||
insert_map.push_back (12);
|
insert_map.push_back (12);
|
||||||
insert_map.push_back (11);
|
insert_map.push_back (11);
|
||||||
insert_map.push_back (10);
|
insert_map.push_back (10);
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
void on_size_allocate (Gtk::Allocation&);
|
void on_size_allocate (Gtk::Allocation&);
|
||||||
bool on_focus_out_event (GdkEventFocus*);
|
bool on_focus_out_event (GdkEventFocus*);
|
||||||
|
|
||||||
|
void set_slave_info ();
|
||||||
void set_timecode (framepos_t, bool);
|
void set_timecode (framepos_t, bool);
|
||||||
void set_bbt (framepos_t, bool);
|
void set_bbt (framepos_t, bool);
|
||||||
void set_minsec (framepos_t, bool);
|
void set_minsec (framepos_t, bool);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue