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.

96 lines
3.5KB

  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. namespace Jack
  21. {
  22. /**
  23. \Brief This class describes the Net Backend
  24. */
  25. class JackNetOneDriver : public JackAudioDriver
  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. #ifdef 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. char* net_name, uint transport_sync, int bitdepth, int use_autoconfig,
  48. int latency, int redundancy, int dont_htonl_floats, int always_deadline );
  49. ~JackNetOneDriver();
  50. int Open ( jack_nframes_t frames_per_cycle, jack_nframes_t rate, bool capturing, bool playing,
  51. int inchannels, int outchannels, bool monitor, const char* capture_driver_name,
  52. const char* playback_driver_name, jack_nframes_t capture_latency, jack_nframes_t playback_latency );
  53. int Close();
  54. int Attach();
  55. int Detach();
  56. int Read();
  57. int Write();
  58. bool Initialize();
  59. int AllocPorts();
  60. void FreePorts();
  61. // BufferSize can't be changed
  62. bool IsFixedBufferSize()
  63. {
  64. return true;
  65. }
  66. int SetBufferSize ( jack_nframes_t buffer_size )
  67. {
  68. return -1;
  69. }
  70. int SetSampleRate ( jack_nframes_t sample_rate )
  71. {
  72. return -1;
  73. }
  74. };
  75. }
  76. #endif