2010-08-09 10:10:23 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2000-2010 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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2009-05-15 21:22:43 -04:00
|
|
|
#include "ardour/session.h"
|
2009-05-20 16:54:07 -04:00
|
|
|
#include "ardour/io.h"
|
|
|
|
#include "ardour/auditioner.h"
|
|
|
|
#include "ardour/audioengine.h"
|
|
|
|
#include "ardour/port.h"
|
2009-12-21 13:23:07 -05:00
|
|
|
|
|
|
|
#include "gui_thread.h"
|
2009-05-15 21:22:43 -04:00
|
|
|
#include "session_option_editor.h"
|
2010-11-09 01:03:51 -05:00
|
|
|
#include "search_path_option.h"
|
2009-05-15 21:22:43 -04:00
|
|
|
#include "i18n.h"
|
|
|
|
|
2009-05-20 16:54:07 -04:00
|
|
|
using namespace std;
|
2009-05-15 21:22:43 -04:00
|
|
|
using namespace ARDOUR;
|
|
|
|
|
|
|
|
SessionOptionEditor::SessionOptionEditor (Session* s)
|
2010-06-03 13:09:28 -04:00
|
|
|
: OptionEditor (&(s->config), _("Session Properties"))
|
2009-11-09 15:05:18 -05:00
|
|
|
, _session_config (&(s->config))
|
2009-05-15 21:22:43 -04:00
|
|
|
{
|
2010-12-01 15:49:22 -05:00
|
|
|
set_session (s);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-06-03 13:09:28 -04:00
|
|
|
set_name ("SessionProperties");
|
|
|
|
|
2010-12-08 12:36:12 -05:00
|
|
|
/* TIMECODE*/
|
2009-05-15 21:22:43 -04:00
|
|
|
|
2011-01-04 15:52:30 -05:00
|
|
|
_sync_source = new ComboOption<SyncSource> (
|
2009-11-09 15:05:18 -05:00
|
|
|
"sync-source",
|
2010-12-08 12:36:12 -05:00
|
|
|
_("External timecode source"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_sync_source),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_sync_source)
|
2009-11-09 15:05:18 -05:00
|
|
|
);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-01-04 15:52:30 -05:00
|
|
|
populate_sync_options ();
|
|
|
|
parameter_changed (string ("external-sync"));
|
2009-11-09 23:30:08 -05:00
|
|
|
|
2011-01-04 15:52:30 -05:00
|
|
|
add_option (_("Timecode"), _sync_source);
|
2010-12-08 12:36:12 -05:00
|
|
|
|
|
|
|
add_option (_("Timecode"), new OptionEditorHeading (_("Timecode Settings")));
|
|
|
|
|
2009-11-09 15:05:18 -05:00
|
|
|
|
2009-10-26 22:24:56 -04:00
|
|
|
ComboOption<TimecodeFormat>* smf = new ComboOption<TimecodeFormat> (
|
2009-10-26 10:38:58 -04:00
|
|
|
"timecode-format",
|
2009-05-15 21:22:43 -04:00
|
|
|
_("Timecode frames-per-second"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_format),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_format)
|
2009-05-15 21:22:43 -04:00
|
|
|
);
|
|
|
|
|
2009-10-26 10:38:58 -04:00
|
|
|
smf->add (timecode_23976, _("23.976"));
|
|
|
|
smf->add (timecode_24, _("24"));
|
|
|
|
smf->add (timecode_24976, _("24.976"));
|
|
|
|
smf->add (timecode_25, _("25"));
|
|
|
|
smf->add (timecode_2997, _("29.97"));
|
|
|
|
smf->add (timecode_2997drop, _("29.97 drop"));
|
|
|
|
smf->add (timecode_30, _("30"));
|
|
|
|
smf->add (timecode_30drop, _("30 drop"));
|
|
|
|
smf->add (timecode_5994, _("59.94"));
|
|
|
|
smf->add (timecode_60, _("60"));
|
2009-05-15 21:22:43 -04:00
|
|
|
|
2010-12-08 12:36:12 -05:00
|
|
|
add_option (_("Timecode"), smf);
|
|
|
|
|
|
|
|
ComboOption<uint32_t>* spf = new ComboOption<uint32_t> (
|
|
|
|
"subframes-per-frame",
|
|
|
|
_("Subframes per frame"),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_subframes_per_frame),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_subframes_per_frame)
|
|
|
|
);
|
|
|
|
|
|
|
|
spf->add (80, _("80"));
|
|
|
|
spf->add (100, _("100"));
|
|
|
|
|
|
|
|
add_option (_("Timecode"), spf);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-12-08 12:36:12 -05:00
|
|
|
add_option (_("Timecode"), new BoolOption (
|
2009-05-15 21:22:43 -04:00
|
|
|
"timecode-source-is-synced",
|
2009-12-01 08:20:36 -05:00
|
|
|
_("Timecode source shares sample clock with audio interface"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_source_is_synced),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_source_is_synced)
|
2009-05-15 21:22:43 -04:00
|
|
|
));
|
2009-05-15 21:53:43 -04:00
|
|
|
|
|
|
|
ComboOption<float>* vpu = new ComboOption<float> (
|
|
|
|
"video-pullup",
|
|
|
|
_("Pull-up / pull-down"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_video_pullup),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_video_pullup)
|
2009-05-15 21:53:43 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
vpu->add (4.1667 + 0.1, _("4.1667 + 0.1%"));
|
|
|
|
vpu->add (4.1667, _("4.1667"));
|
|
|
|
vpu->add (4.1667 - 0.1, _("4.1667 - 0.1%"));
|
|
|
|
vpu->add (0.1, _("0.1"));
|
|
|
|
vpu->add (0, _("none"));
|
|
|
|
vpu->add (-0.1, _("-0.1"));
|
|
|
|
vpu->add (-4.1667 + 0.1, _("-4.1667 + 0.1%"));
|
|
|
|
vpu->add (-4.1667, _("-4.1667"));
|
|
|
|
vpu->add (-4.1667 - 0.1, _("-4.1667 - 0.1%"));
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-12-08 12:36:12 -05:00
|
|
|
add_option (_("Timecode"), vpu);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-12-01 15:49:22 -05:00
|
|
|
ClockOption* co = new ClockOption (
|
|
|
|
"timecode-offset",
|
|
|
|
_("Timecode Offset"),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_offset),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_offset)
|
|
|
|
);
|
|
|
|
|
|
|
|
co->set_session (_session);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-12-08 12:36:12 -05:00
|
|
|
add_option (_("Timecode"), co);
|
2010-12-01 15:49:22 -05:00
|
|
|
|
2010-12-08 12:36:12 -05:00
|
|
|
add_option (_("Timecode"), new BoolOption (
|
2010-12-01 15:49:22 -05:00
|
|
|
"timecode-offset-negative",
|
|
|
|
_("Timecode Offset Negative"),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_offset_negative),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_offset_negative)
|
|
|
|
));
|
|
|
|
|
2009-11-09 23:30:08 -05:00
|
|
|
/* FADES */
|
|
|
|
|
|
|
|
ComboOption<CrossfadeModel>* cfm = new ComboOption<CrossfadeModel> (
|
|
|
|
"xfade-model",
|
|
|
|
_("Crossfades are created"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfade_model),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfade_model)
|
2009-11-09 23:30:08 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
cfm->add (FullCrossfade, _("to span entire overlap"));
|
|
|
|
cfm->add (ShortCrossfade, _("short"));
|
|
|
|
|
|
|
|
add_option (_("Fades"), cfm);
|
|
|
|
|
|
|
|
add_option (_("Fades"), new SpinOption<float> (
|
|
|
|
_("short-xfade-seconds"),
|
|
|
|
_("Short crossfade length"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_short_xfade_seconds),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_short_xfade_seconds),
|
2009-11-09 23:30:08 -05:00
|
|
|
0, 1000, 1, 10,
|
|
|
|
_("ms"), 0.001
|
|
|
|
));
|
|
|
|
|
|
|
|
add_option (_("Fades"), new SpinOption<float> (
|
|
|
|
_("destructive-xfade-seconds"),
|
|
|
|
_("Destructive crossfade length"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_destructive_xfade_msecs),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_destructive_xfade_msecs),
|
2009-11-09 23:30:08 -05:00
|
|
|
0, 1000, 1, 10,
|
|
|
|
_("ms")
|
|
|
|
));
|
|
|
|
|
|
|
|
add_option (_("Fades"), new BoolOption (
|
|
|
|
"auto-xfade",
|
|
|
|
_("Create crossfades automatically"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_auto_xfade),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_auto_xfade)
|
2009-11-09 23:30:08 -05:00
|
|
|
));
|
|
|
|
|
|
|
|
add_option (_("Fades"), new BoolOption (
|
|
|
|
"xfades-active",
|
|
|
|
_("Crossfades active"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfades_active),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfades_active)
|
2009-11-09 23:30:08 -05:00
|
|
|
));
|
|
|
|
|
|
|
|
add_option (_("Fades"), new BoolOption (
|
|
|
|
"xfades-visible",
|
|
|
|
_("Crossfades visible"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfades_visible),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfades_visible)
|
2009-11-09 23:30:08 -05:00
|
|
|
));
|
|
|
|
|
|
|
|
add_option (_("Fades"), new BoolOption (
|
|
|
|
"use-region-fades",
|
|
|
|
_("Region fades active"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_use_region_fades),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_use_region_fades)
|
2009-11-09 23:30:08 -05:00
|
|
|
));
|
|
|
|
|
|
|
|
add_option (_("Fades"), new BoolOption (
|
|
|
|
"show-region-fades",
|
|
|
|
_("Region fades visible"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_region_fades),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_region_fades)
|
2009-11-09 23:30:08 -05:00
|
|
|
));
|
|
|
|
|
2010-11-09 01:03:51 -05:00
|
|
|
/* Media */
|
2009-05-15 21:22:43 -04:00
|
|
|
|
2010-11-09 01:03:51 -05:00
|
|
|
add_option (_("Media"), new OptionEditorHeading (_("Audio file format")));
|
2009-05-15 21:22:43 -04:00
|
|
|
|
|
|
|
ComboOption<SampleFormat>* sf = new ComboOption<SampleFormat> (
|
|
|
|
"native-file-data-format",
|
|
|
|
_("Sample format"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_native_file_data_format),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_native_file_data_format)
|
2009-05-15 21:22:43 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
sf->add (FormatFloat, _("32-bit floating point"));
|
|
|
|
sf->add (FormatInt24, _("24-bit integer"));
|
|
|
|
sf->add (FormatInt16, _("16-bit integer"));
|
|
|
|
|
2010-11-09 01:03:51 -05:00
|
|
|
add_option (_("Media"), sf);
|
2009-05-15 21:22:43 -04:00
|
|
|
|
|
|
|
ComboOption<HeaderFormat>* hf = new ComboOption<HeaderFormat> (
|
|
|
|
"native-file-header-format",
|
|
|
|
_("File type"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_native_file_header_format),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_native_file_header_format)
|
2009-05-15 21:22:43 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
hf->add (BWF, _("Broadcast WAVE"));
|
|
|
|
hf->add (WAVE, _("WAVE"));
|
|
|
|
hf->add (WAVE64, _("WAVE-64"));
|
|
|
|
hf->add (CAF, _("CAF"));
|
|
|
|
|
2010-11-09 01:03:51 -05:00
|
|
|
add_option (_("Media"), hf);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-11-10 09:49:46 -05:00
|
|
|
add_option (_("Media"), new OptionEditorHeading (_("File locations")));
|
|
|
|
|
2010-11-09 01:03:51 -05:00
|
|
|
SearchPathOption* spo = new SearchPathOption ("audio-search-path", _("Search for audio files in:"),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_audio_search_path),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_audio_search_path));
|
|
|
|
add_option (_("Media"), spo);
|
|
|
|
|
|
|
|
spo = new SearchPathOption ("midi-search-path", _("Search for MIDI files in:"),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_midi_search_path),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_midi_search_path));
|
|
|
|
|
|
|
|
add_option (_("Media"), spo);
|
|
|
|
|
|
|
|
/* Misc */
|
|
|
|
|
|
|
|
add_option (_("Misc"), new OptionEditorHeading (_("Layering (in overlaid mode)")));
|
2009-05-15 21:22:43 -04:00
|
|
|
|
|
|
|
ComboOption<LayerModel>* lm = new ComboOption<LayerModel> (
|
|
|
|
"layer-model",
|
2010-11-09 01:03:51 -05:00
|
|
|
_("Layering model"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_layer_model),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_layer_model)
|
2009-05-15 21:22:43 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
lm->add (LaterHigher, _("later is higher"));
|
|
|
|
lm->add (MoveAddHigher, _("most recently moved or added is higher"));
|
|
|
|
lm->add (AddHigher, _("most recently added is higher"));
|
|
|
|
|
|
|
|
add_option (_("Misc"), lm);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-06-21 10:46:17 -04:00
|
|
|
add_option (_("Misc"), new OptionEditorHeading (_("MIDI Note Overlaps")));
|
|
|
|
|
|
|
|
ComboOption<InsertMergePolicy>* li = new ComboOption<InsertMergePolicy> (
|
|
|
|
"insert-merge-policy",
|
2010-11-09 01:03:51 -05:00
|
|
|
_("Policy for handling same note\nand channel overlaps"),
|
2010-06-21 10:46:17 -04:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_insert_merge_policy),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_insert_merge_policy)
|
|
|
|
);
|
|
|
|
|
2010-08-09 10:10:23 -04:00
|
|
|
li->add (InsertMergeReject, _("never allow them"));
|
|
|
|
li->add (InsertMergeRelax, _("don't do anything in particular"));
|
|
|
|
li->add (InsertMergeReplace, _("replace any overlapped existing note"));
|
|
|
|
li->add (InsertMergeTruncateExisting, _("shorten the overlapped existing note"));
|
|
|
|
li->add (InsertMergeTruncateAddition, _("shorten the overlapping new note"));
|
|
|
|
li->add (InsertMergeExtend, _("replace both overlapping notes with a single note"));
|
2010-06-21 10:46:17 -04:00
|
|
|
|
|
|
|
add_option (_("Misc"), li);
|
|
|
|
|
2009-05-15 21:22:43 -04:00
|
|
|
add_option (_("Misc"), new OptionEditorHeading (_("Broadcast WAVE metadata")));
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-05-15 21:22:43 -04:00
|
|
|
add_option (_("Misc"), new EntryOption (
|
|
|
|
"bwf-country-code",
|
|
|
|
_("Country code"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_bwf_country_code),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_bwf_country_code)
|
2009-05-15 21:22:43 -04:00
|
|
|
));
|
|
|
|
|
|
|
|
add_option (_("Misc"), new EntryOption (
|
|
|
|
"bwf-organization-code",
|
|
|
|
_("Organization code"),
|
2009-12-11 18:29:48 -05:00
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_bwf_organization_code),
|
|
|
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_bwf_organization_code)
|
2009-05-15 21:22:43 -04:00
|
|
|
));
|
|
|
|
}
|
2009-11-09 15:05:18 -05:00
|
|
|
|
|
|
|
void
|
2011-01-04 15:52:30 -05:00
|
|
|
SessionOptionEditor::populate_sync_options ()
|
2009-11-09 15:05:18 -05:00
|
|
|
{
|
2011-01-04 15:52:30 -05:00
|
|
|
vector<SyncSource> sync_opts = _session->get_available_sync_options ();
|
2009-11-09 15:05:18 -05:00
|
|
|
|
2011-01-04 15:52:30 -05:00
|
|
|
_sync_source->clear ();
|
2009-11-09 15:05:18 -05:00
|
|
|
|
|
|
|
for (vector<SyncSource>::iterator i = sync_opts.begin(); i != sync_opts.end(); ++i) {
|
2011-01-04 15:52:30 -05:00
|
|
|
_sync_source->add (*i, sync_source_to_string (*i));
|
2009-11-09 15:05:18 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-11-09 23:30:08 -05:00
|
|
|
void
|
2011-01-04 15:52:30 -05:00
|
|
|
SessionOptionEditor::parameter_changed (std::string const & p)
|
2009-11-09 23:30:08 -05:00
|
|
|
{
|
2011-01-04 15:52:30 -05:00
|
|
|
OptionEditor::parameter_changed (p);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2009-11-09 23:30:08 -05:00
|
|
|
if (p == "external-sync") {
|
2011-01-04 15:52:30 -05:00
|
|
|
_sync_source->set_sensitive (!_session->config.get_external_sync ());
|
2009-11-09 23:30:08 -05:00
|
|
|
}
|
|
|
|
}
|