summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui_options.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-03-18 06:07:08 +0000
committerDavid Robillard <d@drobilla.net>2007-03-18 06:07:08 +0000
commit99904735e066804358f1d0bd138a84f1e9ecda91 (patch)
tree71a924cf1660b5b00231275bd481bbd27094dd9b /gtk2_ardour/ardour_ui_options.cc
parenteb270e70a12c410cdd98585ad25bb6d8e384a4f5 (diff)
Merged with trunk R1612.
git-svn-id: svn://localhost/ardour2/branches/midi@1614 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui_options.cc')
-rw-r--r--gtk2_ardour/ardour_ui_options.cc107
1 files changed, 104 insertions, 3 deletions
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index 5674d6dee1..c7db8f4ec6 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -15,7 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <pbd/convert.h>
@@ -25,6 +24,7 @@
#include <ardour/configuration.h>
#include <ardour/session.h>
+#include <ardour/osc.h>
#include <ardour/audioengine.h>
#include "ardour_ui.h"
@@ -64,6 +64,12 @@ ARDOUR_UI::toggle_use_mmc ()
}
void
+ARDOUR_UI::toggle_use_osc ()
+{
+ ActionManager::toggle_config_state ("options", "UseOSC", &Configuration::set_use_osc, &Configuration::get_use_osc);
+}
+
+void
ARDOUR_UI::toggle_use_midi_control ()
{
ActionManager::toggle_config_state ("options", "UseMIDIcontrol", &Configuration::set_midi_control, &Configuration::get_midi_control);
@@ -78,7 +84,7 @@ ARDOUR_UI::toggle_send_midi_feedback ()
void
ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
{
- const char *action;
+ const char *action = 0;
switch (hf) {
case BWF:
@@ -120,7 +126,7 @@ ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
void
ARDOUR_UI::set_native_file_data_format (SampleFormat sf)
{
- const char* action;
+ const char* action = 0;
switch (sf) {
case FormatFloat:
@@ -226,6 +232,39 @@ ARDOUR_UI::set_solo_model (SoloModel model)
}
void
+ARDOUR_UI::set_remote_model (RemoteModel model)
+{
+ const char* action = 0;
+
+ switch (model) {
+ case UserOrdered:
+ action = X_("RemoteUserDefined");
+ break;
+ case MixerOrdered:
+ action = X_("RemoteMixerDefined");
+ break;
+ case EditorOrdered:
+ action = X_("RemoteEditorDefined");
+ break;
+
+ default:
+ fatal << string_compose (_("programming error: unknown remote model in ARDOUR_UI::set_remote_model: %1"), model) << endmsg;
+ /*NOTREACHED*/
+ }
+
+ Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
+
+ if (act) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
+
+ if (ract && ract->get_active() && Config->get_remote_model() != model) {
+ Config->set_remote_model (model);
+ }
+ }
+
+}
+
+void
ARDOUR_UI::set_monitor_model (MonitorModel model)
{
const char* action = 0;
@@ -390,6 +429,12 @@ ARDOUR_UI::toggle_LatchedSolo()
}
void
+ARDOUR_UI::toggle_ShowSoloMutes()
+{
+ ActionManager::toggle_config_state ("options", "ShowSoloMutes", &Configuration::set_show_solo_mutes, &Configuration::get_show_solo_mutes);
+}
+
+void
ARDOUR_UI::mtc_port_changed ()
{
bool have_mtc;
@@ -472,6 +517,33 @@ ARDOUR_UI::map_monitor_model ()
}
void
+ARDOUR_UI::map_remote_model ()
+{
+ const char* on = 0;
+
+ switch (Config->get_remote_model()) {
+ case UserOrdered:
+ on = X_("RemoteUserDefined");
+ break;
+ case MixerOrdered:
+ on = X_("RemoteMixerDefined");
+ break;
+ case EditorOrdered:
+ on = X_("RemoteEditorDefined");
+ break;
+ }
+
+ Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+
+ if (tact && !tact->get_active()) {
+ tact->set_active (true);
+ }
+ }
+}
+
+void
ARDOUR_UI::map_file_header_format ()
{
const char* action = 0;
@@ -757,6 +829,19 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
if (PARAM_IS ("slave-source")) {
sync_option_combo.set_active_text (slave_source_to_string (Config->get_slave_source()));
+
+ switch (Config->get_slave_source()) {
+ case None:
+ ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
+ ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
+ break;
+
+ default:
+ /* XXX need to make auto-play is off as well as insensitive */
+ ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
+ ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
+ break;
+ }
} else if (PARAM_IS ("send-mtc")) {
@@ -766,6 +851,18 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
ActionManager::map_some_state ("options", "SendMMC", &Configuration::get_send_mmc);
+ } else if (PARAM_IS ("use-osc")) {
+
+#ifdef HAVE_LIBLO
+ if (Config->get_use_osc()) {
+ osc->start ();
+ } else {
+ osc->stop ();
+ }
+#endif
+
+ ActionManager::map_some_state ("options", "UseOSC", &Configuration::get_use_osc);
+
} else if (PARAM_IS ("mmc-control")) {
ActionManager::map_some_state ("options", "UseMMC", &Configuration::get_mmc_control);
} else if (PARAM_IS ("midi-feedback")) {
@@ -778,6 +875,8 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
} else if (PARAM_IS ("solo-latched")) {
ActionManager::map_some_state ("options", "LatchedSolo", &Configuration::get_solo_latched);
+ } else if (PARAM_IS ("show-solo-mutes")) {
+ ActionManager::map_some_state ("options", "ShowSoloMutes", &Configuration::get_show_solo_mutes);
} else if (PARAM_IS ("solo-model")) {
map_solo_model ();
} else if (PARAM_IS ("auto-play")) {
@@ -806,6 +905,8 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
ActionManager::map_some_state ("options", "StopTransportAtEndOfSession", &Configuration::get_stop_at_session_end);
} else if (PARAM_IS ("monitoring-model")) {
map_monitor_model ();
+ } else if (PARAM_IS ("remote-model")) {
+ map_remote_model ();
} else if (PARAM_IS ("use-video-sync")) {
ActionManager::map_some_state ("Transport", "ToggleVideoSync", &Configuration::get_use_video_sync);
} else if (PARAM_IS ("quieten-at-speed")) {