X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fconfiguration.h;h=70b7e166c155754986a01dff670566430d06a833;hb=6698f5f686bef82b0c9568558c83a3b9b3344700;hp=c0a1301318802ee31dcb900ef6e603dc315d90b4;hpb=cd87dceb0fda44d7c8fcc2b7844f65def25edb23;p=ardour.git diff --git a/libs/ardour/ardour/configuration.h b/libs/ardour/ardour/configuration.h index c0a1301318..70b7e166c1 100644 --- a/libs/ardour/ardour/configuration.h +++ b/libs/ardour/ardour/configuration.h @@ -15,249 +15,102 @@ 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 +#include #include #include -#include -#include +#include -using std::string; +#include +#include +#include class XMLNode; namespace ARDOUR { -class Configuration : public Stateful +class Configuration : public PBD::Stateful { public: Configuration(); virtual ~Configuration(); struct MidiPortDescriptor { - string tag; - string device; - string type; - string mode; + std::string tag; + std::string device; + std::string type; + std::string mode; - MidiPortDescriptor (const XMLNode&); - XMLNode& get_state(); + MidiPortDescriptor (const XMLNode&); + XMLNode& get_state(); }; - std::map midi_ports; + std::map midi_ports; + + void map_parameters (sigc::slot theSlot); int load_state (); int save_state (); - XMLNode& option_node (const string &, const string &); - + /// calls Stateful::*instant_xml methods using + /// ARDOUR::user_config_directory for the directory argument + void add_instant_xml (XMLNode&); + XMLNode * instant_xml (const std::string& str); + int set_state (const XMLNode&); XMLNode& get_state (void); + XMLNode& get_variables (sigc::slot, std::string which_node = "Config"); + void set_variables (const XMLNode&, ConfigVariableBase::Owner owner); - XMLNode * get_keys() const; - void set_keys(XMLNode *); - - void set_latched_record_enable (bool yn); - bool get_latched_record_enable(); - - 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); + void set_current_owner (ConfigVariableBase::Owner); - bool get_mute_affects_post_fader(); - void set_mute_affects_post_fader (bool); + XMLNode* control_protocol_state () { return _control_protocol_state; } - bool get_mute_affects_control_outs (); - void set_mute_affects_control_outs (bool); + sigc::signal ParameterChanged; - bool get_mute_affects_main_outs (); - void set_mute_affects_main_outs (bool); + /* define accessor methods */ - bool get_solo_latch (); - void set_solo_latch (bool); +#undef CONFIG_VARIABLE +#undef CONFIG_VARIABLE_SPECIAL +#define CONFIG_VARIABLE(Type,var,name,value) \ + Type get_##var () const { return var.get(); } \ + bool set_##var (Type val) { bool ret = var.set (val, current_owner); if (ret) { ParameterChanged (name); } return ret; } +#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \ + Type get_##var () const { return var.get(); } \ + bool set_##var (Type val) { bool ret = var.set (val, current_owner); if (ret) { ParameterChanged (name); } return ret; } +#include "ardour/configuration_vars.h" +#undef CONFIG_VARIABLE +#undef CONFIG_VARIABLE_SPECIAL - 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); - - uint32_t get_midi_feedback_interval_ms(); - void set_midi_feedback_interval_ms (uint32_t); - - bool get_use_hardware_monitoring(); - void set_use_hardware_monitoring(bool); - - bool get_use_sw_monitoring(); - void set_use_sw_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_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); + private: - 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); + /* declare variables */ - bool get_timecode_source_is_synced (); - void set_timecode_source_is_synced (bool); +#undef CONFIG_VARIABLE +#undef CONFIG_VARIABLE_SPECIAL +#define CONFIG_VARIABLE(Type,var,name,value) ConfigVariable var; +#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) ConfigVariableWithMutation var; +#include "ardour/configuration_vars.h" +#undef CONFIG_VARIABLE +#undef CONFIG_VARIABLE_SPECIAL - string get_user_ardour_path (); - string get_system_ardour_path (); + ConfigVariableBase::Owner current_owner; + XMLNode* _control_protocol_state; - 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 use_sw_monitoring; - bool use_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; - uint32_t midi_feedback_interval_ms; - bool midi_feedback_interval_ms_is_user; - bool latched_record_enable; - bool latched_record_enable_is_user; - - XMLNode *key_node; - bool user_configuration; - - XMLNode& state (bool user_only); + XMLNode& state (sigc::slot); + bool save_config_options_predicate (ConfigVariableBase::Owner owner); }; extern Configuration *Config; extern gain_t speed_quietning; /* see comment in configuration.cc */ -}; /* namespace ARDOUR */ +} // namespace ARDOUR #endif /* __ardour_configuration_h__ */