obs-studio/libobs/obs-properties.h

154 lines
5.7 KiB
C
Raw Normal View History

/******************************************************************************
Copyright (C) 2014 by Hugh Bailey <obs.jim@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#pragma once
#include "util/c99defs.h"
#include "obs-data.h"
#ifdef __cplusplus
extern "C" {
#endif
enum obs_property_type {
OBS_PROPERTY_INVALID,
OBS_PROPERTY_BOOL,
OBS_PROPERTY_INT,
OBS_PROPERTY_FLOAT,
OBS_PROPERTY_TEXT,
OBS_PROPERTY_PATH,
OBS_PROPERTY_LIST,
OBS_PROPERTY_COLOR,
};
enum obs_combo_format {
OBS_COMBO_FORMAT_INVALID,
OBS_COMBO_FORMAT_INT,
OBS_COMBO_FORMAT_FLOAT,
OBS_COMBO_FORMAT_STRING
};
enum obs_combo_type {
OBS_COMBO_TYPE_INVALID,
OBS_COMBO_TYPE_EDITABLE,
OBS_COMBO_TYPE_LIST,
};
enum obs_text_type {
OBS_TEXT_DEFAULT,
OBS_TEXT_PASSWORD,
};
struct obs_properties;
struct obs_property;
typedef struct obs_properties *obs_properties_t;
typedef struct obs_property *obs_property_t;
/* ------------------------------------------------------------------------- */
EXPORT obs_properties_t obs_properties_create(const char *locale);
EXPORT void obs_properties_destroy(obs_properties_t props);
EXPORT const char *obs_properties_locale(obs_properties_t props);
EXPORT obs_property_t obs_properties_first(obs_properties_t props);
EXPORT obs_property_t obs_properties_get(obs_properties_t props,
const char *property);
/* used internally by libobs */
extern void obs_properties_apply_settings(obs_properties_t props,
obs_data_t settings);
/* ------------------------------------------------------------------------- */
EXPORT obs_property_t obs_properties_add_bool(obs_properties_t props,
const char *name, const char *description);
EXPORT obs_property_t obs_properties_add_int(obs_properties_t props,
const char *name, const char *description,
int min, int max, int step);
EXPORT obs_property_t obs_properties_add_float(obs_properties_t props,
const char *name, const char *description,
double min, double max, double step);
EXPORT obs_property_t obs_properties_add_text(obs_properties_t props,
const char *name, const char *description,
enum obs_text_type type);
EXPORT obs_property_t obs_properties_add_path(obs_properties_t props,
const char *name, const char *description);
Split output/input audio capture sources - Split input and output audio captures so that they're different sources. This allows easier handling and enumeration of audio devices without having to do some sort of string processing. This way the user interface code can handle this a bit more easily, and so that it doesn't confuse users either. This should be done for all audio capture sources for all operating systems. You don't have to duplicate any code, you just need to create input/output wrapper functions to designate the audio as input or output before creation. - Make it detect soundflower and wavtap devices as mac "output" devices (even though they're actually input) for the mac output capture, and make it so that users can select a default output capture and automatically use soundflower or wavtap. I'm not entirely happy about having to do this, but because mac is designed this way, this is really the only way to handle it that makes it easier for users and UI code to deal with. Note that soundflower and wavtap are still also designated as input devices, so will still show up in input device enumeration. - Remove pragma messages because they were kind polluting the other compiler messages and just getting in the way. In the future we can just do a grep for TODO to find them. - Redo list property again, this time using a safer internal array, rather than requiring sketchy array inputs. Having functions handle everything behind the scenes is much safer. - Remove the reference counter debug log code, as it was included unintentionally in a commit.
2014-03-03 01:56:54 -08:00
EXPORT obs_property_t obs_properties_add_list(obs_properties_t props,
const char *name, const char *description,
Split output/input audio capture sources - Split input and output audio captures so that they're different sources. This allows easier handling and enumeration of audio devices without having to do some sort of string processing. This way the user interface code can handle this a bit more easily, and so that it doesn't confuse users either. This should be done for all audio capture sources for all operating systems. You don't have to duplicate any code, you just need to create input/output wrapper functions to designate the audio as input or output before creation. - Make it detect soundflower and wavtap devices as mac "output" devices (even though they're actually input) for the mac output capture, and make it so that users can select a default output capture and automatically use soundflower or wavtap. I'm not entirely happy about having to do this, but because mac is designed this way, this is really the only way to handle it that makes it easier for users and UI code to deal with. Note that soundflower and wavtap are still also designated as input devices, so will still show up in input device enumeration. - Remove pragma messages because they were kind polluting the other compiler messages and just getting in the way. In the future we can just do a grep for TODO to find them. - Redo list property again, this time using a safer internal array, rather than requiring sketchy array inputs. Having functions handle everything behind the scenes is much safer. - Remove the reference counter debug log code, as it was included unintentionally in a commit.
2014-03-03 01:56:54 -08:00
enum obs_combo_type type, enum obs_combo_format format);
EXPORT obs_property_t obs_properties_add_color(obs_properties_t props,
const char *name, const char *description);
/* ------------------------------------------------------------------------- */
/**
* Optional callback for when a property is modified. If the properties
* need to be refreshed due to changes to the property layout, return true,
* otherwise return false.
*/
typedef bool (*obs_property_modified_t)(obs_properties_t props,
obs_property_t property, obs_data_t settings);
EXPORT void obs_property_set_modified_callback(obs_property_t p,
obs_property_modified_t modified);
EXPORT bool obs_property_modified(obs_property_t p, obs_data_t settings);
EXPORT void obs_property_set_visible(obs_property_t p, bool visible);
EXPORT void obs_property_set_enabled(obs_property_t p, bool enabled);
EXPORT const char * obs_property_name(obs_property_t p);
EXPORT const char * obs_property_description(obs_property_t p);
Add source properties window (very preliminary) - Add a properties window for sources so that you can now actually edit the settings for sources. Also, display the source by itself in the window (Note: not working on mac, and possibly not working on linux). When changing the settings for a source, it will call obs_source_update on that source when you have modified any values automatically. - Add a properties 'widget', eventually I want to turn this in to a regular nice properties view like you'd see in the designer, but right now it just uses a form layout in a QScrollArea with regular controls to display the properties. It's clunky but works for the time being. - Make it so that swap chains and the main graphics subsystem will automatically use at least one backbuffer if none was specified - Fix bug where displays weren't added to the main display array - Make it so that you can get the properties of a source via the actual pointer of a source/encoder/output in addition to being able to look up properties via identifier. - When registering source types, check for required functions (wasn't doing it before). getheight/getwidth should not be optional if it's a video source as well. - Add an RAII OBSObj wrapper to obs.hpp for non-reference-counted libobs pointers - Add an RAII OBSSignal wrapper to obs.hpp for libobs signals to automatically disconnect them on destruction - Move the "scale and center" calculation in window-basic-main.cpp to its own function and in its own source file - Add an 'update' callback to WASAPI audio sources
2014-03-23 01:07:54 -07:00
EXPORT enum obs_property_type obs_property_get_type(obs_property_t p);
EXPORT bool obs_property_enabled(obs_property_t p);
EXPORT bool obs_property_visible(obs_property_t p);
EXPORT bool obs_property_next(obs_property_t *p);
EXPORT int obs_property_int_min(obs_property_t p);
EXPORT int obs_property_int_max(obs_property_t p);
EXPORT int obs_property_int_step(obs_property_t p);
EXPORT double obs_property_float_min(obs_property_t p);
EXPORT double obs_property_float_max(obs_property_t p);
EXPORT double obs_property_float_step(obs_property_t p);
EXPORT enum obs_text_type obs_proprety_text_type(obs_property_t p);
EXPORT enum obs_combo_type obs_property_list_type(obs_property_t p);
EXPORT enum obs_combo_format obs_property_list_format(obs_property_t p);
EXPORT void obs_property_list_clear(obs_property_t p);
EXPORT void obs_property_list_add_string(obs_property_t p,
const char *name, const char *val);
EXPORT void obs_property_list_add_int(obs_property_t p,
const char *name, long long val);
EXPORT void obs_property_list_add_float(obs_property_t p,
const char *name, double val);
EXPORT void obs_property_list_remove(obs_property_t p, size_t idx);
Split output/input audio capture sources - Split input and output audio captures so that they're different sources. This allows easier handling and enumeration of audio devices without having to do some sort of string processing. This way the user interface code can handle this a bit more easily, and so that it doesn't confuse users either. This should be done for all audio capture sources for all operating systems. You don't have to duplicate any code, you just need to create input/output wrapper functions to designate the audio as input or output before creation. - Make it detect soundflower and wavtap devices as mac "output" devices (even though they're actually input) for the mac output capture, and make it so that users can select a default output capture and automatically use soundflower or wavtap. I'm not entirely happy about having to do this, but because mac is designed this way, this is really the only way to handle it that makes it easier for users and UI code to deal with. Note that soundflower and wavtap are still also designated as input devices, so will still show up in input device enumeration. - Remove pragma messages because they were kind polluting the other compiler messages and just getting in the way. In the future we can just do a grep for TODO to find them. - Redo list property again, this time using a safer internal array, rather than requiring sketchy array inputs. Having functions handle everything behind the scenes is much safer. - Remove the reference counter debug log code, as it was included unintentionally in a commit.
2014-03-03 01:56:54 -08:00
EXPORT size_t obs_property_list_item_count(obs_property_t p);
EXPORT const char *obs_property_list_item_name(obs_property_t p, size_t idx);
EXPORT const char *obs_property_list_item_string(obs_property_t p, size_t idx);
EXPORT long long obs_property_list_item_int(obs_property_t p, size_t idx);
EXPORT double obs_property_list_item_float(obs_property_t p, size_t idx);
Split output/input audio capture sources - Split input and output audio captures so that they're different sources. This allows easier handling and enumeration of audio devices without having to do some sort of string processing. This way the user interface code can handle this a bit more easily, and so that it doesn't confuse users either. This should be done for all audio capture sources for all operating systems. You don't have to duplicate any code, you just need to create input/output wrapper functions to designate the audio as input or output before creation. - Make it detect soundflower and wavtap devices as mac "output" devices (even though they're actually input) for the mac output capture, and make it so that users can select a default output capture and automatically use soundflower or wavtap. I'm not entirely happy about having to do this, but because mac is designed this way, this is really the only way to handle it that makes it easier for users and UI code to deal with. Note that soundflower and wavtap are still also designated as input devices, so will still show up in input device enumeration. - Remove pragma messages because they were kind polluting the other compiler messages and just getting in the way. In the future we can just do a grep for TODO to find them. - Redo list property again, this time using a safer internal array, rather than requiring sketchy array inputs. Having functions handle everything behind the scenes is much safer. - Remove the reference counter debug log code, as it was included unintentionally in a commit.
2014-03-03 01:56:54 -08:00
#ifdef __cplusplus
}
#endif