obs-scripting.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /******************************************************************************
  2. Copyright (C) 2017 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 <stdarg.h>
  16. #include <util/c99defs.h>
  17. #include <obs-data.h>
  18. #include <obs-properties.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. struct obs_script;
  23. typedef struct obs_script obs_script_t;
  24. enum obs_script_lang {
  25. OBS_SCRIPT_LANG_UNKNOWN,
  26. OBS_SCRIPT_LANG_LUA,
  27. OBS_SCRIPT_LANG_PYTHON
  28. };
  29. EXPORT bool obs_scripting_load(void);
  30. EXPORT void obs_scripting_unload(void);
  31. EXPORT const char **obs_scripting_supported_formats(void);
  32. typedef void (*scripting_log_handler_t)(void *p, obs_script_t *script, int lvl,
  33. const char *msg);
  34. EXPORT void obs_scripting_set_log_callback(scripting_log_handler_t handler,
  35. void *param);
  36. EXPORT bool obs_scripting_python_runtime_linked(void);
  37. EXPORT void obs_scripting_python_version(char *version, size_t version_length);
  38. EXPORT bool obs_scripting_python_loaded(void);
  39. EXPORT bool obs_scripting_load_python(const char *python_path);
  40. EXPORT obs_script_t *obs_script_create(const char *path, obs_data_t *settings);
  41. EXPORT void obs_script_destroy(obs_script_t *script);
  42. EXPORT const char *obs_script_get_description(const obs_script_t *script);
  43. EXPORT const char *obs_script_get_path(const obs_script_t *script);
  44. EXPORT const char *obs_script_get_file(const obs_script_t *script);
  45. EXPORT enum obs_script_lang obs_script_get_lang(const obs_script_t *script);
  46. EXPORT obs_properties_t *obs_script_get_properties(obs_script_t *script);
  47. EXPORT obs_data_t *obs_script_save(obs_script_t *script);
  48. EXPORT obs_data_t *obs_script_get_settings(obs_script_t *script);
  49. EXPORT void obs_script_update(obs_script_t *script, obs_data_t *settings);
  50. EXPORT bool obs_script_loaded(const obs_script_t *script);
  51. EXPORT bool obs_script_reload(obs_script_t *script);
  52. #ifdef __cplusplus
  53. }
  54. #endif