summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/configuration.h
blob: 0c4202764669cda3797aa2d03c2073bfdaae0448 (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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
/*
    Copyright (C) 1999 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.

    $Id$
*/

#ifndef __ardour_configuration_h__
#define __ardour_configuration_h__

#include <map>

#include <sys/types.h>
#include <string>

#include <ardour/types.h>
#include <ardour/stateful.h>

using std::string;

class XMLNode;

namespace ARDOUR {

class Configuration : public Stateful
{
  public:
	Configuration();
	virtual ~Configuration();

	struct MidiPortDescriptor {
	    string tag;
	    string device;
	    string type;
	    string mode;

	    MidiPortDescriptor (const XMLNode&);
	    XMLNode& get_state();
	};

	std::map<string,MidiPortDescriptor *> midi_ports;

	int load_state ();
	int save_state ();

	XMLNode& option_node (const string &, const string &);
	
	int set_state (const XMLNode&);
	XMLNode& get_state (void);

	XMLNode * get_keys() const;
	void set_keys(XMLNode *);

	void set_use_vst (bool yn);
	bool get_use_vst();

	bool get_trace_midi_input ();
	void set_trace_midi_input (bool);

	bool get_trace_midi_output ();
	void set_trace_midi_output (bool);

	string get_raid_path();
	void set_raid_path(string);

	uint32_t get_minimum_disk_io(); 
	void set_minimum_disk_io(uint32_t);

	float get_track_buffer();
	void set_track_buffer(float);

	bool does_hiding_groups_deactivates_groups();
	void set_hiding_groups_deactivates_groups(bool);

	string get_auditioner_output_left();
	void set_auditioner_output_left(string);

	string get_auditioner_output_right();
	void set_auditioner_output_right(string);

	bool get_mute_affects_pre_fader();
	void set_mute_affects_pre_fader (bool);

	bool get_mute_affects_post_fader();
	void set_mute_affects_post_fader (bool);

	bool get_mute_affects_control_outs ();
	void set_mute_affects_control_outs (bool);

	bool get_mute_affects_main_outs ();
	void set_mute_affects_main_outs (bool);

	bool get_solo_latch ();
	void set_solo_latch (bool);

	uint32_t get_disk_choice_space_threshold();
	void set_disk_choice_space_threshold (uint32_t);

	string get_mmc_port_name();
	void   set_mmc_port_name(string);

	string get_mtc_port_name();
	void   set_mtc_port_name(string);

	string get_midi_port_name();
	void   set_midi_port_name(string);
	
	bool get_use_hardware_monitoring();
	void set_use_hardware_monitoring(bool);

	bool get_jack_time_master();
	void set_jack_time_master(bool);

	bool get_native_format_is_bwf();
	void set_native_format_is_bwf(bool);

	bool get_plugins_stop_with_transport();
	void set_plugins_stop_with_transport(bool);

	bool get_no_sw_monitoring();
	void set_no_sw_monitoring(bool);

	bool get_stop_recording_on_xrun();
	void set_stop_recording_on_xrun(bool);

	bool get_verify_remove_last_capture();
	void set_verify_remove_last_capture(bool);
	
	bool get_stop_at_session_end();
	void set_stop_at_session_end(bool);

	bool get_seamless_looping();
	void set_seamless_looping(bool);

	bool get_auto_xfade();
	void set_auto_xfade (bool);

	bool get_no_new_session_dialog();
	void set_no_new_session_dialog(bool);
	
	uint32_t get_timecode_skip_limit ();
	void set_timecode_skip_limit (uint32_t);

	bool get_timecode_source_is_synced ();
	void set_timecode_source_is_synced (bool);

	string get_user_ardour_path ();
	string get_system_ardour_path ();

	gain_t get_quieten_at_speed ();
	void  set_quieten_at_speed (gain_t);
	
  private:
	void   set_defaults ();
	string get_system_path();
	string get_user_path();

	/* this is subject to wordexp, so we need
	   to keep the original (user-entered) form
	   around. e.g. ~/blah-> /home/foo/blah
	*/
	
	string raid_path;
	bool   raid_path_is_user;
	string orig_raid_path;

	uint32_t minimum_disk_io_bytes;
	bool          minimum_disk_io_bytes_is_user;
	float         track_buffer_seconds;
	bool          track_buffer_seconds_is_user;
	bool          hiding_groups_deactivates_groups;
	bool          hiding_groups_deactivates_groups_is_user;
	string        auditioner_output_left;
	bool          auditioner_output_left_is_user;
	string        auditioner_output_right;
	bool          auditioner_output_right_is_user;
	bool	      mute_affects_pre_fader;
	bool          mute_affects_pre_fader_is_user;
	bool	      mute_affects_post_fader;
	bool          mute_affects_post_fader_is_user;
	bool	      mute_affects_control_outs;
	bool          mute_affects_control_outs_is_user;
	bool	      mute_affects_main_outs;
	bool          mute_affects_main_outs_is_user;
	bool	      solo_latch;
	bool          solo_latch_is_user;
	uint32_t disk_choice_space_threshold;
	bool          disk_choice_space_threshold_is_user;
	string        mtc_port_name;
	bool          mtc_port_name_is_user;
	string        mmc_port_name;
	bool          mmc_port_name_is_user;
	string        midi_port_name;
	bool          midi_port_name_is_user;
	bool          use_hardware_monitoring;
	bool          use_hardware_monitoring_is_user;
	bool          be_jack_time_master;
	bool          be_jack_time_master_is_user;
	bool          native_format_is_bwf;
	bool          native_format_is_bwf_is_user;
	bool          trace_midi_input;
	bool          trace_midi_input_is_user;
	bool          trace_midi_output;
	bool          trace_midi_output_is_user;
	bool          plugins_stop_with_transport;
	bool          plugins_stop_with_transport_is_user;
	bool          no_sw_monitoring;
	bool          no_sw_monitoring_is_user;
	bool          stop_recording_on_xrun;
	bool          stop_recording_on_xrun_is_user;
	bool		  verify_remove_last_capture;
	bool		  verify_remove_last_capture_is_user;
	bool          stop_at_session_end;
	bool          stop_at_session_end_is_user;
	bool          seamless_looping;
	bool          seamless_looping_is_user;
	bool          auto_xfade;
	bool          auto_xfade_is_user;
	bool	      no_new_session_dialog;
	bool	      no_new_session_dialog_is_user;
	uint32_t      timecode_skip_limit;
	bool          timecode_skip_limit_is_user;
	bool          timecode_source_is_synced;
	bool          timecode_source_is_synced_is_user;
	bool          use_vst; /* always per-user */
	bool          quieten_at_speed;
	bool          quieten_at_speed_is_user;

	XMLNode *key_node;
	bool     user_configuration;

	XMLNode& state (bool user_only);
};

extern Configuration *Config;
extern gain_t speed_quietning; /* see comment in configuration.cc */

}; /* namespace ARDOUR */

#endif /* __ardour_configuration_h__ */