summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/JackDbusDriver.cpp4
-rw-r--r--src/JackDbusDriver.hpp10
-rw-r--r--src/JackDriver.hpp9
-rw-r--r--src/Patchage.cpp7
4 files changed, 16 insertions, 14 deletions
diff --git a/src/JackDbusDriver.cpp b/src/JackDbusDriver.cpp
index 28bfb24..c40a149 100644
--- a/src/JackDbusDriver.cpp
+++ b/src/JackDbusDriver.cpp
@@ -723,7 +723,7 @@ JackDriver::disconnect(const PortID tail_id, const PortID head_id)
return true;
}
-jack_nframes_t
+uint32_t
JackDriver::buffer_size()
{
DBusMessage* reply_ptr = nullptr;
@@ -758,7 +758,7 @@ JackDriver::buffer_size()
}
bool
-JackDriver::set_buffer_size(jack_nframes_t size)
+JackDriver::set_buffer_size(const uint32_t size)
{
DBusMessage* reply_ptr = nullptr;
dbus_uint32_t buffer_size = 0u;
diff --git a/src/JackDbusDriver.hpp b/src/JackDbusDriver.hpp
index 4d08214..cbf6b47 100644
--- a/src/JackDbusDriver.hpp
+++ b/src/JackDbusDriver.hpp
@@ -22,13 +22,13 @@
#include <dbus/dbus.h>
#include <glibmm/thread.h>
-#include <jack/jack.h>
-#include <jack/statistics.h>
+#include <cstdint>
#include <string>
class ILog;
+/// Driver for JACK audio and midi ports that uses D-Bus
class JackDriver : public Driver
{
public:
@@ -57,9 +57,9 @@ public:
float get_max_dsp_load();
void reset_max_dsp_load();
- float sample_rate();
- jack_nframes_t buffer_size();
- bool set_buffer_size(jack_nframes_t size);
+ float sample_rate();
+ uint32_t buffer_size();
+ bool set_buffer_size(uint32_t size);
private:
PortType patchage_port_type(dbus_uint32_t dbus_port_type) const;
diff --git a/src/JackDriver.hpp b/src/JackDriver.hpp
index 5a6f89f..1c9bc9e 100644
--- a/src/JackDriver.hpp
+++ b/src/JackDriver.hpp
@@ -24,12 +24,13 @@
#include <glibmm/thread.h>
#include <jack/jack.h>
+#include <cstdint>
#include <mutex>
#include <string>
class ILog;
-/// Driver for JACK audio and midi ports
+/// Driver for JACK audio and midi ports that uses libjack
class JackDriver : public Driver
{
public:
@@ -58,9 +59,9 @@ public:
float get_max_dsp_load();
void reset_max_dsp_load();
- jack_nframes_t sample_rate() { return jack_get_sample_rate(_client); }
- jack_nframes_t buffer_size();
- bool set_buffer_size(jack_nframes_t size);
+ uint32_t sample_rate() { return jack_get_sample_rate(_client); }
+ uint32_t buffer_size();
+ bool set_buffer_size(jack_nframes_t size);
private:
ClientInfo get_client_info(const char* name);
diff --git a/src/Patchage.cpp b/src/Patchage.cpp
index f342c34..b071fd2 100644
--- a/src/Patchage.cpp
+++ b/src/Patchage.cpp
@@ -59,6 +59,7 @@ PATCHAGE_RESTORE_WARNINGS
#include <gtkmm/treemodel.h>
#include <cmath>
+#include <cstdint>
#include <cstdlib>
#include <fstream>
@@ -478,8 +479,8 @@ Patchage::update_toolbar()
#if defined(PATCHAGE_LIBJACK) || defined(HAVE_JACK_DBUS)
if (_jack_driver->is_attached()) {
- const jack_nframes_t buffer_size = _jack_driver->buffer_size();
- const jack_nframes_t sample_rate = _jack_driver->sample_rate();
+ const auto buffer_size = _jack_driver->buffer_size();
+ const auto sample_rate = _jack_driver->sample_rate();
if (sample_rate != 0) {
const int latency_ms =
lrintf(buffer_size * 1000 / float(sample_rate));
@@ -960,7 +961,7 @@ Patchage::buffer_size_changed()
if (selected == -1) {
update_toolbar();
} else {
- const jack_nframes_t buffer_size = 1 << (selected + 5);
+ const uint32_t buffer_size = 1u << (selected + 5);
_jack_driver->set_buffer_size(buffer_size);
update_toolbar();
}