mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
use primary, not secondary, clock mode to drive other clock modes, and dynamically update region editors, location UI and editor regions when it changes
This commit is contained in:
parent
7d5eed0914
commit
0542a30901
7 changed files with 29 additions and 9 deletions
|
|
@ -262,7 +262,7 @@ EditorRegions::EditorRegions (Editor* e)
|
|||
// _display.signal_popup_menu().connect (sigc::bind (sigc::mem_fun (*this, &Editor::show__display_context_menu), 1, 0));
|
||||
|
||||
//ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (sigc::mem_fun(*this, &Editor::redisplay_regions));
|
||||
ARDOUR_UI::instance()->secondary_clock->mode_changed.connect (sigc::mem_fun(*this, &EditorRegions::update_all_rows));
|
||||
ARDOUR_UI::instance()->primary_clock->mode_changed.connect (sigc::mem_fun(*this, &EditorRegions::update_all_rows));
|
||||
ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::region_changed, this, _1, _2), gui_context());
|
||||
ARDOUR::RegionFactory::CheckNewRegion.connect (check_new_region_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::add_region, this, _1), gui_context());
|
||||
|
||||
|
|
@ -747,7 +747,7 @@ EditorRegions::format_position (samplepos_t pos, char* buf, size_t bufsize, bool
|
|||
return;
|
||||
}
|
||||
|
||||
switch (ARDOUR_UI::instance()->secondary_clock->mode ()) {
|
||||
switch (ARDOUR_UI::instance()->primary_clock->mode ()) {
|
||||
case AudioClock::BBT:
|
||||
bbt = _session->tempo_map().bbt_at_sample (pos);
|
||||
if (onoff) {
|
||||
|
|
@ -898,7 +898,7 @@ EditorRegions::populate_row_length (boost::shared_ptr<Region> region, TreeModel:
|
|||
{
|
||||
char buf[16];
|
||||
|
||||
if (ARDOUR_UI::instance()->secondary_clock->mode () == AudioClock::BBT) {
|
||||
if (ARDOUR_UI::instance()->primary_clock->mode () == AudioClock::BBT) {
|
||||
TempoMap& map (_session->tempo_map());
|
||||
Timecode::BBT_Time bbt = map.bbt_at_beat (map.beat_at_sample (region->last_sample()) - map.beat_at_sample (region->first_sample()));
|
||||
snprintf (buf, sizeof (buf), "%03d|%02d|%04d" , bbt.bars, bbt.beats, bbt.ticks);
|
||||
|
|
|
|||
|
|
@ -61,14 +61,14 @@ InsertRemoveTimeDialog::InsertRemoveTimeDialog (PublicEditor& e, bool remove)
|
|||
time_label->set_alignment (1, 0.5);
|
||||
table->attach (*time_label, 0, 1, 0, 1, FILL | EXPAND);
|
||||
position_clock.set_session (_session);
|
||||
position_clock.set_mode (ARDOUR_UI::instance()->secondary_clock->mode());
|
||||
position_clock.set_mode (ARDOUR_UI::instance()->primary_clock->mode());
|
||||
table->attach (position_clock, 1, 2, 0, 1);
|
||||
|
||||
time_label = manage (new Label (remove ? _("Time to remove:") : _("Time to insert:")));
|
||||
time_label->set_alignment (1, 0.5);
|
||||
table->attach (*time_label, 0, 1, 1, 2, FILL | EXPAND);
|
||||
duration_clock.set_session (_session);
|
||||
duration_clock.set_mode (ARDOUR_UI::instance()->secondary_clock->mode());
|
||||
duration_clock.set_mode (ARDOUR_UI::instance()->primary_clock->mode());
|
||||
table->attach (duration_clock, 1, 2, 1, 2);
|
||||
|
||||
//if a Range is selected, assume the user wants to insert/remove the length of the range
|
||||
|
|
|
|||
|
|
@ -761,6 +761,8 @@ LocationUI::LocationUI (std::string state_node_name)
|
|||
|
||||
_clock_group = new ClockGroup;
|
||||
|
||||
ARDOUR_UI::instance()->primary_clock->mode_changed.connect (sigc::mem_fun(*this, &LocationUI::set_clock_mode_from_primary));
|
||||
|
||||
VBox* vbox = manage (new VBox);
|
||||
|
||||
Table* table = manage (new Table (2, 2));
|
||||
|
|
@ -1103,6 +1105,13 @@ LocationUI::refresh_location_list ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
LocationUI::set_clock_mode_from_primary ()
|
||||
{
|
||||
_clock_group->set_clock_mode (ARDOUR_UI::instance()->primary_clock->mode());
|
||||
_mode_set = true;
|
||||
}
|
||||
|
||||
void
|
||||
LocationUI::set_session(ARDOUR::Session* s)
|
||||
{
|
||||
|
|
@ -1180,11 +1189,11 @@ LocationUI::clock_mode_from_session_instant_xml ()
|
|||
|
||||
XMLNode* node = _session->instant_xml (_state_node_name);
|
||||
if (!node) {
|
||||
return ARDOUR_UI::instance()->secondary_clock->mode();
|
||||
return ARDOUR_UI::instance()->primary_clock->mode();
|
||||
}
|
||||
|
||||
if (!node->get_property (X_("clock-mode"), _mode)) {
|
||||
return ARDOUR_UI::instance()->secondary_clock->mode();
|
||||
return ARDOUR_UI::instance()->primary_clock->mode();
|
||||
}
|
||||
|
||||
_mode_set = true;
|
||||
|
|
|
|||
|
|
@ -157,7 +157,6 @@ public:
|
|||
~LocationUI ();
|
||||
|
||||
void set_session (ARDOUR::Session *);
|
||||
void set_clock_mode (AudioClock::Mode);
|
||||
|
||||
void add_new_location();
|
||||
void add_new_range();
|
||||
|
|
@ -216,6 +215,8 @@ private:
|
|||
bool _mode_set;
|
||||
|
||||
std::string _state_node_name;
|
||||
|
||||
void set_clock_mode_from_primary ();
|
||||
};
|
||||
|
||||
class LocationUIWindow : public ArdourWindow
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr<Region> r)
|
|||
set_session (s);
|
||||
|
||||
_clock_group->set_clock_mode (ARDOUR_UI::instance()->primary_clock->mode());
|
||||
ARDOUR_UI::instance()->primary_clock->mode_changed.connect (sigc::mem_fun (*this, &RegionEditor::set_clock_mode_from_primary));
|
||||
|
||||
_clock_group->add (position_clock);
|
||||
_clock_group->add (end_clock);
|
||||
_clock_group->add (length_clock);
|
||||
|
|
@ -202,6 +204,12 @@ RegionEditor::~RegionEditor ()
|
|||
delete _clock_group;
|
||||
}
|
||||
|
||||
void
|
||||
RegionEditor::set_clock_mode_from_primary ()
|
||||
{
|
||||
_clock_group->set_clock_mode (ARDOUR_UI::instance()->primary_clock->mode());
|
||||
}
|
||||
|
||||
void
|
||||
RegionEditor::region_changed (const PBD::PropertyChange& what_changed)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -115,6 +115,8 @@ private:
|
|||
|
||||
Gtk::Label _sources_label;
|
||||
Gtk::ListViewText _sources;
|
||||
|
||||
void set_clock_mode_from_primary ();
|
||||
};
|
||||
|
||||
#endif /* __gtk_ardour_region_edit_h__ */
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ SoundFileBox::SoundFileBox (bool /*persistent*/)
|
|||
table.attach (timecode_clock, 1, 2, 5, 6, FILL, FILL);
|
||||
table.attach (tempomap_value, 1, 2, 6, 7, FILL, FILL);
|
||||
|
||||
length_clock.set_mode (ARDOUR_UI::instance()->secondary_clock->mode());
|
||||
length_clock.set_mode (ARDOUR_UI::instance()->primary_clock->mode());
|
||||
timecode_clock.set_mode (AudioClock::Timecode);
|
||||
|
||||
main_box.pack_start (table, false, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue