13
0
livetrax/gtk2_ardour/engine_dialog.h
Paul Davis 2a89234027 move control app launching back into audio backend to allow ASIO/CoreAudio model to work; push initial state of AMS dialog to backend
Issues remain with the basic model of the AMS dialog - when is
newly chosen state pushed into the backend (which can then
modify the control app button sensitivity. This is a special
problem for this button because APIs like ASIO and CoreAudio
probably don't allow us to launch a control app for an arbitrary
device, but only one actually in use. In this sense it is
different from properties like available buffer size etc, where
we can typically query without actually using the device.
2013-09-09 21:23:12 -04:00

159 lines
4.4 KiB
C++

/*
Copyright (C) 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.
*/
#ifndef __gtk2_ardour_engine_dialog_h__
#define __gtk2_ardour_engine_dialog_h__
#include <map>
#include <vector>
#include <string>
#include <gtkmm/checkbutton.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/table.h>
#include <gtkmm/expander.h>
#include <gtkmm/box.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/button.h>
#include "ardour_dialog.h"
class EngineControl : public ArdourDialog {
public:
EngineControl ();
~EngineControl ();
static bool need_setup ();
XMLNode& get_state ();
void set_state (const XMLNode&);
private:
Gtk::Notebook notebook;
/* core fields used by all backends */
Gtk::ComboBoxText backend_combo;
Gtk::ComboBoxText input_device_combo;
Gtk::ComboBoxText output_device_combo;
Gtk::ComboBoxText sample_rate_combo;
Gtk::ComboBoxText buffer_size_combo;
Gtk::Label buffer_size_duration_label;
Gtk::Adjustment input_latency_adjustment;
Gtk::SpinButton input_latency;
Gtk::Adjustment output_latency_adjustment;
Gtk::SpinButton output_latency;
Gtk::Adjustment input_channels_adjustment;
Gtk::SpinButton input_channels;
Gtk::Adjustment output_channels_adjustment;
Gtk::SpinButton output_channels;
Gtk::Adjustment ports_adjustment;
Gtk::SpinButton ports_spinner;
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;
uint32_t ignore_changes;
static bool engine_running ();
void driver_changed ();
void backend_changed ();
void sample_rate_changed ();
void buffer_size_changed ();
uint32_t get_rate() const;
uint32_t get_buffer_size() const;
uint32_t get_input_channels() const;
uint32_t get_output_channels() const;
uint32_t get_input_latency() const;
uint32_t get_output_latency() const;
std::string get_device_name() const;
std::string get_driver() const;
void audio_mode_changed ();
void device_changed ();
void list_devices ();
void show_buffer_duration ();
struct State {
std::string backend;
std::string driver;
std::string device;
std::string sample_rate;
std::string buffer_size;
uint32_t input_latency;
uint32_t output_latency;
uint32_t input_channels;
uint32_t output_channels;
bool active;
State() : active (false) {};
};
typedef std::list<State> StateList;
StateList states;
State* get_matching_state (const std::string& backend,
const std::string& driver,
const std::string& device);
State* get_current_state ();
void maybe_display_saved_state ();
void save_state ();
static bool print_channel_count (Gtk::SpinButton*);
void build_notebook ();
void on_response (int);
void control_app_button_clicked ();
void manage_control_app_sensitivity ();
int push_state_to_backend (bool start);
};
#endif /* __gtk2_ardour_engine_dialog_h__ */