mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
split EngineDialog into a widget and a dialog
This commit is contained in:
parent
86c730095c
commit
9a4bc841dd
9 changed files with 165 additions and 95 deletions
|
|
@ -191,3 +191,9 @@ ArdourDialog::set_ui_sensitive (bool yn)
|
||||||
{
|
{
|
||||||
_sensitive = yn;
|
_sensitive = yn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ArdourDialog::add_widget_action (Gtk::Widget& w)
|
||||||
|
{
|
||||||
|
get_action_area()->add (w);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,13 @@ public:
|
||||||
void on_show ();
|
void on_show ();
|
||||||
virtual void on_response (int);
|
virtual void on_response (int);
|
||||||
void set_ui_sensitive (bool);
|
void set_ui_sensitive (bool);
|
||||||
|
bool ui_sensitive () const { return _sensitive; }
|
||||||
void disallow_idle ();
|
void disallow_idle ();
|
||||||
|
|
||||||
protected:
|
|
||||||
void pop_splash ();
|
void pop_splash ();
|
||||||
|
void add_widget_action (Gtk::Widget&);
|
||||||
|
|
||||||
|
protected:
|
||||||
void close_self ();
|
void close_self ();
|
||||||
|
|
||||||
bool _sensitive;
|
bool _sensitive;
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ class AddVideoDialog;
|
||||||
class BigClockWindow;
|
class BigClockWindow;
|
||||||
class BigTransportWindow;
|
class BigTransportWindow;
|
||||||
class BundleManager;
|
class BundleManager;
|
||||||
class EngineControl;
|
class EngineControlDialog;
|
||||||
class ExportVideoDialog;
|
class ExportVideoDialog;
|
||||||
class KeyEditor;
|
class KeyEditor;
|
||||||
class LocationUIWindow;
|
class LocationUIWindow;
|
||||||
|
|
@ -785,7 +785,7 @@ private:
|
||||||
WM::Proxy<About> about;
|
WM::Proxy<About> about;
|
||||||
WM::Proxy<LocationUIWindow> location_ui;
|
WM::Proxy<LocationUIWindow> location_ui;
|
||||||
WM::Proxy<RouteParams_UI> route_params;
|
WM::Proxy<RouteParams_UI> route_params;
|
||||||
WM::Proxy<EngineControl> audio_midi_setup;
|
WM::Proxy<EngineControlDialog> audio_midi_setup;
|
||||||
WM::Proxy<ExportVideoDialog> export_video_dialog;
|
WM::Proxy<ExportVideoDialog> export_video_dialog;
|
||||||
WM::Proxy<LuaScriptManager> lua_script_window;
|
WM::Proxy<LuaScriptManager> lua_script_window;
|
||||||
WM::Proxy<IdleOMeter> idleometer;
|
WM::Proxy<IdleOMeter> idleometer;
|
||||||
|
|
|
||||||
|
|
@ -205,8 +205,8 @@ audio will be resampled, which reduces quality.\n"), desired, PROGRAM_NAME, actu
|
||||||
switch (dialog.run()) {
|
switch (dialog.run()) {
|
||||||
case RESPONSE_YES:
|
case RESPONSE_YES:
|
||||||
ARDOUR::AudioEngine::instance ()->stop ();
|
ARDOUR::AudioEngine::instance ()->stop ();
|
||||||
(dynamic_cast<EngineControl*> (audio_midi_setup.get (true)))->run ();
|
(dynamic_cast<EngineControlDialog*> (audio_midi_setup.get (true)))->run ();
|
||||||
(dynamic_cast<EngineControl*> (audio_midi_setup.get (true)))->hide ();
|
(dynamic_cast<EngineControlDialog*> (audio_midi_setup.get (true)))->hide ();
|
||||||
return AudioEngine::instance()->running () ? -1 : 1;
|
return AudioEngine::instance()->running () ? -1 : 1;
|
||||||
case RESPONSE_ACCEPT:
|
case RESPONSE_ACCEPT:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -580,10 +580,10 @@ ARDOUR_UI::starting ()
|
||||||
* audio backend end up.
|
* audio backend end up.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EngineControl* amd;
|
EngineControlDialog* amd;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amd = dynamic_cast<EngineControl*> (audio_midi_setup.get (true));
|
amd = dynamic_cast<EngineControlDialog*> (audio_midi_setup.get (true));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
std::cerr << "audio-midi engine setup failed."<< std::endl;
|
std::cerr << "audio-midi engine setup failed."<< std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -922,10 +922,10 @@ ARDOUR_UI::load_from_application_api (const std::string& path)
|
||||||
|
|
||||||
/* do this again */
|
/* do this again */
|
||||||
|
|
||||||
EngineControl* amd;
|
EngineControlDialog* amd;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amd = dynamic_cast<EngineControl*> (audio_midi_setup.get (true));
|
amd = dynamic_cast<EngineControlDialog*> (audio_midi_setup.get (true));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
std::cerr << "audio-midi engine setup failed."<< std::endl;
|
std::cerr << "audio-midi engine setup failed."<< std::endl;
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -80,9 +80,68 @@ static const unsigned int latency_tab = 1; /* zero-based, page zero is the main
|
||||||
|
|
||||||
static const char* results_markup = X_("<span weight=\"bold\" size=\"larger\">%1</span>");
|
static const char* results_markup = X_("<span weight=\"bold\" size=\"larger\">%1</span>");
|
||||||
|
|
||||||
EngineControl::EngineControl ()
|
EngineControlDialog::EngineControlDialog ()
|
||||||
: ArdourDialog (_("Audio/MIDI Setup"))
|
: ArdourDialog (_("Audio/MIDI Setup"))
|
||||||
, engine_status ("")
|
{
|
||||||
|
engine_control.set_parent (*this);
|
||||||
|
|
||||||
|
if (UIConfiguration::instance().get_allow_to_resize_engine_dialog ()) {
|
||||||
|
set_resizable (false);
|
||||||
|
}
|
||||||
|
set_name (X_("AudioMIDISetup"));
|
||||||
|
|
||||||
|
/* packup the notebook */
|
||||||
|
|
||||||
|
get_vbox ()->set_border_width (12);
|
||||||
|
get_vbox ()->pack_start (engine_control.contents());
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EngineControlDialog::on_response (int r)
|
||||||
|
{
|
||||||
|
/* Do not run ArdourDialog::on_response() which will hide us. Leave
|
||||||
|
* that to whoever invoked us, if they wish to hide us after "start".
|
||||||
|
*
|
||||||
|
* StartupFSM does hide us after response(); Window > Audio/MIDI Setup
|
||||||
|
* does not.
|
||||||
|
*/
|
||||||
|
if (r == RESPONSE_OK) {
|
||||||
|
pop_splash ();
|
||||||
|
}
|
||||||
|
Gtk::Dialog::on_response (r);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
EngineControlDialog::on_show ()
|
||||||
|
{
|
||||||
|
ArdourDialog::on_show ();
|
||||||
|
engine_control.on_show ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EngineControlDialog::on_map ()
|
||||||
|
{
|
||||||
|
if (!ARDOUR_UI::instance ()->the_session () && !PublicEditor::_instance) {
|
||||||
|
set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL);
|
||||||
|
} else if (UIConfiguration::instance ().get_all_floating_windows_are_dialogs ()) {
|
||||||
|
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
|
||||||
|
} else {
|
||||||
|
set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
|
||||||
|
}
|
||||||
|
ArdourDialog::on_map ();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
EngineControlDialog::on_delete_event (GdkEventAny* ev)
|
||||||
|
{
|
||||||
|
engine_control.on_delete_event (ev);
|
||||||
|
return ArdourDialog::on_delete_event (ev);
|
||||||
|
}
|
||||||
|
|
||||||
|
EngineControl::EngineControl ()
|
||||||
|
: engine_status ("")
|
||||||
, settings_table (4, 4)
|
, settings_table (4, 4)
|
||||||
, latency_expander (_("Advanced Settings"))
|
, latency_expander (_("Advanced Settings"))
|
||||||
, monitor_expander (_("Hardware Monitoring"))
|
, monitor_expander (_("Hardware Monitoring"))
|
||||||
|
|
@ -126,6 +185,7 @@ EngineControl::EngineControl ()
|
||||||
, queue_device_changed (false)
|
, queue_device_changed (false)
|
||||||
, _have_control (true)
|
, _have_control (true)
|
||||||
, block_signals (0)
|
, block_signals (0)
|
||||||
|
, parent (nullptr)
|
||||||
{
|
{
|
||||||
using namespace Notebook_Helpers;
|
using namespace Notebook_Helpers;
|
||||||
vector<string> backend_names;
|
vector<string> backend_names;
|
||||||
|
|
@ -133,11 +193,6 @@ EngineControl::EngineControl ()
|
||||||
AttachOptions xopt = AttachOptions (FILL | EXPAND);
|
AttachOptions xopt = AttachOptions (FILL | EXPAND);
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
if (UIConfiguration::instance().get_allow_to_resize_engine_dialog ()) {
|
|
||||||
set_resizable (false);
|
|
||||||
}
|
|
||||||
set_name (X_("AudioMIDISetup"));
|
|
||||||
|
|
||||||
/* the backend combo is the one thing that is ALWAYS visible */
|
/* the backend combo is the one thing that is ALWAYS visible */
|
||||||
|
|
||||||
vector<const ARDOUR::AudioBackendInfo*> backends = ARDOUR::AudioEngine::instance ()->available_backends ();
|
vector<const ARDOUR::AudioBackendInfo*> backends = ARDOUR::AudioEngine::instance ()->available_backends ();
|
||||||
|
|
@ -277,11 +332,6 @@ EngineControl::EngineControl ()
|
||||||
|
|
||||||
notebook.set_name ("SettingsNotebook");
|
notebook.set_name ("SettingsNotebook");
|
||||||
|
|
||||||
/* packup the notebook */
|
|
||||||
|
|
||||||
get_vbox ()->set_border_width (12);
|
|
||||||
get_vbox ()->pack_start (notebook);
|
|
||||||
|
|
||||||
/* Setup buttons and signals */
|
/* Setup buttons and signals */
|
||||||
|
|
||||||
lm_button_audio.signal_clicked.connect (sigc::mem_fun (*this, &EngineControl::calibrate_audio_latency));
|
lm_button_audio.signal_clicked.connect (sigc::mem_fun (*this, &EngineControl::calibrate_audio_latency));
|
||||||
|
|
@ -454,7 +504,6 @@ EngineControl::SignalBlocker::~SignalBlocker ()
|
||||||
void
|
void
|
||||||
EngineControl::on_show ()
|
EngineControl::on_show ()
|
||||||
{
|
{
|
||||||
ArdourDialog::on_show ();
|
|
||||||
if (!ARDOUR::AudioEngine::instance ()->current_backend () || !ARDOUR::AudioEngine::instance ()->running ()) {
|
if (!ARDOUR::AudioEngine::instance ()->current_backend () || !ARDOUR::AudioEngine::instance ()->running ()) {
|
||||||
// re-check _have_control (jackd running) see #6041
|
// re-check _have_control (jackd running) see #6041
|
||||||
backend_changed ();
|
backend_changed ();
|
||||||
|
|
@ -463,19 +512,6 @@ EngineControl::on_show ()
|
||||||
start_stop_button.grab_focus ();
|
start_stop_button.grab_focus ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
EngineControl::on_map ()
|
|
||||||
{
|
|
||||||
if (!ARDOUR_UI::instance ()->the_session () && !PublicEditor::_instance) {
|
|
||||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL);
|
|
||||||
} else if (UIConfiguration::instance ().get_all_floating_windows_are_dialogs ()) {
|
|
||||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
|
|
||||||
} else {
|
|
||||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
|
|
||||||
}
|
|
||||||
ArdourDialog::on_map ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
EngineControl::config_parameter_changed (std::string const& p)
|
EngineControl::config_parameter_changed (std::string const& p)
|
||||||
{
|
{
|
||||||
|
|
@ -500,15 +536,17 @@ EngineControl::config_parameter_changed (std::string const& p)
|
||||||
bool
|
bool
|
||||||
EngineControl::start_engine ()
|
EngineControl::start_engine ()
|
||||||
{
|
{
|
||||||
|
assert (parent);
|
||||||
|
|
||||||
int rv = push_state_to_backend (true);
|
int rv = push_state_to_backend (true);
|
||||||
if (rv < 0) {
|
if (rv < 0) {
|
||||||
/* error message from backend */
|
/* error message from backend */
|
||||||
ArdourMessageDialog msg (*this, ARDOUR::AudioEngine::instance ()->get_last_backend_error ());
|
ArdourMessageDialog msg (*parent, ARDOUR::AudioEngine::instance ()->get_last_backend_error ());
|
||||||
msg.run ();
|
msg.run ();
|
||||||
} else if (rv > 0) {
|
} else if (rv > 0) {
|
||||||
/* error from push_state_to_backend() */
|
/* error from push_state_to_backend() */
|
||||||
// TODO: get error message from push_state_to_backend
|
// TODO: get error message from push_state_to_backend
|
||||||
ArdourMessageDialog msg (*this, _("Could not configure Audio/MIDI engine with given settings."));
|
ArdourMessageDialog msg (*parent, _("Could not configure Audio/MIDI engine with given settings."));
|
||||||
msg.run ();
|
msg.run ();
|
||||||
}
|
}
|
||||||
return rv == 0;
|
return rv == 0;
|
||||||
|
|
@ -1083,8 +1121,8 @@ EngineControl::backend_changed ()
|
||||||
maybe_display_saved_state ();
|
maybe_display_saved_state ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!UIConfiguration::instance().get_allow_to_resize_engine_dialog ()) {
|
if (parent && !UIConfiguration::instance().get_allow_to_resize_engine_dialog ()) {
|
||||||
resize (1, 1); // shrink window
|
parent->resize (1, 1); // shrink window
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2680,7 +2718,7 @@ EngineControl::get_output_device_name () const
|
||||||
void
|
void
|
||||||
EngineControl::control_app_button_clicked ()
|
EngineControl::control_app_button_clicked ()
|
||||||
{
|
{
|
||||||
if (!_sensitive) {
|
if (!parent || parent->ui_sensitive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2693,25 +2731,10 @@ EngineControl::control_app_button_clicked ()
|
||||||
backend->launch_control_app ();
|
backend->launch_control_app ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
EngineControl::on_response (int r)
|
|
||||||
{
|
|
||||||
/* Do not run ArdourDialog::on_response() which will hide us. Leave
|
|
||||||
* that to whoever invoked us, if they wish to hide us after "start".
|
|
||||||
*
|
|
||||||
* StartupFSM does hide us after response(); Window > Audio/MIDI Setup
|
|
||||||
* does not.
|
|
||||||
*/
|
|
||||||
if (r == RESPONSE_OK) {
|
|
||||||
pop_splash ();
|
|
||||||
}
|
|
||||||
Gtk::Dialog::on_response (r);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
EngineControl::start_stop_button_clicked ()
|
EngineControl::start_stop_button_clicked ()
|
||||||
{
|
{
|
||||||
if (!_sensitive) {
|
if (!parent || parent->ui_sensitive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2732,13 +2755,15 @@ EngineControl::start_stop_button_clicked ()
|
||||||
rv = start_engine () ? RESPONSE_OK : RESPONSE_ACCEPT;
|
rv = start_engine () ? RESPONSE_OK : RESPONSE_ACCEPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
response (rv);
|
if (parent) {
|
||||||
|
parent->response (rv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EngineControl::update_devices_button_clicked ()
|
EngineControl::update_devices_button_clicked ()
|
||||||
{
|
{
|
||||||
if (!_sensitive) {
|
if (!parent || parent->ui_sensitive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2760,7 +2785,7 @@ EngineControl::update_devices_button_clicked ()
|
||||||
void
|
void
|
||||||
EngineControl::try_autostart_button_clicked ()
|
EngineControl::try_autostart_button_clicked ()
|
||||||
{
|
{
|
||||||
if (!_sensitive) {
|
if (!parent || parent->ui_sensitive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2771,7 +2796,7 @@ EngineControl::try_autostart_button_clicked ()
|
||||||
void
|
void
|
||||||
EngineControl::use_buffered_io_button_clicked ()
|
EngineControl::use_buffered_io_button_clicked ()
|
||||||
{
|
{
|
||||||
if (!_sensitive) {
|
if (!parent || parent->ui_sensitive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2952,6 +2977,10 @@ unparent_widget (Gtk::Widget& w)
|
||||||
void
|
void
|
||||||
EngineControl::populate_action_area (int page_num)
|
EngineControl::populate_action_area (int page_num)
|
||||||
{
|
{
|
||||||
|
if (!parent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* re-populate action area */
|
/* re-populate action area */
|
||||||
unparent_widget (start_stop_button);
|
unparent_widget (start_stop_button);
|
||||||
unparent_widget (connect_disconnect_button);
|
unparent_widget (connect_disconnect_button);
|
||||||
|
|
@ -2962,17 +2991,19 @@ EngineControl::populate_action_area (int page_num)
|
||||||
|
|
||||||
if (page_num == 0) {
|
if (page_num == 0) {
|
||||||
if (_have_control) {
|
if (_have_control) {
|
||||||
get_action_area ()->add (start_stop_button);
|
parent->add_widget_action (start_stop_button);
|
||||||
} else {
|
} else {
|
||||||
get_action_area ()->add (connect_disconnect_button);
|
parent->add_widget_action (connect_disconnect_button);
|
||||||
}
|
}
|
||||||
} else if (page_num == latency_tab) {
|
} else if (page_num == latency_tab) {
|
||||||
get_action_area ()->add (lm_measure_button);
|
parent->add_widget_action (lm_measure_button);
|
||||||
get_action_area ()->add (lm_use_button);
|
parent->add_widget_action (lm_use_button);
|
||||||
get_action_area ()->add (lm_back_button);
|
parent->add_widget_action (lm_back_button);
|
||||||
get_action_area ()->show_all ();
|
lm_measure_button.show();
|
||||||
|
lm_use_button.show ();
|
||||||
|
lm_back_button.show ();
|
||||||
} else if (page_num == midi_tab) {
|
} else if (page_num == midi_tab) {
|
||||||
get_action_area ()->add (midi_back_button);
|
parent->add_widget_action (midi_back_button);
|
||||||
midi_back_button.show ();
|
midi_back_button.show ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3148,7 +3179,7 @@ EngineControl::end_latency_detection ()
|
||||||
void
|
void
|
||||||
EngineControl::latency_button_clicked ()
|
EngineControl::latency_button_clicked ()
|
||||||
{
|
{
|
||||||
if (!_sensitive) {
|
if (!parent || parent->ui_sensitive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3162,7 +3193,7 @@ EngineControl::latency_button_clicked ()
|
||||||
void
|
void
|
||||||
EngineControl::latency_back_button_clicked ()
|
EngineControl::latency_back_button_clicked ()
|
||||||
{
|
{
|
||||||
if (!_sensitive) {
|
if (!parent || parent->ui_sensitive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3181,7 +3212,7 @@ EngineControl::latency_back_button_clicked ()
|
||||||
void
|
void
|
||||||
EngineControl::use_latency_button_clicked ()
|
EngineControl::use_latency_button_clicked ()
|
||||||
{
|
{
|
||||||
if (!_sensitive) {
|
if (!parent || parent->ui_sensitive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3227,7 +3258,9 @@ EngineControl::use_latency_button_clicked ()
|
||||||
* from a running instance.
|
* from a running instance.
|
||||||
*/
|
*/
|
||||||
notebook.set_current_page (0);
|
notebook.set_current_page (0);
|
||||||
response (RESPONSE_OK);
|
if (parent) {
|
||||||
|
parent->response (RESPONSE_OK);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3236,17 +3269,6 @@ EngineControl::use_latency_button_clicked ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
EngineControl::on_delete_event (GdkEventAny* ev)
|
|
||||||
{
|
|
||||||
if (lm_running || notebook.get_current_page () == 2) {
|
|
||||||
/* currently measuring latency - be sure to clean up */
|
|
||||||
end_latency_detection ();
|
|
||||||
}
|
|
||||||
|
|
||||||
return ArdourDialog::on_delete_event (ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
EngineControl::engine_running ()
|
EngineControl::engine_running ()
|
||||||
{
|
{
|
||||||
|
|
@ -3319,13 +3341,13 @@ EngineControl::connect_disconnect_click ()
|
||||||
stop_engine ();
|
stop_engine ();
|
||||||
} else {
|
} else {
|
||||||
if (!ARDOUR_UI::instance ()->the_session ()) {
|
if (!ARDOUR_UI::instance ()->the_session ()) {
|
||||||
pop_splash ();
|
parent->pop_splash ();
|
||||||
hide ();
|
parent->hide ();
|
||||||
ARDOUR::GUIIdle ();
|
ARDOUR::GUIIdle ();
|
||||||
}
|
}
|
||||||
start_engine ();
|
start_engine ();
|
||||||
if (!ARDOUR_UI::instance ()->the_session ()) {
|
if (!ARDOUR_UI::instance ()->the_session ()) {
|
||||||
ArdourDialog::response (RESPONSE_OK);
|
parent->response (RESPONSE_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3355,3 +3377,19 @@ EngineControl::configure_midi_devices ()
|
||||||
{
|
{
|
||||||
notebook.set_current_page (midi_tab);
|
notebook.set_current_page (midi_tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EngineControl::set_parent (ArdourDialog& d)
|
||||||
|
{
|
||||||
|
parent = &d;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
EngineControl::on_delete_event (GdkEventAny*)
|
||||||
|
{
|
||||||
|
if (lm_running || notebook.get_current_page () == 2) {
|
||||||
|
/* currently measuring latency - be sure to clean up */
|
||||||
|
end_latency_detection ();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
#include "ardour_dialog.h"
|
#include "ardour_dialog.h"
|
||||||
|
|
||||||
class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList
|
class EngineControl : public PBD::ScopedConnectionList, virtual public sigc::trackable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EngineControl ();
|
EngineControl ();
|
||||||
|
|
@ -58,6 +58,12 @@ public:
|
||||||
|
|
||||||
void set_desired_sample_rate (uint32_t);
|
void set_desired_sample_rate (uint32_t);
|
||||||
|
|
||||||
|
Gtk::Widget& contents() { return notebook; }
|
||||||
|
void on_show ();
|
||||||
|
bool on_delete_event (GdkEventAny*);
|
||||||
|
|
||||||
|
void set_parent (ArdourDialog&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Gtk::Notebook notebook;
|
Gtk::Notebook notebook;
|
||||||
|
|
||||||
|
|
@ -347,8 +353,6 @@ private:
|
||||||
sigc::connection latency_timeout;
|
sigc::connection latency_timeout;
|
||||||
sigc::connection lm_back_button_signal;
|
sigc::connection lm_back_button_signal;
|
||||||
|
|
||||||
void on_show ();
|
|
||||||
void on_map ();
|
|
||||||
void on_monitor_expand ();
|
void on_monitor_expand ();
|
||||||
void on_latency_expand ();
|
void on_latency_expand ();
|
||||||
void config_parameter_changed (std::string const&);
|
void config_parameter_changed (std::string const&);
|
||||||
|
|
@ -382,8 +386,6 @@ private:
|
||||||
|
|
||||||
/* main dialog events */
|
/* main dialog events */
|
||||||
void on_switch_page (GtkNotebookPage*, guint page_num);
|
void on_switch_page (GtkNotebookPage*, guint page_num);
|
||||||
bool on_delete_event (GdkEventAny*);
|
|
||||||
void on_response (int);
|
|
||||||
|
|
||||||
void connect_disconnect_click ();
|
void connect_disconnect_click ();
|
||||||
void calibrate_audio_latency ();
|
void calibrate_audio_latency ();
|
||||||
|
|
@ -396,6 +398,27 @@ private:
|
||||||
PBD::ScopedConnection running_connection;
|
PBD::ScopedConnection running_connection;
|
||||||
PBD::ScopedConnectionList stopped_connection;
|
PBD::ScopedConnectionList stopped_connection;
|
||||||
PBD::ScopedConnection devicelist_connection;
|
PBD::ScopedConnection devicelist_connection;
|
||||||
|
|
||||||
|
ArdourDialog* parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
class EngineControlDialog : public ArdourDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
EngineControlDialog ();
|
||||||
|
|
||||||
|
XMLNode& get_state () const { return engine_control.get_state (); }
|
||||||
|
bool set_state (XMLNode const & node) { return engine_control.set_state (node); }
|
||||||
|
|
||||||
|
void set_desired_sample_rate (uint32_t hz) { engine_control.set_desired_sample_rate (hz); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
EngineControl engine_control;
|
||||||
|
|
||||||
|
void on_show ();
|
||||||
|
void on_map ();
|
||||||
|
void on_response (int);
|
||||||
|
bool on_delete_event (GdkEventAny*);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __gtk2_ardour_engine_dialog_h__ */
|
#endif /* __gtk2_ardour_engine_dialog_h__ */
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
#include "ardour_dialog.h"
|
#include "ardour_dialog.h"
|
||||||
|
|
||||||
class EngineControl;
|
class EngineControlDialog;
|
||||||
|
|
||||||
class SessionDialog : public ArdourDialog
|
class SessionDialog : public ArdourDialog
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ using namespace PBD;
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
StartupFSM::StartupFSM (EngineControl& amd)
|
StartupFSM::StartupFSM (EngineControlDialog& amd)
|
||||||
: session_domain (Config->get_preferred_time_domain())
|
: session_domain (Config->get_preferred_time_domain())
|
||||||
, session_existing_sample_rate (0)
|
, session_existing_sample_rate (0)
|
||||||
, session_engine_hints ("EngineHints")
|
, session_engine_hints ("EngineHints")
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
class ArdourDialog;
|
class ArdourDialog;
|
||||||
class NewUserWizard;
|
class NewUserWizard;
|
||||||
class EngineControl;
|
class EngineControlDialog;
|
||||||
class SessionDialog;
|
class SessionDialog;
|
||||||
class PluginScanDialog;
|
class PluginScanDialog;
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ class StartupFSM : public sigc::trackable
|
||||||
WaitingForPlugins
|
WaitingForPlugins
|
||||||
};
|
};
|
||||||
|
|
||||||
StartupFSM (EngineControl&);
|
StartupFSM (EngineControlDialog&);
|
||||||
~StartupFSM ();
|
~StartupFSM ();
|
||||||
|
|
||||||
void start ();
|
void start ();
|
||||||
|
|
@ -121,7 +121,7 @@ class StartupFSM : public sigc::trackable
|
||||||
* created and destroyed within the scope of startup.
|
* created and destroyed within the scope of startup.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EngineControl& audiomidi_dialog;
|
EngineControlDialog& audiomidi_dialog;
|
||||||
NewUserWizard* new_user_dialog;
|
NewUserWizard* new_user_dialog;
|
||||||
SessionDialog* session_dialog;
|
SessionDialog* session_dialog;
|
||||||
ArdourDialog* pre_release_dialog;
|
ArdourDialog* pre_release_dialog;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue