Gtk::TreeViewColumn* mute_state_column = manage (new TreeViewColumn("M", *mute_col_renderer));
mute_state_column->add_attribute(mute_col_renderer->property_state(), _columns.mute_state);
- mute_state_column->add_attribute(mute_col_renderer->property_visible(), _columns.is_track);
// Solo enable toggle
CellRendererPixbufMulti* solo_col_renderer = manage (new CellRendererPixbufMulti());
Gtk::TreeViewColumn* solo_state_column = manage (new TreeViewColumn("S", *solo_col_renderer));
solo_state_column->add_attribute(solo_col_renderer->property_state(), _columns.solo_state);
- solo_state_column->add_attribute(solo_col_renderer->property_visible(), _columns.is_track);
-
_display.append_column (*rec_state_column);
_display.append_column (*mute_state_column);
EditorComponent::connect_to_session (s);
initial_display ();
+
+ _session->SoloChanged.connect (mem_fun (*this, &EditorRoutes::solo_changed_so_update_mute));
}
void
TimeAxisView *tv = row[_columns.tv];
AudioTimeAxisView *atv = dynamic_cast<AudioTimeAxisView*> (tv);
- if (atv != 0 && atv->is_audio_track()){
- atv->reversibly_apply_track_boolean ("mute-enable change", &Track::set_mute, !atv->track()->muted(), this);
+ if (atv != 0) {
+ atv->reversibly_apply_route_boolean ("mute-enable change", &Route::set_mute, !atv->route()->muted(), this);
}
}
TimeAxisView *tv = row[_columns.tv];
AudioTimeAxisView *atv = dynamic_cast<AudioTimeAxisView*> (tv);
- if (atv != 0 && atv->is_audio_track()){
- atv->reversibly_apply_track_boolean ("solo-enable change", &Track::set_solo, !atv->track()->soloed(), this);
+ if (atv != 0) {
+ atv->reversibly_apply_route_boolean ("solo-enable change", &Route::set_solo, !atv->route()->soloed(), this);
}
}
if ((*x)->is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> ((*x)->route());
t->diskstream()->RecordEnableChanged.connect (mem_fun (*this, &EditorRoutes::update_rec_display));
- t->mute_changed.connect (mem_fun (*this, &EditorRoutes::update_mute_display));
- t->solo_changed.connect (mem_fun (*this, &EditorRoutes::update_solo_display));
}
+
+ (*x)->route()->mute_changed.connect (mem_fun (*this, &EditorRoutes::update_mute_display));
+ (*x)->route()->solo_changed.connect (mem_fun (*this, &EditorRoutes::update_solo_display));
}
update_rec_display ();
for (i = rows.begin(); i != rows.end(); ++i) {
boost::shared_ptr<Route> route = (*i)[_columns.route];
-
- if (boost::dynamic_pointer_cast<Track>(route)) {
-
- if (route->muted()){
- (*i)[_columns.mute_state] = 1;
- } else {
- (*i)[_columns.mute_state] = 0;
- }
- }
+ (*i)[_columns.mute_state] = RouteUI::mute_visual_state (*_session, route) > 0 ? 1 : 0;
}
}
for (i = rows.begin(); i != rows.end(); ++i) {
boost::shared_ptr<Route> route = (*i)[_columns.route];
-
- if (boost::dynamic_pointer_cast<Track>(route)) {
-
- if (route->soloed()){
- (*i)[_columns.solo_state] = 1;
- } else {
- (*i)[_columns.solo_state] = 0;
- }
- }
+ (*i)[_columns.solo_state] = RouteUI::solo_visual_state (route) > 0 ? 1 : 0;
}
}
route->set_name (new_text);
}
}
+
+void
+EditorRoutes::solo_changed_so_update_mute ()
+{
+ ENSURE_GUI_THREAD (mem_fun (*this, &EditorRoutes::solo_changed_so_update_mute));
+
+ update_mute_display (this);
+}
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_solo_display));
}
+int
+RouteUI::solo_visual_state (boost::shared_ptr<Route> r)
+{
+ if (Config->get_solo_control_is_listen_control()) {
+
+ if (r->listening()) {
+ return 1;
+ } else {
+ return 0;
+ }
+
+ } else {
+
+ if (r->solo_isolated()) {
+ return 2;
+ } else if (r->soloed()) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ return 0;
+}
+
void
RouteUI::update_solo_display ()
{
bool x;
-
+
if (Config->get_solo_control_is_listen_control()) {
if (solo_button->get_active() != (x = _route->listening())) {
ignore_toggle = false;
}
- if (x) {
- solo_button->set_visual_state (1);
- } else {
- solo_button->set_visual_state (0);
- }
-
-
} else {
- if (solo_button->get_active() != (x = _route->soloed())){
+ if (solo_button->get_active() != (x = _route->soloed())) {
ignore_toggle = true;
solo_button->set_active (x);
ignore_toggle = false;
}
- if (_route->solo_isolated()) {
- solo_button->set_visual_state (2);
- } else if (x) {
- solo_button->set_visual_state (1);
- } else {
- solo_button->set_visual_state (0);
- }
}
+
+ solo_button->set_visual_state (solo_visual_state (_route));
}
void
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_mute_display));
}
+int
+RouteUI::mute_visual_state (Session& s, boost::shared_ptr<Route> r)
+{
+ if (Config->get_show_solo_mutes()) {
+
+ if (r->muted ()) {
+ /* full mute */
+ return 2;
+ } else if (s.soloing() && !r->soloed() && !r->solo_isolated()) {
+ /* mute-because-not-soloed */
+ return 1;
+ } else {
+ /* no mute at all */
+ return 0;
+ }
+
+ } else {
+
+ if (r->muted()) {
+ /* full mute */
+ return 2;
+ } else {
+ /* no mute at all */
+ return 0;
+ }
+ }
+
+ return 0;
+}
+
void
RouteUI::update_mute_display ()
{
ignore_toggle = false;
}
- /* now attend to visual state */
-
- if (Config->get_show_solo_mutes()) {
- if (_route->muted()) {
- /* full mute */
- mute_button->set_visual_state (2);
- } else if (_session.soloing() && !_route->soloed() && !_route->solo_isolated()) {
- /* mute-because-not-soloed */
- mute_button->set_visual_state (1);
- } else {
- /* no mute at all */
- mute_button->set_visual_state (0);
- }
- } else {
- if (_route->muted()) {
- /* full mute */
- mute_button->set_visual_state (2);
- } else {
- /* no mute at all */
- mute_button->set_visual_state (0);
- }
- }
-
+ mute_button->set_visual_state (mute_visual_state (_session, _route));
}
void