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.

99 lines
3.8KB

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