summaryrefslogtreecommitdiff
path: root/gtk2_ardour/session_option_editor.cc
blob: 6c05794ed142a37122f3f793f1c609d29dbf97dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#include "ardour/session.h"
#include "session_option_editor.h"
#include "i18n.h"

using namespace sigc;
using namespace ARDOUR;

SessionOptionEditor::SessionOptionEditor (Session* s)
	: OptionEditor (&(s->config), _("Session Preferences")),
	  _session_config (&(s->config))
{
	/* FADES */

	ComboOption<CrossfadeModel>* cfm = new ComboOption<CrossfadeModel> (
		"xfade-model",
		_("Crossfades are created"),
		mem_fun (*_session_config, &SessionConfiguration::get_xfade_model),
		mem_fun (*_session_config, &SessionConfiguration::set_xfade_model)
		);

	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"),
		mem_fun (*_session_config, &SessionConfiguration::get_short_xfade_seconds),
		mem_fun (*_session_config, &SessionConfiguration::set_short_xfade_seconds),
		0, 1000, 1, 10,
		_("ms"), 0.001
			    ));

	add_option (_("Fades"), new SpinOption<float> (
		_("destructive-xfade-seconds"),
		_("Destructive crossfade length"),
		mem_fun (*_session_config, &SessionConfiguration::get_destructive_xfade_msecs),
		mem_fun (*_session_config, &SessionConfiguration::set_destructive_xfade_msecs),
		0, 1000, 1, 10,
		_("ms")
			    ));

	add_option (_("Fades"), new BoolOption (
			    "auto-xfade",
			    _("Create crossfades automatically"),
			    mem_fun (*_session_config, &SessionConfiguration::get_auto_xfade),
			    mem_fun (*_session_config, &SessionConfiguration::set_auto_xfade)
			    ));

        add_option (_("Fades"), new BoolOption (
			    "xfades-active",
			    _("Crossfades active"),
			    mem_fun (*_session_config, &SessionConfiguration::get_xfades_active),
			    mem_fun (*_session_config, &SessionConfiguration::set_xfades_active)
			    ));

	add_option (_("Fades"), new BoolOption (
			    "xfades-visible",
			    _("Crossfades visible"),
			    mem_fun (*_session_config, &SessionConfiguration::get_xfades_visible),
			    mem_fun (*_session_config, &SessionConfiguration::set_xfades_visible)
			    ));

	add_option (_("Fades"), new BoolOption (
			    "use-region-fades",
			    _("Region fades active"),
			    mem_fun (*_session_config, &SessionConfiguration::get_use_region_fades),
			    mem_fun (*_session_config, &SessionConfiguration::set_use_region_fades)
			    ));

	add_option (_("Fades"), new BoolOption (
			    "show-region-fades",
			    _("Region fades visible"),
			    mem_fun (*_session_config, &SessionConfiguration::get_show_region_fades),
			    mem_fun (*_session_config, &SessionConfiguration::set_show_region_fades)
			    ));

	/* SYNC */

	ComboOption<uint32_t>* spf = new ComboOption<uint32_t> (
		"subframes-per-frame",
		_("Subframes per frame"),
		mem_fun (*_session_config, &SessionConfiguration::get_subframes_per_frame),
		mem_fun (*_session_config, &SessionConfiguration::set_subframes_per_frame)
		);

	spf->add (80, _("80"));
	spf->add (100, _("100"));

	add_option (_("Sync"), spf);

	ComboOption<SmpteFormat>* smf = new ComboOption<SmpteFormat> (
		"smpte-format",
		_("Timecode frames-per-second"),
		mem_fun (*_session_config, &SessionConfiguration::get_smpte_format),
		mem_fun (*_session_config, &SessionConfiguration::set_smpte_format)
		);

	smf->add (smpte_23976, _("23.976"));
	smf->add (smpte_24, _("24"));
	smf->add (smpte_24976, _("24.976"));
	smf->add (smpte_25, _("25"));
	smf->add (smpte_2997, _("29.97"));
	smf->add (smpte_2997drop, _("29.97 drop"));
	smf->add (smpte_30, _("30"));
	smf->add (smpte_30drop, _("30 drop"));
	smf->add (smpte_5994, _("59.94"));
	smf->add (smpte_60, _("60"));

	add_option (_("Sync"), smf);
		
	add_option (_("Sync"), new BoolOption (
			    "timecode-source-is-synced",
			    _("Timecode source is synced"),
			    mem_fun (*_session_config, &SessionConfiguration::get_timecode_source_is_synced),
			    mem_fun (*_session_config, &SessionConfiguration::set_timecode_source_is_synced)
			    ));
	
	/* MISC */

	add_option (_("Misc"), new OptionEditorHeading (_("Audio file format")));

	ComboOption<SampleFormat>* sf = new ComboOption<SampleFormat> (
		"native-file-data-format",
		_("Sample format"),
		mem_fun (*_session_config, &SessionConfiguration::get_native_file_data_format),
		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 (_("Misc"), sf);

	ComboOption<HeaderFormat>* hf = new ComboOption<HeaderFormat> (
		"native-file-header-format",
		_("File type"),
		mem_fun (*_session_config, &SessionConfiguration::get_native_file_header_format),
		mem_fun (*_session_config, &SessionConfiguration::set_native_file_header_format)
		);

	hf->add (BWF, _("Broadcast WAVE"));
	hf->add (WAVE, _("WAVE"));
	hf->add (WAVE64, _("WAVE-64"));
	hf->add (CAF, _("CAF"));

	add_option (_("Misc"), hf);

	add_option (_("Misc"), new OptionEditorHeading (_("Layering")));

	ComboOption<LayerModel>* lm = new ComboOption<LayerModel> (
		"layer-model",
		_("Layering model"),
		mem_fun (*_session_config, &SessionConfiguration::get_layer_model),
		mem_fun (*_session_config, &SessionConfiguration::set_layer_model)
		);

	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);
	
	add_option (_("Misc"), new OptionEditorHeading (_("Broadcast WAVE metadata")));
	
	add_option (_("Misc"), new EntryOption (
			    "bwf-country-code",
			    _("Country code"),
			    mem_fun (*_session_config, &SessionConfiguration::get_bwf_country_code),
			    mem_fun (*_session_config, &SessionConfiguration::set_bwf_country_code)
			    ));

	add_option (_("Misc"), new EntryOption (
			    "bwf-organization-code",
			    _("Organization code"),
			    mem_fun (*_session_config, &SessionConfiguration::get_bwf_organization_code),
			    mem_fun (*_session_config, &SessionConfiguration::set_bwf_organization_code)
			    ));
}