#include "pbd/error.h"
#include "opts.h"
+#include "debug.h"
#include "ardour_ui.h"
#include "engine_dialog.h"
#include "gui_thread.h"
using namespace Glib;
using namespace ARDOUR_UI_UTILS;
+#define DEBUG_ECONTROL(msg) DEBUG_TRACE (PBD::DEBUG::EngineControl, string_compose ("%1: %2\n", __LINE__, msg));
+
static const unsigned int midi_tab = 2;
static const unsigned int latency_tab = 1; /* zero-based, page zero is the main setup page */
void
EngineControl::backend_changed ()
{
+ DEBUG_ECONTROL ("backend_changed");
+
string backend_name = backend_combo.get_active_text();
boost::shared_ptr<ARDOUR::AudioBackend> backend;
return;
}
+ DEBUG_ECONTROL (string_compose ("Backend name: %1", backend_name));
+
_have_control = ARDOUR::AudioEngine::instance()->setup_required ();
build_notebook ();
string current_driver;
current_driver = backend->driver_name ();
+ DEBUG_ECONTROL (string_compose ("backend->driver_name: %1", current_driver));
+
// driver might not have been set yet
if (current_driver == "") {
current_driver = driver_combo.get_active_text ();
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
set_popdown_strings (driver_combo, drivers);
+ DEBUG_ECONTROL (
+ string_compose ("driver_combo.set_active_text: %1", current_driver));
driver_combo.set_active_text (current_driver);
}
bool
EngineControl::set_driver_popdown_strings ()
{
+ DEBUG_ECONTROL ("set_driver_popdown_strings");
string backend_name = backend_combo.get_active_text();
boost::shared_ptr<ARDOUR::AudioBackend> backend;
bool
EngineControl::set_device_popdown_strings ()
{
+ DEBUG_ECONTROL ("set_device_popdown_strings");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
vector<ARDOUR::AudioBackend::DeviceStatus> all_devices = backend->enumerate_devices ();
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
set_popdown_strings (device_combo, available_devices);
+ DEBUG_ECONTROL (string_compose ("set device_combo active text: %1", current_device));
device_combo.set_active_text (current_device);
}
bool
EngineControl::set_input_device_popdown_strings ()
{
+ DEBUG_ECONTROL ("set_input_device_popdown_strings");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
vector<ARDOUR::AudioBackend::DeviceStatus> all_devices = backend->enumerate_input_devices ();
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
set_popdown_strings (input_device_combo, available_devices);
+ DEBUG_ECONTROL (string_compose ("set input_device_combo active text: %1", current_device));
input_device_combo.set_active_text (current_device);
}
bool
EngineControl::set_output_device_popdown_strings ()
{
+ DEBUG_ECONTROL ("set_output_device_popdown_strings");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
vector<ARDOUR::AudioBackend::DeviceStatus> all_devices = backend->enumerate_output_devices ();
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
set_popdown_strings (output_device_combo, available_devices);
+ DEBUG_ECONTROL (string_compose ("set input_device_combo active text: %1", current_device));
output_device_combo.set_active_text (current_device);
}
void
EngineControl::list_devices ()
{
+ DEBUG_ECONTROL ("list_devices");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
assert (backend);
void
EngineControl::driver_changed ()
{
+ DEBUG_ECONTROL ("driver_changed");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
assert (backend);
void
EngineControl::set_samplerate_popdown_strings (const std::string& device_name)
{
+ DEBUG_ECONTROL ("set_samplerate_popdown_strings");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
string desired;
vector<float> sr;
void
EngineControl::set_buffersize_popdown_strings (const std::string& device_name)
{
+ DEBUG_ECONTROL ("set_buffersize_popdown_strings");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
vector<uint32_t> bs;
vector<string> s;
void
EngineControl::device_changed ()
{
+ DEBUG_ECONTROL ("device_changed");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
assert (backend);
void
EngineControl::input_device_changed ()
{
+ DEBUG_ECONTROL ("input_device_changed");
device_changed ();
}
void
EngineControl::output_device_changed ()
{
+ DEBUG_ECONTROL ("output_device_changed");
device_changed ();
}
void
EngineControl::sample_rate_changed ()
{
+ DEBUG_ECONTROL ("sample_rate_changed");
/* reset the strings for buffer size to show the correct msec value
(reflecting the new sample rate).
*/
void
EngineControl::buffer_size_changed ()
{
+ DEBUG_ECONTROL ("buffer_size_changed");
show_buffer_duration ();
}
void
EngineControl::show_buffer_duration ()
{
-
+ DEBUG_ECONTROL ("show_buffer_duration");
/* buffer sizes - convert from just samples to samples + msecs for
* the displayed string
*/
void
EngineControl::midi_option_changed ()
{
+ DEBUG_ECONTROL ("midi_option_changed");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
assert (backend);
void
EngineControl::set_current_state (const State& state)
{
+ DEBUG_ECONTROL ("set_current_state");
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
backend_combo.set_active_text (state->backend);
int
EngineControl::push_state_to_backend (bool start)
{
+ DEBUG_ECONTROL ("push_state_to_backend");
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
if (!backend) {