#include "ardour/debug.h"
#include "ardour/audio_track.h"
#include "ardour/midi_track.h"
+#include "ardour/monitor_control.h"
#include "ardour/plugin_manager.h"
#include "ardour/route_group.h"
#include "ardour/selection.h"
, track_menu (0)
, _plugin_selector (0)
, foldback_strip (0)
+ , _show_foldback_strip (true)
, _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide)
, _spill_scroll_position (0)
, ignore_reorder (false)
{
load_bindings ();
register_actions ();
+ Glib::RefPtr<ToggleAction> fb_act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
+ fb_act->set_sensitive (false);
+
_content.set_data ("ardour-bindings", bindings);
PresentationInfo::Change.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::presentation_info_changed, this, _1), gui_context());
MixerStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_strip, this, _1), gui_context());
VCAMasterStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_master, this, _1), gui_context());
+ FoldbackStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_foldback, this, _1), gui_context());
/* handle escape */
{
monitor_section_detached ();
- StripableList fb;
- _session->get_stripables (fb, PresentationInfo::FoldbackBus);
- if (fb.size()) {
- if (foldback_strip) {
- delete foldback_strip;
- foldback_strip = 0;
- }
- }
+ delete foldback_strip;
+ foldback_strip = 0;
delete _plugin_selector;
delete track_menu;
}
if (route->is_monitor()) {
out_packer.pack_end (_monitor_section.tearoff(), false, false);
- if (foldback_strip) {
- out_packer.remove (*foldback_strip);
- out_packer.pack_end (*foldback_strip, false, false);
- foldback_strip->set_packed (true);
- }
_monitor_section.set_session (_session);
_monitor_section.tearoff().show_all ();
}
if (route->is_foldbackbus ()) {
if (foldback_strip) {
+ // last strip created is shown
foldback_strip->set_route (route);
} else {
foldback_strip = new FoldbackStrip (*this, _session, route);
- out_packer.pack_end (*foldback_strip, false, false);
+ out_packer.pack_start (*foldback_strip, false, false);
+ // change 0 to 1 below for foldback to right of master
+ out_packer.reorder_child (*foldback_strip, 0);
foldback_strip->set_packed (true);
}
+ /* config from last run is set before there are any foldback strips
+ * this takes that setting and applies it after at least one foldback
+ * strip exists */
+ bool yn = _show_foldback_strip;
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
+ act->set_sensitive (true);
+ act->set_active(!yn);
+ act->set_active(yn);
continue;
}
}
}
+void
+Mixer_UI::remove_foldback (FoldbackStrip* strip)
+{
+ if (_session && _session->deletion_in_progress()) {
+ /* its all being taken care of */
+ return;
+ }
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
+ act->set_sensitive (false);
+ if (foldback_strip) {
+ foldback_strip->destroy_();
+ }
+ foldback_strip = 0;
+}
+
void
Mixer_UI::presentation_info_changed (PropertyChange const & what_changed)
{
(*i)[stripable_columns.visible] = av->marked_for_display ();
}
- /* force presentation catch up with visibility changes
- */
-
+ /* force presentation to catch up with visibility changes */
sync_presentation_info_from_treeview ();
}
(*i)[stripable_columns.visible] = yn;
}
+
+ /* force presentation to catch up with visibility changes */
+ sync_presentation_info_from_treeview ();
}
redisplay_track_list ();
}
-
void
Mixer_UI::set_all_audio_midi_visibility (int tracks, bool yn)
{
break;
}
}
+
+ /* force presentation to catch up with visibility changes */
+ sync_presentation_info_from_treeview ();
}
redisplay_track_list ();
}
}
+void
+Mixer_UI::toggle_foldback_strip ()
+{
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
+ showhide_foldback_strip (act->get_active());
+}
+
+
+void
+Mixer_UI::showhide_foldback_strip (bool yn)
+{
+ _show_foldback_strip = yn;
+
+ if (foldback_strip) {
+ if (yn) {
+ foldback_strip->show();
+ } else {
+ foldback_strip->hide();
+ }
+ }
+}
+
void
Mixer_UI::toggle_vcas ()
{
act->set_active (yn);
}
+ yn = true;
+ node.get_property ("foldback-strip-visible", yn);
+ {
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleFoldbackStrip"));
+ /* do it twice to force the change */
+ act->set_active (!yn);
+ act->set_active (yn);
+ }
+
yn = true;
node.get_property ("show-vca-pane", yn);
{
act = ActionManager::get_toggle_action ("Mixer", "ToggleMonitorSection");
node->set_property ("monitor-section-visible", act->get_active ());
+ act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
+ node->set_property ("foldback-strip-visible", act->get_active ());
+
act = ActionManager::get_toggle_action ("Mixer", "ToggleVCAPane");
node->set_property ("show-vca-pane", act->get_active ());
#endif
ActionManager::register_toggle_action (group, X_("ToggleMonitorSection"), _("Mixer: Show Monitor Section"), sigc::mem_fun (*this, &Mixer_UI::toggle_monitor_section));
+
+ ActionManager::register_toggle_action (group, X_("ToggleFoldbackStrip"), _("Mixer: Show Foldback Strip"), sigc::mem_fun (*this, &Mixer_UI::toggle_foldback_strip));
+
+ ActionManager::register_toggle_action (group, X_("toggle-disk-monitor"), _("Toggle Disk Monitoring"), sigc::bind (sigc::mem_fun (*this, &Mixer_UI::toggle_monitor_action), MonitorDisk, false, false));
+ ActionManager::register_toggle_action (group, X_("toggle-input-monitor"), _("Toggle Input Monitoring"), sigc::bind (sigc::mem_fun (*this, &Mixer_UI::toggle_monitor_action), MonitorInput, false, false));
}
void
if (s) {
ac = (s.get()->*get_control)();
if (ac) {
+ ac->start_touch (_session->audible_sample ());
cl->push_back (ac);
if (!have_val) {
val = !ac->get_value();
}
return true;
}
+
+void
+Mixer_UI::toggle_monitor_action (MonitorChoice monitor_choice, bool group_override, bool all)
+{
+ MonitorChoice mc;
+ boost::shared_ptr<RouteList> rl;
+
+ for (AxisViewSelection::iterator i = _selection.axes.begin(); i != _selection.axes.end(); ++i) {
+ boost::shared_ptr<ARDOUR::Route> rt = boost::dynamic_pointer_cast<ARDOUR::Route> ((*i)->stripable());
+
+ if (rt->monitoring_control()->monitoring_choice() & monitor_choice) {
+ mc = MonitorChoice (rt->monitoring_control()->monitoring_choice() & ~monitor_choice);
+ } else {
+ mc = MonitorChoice (rt->monitoring_control()->monitoring_choice() | monitor_choice);
+ }
+
+ if (all) {
+ /* Primary-Tertiary-click applies change to all routes */
+ rl = _session->get_routes ();
+ _session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::NoGroup);
+ } else if (group_override) {
+ rl.reset (new RouteList);
+ rl->push_back (rt);
+ _session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::InverseGroup);
+ } else {
+ rl.reset (new RouteList);
+ rl->push_back (rt);
+ _session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::UseGroup);
+ }
+
+ }
+}