obs-properties.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 "obs.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_ENUM,
  26. OBS_PROPERTY_TEXT_LIST,
  27. OBS_PROPERTY_COLOR,
  28. };
  29. enum obs_dropdown_type {
  30. OBS_DROPDOWN_INVALID,
  31. OBS_DROPDOWN_EDIT,
  32. OBS_DROPDOWN_LIST,
  33. };
  34. struct obs_property_list;
  35. struct obs_category;
  36. struct obs_property;
  37. typedef struct obs_property_list *obs_property_list_t;
  38. typedef struct obs_category *obs_category_t;
  39. typedef struct obs_property *obs_property_t;
  40. /* ------------------------------------------------------------------------- */
  41. EXPORT obs_property_list_t obs_property_list_create();
  42. EXPORT void obs_property_list_destroy(obs_property_list_t props);
  43. EXPORT obs_category_t obs_property_list_add_category(obs_property_list_t props,
  44. const char *name);
  45. EXPORT obs_category_t obs_property_list_categories(obs_property_list_t props);
  46. /* ------------------------------------------------------------------------- */
  47. EXPORT void obs_category_add_int(obs_category_t cat, const char *name,
  48. const char *description, int min, int max, int step);
  49. EXPORT void obs_category_add_float(obs_category_t cat, const char *name,
  50. const char *description, double min, double max, double step);
  51. EXPORT void obs_category_add_text(obs_category_t cat, const char *name,
  52. const char *description);
  53. EXPORT void obs_category_add_path(obs_category_t cat, const char *name,
  54. const char *description);
  55. EXPORT void obs_category_add_enum_list(obs_category_t cat,
  56. const char *name, const char *description,
  57. const char **strings);
  58. EXPORT void obs_category_add_text_list(obs_category_t cat,
  59. const char *name, const char *description,
  60. const char **strings, enum obs_dropdown_type type);
  61. EXPORT void obs_category_add_color(obs_category_t cat, const char *name,
  62. const char *description);
  63. EXPORT bool obs_category_next(obs_category_t *cat);
  64. EXPORT obs_property_t obs_category_properties(obs_category_t cat);
  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 const char ** obs_property_dropdown_strings(obs_property_t p);
  77. EXPORT enum obs_dropdown_type obs_property_dropdown_type(obs_property_t p);
  78. #ifdef __cplusplus
  79. }
  80. #endif