#include "ardour/session.h"
#include "ardour/audioengine.h"
#include "ardour/audio_track.h"
-#include "ardour/audio_diskstream.h"
#include "ardour/midi_track.h"
-#include "ardour/midi_diskstream.h"
#include "ardour/template_utils.h"
#include "ardour/filename_extensions.h"
#include "ardour/directory_names.h"
post_fader_mute_check = 0;
listen_mute_check = 0;
main_mute_check = 0;
+ solo_safe_check = 0;
+ solo_isolated_check = 0;
ignore_toggle = false;
_solo_release = 0;
_mute_release = 0;
_route->active_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_active_changed, this), gui_context());
_route->mute_changed.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::mute_changed, this, _1), gui_context());
- _route->solo_changed.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::solo_changed, this, _1), gui_context());
- _route->listen_changed.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::listen_changed, this, _1), gui_context());
- _route->solo_isolated_changed.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::solo_changed, this, _1), gui_context());
+
+ _route->solo_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_solo_display, this), gui_context());
+ _route->solo_safe_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_solo_display, this), gui_context());
+ _route->listen_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_solo_display, this), gui_context());
+ _route->solo_isolated_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_solo_display, this), gui_context());
+
_route->phase_invert_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::polarity_changed, this), gui_context());
_route->PropertyChanged.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::property_changed, this, _1), gui_context());
if (_session->writable() && is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route);
- t->diskstream()->RecordEnableChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_rec_enable_changed, this), gui_context());
+ t->RecordEnableChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_rec_enable_changed, this), gui_context());
rec_enable_button->show();
rec_enable_button->set_controllable (t->rec_enable_control());
solo_button->show();
}
- /* map the current state */
-
- mute_changed (0);
- solo_changed (0);
-
map_frozen ();
}
return true;
}
- _mute_release = new SoloMuteRelease (_route->muted ());
+ _mute_release = new SoloMuteRelease (_route->self_muted ());
}
if (ev->button == 1 || Keyboard::is_button2_event (ev)) {
_mute_release->routes = _session->get_routes ();
}
- _session->set_mute (_session->get_routes(), !_route->muted());
+ _session->set_mute (_session->get_routes(), !_route->self_muted());
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
_mute_release->routes = _session->get_routes ();
}
- _session->set_mute (_session->get_routes(), !_route->muted(), Session::rt_cleanup, true);
+ _session->set_mute (_session->get_routes(), !_route->self_muted(), Session::rt_cleanup, true);
}
} else {
_mute_release->routes = rl;
}
- _session->set_mute (rl, !_route->muted());
+ _session->set_mute (rl, !_route->self_muted());
}
}
return true;
}
- _solo_release = new SoloMuteRelease (_route->soloed());
+ _solo_release = new SoloMuteRelease (_route->self_soloed());
}
if (ev->button == 1 || Keyboard::is_button2_event (ev)) {
if (Config->get_solo_control_is_listen_control()) {
_session->set_listen (_session->get_routes(), !_route->listening(), Session::rt_cleanup, true);
} else {
- _session->set_solo (_session->get_routes(), !_route->soloed(), Session::rt_cleanup, true);
+ _session->set_solo (_session->get_routes(), !_route->self_soloed(), Session::rt_cleanup, true);
}
} else if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
if (Config->get_solo_control_is_listen_control()) {
_session->set_listen (_route->route_group()->route_list(), !_route->listening(), Session::rt_cleanup, true);
} else {
- _session->set_solo (_route->route_group()->route_list(), !_route->soloed(), Session::rt_cleanup, true);
+ _session->set_solo (_route->route_group()->route_list(), !_route->self_soloed(), Session::rt_cleanup, true);
}
}
if (Config->get_solo_control_is_listen_control()) {
_session->set_listen (rl, !_route->listening());
} else {
- _session->set_solo (rl, !_route->soloed());
+ _session->set_solo (rl, !_route->self_soloed());
}
}
}
}
}
-void
-RouteUI::solo_changed(void* /*src*/)
-{
- Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&RouteUI::update_solo_display, this));
-}
-
-
-void
-RouteUI::listen_changed(void* /*src*/)
-{
- Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&RouteUI::update_solo_display, this));
-}
-
int
RouteUI::solo_visual_state (boost::shared_ptr<Route> r)
{
if (r->listening()) {
return 1;
} else {
- return 0;
+ return 0;
}
}
if (r->solo_isolated()) {
return 2;
} else if (r->soloed()) {
- return 1;
+ if (!r->self_soloed()) {
+ return 3;
+ } else {
+ return 1;
+ }
} else {
return 0;
}
}
if (r->solo_isolated()) {
- return 1;
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+int
+RouteUI::solo_safe_visual_state (boost::shared_ptr<Route> r)
+{
+ if (r->is_master() || r->is_monitor()) {
+ return 0;
+ }
+
+ if (r->solo_safe()) {
+ return 1;
} else {
return 0;
}
}
+ bool yn = _route->solo_safe ();
+
+ if (solo_safe_check && solo_safe_check->get_active() != yn) {
+ solo_safe_check->set_active (yn);
+ }
+
+ yn = _route->solo_isolated ();
+
+ if (solo_isolated_check && solo_isolated_check->get_active() != yn) {
+ solo_isolated_check->set_active (yn);
+ }
+
+ set_button_names ();
+
solo_button->set_visual_state (solo_visual_state_with_isolate (_route));
}
if (Config->get_show_solo_mutes()) {
- if (r->muted ()) {
+ if (r->self_muted ()) {
/* full mute */
return 2;
- } else if (s->soloing() && !r->soloed() && !r->solo_isolated()) {
- /* mute-because-not-soloed */
+ } else if (r->muted_by_others()) {
return 1;
} else {
/* no mute at all */
} else {
- if (r->muted()) {
+ if (r->self_muted()) {
/* full mute */
return 2;
} else {
check = new CheckMenuItem(_("Solo Isolate"));
check->set_active (_route->solo_isolated());
check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_isolated), check));
- _route->solo_isolated_changed.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::solo_isolated_toggle, this, _1, check), gui_context());
items.push_back (CheckMenuElem(*check));
+ solo_isolated_check = dynamic_cast<CheckMenuItem*>(&items.back());
check->show_all();
check = new CheckMenuItem(_("Solo Safe"));
check->set_active (_route->solo_safe());
check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_safe), check));
- _route->solo_safe_changed.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::solo_safe_toggle, this, _1, check), gui_context());
items.push_back (CheckMenuElem(*check));
+ solo_safe_check = dynamic_cast<CheckMenuItem*>(&items.back());
check->show_all();
//items.push_back (SeparatorElem());
}
}
-void
-RouteUI::solo_isolated_toggle(void* /*src*/, Gtk::CheckMenuItem* check)
-{
- bool yn = _route->solo_isolated ();
-
- if (check->get_active() != yn) {
- check->set_active (yn);
- }
-}
-
-
-void
-RouteUI::solo_safe_toggle(void* /*src*/, Gtk::CheckMenuItem* check)
-{
- bool yn = _route->solo_safe ();
-
- if (check->get_active() != yn) {
- check->set_active (yn);
- }
-}
-
void
RouteUI::disconnect_input ()
{
return boost::dynamic_pointer_cast<MidiTrack>(_route);
}
-boost::shared_ptr<Diskstream>
-RouteUI::get_diskstream () const
-{
- boost::shared_ptr<Track> t;
-
- if ((t = boost::dynamic_pointer_cast<Track>(_route)) != 0) {
- return t->diskstream();
- } else {
- return boost::shared_ptr<Diskstream> ((Diskstream*) 0);
- }
-}
-
string
RouteUI::name() const
{