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.

63 lines
1.9KB

  1. /*
  2. Copyright (C) 2019 Laxmi Devi <laxmi.devi@in.bosch.com>
  3. Copyright (C) 2019 Timo Wischer <twischer@de.adit-jv.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. #ifndef __jack_format_converter_h__
  17. #define __jack_format_converter_h__
  18. #include <typeinfo>
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. #include <jack/weakmacros.h>
  24. class IJackPortConverter {
  25. public:
  26. virtual void* get(jack_nframes_t frames) = 0;
  27. virtual void set(void* buf, jack_nframes_t frames) = 0;
  28. };
  29. /**
  30. * This returns a pointer to the instance of the object IJackPortConverter based
  31. * on the dst_type. Applications can use the get() and set()
  32. * of this object to get and set the pointers to the memory area associated with the specified port.
  33. * Currently Jack only supports Float, int32_t and int16_t.
  34. *
  35. * @param port jack_port_t pointer.
  36. * @param dst_type type required by client.
  37. * @param init_output_silence if true, jack will initialize the output port with silence
  38. *
  39. * @return ptr to IJackPortConverter on success, otherwise NULL if dst_type is not supported.
  40. */
  41. IJackPortConverter* jack_port_create_converter(jack_port_t* port, const std::type_info& dst_type, const bool init_output_silence=true) JACK_OPTIONAL_WEAK_EXPORT;
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif // __jack_format_converter_h__