/*
- Copyright (C) 2000-2004 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2005-2006 Taybin Rutkin <taybin@taybin.com>
+ * Copyright (C) 2005-2018 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2006-2007 Doug McLain <doug@nostar.net>
+ * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2007-2012 David Robillard <d@drobilla.net>
+ * Copyright (C) 2007-2016 Tim Mayberry <mojofunk@gmail.com>
+ * Copyright (C) 2013-2015 Nick Mainsbridge <mainsbridge@gmail.com>
+ * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2014-2018 Ben Loftis <ben@harrisonconsoles.com>
+ * Copyright (C) 2016-2018 Len Ovens <len@ovenwerks.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#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"
#include "widgets/tearoff.h"
+#include "foldback_strip.h"
#include "keyboard.h"
#include "mixer_ui.h"
#include "mixer_strip.h"
, in_group_row_change (false)
, 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 ();
+ delete foldback_strip;
+ foldback_strip = 0;
delete _plugin_selector;
delete track_menu;
}
continue;
}
+ 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_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;
+ }
strip = new MixerStrip (*this, _session, route);
strips.push_back (strip);
}
}
+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)
{
}
_monitor_section.tearoff().hide_visible ();
+ StripableList fb;
+ _session->get_stripables (fb, PresentationInfo::FoldbackBus);
+ if (fb.size()) {
+ if (foldback_strip) {
+ delete foldback_strip;
+ foldback_strip = 0;
+ }
+ }
monitor_section_detached ();
(*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 ();
Mixer_UI::initial_track_display ()
{
StripableList sl;
+ StripableList fb;
_session->get_stripables (sl);
+ _session->get_stripables (fb, PresentationInfo::FoldbackBus);
+ if (fb.size()) {
+ boost::shared_ptr<ARDOUR::Stripable> _current_foldback = *(fb.begin());
+ sl.push_back (_current_foldback);
+ }
sl.sort (PresentationInfoMixerSorter());
}
}
+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);
+ }
+
+ }
+}