summaryrefslogtreecommitdiff
path: root/drumgizmo/jackclient.cc
diff options
context:
space:
mode:
Diffstat (limited to 'drumgizmo/jackclient.cc')
-rw-r--r--drumgizmo/jackclient.cc22
1 files changed, 8 insertions, 14 deletions
diff --git a/drumgizmo/jackclient.cc b/drumgizmo/jackclient.cc
index 8d422cb..376f3fb 100644
--- a/drumgizmo/jackclient.cc
+++ b/drumgizmo/jackclient.cc
@@ -33,29 +33,23 @@ JackProcess::~JackProcess() {
// --------------------------------------------------------------------
-JackChannel::JackChannel()
- : samples{}
- , client{nullptr}
- , port{nullptr} {
-}
-
-JackChannel::JackChannel(JackClient& client, std::size_t buffer_size,
- std::string const & name)
- : samples{}
- , client{client.client}
+JackPort::JackPort(JackClient& client, std::string const & name, const char * type, JackPortFlags flags)
+ : client{client.client}
// register jack port for given client
- , port{jack_port_register(this->client, name.c_str(),
- JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0)} {
- samples.resize(buffer_size);
+ , port{jack_port_register(this->client, name.c_str(), type, flags, 0)} {
}
-JackChannel::~JackChannel() {
+JackPort::~JackPort() {
if (port != nullptr) {
assert(client != nullptr);
jack_port_unregister(client, port);
}
}
+void* JackPort::getBuffer(jack_nframes_t num_frames) {
+ return jack_port_get_buffer(port, num_frames);
+}
+
// --------------------------------------------------------------------
int _wrap_jack_process(jack_nframes_t nframes, void* arg){