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.

98 lines
2.8KB

  1. /*
  2. Copyright (C) 2003 Bob Ham <rah@bash.sh>
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #ifndef __jack_driver_interface_h__
  16. #define __jack_driver_interface_h__
  17. #ifdef __cplusplus
  18. extern "C"
  19. {
  20. #endif
  21. #include <limits.h>
  22. #ifdef WIN32
  23. #include "types.h"
  24. #define PATH_MAX 1024
  25. #else
  26. #include <inttypes.h>
  27. #endif
  28. #define JACK_DRIVER_NAME_MAX 15
  29. #define JACK_DRIVER_PARAM_NAME_MAX 15
  30. #define JACK_DRIVER_PARAM_STRING_MAX 63
  31. /** Driver parameter types */
  32. typedef enum
  33. {
  34. JackDriverParamInt = 1,
  35. JackDriverParamUInt,
  36. JackDriverParamChar,
  37. JackDriverParamString,
  38. JackDriverParamBool
  39. } jack_driver_param_type_t;
  40. /** Driver parameter value */
  41. typedef union
  42. {
  43. uint32_t ui;
  44. int32_t i;
  45. char c;
  46. char str[JACK_DRIVER_PARAM_STRING_MAX + 1];
  47. } jack_driver_param_value_t;
  48. /** A driver parameter descriptor */
  49. typedef struct {
  50. char name[JACK_DRIVER_NAME_MAX + 1]; /**< The parameter's name */
  51. char character; /**< The parameter's character (for getopt, etc) */
  52. jack_driver_param_type_t type; /**< The parameter's type */
  53. jack_driver_param_value_t value; /**< The parameter's (default) value */
  54. char short_desc[64]; /**< A short (~30 chars) description for the user */
  55. char long_desc[1024]; /**< A longer description for the user */
  56. }
  57. jack_driver_param_desc_t;
  58. /** A driver parameter */
  59. typedef struct {
  60. char character;
  61. jack_driver_param_value_t value;
  62. }
  63. jack_driver_param_t;
  64. /** A struct for describing a jack driver */
  65. typedef struct {
  66. char name[JACK_DRIVER_NAME_MAX + 1]; /**< The driver's canonical name */
  67. char file[PATH_MAX + 1]; /**< The filename of the driver's shared object file */
  68. uint32_t nparams; /**< The number of parameters the driver has */
  69. jack_driver_param_desc_t * params; /**< An array of parameter descriptors */
  70. }
  71. jack_driver_desc_t;
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75. #endif /* __jack_driver_interface_h__ */