summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-03-28 19:22:29 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-03-28 19:22:29 +0000
commite27ac3278b0d335be0ccd9d6d6373287d406adb5 (patch)
tree3e0e812304a7652909f341b1a06b5bedb04a9cb2 /gtk2_ardour/ardour_ui.cc
parent744acb7c16806759743901190d8b38b61475d5be (diff)
a) fix problems with multichannel tape tracks
b) separate data format and header format for native audio files c) expose data/header selections in GUI d) fix error in file naming for multichannel tape tracks e) remove blocks on GTK rc files during startup git-svn-id: svn://localhost/trunk/ardour2@423 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc107
1 files changed, 107 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index a92e9edd8c..3c01e73514 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -271,6 +271,10 @@ ARDOUR_UI::set_engine (AudioEngine& e)
blink_timeout_tag = -1;
+ /* the global configuration object is now valid */
+
+ use_config ();
+
/* this being a GUI and all, we want peakfiles */
FileSource::set_build_peakfiles (true);
@@ -2326,3 +2330,106 @@ ARDOUR_UI::cmdline_new_session (string path)
_will_create_new_session_automatically = false; /* done it */
return FALSE; /* don't call it again */
}
+
+void
+ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
+{
+ Glib::RefPtr<Action> act;
+
+ switch (hf) {
+ case BWF:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatBWF"));
+ break;
+ case WAVE:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatWAVE"));
+ break;
+ case WAVE64:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatWAVE64"));
+ break;
+ case iXML:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatiXML"));
+ break;
+ case RF64:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatRF64"));
+ break;
+ }
+
+ if (act) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
+ if (ract && ract->get_active() && Config->get_native_file_header_format() != hf) {
+ Config->set_native_file_header_format (hf);
+ if (session) {
+ session->reset_native_file_format ();
+ }
+ }
+ }
+}
+
+void
+ARDOUR_UI::set_native_file_data_format (SampleFormat sf)
+{
+ Glib::RefPtr<Action> act;
+
+ switch (sf) {
+ case FormatFloat:
+ act = ActionManager::get_action (X_("options"), X_("FileDataFormatFloat"));
+ break;
+ case FormatInt24:
+ act = ActionManager::get_action (X_("options"), X_("FileDataFormat24bit"));
+ break;
+ }
+
+ if (act) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
+
+ if (ract && ract->get_active() && Config->get_native_file_data_format() != sf) {
+ Config->set_native_file_data_format (sf);
+ if (session) {
+ session->reset_native_file_format ();
+ }
+ }
+ }
+}
+
+void
+ARDOUR_UI::use_config ()
+{
+ Glib::RefPtr<Action> act;
+
+ switch (Config->get_native_file_data_format ()) {
+ case FormatFloat:
+ act = ActionManager::get_action (X_("options"), X_("FileDataFormatFloat"));
+ break;
+ case FormatInt24:
+ act = ActionManager::get_action (X_("options"), X_("FileDataFormat24bit"));
+ break;
+ }
+
+ if (act) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
+ ract->set_active ();
+ }
+
+ switch (Config->get_native_file_header_format ()) {
+ case BWF:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatBWF"));
+ break;
+ case WAVE:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatWAVE"));
+ break;
+ case WAVE64:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatWAVE64"));
+ break;
+ case iXML:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatiXML"));
+ break;
+ case RF64:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatRF64"));
+ break;
+ }
+
+ if (act) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
+ ract->set_active ();
+ }
+}