summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/JackDriver.cpp18
-rw-r--r--src/JackDriver.h2
-rw-r--r--src/Patchage.cpp3
-rw-r--r--src/PatchageModule.h1
4 files changed, 17 insertions, 7 deletions
diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp
index ddb6744..77625bc 100644
--- a/src/JackDriver.cpp
+++ b/src/JackDriver.cpp
@@ -459,14 +459,24 @@ JackDriver::reset_xruns()
}
-void
+bool
JackDriver::set_buffer_size(jack_nframes_t size)
{
- if (buffer_size() == size)
- return;
+ if (buffer_size() == size) {
+ return true;
+ }
+
+ if (!m_client) {
+ m_buffer_size = size;
+ return true;
+ }
- if (m_client && jack_set_buffer_size(m_client, size))
+ if (jack_set_buffer_size(m_client, size)) {
m_app->status_message("[JACK] ERROR: Unable to set buffer size");
+ return false;
+ } else {
+ return true;
+ }
}
void
diff --git a/src/JackDriver.h b/src/JackDriver.h
index c37970c..7acbad8 100644
--- a/src/JackDriver.h
+++ b/src/JackDriver.h
@@ -76,7 +76,7 @@ public:
jack_client_t* client() { return m_client; }
jack_nframes_t buffer_size();
- void set_buffer_size(jack_nframes_t size);
+ bool set_buffer_size(jack_nframes_t size);
inline float sample_rate() { return jack_get_sample_rate(m_client); }
diff --git a/src/Patchage.cpp b/src/Patchage.cpp
index f60bdef..61a9abd 100644
--- a/src/Patchage.cpp
+++ b/src/Patchage.cpp
@@ -712,7 +712,8 @@ Patchage::buffer_size_changed()
//cerr << "BS Changed: " << selected << ": " << buffer_size << endl;
- m_jack_driver->set_buffer_size(buffer_size);
+ if ( ! m_jack_driver->set_buffer_size(buffer_size))
+ update_toolbar(); // reset combo box to actual value
}
}
diff --git a/src/PatchageModule.h b/src/PatchageModule.h
index e047c52..cb490ad 100644
--- a/src/PatchageModule.h
+++ b/src/PatchageModule.h
@@ -14,7 +14,6 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#ifndef PATCHAGEMODULE_H
#define PATCHAGEMODULE_H