diff options
author | Christian Glöckner <cgloeckner@freenet.de> | 2016-01-25 12:32:09 +0100 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2016-02-09 09:03:16 +0100 |
commit | 41b6ef4642b25c22e47e5f89f113b502d3a4321c (patch) | |
tree | 2aac4d7d2fe822506d7ce902f81d3c7dc52e0171 /drumgizmo/jackclient.cc | |
parent | 7236fee052f52667f116ed83cacb21ed587d0d65 (diff) |
added JackMidiInputEngine + additional minor changes
Diffstat (limited to 'drumgizmo/jackclient.cc')
-rw-r--r-- | drumgizmo/jackclient.cc | 22 |
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){ |