summaryrefslogtreecommitdiff
path: root/drumgizmo/jackclient.h
diff options
context:
space:
mode:
Diffstat (limited to 'drumgizmo/jackclient.h')
-rw-r--r--drumgizmo/jackclient.h56
1 files changed, 30 insertions, 26 deletions
diff --git a/drumgizmo/jackclient.h b/drumgizmo/jackclient.h
index ede6d9e..ebfc28d 100644
--- a/drumgizmo/jackclient.h
+++ b/drumgizmo/jackclient.h
@@ -35,41 +35,45 @@
class JackClient;
-class JackProcess {
- public:
- virtual ~JackProcess();
- virtual void process(jack_nframes_t num_frames) = 0;
+class JackProcess
+{
+public:
+ virtual ~JackProcess();
+ virtual void process(jack_nframes_t num_frames) = 0;
};
// --------------------------------------------------------------------
// RAII-wrapper for jack_port_t
-struct JackPort {
- JackPort(JackClient& client, std::string const & name, const char * type, JackPortFlags flags);
+struct JackPort
+{
+ JackPort(JackClient &client, std::string const &name, const char *type,
+ JackPortFlags flags);
~JackPort();
-
- jack_client_t* const client;
- jack_port_t* const port;
+
+ jack_client_t *const client;
+ jack_port_t *const port;
};
// --------------------------------------------------------------------
-class JackClient {
+class JackClient
+{
friend struct JackPort;
-
- public:
- JackClient();
- ~JackClient();
-
- void add(JackProcess& process);
- void remove(JackProcess& process);
- void activate();
- int process(jack_nframes_t num_frames);
- std::size_t getBufferSize() const;
- std::size_t getSampleRate() const;
-
- private:
- jack_client_t* client;
- std::set<JackProcess*> processes;
- bool is_active;
+
+public:
+ JackClient();
+ ~JackClient();
+
+ void add(JackProcess &process);
+ void remove(JackProcess &process);
+ void activate();
+ int process(jack_nframes_t num_frames);
+ std::size_t getBufferSize() const;
+ std::size_t getSampleRate() const;
+
+private:
+ jack_client_t *client;
+ std::set<JackProcess *> processes;
+ bool is_active;
};