summaryrefslogtreecommitdiff
path: root/gtk2_ardour/session_option_editor.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-01-18 01:30:44 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-01-18 01:30:44 +0000
commit508c5eb5bd7e31d721c3a29fc734aab3a44aa8a9 (patch)
tree4937d96a3f4d366d4722c6225da147599b97a955 /gtk2_ardour/session_option_editor.cc
parent4b95a7912aa27b13c4715b9580ec1bb10dbfd7c3 (diff)
make monitor section an optional feature than can be added/removed as needed. this is a big commit, and breakage is possible. it has been moderately tested. this commit also locks the remote control ID of the master bus to 318 and the monitor section (if any) to 319. the numbers are based on MIDI Machine Control limits
git-svn-id: svn://localhost/ardour2/branches/3.0@11256 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/session_option_editor.cc')
-rw-r--r--gtk2_ardour/session_option_editor.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/gtk2_ardour/session_option_editor.cc b/gtk2_ardour/session_option_editor.cc
index dc72e6a045..e5cd7780f1 100644
--- a/gtk2_ardour/session_option_editor.cc
+++ b/gtk2_ardour/session_option_editor.cc
@@ -260,6 +260,13 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
sigc::mem_fun (*_session_config, &SessionConfiguration::set_auto_input)
));
+ add_option (_("Monitoring"), new BoolOption (
+ "have-monitor-section",
+ _("Use monitor section in this session"),
+ sigc::mem_fun (*this, &SessionOptionEditor::get_use_monitor_section),
+ sigc::mem_fun (*this, &SessionOptionEditor::set_use_monitor_section)
+ ));
+
/* Misc */
add_option (_("Misc"), new OptionEditorHeading (_("MIDI Options")));
@@ -341,3 +348,27 @@ SessionOptionEditor::parameter_changed (std::string const & p)
_sync_source->set_sensitive (!_session->config.get_external_sync ());
}
}
+
+/* the presence of absence of a monitor section is not really a regular session
+ * property so we provide these two functions to act as setter/getter slots
+ */
+
+bool
+SessionOptionEditor::set_use_monitor_section (bool yn)
+{
+ bool had_monitor_section = _session->monitor_out();
+
+ if (yn) {
+ _session->add_monitor_section ();
+ } else {
+ _session->remove_monitor_section ();
+ }
+
+ return had_monitor_section != yn;
+}
+
+bool
+SessionOptionEditor::get_use_monitor_section ()
+{
+ return _session->monitor_out() != 0;
+}