You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
772 B

12 years ago
  1. #ifndef CLIENT_H
  2. #define CLIENT_H
  3. #include <jack/jack.h>
  4. typedef jack_default_audio_sample_t sample_t;
  5. typedef jack_nframes_t tick_t;
  6. class Client
  7. {
  8. private:
  9. jack_client_t *m_client;
  10. protected:
  11. jack_port_t **m_ports;
  12. const char *m_name;
  13. jack_nframes_t m_sample_rate;
  14. private:
  15. static void shutdown(void *arg);
  16. static int process(jack_nframes_t nframes, void *arg);
  17. virtual void shutdown() = 0;
  18. virtual int process(jack_nframes_t) = 0;
  19. public:
  20. Client() : m_client(NULL), m_ports(NULL), m_name(NULL), m_sample_rate(0)
  21. {
  22. }
  23. ~Client()
  24. {
  25. }
  26. bool open(const char *name);
  27. void close();
  28. jack_port_t *port_register(const char *port_name, const char *port_type, unsigned long flags, unsigned long buffer_size);
  29. };
  30. #endif // CLIENT_H