jack1 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.

119 lines
3.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. #endif
  20. #include <limits.h>
  21. #include <jack/jack.h>
  22. #include "internal.h"
  23. #define JACK_DRIVER_NAME_MAX 15
  24. #define JACK_DRIVER_PARAM_NAME_MAX 15
  25. #define JACK_DRIVER_PARAM_STRING_MAX 63
  26. #define JACK_CONSTRAINT_FLAG_RANGE ((uint32_t)1) /**< if set, constraint is a range (min-max) */
  27. #define JACK_CONSTRAINT_FLAG_STRICT ((uint32_t)2) /**< if set, constraint is strict, i.e. supplying non-matching value will not work */
  28. #define JACK_CONSTRAINT_FLAG_FAKE_VALUE ((uint32_t)4) /**< if set, values have no user meaningful meaning */
  29. /** Driver parameter types */
  30. typedef enum {
  31. JackDriverParamInt = 1,
  32. JackDriverParamUInt,
  33. JackDriverParamChar,
  34. JackDriverParamString,
  35. JackDriverParamBool
  36. } jack_driver_param_type_t;
  37. /** Driver parameter value */
  38. typedef union {
  39. uint32_t ui;
  40. int32_t i;
  41. char c;
  42. char str[JACK_DRIVER_PARAM_STRING_MAX + 1];
  43. } jack_driver_param_value_t;
  44. typedef struct {
  45. jack_driver_param_value_t value;
  46. char short_desc[64]; /**< A short (~30 chars) description for the user */
  47. } jack_driver_param_value_enum_t;
  48. typedef struct {
  49. uint32_t flags; /**< JACK_CONSTRAINT_FLAG_XXX */
  50. union {
  51. struct {
  52. jack_driver_param_value_t min;
  53. jack_driver_param_value_t max;
  54. } range; /**< valid when JACK_CONSTRAINT_FLAG_RANGE flag is set */
  55. struct {
  56. uint32_t count;
  57. jack_driver_param_value_enum_t * possible_values_array;
  58. } enumeration; /**< valid when JACK_CONSTRAINT_FLAG_RANGE flag is not set */
  59. } constraint;
  60. } jack_driver_param_constraint_desc_t;
  61. /** A driver parameter descriptor */
  62. typedef struct {
  63. char name[JACK_DRIVER_NAME_MAX + 1]; /**< The parameter's name */
  64. char character; /**< The parameter's character (for getopt, etc) */
  65. jack_driver_param_type_t type; /**< The parameter's type */
  66. jack_driver_param_value_t value; /**< The parameter's (default) value */
  67. jack_driver_param_constraint_desc_t * constraint; /**< Pointer to parameter constraint descriptor. NULL if there is no constraint */
  68. char short_desc[64]; /**< A short (~30 chars) description for the user */
  69. char long_desc[1024]; /**< A longer description for the user */
  70. } jack_driver_param_desc_t;
  71. /** A driver parameter */
  72. typedef struct {
  73. char character;
  74. jack_driver_param_value_t value;
  75. } jack_driver_param_t;
  76. /** A struct for describing a jack driver */
  77. typedef struct {
  78. char name[JACK_DRIVER_NAME_MAX + 1]; /**< The driver's canonical name */
  79. char file[PATH_MAX + 1]; /**< The filename of the driver's shared object file */
  80. uint32_t nparams; /**< The number of parameters the driver has */
  81. jack_driver_param_desc_t * params; /**< An array of parameter descriptors */
  82. } jack_driver_desc_t;
  83. #ifdef __cplusplus
  84. }
  85. #endif
  86. #endif /* __jack_driver_interface_h__ */