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.

75 lines
2.3KB

  1. /*
  2. Copyright (C) 2013 Matt Flax <flatmax@flatmax.org>
  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 JACKIIODRIVER_H
  16. #define JACKIIODRIVER_H
  17. #include "JackAudioDriver.h"
  18. #include "JackThreadedDriver.h"
  19. #include <IIO/IIOMMap.H>
  20. namespace Jack {
  21. /** The Linux Industrial IO (IIO) subsystem driver for Jack.
  22. Currently this driver only supports capture.
  23. */
  24. class JackIIODriver : public JackAudioDriver {
  25. public:
  26. IIOMMap iio; ///< The actual IIO devices
  27. Eigen::Array<unsigned short int, Eigen::Dynamic, Eigen::Dynamic> data; ///< When we grab a mmapped buffer, store it here.
  28. /** Constructor
  29. */
  30. JackIIODriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table) : JackAudioDriver(name, alias, engine, table) {
  31. }
  32. /** Destructor
  33. */
  34. virtual ~JackIIODriver() {
  35. }
  36. virtual int Open(jack_nframes_t buffer_size,
  37. jack_nframes_t samplerate,
  38. bool capturing,
  39. bool playing,
  40. int inchannels,
  41. int outchannels,
  42. bool monitor,
  43. const char* capture_driver_name,
  44. const char* playback_driver_name,
  45. jack_nframes_t capture_latency,
  46. jack_nframes_t playback_latency);
  47. virtual int Close();
  48. virtual int Read(); ///< Read from the IIO sysetm and load the jack buffers
  49. virtual int Write(); ///< Not implemented.
  50. virtual int SetBufferSize(jack_nframes_t buffer_size) {
  51. //cout<<"JackIIODriver::SetBufferSize("<<buffer_size<<")\n";
  52. return JackAudioDriver::SetBufferSize(buffer_size);
  53. }
  54. };
  55. } // end of Jack namespace
  56. #endif // JACKIIODRIVER_H