obs-properties.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /******************************************************************************
  2. Copyright (C) 2014 by Hugh Bailey <[email protected]>
  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, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include "util/c99defs.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. enum obs_property_type {
  20. OBS_PROPERTY_INVALID,
  21. OBS_PROPERTY_INT,
  22. OBS_PROPERTY_FLOAT,
  23. OBS_PROPERTY_TEXT,
  24. OBS_PROPERTY_PATH,
  25. OBS_PROPERTY_LIST,
  26. OBS_PROPERTY_COLOR,
  27. };
  28. enum obs_combo_format {
  29. OBS_COMBO_FORMAT_INVALID,
  30. OBS_COMBO_FORMAT_INT,
  31. OBS_COMBO_FORMAT_FLOAT,
  32. OBS_COMBO_FORMAT_STRING
  33. };
  34. enum obs_combo_type {
  35. OBS_COMBO_TYPE_INVALID,
  36. OBS_COMBO_TYPE_EDITABLE,
  37. OBS_COMBO_TYPE_LIST,
  38. };
  39. struct obs_properties;
  40. struct obs_property;
  41. typedef struct obs_properties *obs_properties_t;
  42. typedef struct obs_property *obs_property_t;
  43. /* ------------------------------------------------------------------------- */
  44. EXPORT obs_properties_t obs_properties_create();
  45. EXPORT void obs_properties_destroy(obs_properties_t props);
  46. EXPORT obs_property_t obs_properties_first(obs_properties_t props);
  47. EXPORT obs_property_t obs_properties_get(obs_properties_t props,
  48. const char *property);
  49. /* ------------------------------------------------------------------------- */
  50. EXPORT void obs_properties_add_int(obs_properties_t props, const char *name,
  51. const char *description, int min, int max, int step);
  52. EXPORT void obs_properties_add_float(obs_properties_t props, const char *name,
  53. const char *description, double min, double max, double step);
  54. EXPORT void obs_properties_add_text(obs_properties_t props, const char *name,
  55. const char *description);
  56. EXPORT void obs_properties_add_path(obs_properties_t props, const char *name,
  57. const char *description);
  58. EXPORT obs_property_t obs_properties_add_list(obs_properties_t props,
  59. const char *name, const char *description,
  60. enum obs_combo_type type, enum obs_combo_format format);
  61. EXPORT void obs_properties_add_color(obs_properties_t props, const char *name,
  62. const char *description);
  63. EXPORT void obs_property_list_add_item(obs_property_t p,
  64. const char *name, const char *value);
  65. /* ------------------------------------------------------------------------- */
  66. EXPORT const char * obs_property_name(obs_property_t p);
  67. EXPORT const char * obs_property_description(obs_property_t p);
  68. EXPORT enum obs_property_type obs_property_type(obs_property_t p);
  69. EXPORT bool obs_property_next(obs_property_t *p);
  70. EXPORT int obs_property_int_min(obs_property_t p);
  71. EXPORT int obs_property_int_max(obs_property_t p);
  72. EXPORT int obs_property_int_step(obs_property_t p);
  73. EXPORT double obs_property_float_min(obs_property_t p);
  74. EXPORT double obs_property_float_max(obs_property_t p);
  75. EXPORT double obs_property_float_step(obs_property_t p);
  76. EXPORT enum obs_combo_type obs_property_list_type(obs_property_t p);
  77. EXPORT enum obs_combo_format obs_property_list_format(obs_property_t p);
  78. EXPORT size_t obs_property_list_item_count(obs_property_t p);
  79. EXPORT const char *obs_property_list_item_name(obs_property_t p, size_t idx);
  80. EXPORT const char *obs_property_list_item_value(obs_property_t p, size_t idx);
  81. #ifdef __cplusplus
  82. }
  83. #endif