#include <gtkmm/messagedialog.h>
#include "pbd/error.h"
+#include "pbd/locale_guard.h"
#include "pbd/xml++.h"
#include "pbd/unwind.h"
#include "pbd/failed_constructor.h"
using namespace Gtkmm2ext;
using namespace PBD;
using namespace Glib;
+using namespace ArdourWidgets;
using namespace ARDOUR_UI_UTILS;
#define DEBUG_ECONTROL(msg) DEBUG_TRACE (PBD::DEBUG::EngineControl, string_compose ("%1: %2\n", __LINE__, msg));
EngineControl::SignalBlocker::SignalBlocker (EngineControl& engine_control,
const std::string& reason)
- : ec (engine_control)
- , m_reason (reason)
+ : ec (engine_control)
+ , m_reason (reason)
{
DEBUG_ECONTROL (string_compose ("SignalBlocker: %1", m_reason));
ec.block_changed_signals ();
if (get_popdown_string_count (buffer_size_combo) > 0) {
if (!engine_running) {
buffer_size_combo.set_sensitive (valid);
- } else if (backend->can_change_sample_rate_when_running()) {
+ } else if (backend->can_change_buffer_size_when_running ()) {
buffer_size_combo.set_sensitive (valid || !_have_control);
} else {
-#if 1
- /* TODO
- * Currently there is no way to manually stop the
- * engine in order to re-configure it.
- * This needs to remain sensitive for now.
- *
- * (it's also handy to implicily
- * re-start the engine)
- */
- buffer_size_combo.set_sensitive (true);
-#else
buffer_size_combo.set_sensitive (false);
-#endif
}
} else {
buffer_size_combo.set_sensitive (false);
if (!_have_control) {
// set settings from backend that we do have control over
+ set_buffersize_popdown_strings ();
set_active_text_if_present (buffer_size_combo, bufsize_as_string (backend->buffer_size()));
}
s.push_back (bufsize_as_string (*x));
}
- uint32_t previous_size = 0;
+ uint32_t previous_size = backend->buffer_size ();
if (!buffer_size_combo.get_active_text().empty()) {
previous_size = get_buffer_size ();
}
EngineControl::buffer_size_changed ()
{
DEBUG_ECONTROL ("buffer_size_changed");
+ if (ARDOUR::AudioEngine::instance()->running()) {
+ boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
+ if (backend && backend->can_change_buffer_size_when_running ()) {
+ backend->set_buffer_size (get_buffer_size());
+ }
+ }
show_buffer_duration ();
}
void
EngineControl::maybe_display_saved_state ()
{
- if (!_have_control) {
+ if (!_have_control || ARDOUR::AudioEngine::instance()->running ()) {
return;
}