提交 74b4743b 编写于 作者: J jp9000

Remove 'locale' from properties

Having the value stored here is somewhat pointless, so this is one step
in fixing the locale handling.  Locale should be handled by the modules
themselves with their own loaded locale lookup information.
上级 899f0530
......@@ -90,7 +90,6 @@ struct obs_property {
};
struct obs_properties {
const char *locale;
void *param;
void (*destroy)(void *param);
......@@ -98,12 +97,11 @@ struct obs_properties {
struct obs_property **last;
};
obs_properties_t obs_properties_create(const char *locale)
obs_properties_t obs_properties_create(void)
{
struct obs_properties *props;
props = bzalloc(sizeof(struct obs_properties));
props->locale = locale;
props->last = &props->first_property;
props->last = &props->first_property;
return props;
}
......@@ -125,10 +123,10 @@ void *obs_properties_get_param(obs_properties_t props)
return props ? props->param : NULL;
}
obs_properties_t obs_properties_create_param(const char *locale,
void *param, void (*destroy)(void *param))
obs_properties_t obs_properties_create_param(void *param,
void (*destroy)(void *param))
{
struct obs_properties *props = obs_properties_create(locale);
struct obs_properties *props = obs_properties_create();
obs_properties_set_param(props, param, destroy);
return props;
}
......@@ -161,11 +159,6 @@ void obs_properties_destroy(obs_properties_t props)
}
}
const char *obs_properties_locale(obs_properties_t props)
{
return props ? props->locale : NULL;
}
obs_property_t obs_properties_first(obs_properties_t props)
{
return (props != NULL) ? props->first_property : NULL;
......
......@@ -61,17 +61,15 @@ typedef struct obs_property *obs_property_t;
/* ------------------------------------------------------------------------- */
EXPORT obs_properties_t obs_properties_create(const char *locale);
EXPORT obs_properties_t obs_properties_create_param(const char *locale,
void *param, void (*destroy)(void *param));
EXPORT obs_properties_t obs_properties_create(void);
EXPORT obs_properties_t obs_properties_create_param(void *param,
void (*destroy)(void *param));
EXPORT void obs_properties_destroy(obs_properties_t props);
EXPORT void obs_properties_set_param(obs_properties_t props,
void *param, void (*destroy)(void *param));
EXPORT void *obs_properties_get_param(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,
......
......@@ -283,7 +283,7 @@ skip:
*/
static obs_properties_t pulse_properties(const char *locale, bool input)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
obs_property_t devices = obs_properties_add_list(props, "device_id",
"Device", OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
......
......@@ -454,7 +454,7 @@ static bool resolution_selected(obs_properties_t props, obs_property_t p,
static obs_properties_t v4l2_properties(const char *locale)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
obs_property_t device_list = obs_properties_add_list(props, "device_id",
"Device", OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
obs_property_t format_list = obs_properties_add_list(props,
......
......@@ -48,7 +48,7 @@ void XCompcapMain::deinit()
obs_properties_t XCompcapMain::properties(const char *locale)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
obs_property_t wins = obs_properties_add_list(props, "capture_window",
"Captured Window", OBS_COMBO_TYPE_LIST,
......
......@@ -156,7 +156,7 @@ static void xshm_defaults(obs_data_t defaults)
*/
static obs_properties_t xshm_properties(const char *locale)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
int_fast32_t screen_max;
Display *dpy = XOpenDisplay(NULL);
......
......@@ -571,7 +571,7 @@ static bool properties_device_changed(obs_properties_t props, obs_property_t p,
static obs_properties_t av_capture_properties(char const *locale)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
/* TODO: locale */
obs_property_t dev_list = obs_properties_add_list(props, "device",
......
......@@ -706,7 +706,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(locale);
obs_properties_t props = obs_properties_create();
obs_property_t property;
struct device_list devices;
......
......@@ -240,7 +240,7 @@ static void aac_defaults(obs_data_t settings)
static obs_properties_t aac_properties(const char *locale)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
/* TODO: locale */
obs_properties_add_int(props, "bitrate", "Bitrate", 32, 320, 32);
......
......@@ -67,7 +67,7 @@ static const char *libfdk_getname(const char *locale)
static obs_properties_t libfdk_properties(const char *locale)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
obs_properties_add_int(props, "bitrate", "Bitrate", 32, 256, 32);
obs_properties_add_bool(props, "afterburner", "Enable AAC Afterburner");
......
......@@ -191,7 +191,7 @@ static void flv_output_data(void *data, struct encoder_packet *packet)
static obs_properties_t flv_output_properties(const char *locale)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
/* TODO: locale */
obs_properties_add_text(props, "path", "File Path", OBS_TEXT_DEFAULT);
......
......@@ -569,7 +569,7 @@ static void rtmp_stream_defaults(obs_data_t defaults)
static obs_properties_t rtmp_stream_properties(const char *locale)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
/* TODO: locale */
obs_properties_add_text(props, "path", "Stream URL", OBS_TEXT_DEFAULT);
......
......@@ -97,7 +97,7 @@ static obs_properties_t obs_x264_props(const char *locale)
{
/* TODO: locale */
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
obs_property_t list;
obs_properties_add_int(props, "bitrate", "Bitrate", 50, 100000, 1);
......
......@@ -202,7 +202,7 @@ static bool service_selected(obs_properties_t props, obs_property_t p,
static obs_properties_t rtmp_common_properties(const char *locale)
{
obs_properties_t ppts = obs_properties_create(locale);
obs_properties_t ppts = obs_properties_create();
obs_property_t list;
char *file;
......
......@@ -43,7 +43,7 @@ static void *rtmp_custom_create(obs_data_t settings, obs_service_t service)
static obs_properties_t rtmp_custom_properties(const char *locale)
{
obs_properties_t ppts = obs_properties_create(locale);
obs_properties_t ppts = obs_properties_create();
/* TODO: locale */
......
......@@ -364,7 +364,7 @@ static void wc_defaults(obs_data_t defaults)
static obs_properties_t wc_properties(const char *locale)
{
obs_properties_t ppts = obs_properties_create(locale);
obs_properties_t ppts = obs_properties_create();
obs_property_t p;
/* TODO: locale */
......
......@@ -780,7 +780,7 @@ static bool DeviceIntervalChanged(obs_properties_t props, obs_property_t p,
static obs_properties_t GetDShowProperties(const char *locale)
{
obs_properties_t ppts = obs_properties_create(locale);
obs_properties_t ppts = obs_properties_create();
PropertiesData *data = new PropertiesData;
obs_properties_set_param(ppts, data, PropertiesDataDestroy);
......
......@@ -468,7 +468,7 @@ static void UpdateWASAPISource(void *obj, obs_data_t settings)
static obs_properties_t GetWASAPIProperties(const char *locale, bool input)
{
obs_properties_t props = obs_properties_create(locale);
obs_properties_t props = obs_properties_create();
vector<AudioDeviceInfo> devices;
/* TODO: translate */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册