plugin-properties.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // plugin-properties.h
  3. // obs-studio
  4. //
  5. // Created by Patrick Heyer on 2023-03-07.
  6. //
  7. @import Foundation;
  8. #import <obs-properties.h>
  9. /// Configures single source property's visibility, possible modification callback and callback payload data, as well as whether the property should be enabled
  10. /// - Parameters:
  11. /// - property: The source property to change
  12. /// - enable: Whether the source property should be enabled (user-changeable)
  13. /// - visible: Whether the source property should be visible
  14. /// - callback: Pointer to a function that will be called if this property has been modified or the properties are reloaded
  15. /// - capture: Optional reference to ``OBSAVCapture`` instance
  16. void configure_property(obs_property_t *property, bool enable, bool visible, void *callback, OBSAVCapture *capture);
  17. /// Generic callback handler for changed properties. Will update all properties of an OBSAVCapture source at once
  18. /// - Parameters:
  19. /// - capture: Pointer to ``OBSAVCapture`` instance
  20. /// - properties: Pointer to properties struct associated with the source
  21. /// - property: Pointer to the property that the callback is attached to
  22. /// - settings: Pointer to settings associated with the source
  23. /// - Returns: Always returns true
  24. bool properties_changed(OBSAVCapture *capture, obs_properties_t *properties, obs_property_t *property,
  25. obs_data_t *settings);
  26. /// Callback handler for preset changes.
  27. /// - Parameters:
  28. /// - capture: Pointer to ``OBSAVCapture`` instance
  29. /// - properties: Pointer to properties struct associated with the source
  30. /// - property: Pointer to the property that the callback is attached to
  31. /// - settings: Pointer to settings associated with the source
  32. /// - Returns: Always returns true
  33. bool properties_changed_preset(OBSAVCapture *capture, obs_properties_t *properties, obs_property_t *property,
  34. obs_data_t *settings);
  35. /// Callback handler for changing preset usage for an OBSAVCapture source. Switches between preset-based configuration and manual configuration
  36. /// - Parameters:
  37. /// - capture: Pointer to ``OBSAVCapture`` instance
  38. /// - properties: Pointer to properties struct associated with the source
  39. /// - property: Pointer to the property that the callback is attached to
  40. /// - settings: Pointer to settings associated with the source
  41. /// - Returns: Always returns true
  42. bool properties_changed_use_preset(OBSAVCapture *capture, obs_properties_t *properties, obs_property_t *property,
  43. obs_data_t *settings);
  44. /// Updates preset property with description-value-pairs of presets supported by the currently selected device
  45. /// - Parameters:
  46. /// - capture: Pointer to ``OBSAVCapture`` instance
  47. /// - property: Pointer to the property that the callback is attached to
  48. /// - settings: Pointer to settings associated with the source
  49. /// - Returns: Always returns true
  50. bool properties_update_preset(OBSAVCapture *capture, obs_property_t *property, obs_data_t *settings);
  51. /// Updates device property with description-value-pairs of devices available via CoreMediaIO
  52. /// - Parameters:
  53. /// - capture: Pointer to ``OBSAVCapture`` instance
  54. /// - property: Pointer to the property that the callback is attached to
  55. /// - settings: Pointer to settings associated with the source
  56. /// - Returns: Always returns true
  57. bool properties_update_device(OBSAVCapture *capture, obs_property_t *property, obs_data_t *settings);
  58. /// Updates available values for all properties required in manual device configuration.
  59. ///
  60. /// Properties updated by this call include:
  61. /// * Resolutions
  62. /// * Frame rates and frame rate ranges
  63. /// * Color formats
  64. /// * Color range
  65. ///
  66. /// In CoreMediaIO color format, resolution and frame rate ranges are always coupled into a single format, while color range is always contained in the color format. The formats are thus compiled and de-duplicated to create a selection of all properties.
  67. ///
  68. /// Frame rate ranges will be limited to ranges only available for a specific combination of resolution and color format.
  69. ///
  70. /// - Parameters:
  71. /// - capture: Pointer to ``OBSAVCapture`` instance
  72. /// - property: Pointer to the property that the callback is attached to
  73. /// - settings: Pointer to settings associated with the source
  74. /// - Returns: Always returns true
  75. bool properties_update_config(OBSAVCapture *capture, obs_properties_t *properties, obs_data_t *settings);