Improve properties API
Improve the properties API so that it can actually respond somewhat to user input. Maybe later this might be further improved or replaced with something script-based. When creating a property, you can now add a callback to that property that notifies when the property has been changed in the user interface. Return true if you want the properties to be refreshed, or false if not. Though now that I think about it I doubt there would ever be a case where you would have this callback and *not* refresh the properties. Regardless, this allows functions to change the values of properties or settings, or enable/disable/hide other property controls from view dynamically.
This commit is contained in:
@@ -709,7 +709,7 @@ static void *coreaudio_create_output_capture(obs_data_t settings,
|
||||
|
||||
static obs_properties_t coreaudio_properties(const char *locale, bool input)
|
||||
{
|
||||
obs_properties_t props = obs_properties_create();
|
||||
obs_properties_t props = obs_properties_create(locale);
|
||||
obs_property_t property;
|
||||
struct device_list devices;
|
||||
|
||||
@@ -723,17 +723,15 @@ static obs_properties_t coreaudio_properties(const char *locale, bool input)
|
||||
|
||||
/* TODO: translate */
|
||||
if (devices.items.num)
|
||||
obs_property_list_add_item(property, "Default", "default");
|
||||
obs_property_list_add_string(property, "Default", "default");
|
||||
|
||||
for (size_t i = 0; i < devices.items.num; i++) {
|
||||
struct device_item *item = devices.items.array+i;
|
||||
obs_property_list_add_item(property,
|
||||
obs_property_list_add_string(property,
|
||||
item->name.array, item->value.array);
|
||||
}
|
||||
|
||||
device_list_free(&devices);
|
||||
|
||||
UNUSED_PARAMETER(locale);
|
||||
return props;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user