X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fengine_dialog.h;h=6d10eb76ac7b7264d7b62009770ddb034e77338b;hb=983bf548cdc1fb184d122c62190fb76069328a27;hp=a92d0629f29852dd420b63652c15c7660b15ec90;hpb=209e4bdcaed8e0f7d66fa5673f9049948e1f1d53;p=ardour.git diff --git a/gtk2_ardour/engine_dialog.h b/gtk2_ardour/engine_dialog.h index a92d0629f2..6d10eb76ac 100644 --- a/gtk2_ardour/engine_dialog.h +++ b/gtk2_ardour/engine_dialog.h @@ -33,9 +33,12 @@ #include #include +#include "pbd/signals.h" + #include "ardour_dialog.h" +#include "ardour_button.h" -class EngineControl : public ArdourDialog { +class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList { public: EngineControl (); ~EngineControl (); @@ -52,10 +55,15 @@ class EngineControl : public ArdourDialog { /* core fields used by all backends */ + Gtk::Table basic_packer; + Gtk::HBox basic_hbox; + Gtk::VBox basic_vbox; + Gtk::ComboBoxText backend_combo; - Gtk::ComboBoxText input_device_combo; - Gtk::ComboBoxText output_device_combo; + Gtk::ComboBoxText driver_combo; + Gtk::ComboBoxText device_combo; Gtk::ComboBoxText sample_rate_combo; + Gtk::ComboBoxText midi_option_combo; Gtk::ComboBoxText buffer_size_combo; Gtk::Label buffer_size_duration_label; Gtk::Adjustment input_latency_adjustment; @@ -69,45 +77,59 @@ class EngineControl : public ArdourDialog { Gtk::Adjustment ports_adjustment; Gtk::SpinButton ports_spinner; + Gtk::Label have_control_text; Gtk::Button control_app_button; - /* JACK specific */ - - Gtk::CheckButton realtime_button; - Gtk::CheckButton no_memory_lock_button; - Gtk::CheckButton unlock_memory_button; - Gtk::CheckButton soft_mode_button; - Gtk::CheckButton monitor_button; - Gtk::CheckButton force16bit_button; - Gtk::CheckButton hw_monitor_button; - Gtk::CheckButton hw_meter_button; - Gtk::CheckButton verbose_output_button; - - Gtk::ComboBoxText preset_combo; - Gtk::ComboBoxText serverpath_combo; - Gtk::ComboBoxText driver_combo; - Gtk::ComboBoxText device_combo; - Gtk::ComboBoxText timeout_combo; - Gtk::ComboBoxText dither_mode_combo; - Gtk::ComboBoxText audio_mode_combo; - Gtk::ComboBoxText midi_driver_combo; - - Gtk::Table basic_packer; - Gtk::Table midi_packer; - Gtk::HBox basic_hbox; - Gtk::VBox basic_vbox; - Gtk::HBox midi_hbox; + Gtk::Button connect_disconnect_button; - uint32_t ignore_changes; + /* latency measurement */ + + Gtk::ComboBoxText lm_output_channel_combo; + Gtk::ComboBoxText lm_input_channel_combo; + Gtk::Label lm_measure_label; + Gtk::Button lm_measure_button; + Gtk::Button lm_use_button; + Gtk::Button lm_back_button; + ArdourButton lm_button; + Gtk::Label lm_title; + Gtk::Label lm_results; + Gtk::Table lm_table; + Gtk::VBox lm_vbox; + bool have_lm_results; + bool lm_running; + + Gtk::Button* cancel_button; + Gtk::Button* ok_button; + Gtk::Button* apply_button; + + /* MIDI Tab */ + + Gtk::VBox midi_vbox; + Gtk::Button midi_refresh_button; + Gtk::Table midi_device_table; + + /* MIDI ... JACK */ - static bool engine_running (); + Gtk::CheckButton aj_button; + uint32_t ignore_changes; + uint32_t _desired_sample_rate; + bool started_at_least_once; + void driver_changed (); void backend_changed (); void sample_rate_changed (); void buffer_size_changed (); + void parameter_changed (); + void midi_option_changed (); - uint32_t get_rate() const; + void setup_midi_tab_for_backend (); + void setup_midi_tab_for_jack (); + void refresh_midi_display (); + + std::string bufsize_as_string (uint32_t); + + float get_rate() const; uint32_t get_buffer_size() const; uint32_t get_input_channels() const; uint32_t get_output_channels() const; @@ -115,8 +137,9 @@ class EngineControl : public ArdourDialog { uint32_t get_output_latency() const; std::string get_device_name() const; std::string get_driver() const; + std::string get_backend() const; + std::string get_midi_option () const; - void audio_mode_changed (); void device_changed (); void list_devices (); void show_buffer_duration (); @@ -125,15 +148,22 @@ class EngineControl : public ArdourDialog { std::string backend; std::string driver; std::string device; - std::string sample_rate; - std::string buffer_size; + float sample_rate; + uint32_t buffer_size; uint32_t input_latency; uint32_t output_latency; uint32_t input_channels; uint32_t output_channels; bool active; + std::string midi_option; + + State() + : input_latency (0) + , output_latency (0) + , input_channels (0) + , output_channels (0) + , active (false) {} - State() : active (false) {}; }; typedef std::list StateList; @@ -143,19 +173,46 @@ class EngineControl : public ArdourDialog { State* get_matching_state (const std::string& backend, const std::string& driver, const std::string& device); - State* get_current_state (); + State* get_saved_state_for_currently_displayed_backend_and_device (); void maybe_display_saved_state (); - void save_state (); + State* save_state (); + void store_state (State&); + + bool _have_control; static bool print_channel_count (Gtk::SpinButton*); void build_notebook (); + void build_full_control_notebook (); + void build_no_control_notebook (); void on_response (int); void control_app_button_clicked (); + void use_latency_button_clicked (); void manage_control_app_sensitivity (); int push_state_to_backend (bool start); - uint32_t _desired_sample_rate; + void post_push (); + void update_sensitivity (); + + /* latency measurement */ + void latency_button_clicked (); + bool check_latency_measurement (); + sigc::connection latency_timeout; + void enable_latency_tab (); + void disable_latency_tab (); + void start_latency_detection (); + void end_latency_detection (); + + void on_switch_page (GtkNotebookPage*, guint page_num); + bool on_delete_event (GdkEventAny*); + + void engine_running (); + void engine_stopped (); + PBD::ScopedConnection running_connection; + PBD::ScopedConnection stopped_connection; + + void connect_disconnect_click (); + void calibrate_latency (); }; #endif /* __gtk2_ardour_engine_dialog_h__ */