jack2 codebase
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.

95 lines
3.2KB

  1. /*
  2. Copyright (C) 2008-2011 Torben Horn
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. */
  15. #ifndef __JackNetDriver__
  16. #define __JackNetDriver__
  17. #include "JackTimedDriver.h"
  18. #include "netjack.h"
  19. #include "netjack_packet.h"
  20. namespace Jack
  21. {
  22. /**
  23. \Brief This class describes the Net Backend
  24. */
  25. class JackNetOneDriver : public JackWaiterDriver
  26. {
  27. private:
  28. netjack_driver_state_t netj;
  29. void
  30. render_payload_to_jack_ports_float(void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes, int dont_htonl_floats);
  31. void
  32. render_jack_ports_to_payload_float(JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up, int dont_htonl_floats );
  33. #if HAVE_CELT
  34. void
  35. render_payload_to_jack_ports_celt(void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes);
  36. void
  37. render_jack_ports_to_payload_celt(JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up);
  38. #endif
  39. void
  40. render_payload_to_jack_ports(int bitdepth, void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes, int dont_htonl_floats);
  41. void
  42. render_jack_ports_to_payload(int bitdepth, JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up, int dont_htonl_floats);
  43. public:
  44. JackNetOneDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table,
  45. int port, int mtu, int capture_ports, int playback_ports, int midi_input_ports, int midi_output_ports,
  46. int sample_rate, int period_size, int resample_factor,
  47. const char* net_name, uint transport_sync, int bitdepth, int use_autoconfig,
  48. int latency, int redundancy, int dont_htonl_floats, int always_deadline, int jitter_val);
  49. virtual ~JackNetOneDriver();
  50. int Close();
  51. int Attach();
  52. int Detach();
  53. int Read();
  54. int Write();
  55. bool Initialize();
  56. int AllocPorts();
  57. void FreePorts();
  58. // BufferSize can't be changed
  59. bool IsFixedBufferSize()
  60. {
  61. return true;
  62. }
  63. int SetBufferSize(jack_nframes_t buffer_size)
  64. {
  65. return -1;
  66. }
  67. int SetSampleRate(jack_nframes_t sample_rate)
  68. {
  69. return -1;
  70. }
  71. };
  72. }
  73. #endif