summaryrefslogtreecommitdiff
path: root/gtk2_ardour/session_option_editor.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-11-07 19:53:23 +0100
committerRobin Gareus <robin@gareus.org>2018-11-07 19:59:51 +0100
commitb06713bd8e57a33bdb4544a3de249933e984f1be (patch)
treed2a35382e2d36345b4be0624d312df3fda3054ea /gtk2_ardour/session_option_editor.cc
parent2991afaf0da78f860854f59a7d6c4e64fb519d23 (diff)
GUI options to select FLAC as media format
Diffstat (limited to 'gtk2_ardour/session_option_editor.cc')
-rw-r--r--gtk2_ardour/session_option_editor.cc38
1 files changed, 31 insertions, 7 deletions
diff --git a/gtk2_ardour/session_option_editor.cc b/gtk2_ardour/session_option_editor.cc
index e2775e641d..0ffb4c14d7 100644
--- a/gtk2_ardour/session_option_editor.cc
+++ b/gtk2_ardour/session_option_editor.cc
@@ -179,18 +179,15 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
add_option (_("Media"), new OptionEditorHeading (_("Audio File Format")));
- ComboOption<SampleFormat>* sf = new ComboOption<SampleFormat> (
+ _sf = new ComboOption<SampleFormat> (
"native-file-data-format",
_("Sample format"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_native_file_data_format),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_native_file_data_format)
);
-
- sf->add (FormatFloat, _("32-bit floating point"));
- sf->add (FormatInt24, _("24-bit integer"));
- sf->add (FormatInt16, _("16-bit integer"));
-
- add_option (_("Media"), sf);
+ add_option (_("Media"), _sf);
+ /* refill available sample-formats, depening on file-format */
+ parameter_changed ("native-file-header-format");
ComboOption<HeaderFormat>* hf = new ComboOption<HeaderFormat> (
"native-file-header-format",
@@ -210,6 +207,7 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
#ifdef HAVE_RF64_RIFF
hf->add (RF64_WAV, _("RF64 (WAV compatible)"));
#endif
+ hf->add (FLAC, _("FLAC"));
add_option (_("Media"), hf);
@@ -410,6 +408,13 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
set_current_page (_("Timecode"));
}
+SessionOptionEditor::~SessionOptionEditor ()
+{
+ delete _vpu;
+ delete _sf;
+ delete _take_name;
+}
+
void
SessionOptionEditor::parameter_changed (std::string const & p)
{
@@ -429,6 +434,25 @@ SessionOptionEditor::parameter_changed (std::string const & p)
else if (p == "track-name-take") {
_take_name->set_sensitive(_session_config->get_track_name_take());
}
+ else if (p == "native-file-header-format") {
+ bool need_refill = true;
+ _sf->clear ();
+ if (_session_config->get_native_file_header_format() == FLAC) {
+ _sf->add (FormatInt24, _("24-bit integer"));
+ _sf->add (FormatInt16, _("16-bit integer"));
+ if (_session_config->get_native_file_data_format() == FormatFloat) {
+ _session_config->set_native_file_data_format (FormatInt24);
+ need_refill = false;
+ }
+ } else {
+ _sf->add (FormatFloat, _("32-bit floating point"));
+ _sf->add (FormatInt24, _("24-bit integer"));
+ _sf->add (FormatInt16, _("16-bit integer"));
+ }
+ if (need_refill) {
+ parameter_changed ("native-file-data-format");
+ }
+ }
}
/* the presence of absence of a monitor section is not really a regular session