mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
more work on RID and editor/mixer order matching; when a track/bus is hidden in the GUI controlling RID, it gets a extremely large RID to prevent it showing up on a control surface (but ... for now ... is still visible in the other GUI, even if "sync order between mixer + editor" is enabled); change font in editor route list
git-svn-id: svn://localhost/ardour2/branches/3.0@13054 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
dd440c22c1
commit
e43d91949b
12 changed files with 268 additions and 208 deletions
|
|
@ -1482,6 +1482,10 @@ Editor::parameter_changed (std::string p)
|
|||
}
|
||||
} else if (p == "show-region-gain") {
|
||||
set_gain_envelope_visibility ();
|
||||
} else if (p == "remote-model") {
|
||||
if (_routes) {
|
||||
_routes->reset_remote_control_ids ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -201,5 +201,5 @@ EditorGroupTabs::selected_routes () const
|
|||
void
|
||||
EditorGroupTabs::sync_order_keys ()
|
||||
{
|
||||
_editor->_routes->sync_order_keys_from_model ();
|
||||
_editor->_routes->sync_order_keys_from_treeview ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ EditorRoutes::EditorRoutes (Editor* e)
|
|||
_display.get_selection()->set_mode (SELECTION_SINGLE);
|
||||
_display.get_selection()->set_select_function (sigc::mem_fun (*this, &EditorRoutes::selection_filter));
|
||||
_display.set_reorderable (true);
|
||||
_display.set_name (X_("MixerTrackDisplayList"));
|
||||
_display.set_rules_hint (true);
|
||||
_display.set_size_request (100, -1);
|
||||
_display.add_object_drag (_columns.route.index(), "routes");
|
||||
|
|
@ -281,7 +282,7 @@ EditorRoutes::EditorRoutes (Editor* e)
|
|||
|
||||
_display.set_enable_search (false);
|
||||
|
||||
Route::SyncOrderKeys.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::sync_model_from_order_keys, this, _1), gui_context());
|
||||
Route::SyncOrderKeys.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::sync_treeview_from_order_keys, this, _1), gui_context());
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -550,14 +551,14 @@ EditorRoutes::route_deleted (Gtk::TreeModel::Path const &)
|
|||
as when a row/route is actually deleted.
|
||||
*/
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "editor routes treeview row deleted\n");
|
||||
sync_order_keys_from_model ();
|
||||
sync_order_keys_from_treeview ();
|
||||
}
|
||||
|
||||
void
|
||||
EditorRoutes::reordered (TreeModel::Path const &, TreeModel::iterator const &, int* /*what*/)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "editor routes treeview reordered\n");
|
||||
sync_order_keys_from_model ();
|
||||
sync_order_keys_from_treeview ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -664,7 +665,7 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
|
|||
|
||||
/* now update route order keys from the treeview/track display order */
|
||||
|
||||
sync_order_keys_from_model ();
|
||||
sync_order_keys_from_treeview ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -760,7 +761,7 @@ EditorRoutes::update_visibility ()
|
|||
/* force route order keys catch up with visibility changes
|
||||
*/
|
||||
|
||||
sync_order_keys_from_model ();
|
||||
sync_order_keys_from_treeview ();
|
||||
|
||||
resume_redisplay ();
|
||||
}
|
||||
|
|
@ -799,7 +800,57 @@ EditorRoutes::show_track_in_display (TimeAxisView& tv)
|
|||
}
|
||||
|
||||
void
|
||||
EditorRoutes::sync_order_keys_from_model ()
|
||||
EditorRoutes::reset_remote_control_ids ()
|
||||
{
|
||||
if (Config->get_remote_model() != EditorOrdered || !_session || _session->deletion_in_progress()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TreeModel::Children rows = _model->children();
|
||||
|
||||
if (rows.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "editor reset remote control ids\n");
|
||||
|
||||
TreeModel::Children::iterator ri;
|
||||
bool rid_change = false;
|
||||
uint32_t rid = 1;
|
||||
uint32_t invisible_key = UINT32_MAX;
|
||||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
|
||||
boost::shared_ptr<Route> route = (*ri)[_columns.route];
|
||||
bool visible = (*ri)[_columns.visible];
|
||||
|
||||
|
||||
if (!route->is_master() && !route->is_monitor()) {
|
||||
|
||||
uint32_t new_rid = (visible ? rid : invisible_key--);
|
||||
|
||||
if (new_rid != route->remote_control_id()) {
|
||||
route->set_remote_control_id_from_order_key (EditorSort, new_rid);
|
||||
rid_change = true;
|
||||
}
|
||||
|
||||
if (visible) {
|
||||
rid++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (rid_change) {
|
||||
/* tell the world that we changed the remote control IDs */
|
||||
_session->notify_remote_id_change ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
EditorRoutes::sync_order_keys_from_treeview ()
|
||||
{
|
||||
if (_ignore_reorder || !_session || _session->deletion_in_progress()) {
|
||||
return;
|
||||
|
|
@ -811,30 +862,60 @@ EditorRoutes::sync_order_keys_from_model ()
|
|||
return;
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "editor sync order keys from model\n");
|
||||
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "editor sync order keys from treeview\n");
|
||||
|
||||
TreeModel::Children::iterator ri;
|
||||
bool changed = false;
|
||||
bool rid_change = false;
|
||||
uint32_t order = 0;
|
||||
uint32_t rid = 1;
|
||||
uint32_t invisible_key = UINT32_MAX;
|
||||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri, ++order) {
|
||||
boost::shared_ptr<Route> route = (*ri)[_columns.route];
|
||||
bool visible = (*ri)[_columns.visible];
|
||||
|
||||
uint32_t old_key = route->order_key (EditorSort);
|
||||
|
||||
if (order != old_key) {
|
||||
route->set_order_key (EditorSort, order);
|
||||
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if ((Config->get_remote_model() == EditorOrdered) && !route->is_master() && !route->is_monitor()) {
|
||||
|
||||
uint32_t new_rid = (visible ? rid : invisible_key--);
|
||||
|
||||
if (new_rid != route->remote_control_id()) {
|
||||
route->set_remote_control_id_from_order_key (EditorSort, new_rid);
|
||||
rid_change = true;
|
||||
}
|
||||
|
||||
if (visible) {
|
||||
rid++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
++order;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
/* tell the world that we changed the editor sort keys */
|
||||
_session->sync_order_keys (EditorSort);
|
||||
}
|
||||
|
||||
if (rid_change) {
|
||||
/* tell the world that we changed the remote control IDs */
|
||||
_session->notify_remote_id_change ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
EditorRoutes::sync_model_from_order_keys (RouteSortOrderKey src)
|
||||
EditorRoutes::sync_treeview_from_order_keys (RouteSortOrderKey src)
|
||||
{
|
||||
/* Some route order key(s) for `src' has been changed, make sure that
|
||||
we update out tree/list model and GUI to reflect the change.
|
||||
|
|
@ -886,9 +967,9 @@ EditorRoutes::sync_model_from_order_keys (RouteSortOrderKey src)
|
|||
boost::shared_ptr<Route> route = (*ri)[_columns.route];
|
||||
uint32_t new_order = route->order_key (EditorSort);
|
||||
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("editor change order for %1 from %2 to %3\n",
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("EDITOR change order for %1 from %2 to %3\n",
|
||||
route->name(), old_order, new_order));
|
||||
|
||||
|
||||
neworder[new_order] = old_order;
|
||||
|
||||
if (old_order != new_order) {
|
||||
|
|
@ -957,7 +1038,7 @@ EditorRoutes::set_all_tracks_visibility (bool yn)
|
|||
/* force route order keys catch up with visibility changes
|
||||
*/
|
||||
|
||||
sync_order_keys_from_model ();
|
||||
sync_order_keys_from_treeview ();
|
||||
|
||||
resume_redisplay ();
|
||||
}
|
||||
|
|
@ -1019,7 +1100,7 @@ EditorRoutes::set_all_audio_midi_visibility (int tracks, bool yn)
|
|||
/* force route order keys catch up with visibility changes
|
||||
*/
|
||||
|
||||
sync_order_keys_from_model ();
|
||||
sync_order_keys_from_treeview ();
|
||||
|
||||
resume_redisplay ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,9 +59,10 @@ public:
|
|||
std::list<TimeAxisView*> views () const;
|
||||
void hide_all_tracks (bool);
|
||||
void clear ();
|
||||
void sync_order_keys_from_model ();
|
||||
private:
|
||||
void sync_order_keys_from_treeview ();
|
||||
void reset_remote_control_ids ();
|
||||
|
||||
private:
|
||||
void initial_display ();
|
||||
void on_input_active_changed (std::string const &);
|
||||
void on_tv_rec_enable_changed (std::string const &);
|
||||
|
|
@ -71,7 +72,7 @@ private:
|
|||
void on_tv_solo_safe_toggled (std::string const &);
|
||||
void build_menu ();
|
||||
void show_menu ();
|
||||
void sync_model_from_order_keys (ARDOUR::RouteSortOrderKey);
|
||||
void sync_treeview_from_order_keys (ARDOUR::RouteSortOrderKey);
|
||||
void route_deleted (Gtk::TreeModel::Path const &);
|
||||
void visible_changed (std::string const &);
|
||||
void active_changed (std::string const &);
|
||||
|
|
|
|||
|
|
@ -192,5 +192,5 @@ MixerGroupTabs::selected_routes () const
|
|||
void
|
||||
MixerGroupTabs::sync_order_keys ()
|
||||
{
|
||||
_mixer->sync_order_keys_from_model ();
|
||||
_mixer->sync_order_keys_from_treeview ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
#include <gtkmm/accelmap.h>
|
||||
|
||||
#include "pbd/convert.h"
|
||||
#include "pbd/stacktrace.h"
|
||||
#include "pbd/unwind.h"
|
||||
|
||||
#include <glibmm/thread.h>
|
||||
|
|
@ -94,7 +93,7 @@ Mixer_UI::Mixer_UI ()
|
|||
/* allow this window to become the key focus window */
|
||||
set_flags (CAN_FOCUS);
|
||||
|
||||
Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::sync_model_from_order_keys, this, _1), gui_context());
|
||||
Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::sync_treeview_from_order_keys, this, _1), gui_context());
|
||||
|
||||
scroller_base.set_flags (Gtk::CAN_FOCUS);
|
||||
scroller_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
|
||||
|
|
@ -366,7 +365,7 @@ Mixer_UI::add_strips (RouteList& routes)
|
|||
}
|
||||
}
|
||||
|
||||
sync_order_keys_from_model ();
|
||||
sync_order_keys_from_treeview ();
|
||||
redisplay_track_list ();
|
||||
}
|
||||
|
||||
|
|
@ -395,7 +394,52 @@ Mixer_UI::remove_strip (MixerStrip* strip)
|
|||
}
|
||||
|
||||
void
|
||||
Mixer_UI::sync_order_keys_from_model ()
|
||||
Mixer_UI::reset_remote_control_ids ()
|
||||
{
|
||||
if (Config->get_remote_model() != MixerOrdered || !_session || _session->deletion_in_progress()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TreeModel::Children rows = track_model->children();
|
||||
|
||||
if (rows.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "mixer resets remote control ids after remote model change\n");
|
||||
|
||||
TreeModel::Children::iterator ri;
|
||||
bool rid_change = false;
|
||||
uint32_t rid = 1;
|
||||
uint32_t invisible_key = UINT32_MAX;
|
||||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
|
||||
bool visible = (*ri)[track_columns.visible];
|
||||
|
||||
if (!route->is_master() && !route->is_monitor()) {
|
||||
|
||||
uint32_t new_rid = (visible ? rid : invisible_key--);
|
||||
|
||||
if (new_rid != route->remote_control_id()) {
|
||||
route->set_remote_control_id_from_order_key (MixerSort, new_rid);
|
||||
rid_change = true;
|
||||
}
|
||||
|
||||
if (visible) {
|
||||
rid++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rid_change) {
|
||||
/* tell the world that we changed the remote control IDs */
|
||||
_session->notify_remote_id_change ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::sync_order_keys_from_treeview ()
|
||||
{
|
||||
if (ignore_reorder || !_session || _session->deletion_in_progress()) {
|
||||
return;
|
||||
|
|
@ -411,26 +455,53 @@ Mixer_UI::sync_order_keys_from_model ()
|
|||
|
||||
TreeModel::Children::iterator ri;
|
||||
bool changed = false;
|
||||
bool rid_change = false;
|
||||
uint32_t order = 0;
|
||||
uint32_t rid = 1;
|
||||
uint32_t invisible_key = UINT32_MAX;
|
||||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri, ++order) {
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
|
||||
bool visible = (*ri)[track_columns.visible];
|
||||
|
||||
uint32_t old_key = route->order_key (MixerSort);
|
||||
|
||||
if (old_key != order) {
|
||||
if (order != old_key) {
|
||||
route->set_order_key (MixerSort, order);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if ((Config->get_remote_model() == MixerOrdered) && !route->is_master() && !route->is_monitor()) {
|
||||
|
||||
uint32_t new_rid = (visible ? rid : invisible_key--);
|
||||
|
||||
if (new_rid != route->remote_control_id()) {
|
||||
route->set_remote_control_id_from_order_key (MixerSort, new_rid);
|
||||
rid_change = true;
|
||||
}
|
||||
|
||||
if (visible) {
|
||||
rid++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
++order;
|
||||
}
|
||||
|
||||
|
||||
if (changed) {
|
||||
/* tell everyone that we changed the mixer sort keys */
|
||||
_session->sync_order_keys (MixerSort);
|
||||
}
|
||||
|
||||
if (rid_change) {
|
||||
/* tell the world that we changed the remote control IDs */
|
||||
_session->notify_remote_id_change ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::sync_model_from_order_keys (RouteSortOrderKey src)
|
||||
Mixer_UI::sync_treeview_from_order_keys (RouteSortOrderKey src)
|
||||
{
|
||||
if (!_session || _session->deletion_in_progress()) {
|
||||
return;
|
||||
|
|
@ -465,7 +536,7 @@ Mixer_UI::sync_model_from_order_keys (RouteSortOrderKey src)
|
|||
|
||||
vector<int> neworder;
|
||||
TreeModel::Children rows = track_model->children();
|
||||
uint32_t n = 0;
|
||||
uint32_t old_order = 0;
|
||||
bool changed = false;
|
||||
|
||||
if (rows.empty()) {
|
||||
|
|
@ -474,18 +545,18 @@ Mixer_UI::sync_model_from_order_keys (RouteSortOrderKey src)
|
|||
|
||||
neworder.assign (rows.size(), 0);
|
||||
|
||||
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++n) {
|
||||
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
|
||||
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
|
||||
uint32_t o = route->order_key (MixerSort);
|
||||
uint32_t new_order = route->order_key (MixerSort);
|
||||
|
||||
neworder[o] = n;
|
||||
neworder[new_order] = old_order;
|
||||
|
||||
if (o != n) {
|
||||
if (old_order != new_order) {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("mixer change order for %1 to %2\n",
|
||||
route->name(), route->order_key (MixerSort)));
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("MIXER change order for %1 from %2 to %3\n",
|
||||
route->name(), old_order, new_order));
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
|
|
@ -679,6 +750,50 @@ Mixer_UI::session_going_away ()
|
|||
update_title ();
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::track_visibility_changed (std::string const & path)
|
||||
{
|
||||
if (_session && _session->deletion_in_progress()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TreeIter iter;
|
||||
|
||||
if ((iter = track_model->get_iter (path))) {
|
||||
MixerStrip* strip = (*iter)[track_columns.strip];
|
||||
if (strip) {
|
||||
bool visible = (*iter)[track_columns.visible];
|
||||
|
||||
if (strip->set_marked_for_display (!visible)) {
|
||||
update_track_visibility ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::update_track_visibility ()
|
||||
{
|
||||
TreeModel::Children rows = track_model->children();
|
||||
TreeModel::Children::iterator i;
|
||||
|
||||
{
|
||||
Unwinder<bool> uw (no_track_list_redisplay, true);
|
||||
|
||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
MixerStrip *strip = (*i)[track_columns.strip];
|
||||
(*i)[track_columns.visible] = strip->marked_for_display ();
|
||||
}
|
||||
|
||||
/* force route order keys catch up with visibility changes
|
||||
*/
|
||||
|
||||
sync_order_keys_from_treeview ();
|
||||
}
|
||||
|
||||
redisplay_track_list ();
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::show_strip (MixerStrip* ms)
|
||||
{
|
||||
|
|
@ -851,7 +966,7 @@ void
|
|||
Mixer_UI::track_list_reorder (const TreeModel::Path&, const TreeModel::iterator&, int* /*new_order*/)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "mixer UI treeview reordered\n");
|
||||
sync_order_keys_from_model ();
|
||||
sync_order_keys_from_treeview ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -861,7 +976,7 @@ Mixer_UI::track_list_delete (const Gtk::TreeModel::Path&)
|
|||
as when a row/route is actually deleted.
|
||||
*/
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "mixer UI treeview row deleted\n");
|
||||
sync_order_keys_from_model ();
|
||||
sync_order_keys_from_treeview ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1008,43 +1123,9 @@ Mixer_UI::track_display_button_press (GdkEventButton* ev)
|
|||
return true;
|
||||
}
|
||||
|
||||
TreeIter iter;
|
||||
TreeModel::Path path;
|
||||
TreeViewColumn* column;
|
||||
int cellx;
|
||||
int celly;
|
||||
|
||||
if (!track_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (GPOINTER_TO_UINT (column->get_data (X_("colnum")))) {
|
||||
case 0:
|
||||
/* allow normal processing to occur */
|
||||
return false;
|
||||
|
||||
case 1: /* visibility */
|
||||
if ((iter = track_model->get_iter (path))) {
|
||||
MixerStrip* strip = (*iter)[track_columns.strip];
|
||||
if (strip) {
|
||||
|
||||
if (!strip->route()->is_master() && !strip->route()->is_monitor()) {
|
||||
bool visible = (*iter)[track_columns.visible];
|
||||
(*iter)[track_columns.visible] = !visible;
|
||||
redisplay_track_list ();
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Mixer_UI::build_track_menu ()
|
||||
{
|
||||
|
|
@ -1659,6 +1740,8 @@ Mixer_UI::parameter_changed (string const & p)
|
|||
for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
||||
(*i)->set_width_enum (s ? Narrow : Wide, this);
|
||||
}
|
||||
} else if (p == "remote-model") {
|
||||
reset_remote_control_ids ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1701,6 +1784,7 @@ Mixer_UI::setup_track_display ()
|
|||
CellRendererToggle* track_list_visible_cell = dynamic_cast<CellRendererToggle*>(track_display.get_column_cell_renderer (1));
|
||||
track_list_visible_cell->property_activatable() = true;
|
||||
track_list_visible_cell->property_radio() = false;
|
||||
track_list_visible_cell->signal_toggled().connect (sigc::mem_fun (*this, &Mixer_UI::track_visibility_changed));
|
||||
|
||||
track_display.signal_button_press_event().connect (sigc::mem_fun (*this, &Mixer_UI::track_display_button_press), false);
|
||||
|
||||
|
|
|
|||
|
|
@ -166,9 +166,11 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
|
|||
|
||||
void initial_track_display ();
|
||||
void show_track_list_menu ();
|
||||
|
||||
|
||||
void set_all_strips_visibility (bool yn);
|
||||
void set_all_audio_visibility (int tracks, bool yn);
|
||||
void track_visibility_changed (std::string const & path);
|
||||
void update_track_visibility ();
|
||||
|
||||
void hide_all_routes ();
|
||||
void show_all_routes ();
|
||||
|
|
@ -244,8 +246,9 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
|
|||
|
||||
Width _strip_width;
|
||||
|
||||
void sync_order_keys_from_model ();
|
||||
void sync_model_from_order_keys (ARDOUR::RouteSortOrderKey);
|
||||
void sync_order_keys_from_treeview ();
|
||||
void sync_treeview_from_order_keys (ARDOUR::RouteSortOrderKey);
|
||||
void reset_remote_control_ids ();
|
||||
bool ignore_reorder;
|
||||
|
||||
void parameter_changed (std::string const &);
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
|
|||
|
||||
void set_remote_control_id (uint32_t id, bool notify_class_listeners = true);
|
||||
uint32_t remote_control_id () const;
|
||||
void set_remote_control_id_from_order_key (RouteSortOrderKey);
|
||||
void set_remote_control_id_from_order_key (RouteSortOrderKey, uint32_t order_key);
|
||||
|
||||
/* for things concerned about *this* route's RID */
|
||||
|
||||
|
|
@ -531,8 +531,6 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
|
|||
int set_state_2X (const XMLNode&, int);
|
||||
void set_processor_state_2X (XMLNodeList const &, int);
|
||||
|
||||
static uint32_t order_key_cnt;
|
||||
|
||||
typedef std::map<RouteSortOrderKey,uint32_t> OrderKeys;
|
||||
OrderKeys order_keys;
|
||||
uint32_t _remote_control_id;
|
||||
|
|
|
|||
|
|
@ -234,8 +234,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
bool operator() (boost::shared_ptr<Route>, boost::shared_ptr<Route> b);
|
||||
};
|
||||
|
||||
void notify_remote_id_change ();
|
||||
void sync_order_keys (RouteSortOrderKey);
|
||||
void sync_remote_id_from_order_keys (RouteSortOrderKey);
|
||||
|
||||
template<class T> void foreach_route (T *obj, void (T::*func)(Route&));
|
||||
template<class T> void foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>));
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ using namespace std;
|
|||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
uint32_t Route::order_key_cnt = 0;
|
||||
PBD::Signal1<void,RouteSortOrderKey> Route::SyncOrderKeys;
|
||||
PBD::Signal0<void> Route::RemoteControlIDChange;
|
||||
|
||||
|
|
@ -286,19 +285,12 @@ Route::sync_order_keys (RouteSortOrderKey base)
|
|||
|
||||
for (OrderKeys::iterator k = order_keys.begin(); k != order_keys.end(); ++k) {
|
||||
|
||||
if (is_master() || is_monitor()) {
|
||||
/* don't sync the sort keys for master/monitor,
|
||||
* since they are not part of the normal ordering.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
if (k->first != base) {
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1 set key for %2 to %3 from %4\n",
|
||||
name(),
|
||||
enum_2_string (k->first),
|
||||
i->second,
|
||||
base));
|
||||
enum_2_string (base)));
|
||||
|
||||
k->second = i->second;
|
||||
}
|
||||
|
|
@ -306,66 +298,17 @@ Route::sync_order_keys (RouteSortOrderKey base)
|
|||
}
|
||||
|
||||
void
|
||||
Route::set_remote_control_id_from_order_key (RouteSortOrderKey key)
|
||||
Route::set_remote_control_id_from_order_key (RouteSortOrderKey key, uint32_t rid)
|
||||
{
|
||||
if (is_master() || is_monitor() || is_hidden()) {
|
||||
/* hard-coded remote IDs, or no remote ID */
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t n = order_keys[key];
|
||||
|
||||
/* we have a nasty glitch in an otherwise fairly clean system here.
|
||||
|
||||
in theory, a route's remote control ID is determined by the order
|
||||
key matching the current remote model (for UserOrdered, the user
|
||||
controls everything). its one greater, because order keys are zero
|
||||
based and remote control IDs start at one.
|
||||
|
||||
but ... an order key for the master bus may place it before or even
|
||||
within normal routes, yet its remote control ID (like the monitor
|
||||
bus) is hardcoded to MasterBusRemoteControlID. this means that all
|
||||
routes ordered after it (in whatever controls the EditorSort or
|
||||
MixerSort ordering) will end up with a remote control ID that is one
|
||||
too large.
|
||||
|
||||
we therefore check on the master bus ordering, and adjust
|
||||
later-sorted routes remote control ID to avoid this "off by one"
|
||||
error, which keeps remote control ID's contiguous and "right".
|
||||
|
||||
ideally, this would be done in a UI layer, where this logic
|
||||
is really understood and has meaning, rather than in libardour where
|
||||
its fundamentally meaningless.
|
||||
*/
|
||||
|
||||
switch (Config->get_remote_model()) {
|
||||
case UserOrdered:
|
||||
break;
|
||||
case EditorOrdered:
|
||||
if (key == EditorSort) {
|
||||
boost::shared_ptr<Route> master = _session.master_out();
|
||||
if (master && n > 0 && n > master->order_key (EditorSort)) {
|
||||
--n;
|
||||
}
|
||||
_remote_control_id = n + 1;
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1: from order key %2, set edit-based RID to %3\n",
|
||||
name(), n, _remote_control_id));
|
||||
RemoteControlIDChanged (); /* EMIT SIGNAL * (per-route) */
|
||||
}
|
||||
break;
|
||||
|
||||
case MixerOrdered:
|
||||
if (key == MixerSort) {
|
||||
boost::shared_ptr<Route> master = _session.master_out();
|
||||
if (master && n > 0 && n > master->order_key (MixerSort)) {
|
||||
--n;
|
||||
}
|
||||
_remote_control_id = n + 1;
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1: from order key %2, set mix-based RID to %3\n",
|
||||
name(), n, _remote_control_id));
|
||||
RemoteControlIDChanged (); /* EMIT SIGNAL (per-route) */
|
||||
}
|
||||
break;
|
||||
if (_remote_control_id != rid) {
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1: set edit-based RID to %2\n", name(), rid));
|
||||
_remote_control_id = rid;
|
||||
RemoteControlIDChanged (); /* EMIT SIGNAL (per-route) */
|
||||
}
|
||||
|
||||
/* don't emit the class-level RID signal RemoteControlIDChange here,
|
||||
|
|
@ -389,8 +332,8 @@ Route::set_order_key (RouteSortOrderKey key, uint32_t n)
|
|||
|
||||
order_keys[key] = n;
|
||||
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1 order key %2 set to %3 (chk=%4)\n",
|
||||
name(), enum_2_string (key), n, order_key (key)));
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1 order key %2 set to %3\n",
|
||||
name(), enum_2_string (key), order_key (key)));
|
||||
|
||||
_session.set_dirty ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2206,22 +2206,6 @@ Session::add_routes (RouteList& new_routes, bool input_auto_connect, bool output
|
|||
}
|
||||
|
||||
RouteAdded (new_routes); /* EMIT SIGNAL */
|
||||
|
||||
/* we added at least one new route, and everyone who needs to has now
|
||||
* handled this event. This means that route order keys are correctly
|
||||
* set and we can now ensure that remote control IDs are set.
|
||||
*/
|
||||
|
||||
switch (Config->get_remote_model()) {
|
||||
case UserOrdered:
|
||||
break;
|
||||
case MixerOrdered:
|
||||
sync_remote_id_from_order_keys (MixerSort);
|
||||
break;
|
||||
case EditorOrdered:
|
||||
sync_remote_id_from_order_keys (EditorSort);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -4713,7 +4697,7 @@ Session::next_control_id () const
|
|||
}
|
||||
|
||||
void
|
||||
Session::sync_order_keys (RouteSortOrderKey sort_key_changed)
|
||||
Session::notify_remote_id_change ()
|
||||
{
|
||||
if (deletion_in_progress()) {
|
||||
return;
|
||||
|
|
@ -4727,6 +4711,14 @@ Session::sync_order_keys (RouteSortOrderKey sort_key_changed)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Session::sync_order_keys (RouteSortOrderKey sort_key_changed)
|
||||
{
|
||||
if (deletion_in_progress()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* tell everyone that something has happened to the sort keys
|
||||
and let them sync up with the change(s)
|
||||
|
|
@ -4738,46 +4730,7 @@ Session::sync_order_keys (RouteSortOrderKey sort_key_changed)
|
|||
|
||||
Route::SyncOrderKeys (sort_key_changed); /* EMIT SIGNAL */
|
||||
|
||||
/* ensure that remote control IDs are in sync with the relevant
|
||||
order keys.
|
||||
*/
|
||||
|
||||
sync_remote_id_from_order_keys (sort_key_changed);
|
||||
}
|
||||
|
||||
void
|
||||
Session::sync_remote_id_from_order_keys (RouteSortOrderKey sort_key_changed)
|
||||
{
|
||||
/* update remote control IDs if that makes sense */
|
||||
|
||||
bool do_update = false;
|
||||
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("sync RID to order key %1\n", enum_2_string (sort_key_changed)));
|
||||
|
||||
switch (Config->get_remote_model()) {
|
||||
case UserOrdered:
|
||||
break;
|
||||
case EditorOrdered:
|
||||
if (sort_key_changed == EditorSort) {
|
||||
do_update = true;
|
||||
}
|
||||
break;
|
||||
case MixerOrdered:
|
||||
if (sort_key_changed == MixerSort) {
|
||||
do_update = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (do_update) {
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "\tactually update + signal\n");
|
||||
boost::shared_ptr<RouteList> r = routes.reader();
|
||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
||||
(*i)->set_remote_control_id_from_order_key (sort_key_changed);
|
||||
}
|
||||
|
||||
Route::RemoteControlIDChange (); /* EMIT SIGNAL - static */
|
||||
}
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "\tsync done\n");
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -3507,16 +3507,9 @@ Session::config_changed (std::string p, bool ours)
|
|||
} else if (p == "history-depth") {
|
||||
set_history_depth (Config->get_history_depth());
|
||||
} else if (p == "remote-model") {
|
||||
switch (Config->get_remote_model()) {
|
||||
case UserOrdered:
|
||||
break;
|
||||
case MixerOrdered:
|
||||
sync_remote_id_from_order_keys (MixerSort);
|
||||
break;
|
||||
case EditorOrdered:
|
||||
sync_remote_id_from_order_keys (EditorSort);
|
||||
break;
|
||||
}
|
||||
/* XXX DO SOMETHING HERE TO TELL THE GUI THAT WE NEED
|
||||
TO SET REMOTE ID'S
|
||||
*/
|
||||
} else if (p == "sync-all-route-ordering") {
|
||||
|
||||
/* sync to editor order unless mixer is used for remote IDs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue