mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
Merge pull request #124 from jp9000/new-locale-handling
Update to new module locale API
This commit is contained in:
@@ -281,9 +281,9 @@ skip:
|
||||
/**
|
||||
* Get plugin properties
|
||||
*/
|
||||
static obs_properties_t pulse_properties(const char *locale, bool input)
|
||||
static obs_properties_t pulse_properties(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);
|
||||
|
||||
@@ -295,14 +295,14 @@ static obs_properties_t pulse_properties(const char *locale, bool input)
|
||||
return props;
|
||||
}
|
||||
|
||||
static obs_properties_t pulse_input_properties(const char *locale)
|
||||
static obs_properties_t pulse_input_properties(void)
|
||||
{
|
||||
return pulse_properties(locale, true);
|
||||
return pulse_properties(true);
|
||||
}
|
||||
|
||||
static obs_properties_t pulse_output_properties(const char *locale)
|
||||
static obs_properties_t pulse_output_properties(void)
|
||||
{
|
||||
return pulse_properties(locale, false);
|
||||
return pulse_properties(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,15 +366,15 @@ static void pulse_output_defaults(obs_data_t settings)
|
||||
/**
|
||||
* Returns the name of the plugin
|
||||
*/
|
||||
static const char *pulse_input_getname(const char *locale)
|
||||
static const char *pulse_input_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
/* TODO: locale */
|
||||
return "Pulse Audio Input Capture";
|
||||
}
|
||||
|
||||
static const char *pulse_output_getname(const char *locale)
|
||||
static const char *pulse_output_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
/* TODO: locale */
|
||||
return "Pulse Audio Output Capture";
|
||||
}
|
||||
|
||||
|
||||
@@ -266,9 +266,9 @@ exit:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char* v4l2_getname(const char* locale)
|
||||
static const char* v4l2_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
/* TODO: locale */
|
||||
return "V4L2 Capture Input";
|
||||
}
|
||||
|
||||
@@ -452,9 +452,10 @@ static bool resolution_selected(obs_properties_t props, obs_property_t p,
|
||||
return true;
|
||||
}
|
||||
|
||||
static obs_properties_t v4l2_properties(const char *locale)
|
||||
static obs_properties_t v4l2_properties(void)
|
||||
{
|
||||
obs_properties_t props = obs_properties_create(locale);
|
||||
/* TODO: 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,
|
||||
|
||||
@@ -37,9 +37,9 @@ static uint32_t xcompcap_getheight(void* data)
|
||||
return cc->height();
|
||||
}
|
||||
|
||||
static obs_properties_t xcompcap_props(const char *locale)
|
||||
static obs_properties_t xcompcap_props(void)
|
||||
{
|
||||
return XCompcapMain::properties(locale);
|
||||
return XCompcapMain::properties();
|
||||
}
|
||||
|
||||
void xcompcap_defaults(obs_data_t settings)
|
||||
@@ -55,10 +55,9 @@ void xcompcap_update(void *data, obs_data_t settings)
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
|
||||
static const char* xcompcap_getname(const char* locale)
|
||||
static const char* xcompcap_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
|
||||
/* TODO: locale */
|
||||
return "Xcomposite capture";
|
||||
}
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@ void XCompcapMain::deinit()
|
||||
XCompcap::cleanupDisplay();
|
||||
}
|
||||
|
||||
obs_properties_t XCompcapMain::properties(const char *locale)
|
||||
obs_properties_t XCompcapMain::properties()
|
||||
{
|
||||
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,
|
||||
|
||||
@@ -8,7 +8,7 @@ class XCompcapMain
|
||||
static bool init();
|
||||
static void deinit();
|
||||
|
||||
static obs_properties_t properties(const char *locale);
|
||||
static obs_properties_t properties();
|
||||
static void defaults(obs_data_t settings);
|
||||
|
||||
XCompcapMain(obs_data_t settings, obs_source_t source);
|
||||
|
||||
@@ -108,9 +108,9 @@ static int_fast32_t xshm_update_geometry(struct xshm_data *data,
|
||||
/**
|
||||
* Returns the name of the plugin
|
||||
*/
|
||||
static const char* xshm_getname(const char* locale)
|
||||
static const char* xshm_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
/* TODO: locale */
|
||||
return "X11 Shared Memory Screen Input";
|
||||
}
|
||||
|
||||
@@ -154,9 +154,10 @@ static void xshm_defaults(obs_data_t defaults)
|
||||
/**
|
||||
* Get the properties for the capture
|
||||
*/
|
||||
static obs_properties_t xshm_properties(const char *locale)
|
||||
static obs_properties_t xshm_properties(void)
|
||||
{
|
||||
obs_properties_t props = obs_properties_create(locale);
|
||||
/* TODO: locale */
|
||||
obs_properties_t props = obs_properties_create();
|
||||
int_fast32_t screen_max;
|
||||
|
||||
Display *dpy = XOpenDisplay(NULL);
|
||||
|
||||
@@ -131,10 +131,9 @@ static inline void update_frame_size(struct av_capture *capture,
|
||||
}
|
||||
@end
|
||||
|
||||
static const char *av_capture_getname(const char *locale)
|
||||
static const char *av_capture_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "Video Capture Device";
|
||||
}
|
||||
|
||||
@@ -569,9 +568,9 @@ static bool properties_device_changed(obs_properties_t props, obs_property_t p,
|
||||
return true;
|
||||
}
|
||||
|
||||
static obs_properties_t av_capture_properties(char const *locale)
|
||||
static obs_properties_t av_capture_properties(void)
|
||||
{
|
||||
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",
|
||||
|
||||
@@ -628,17 +628,15 @@ static void coreaudio_uninit(struct coreaudio_data *ca)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const char *coreaudio_input_getname(const char *locale)
|
||||
static const char *coreaudio_input_getname(void)
|
||||
{
|
||||
/* TODO: Locale */
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "CoreAudio Input Capture";
|
||||
}
|
||||
|
||||
static const char *coreaudio_output_getname(const char *locale)
|
||||
static const char *coreaudio_output_getname(void)
|
||||
{
|
||||
/* TODO: Locale */
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "CoreAudio Output Capture";
|
||||
}
|
||||
|
||||
@@ -704,9 +702,9 @@ static void *coreaudio_create_output_capture(obs_data_t settings,
|
||||
return coreaudio_create(settings, source, false);
|
||||
}
|
||||
|
||||
static obs_properties_t coreaudio_properties(const char *locale, bool input)
|
||||
static obs_properties_t coreaudio_properties(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;
|
||||
|
||||
@@ -732,14 +730,14 @@ static obs_properties_t coreaudio_properties(const char *locale, bool input)
|
||||
return props;
|
||||
}
|
||||
|
||||
static obs_properties_t coreaudio_input_properties(const char *locale)
|
||||
static obs_properties_t coreaudio_input_properties(void)
|
||||
{
|
||||
return coreaudio_properties(locale, true);
|
||||
return coreaudio_properties(true);
|
||||
}
|
||||
|
||||
static obs_properties_t coreaudio_output_properties(const char *locale)
|
||||
static obs_properties_t coreaudio_output_properties(void)
|
||||
{
|
||||
return coreaudio_properties(locale, false);
|
||||
return coreaudio_properties(false);
|
||||
}
|
||||
|
||||
struct obs_source_info coreaudio_input_capture_info = {
|
||||
|
||||
@@ -44,9 +44,9 @@ struct aac_encoder {
|
||||
int frame_size_bytes;
|
||||
};
|
||||
|
||||
static const char *aac_getname(const char *locale)
|
||||
static const char *aac_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
/* TODO: locale */
|
||||
return "FFmpeg Default AAC Encoder";
|
||||
}
|
||||
|
||||
@@ -238,9 +238,9 @@ static void aac_defaults(obs_data_t settings)
|
||||
obs_data_set_default_int(settings, "bitrate", 128);
|
||||
}
|
||||
|
||||
static obs_properties_t aac_properties(const char *locale)
|
||||
static obs_properties_t aac_properties(void)
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -396,9 +396,9 @@ fail:
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const char *ffmpeg_output_getname(const char *locale)
|
||||
static const char *ffmpeg_output_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
/* TODO: locale */
|
||||
return "FFmpeg file output";
|
||||
}
|
||||
|
||||
|
||||
@@ -59,15 +59,15 @@ typedef struct libfdk_encoder {
|
||||
int packet_buffer_size;
|
||||
} libfdk_encoder_t;
|
||||
|
||||
static const char *libfdk_getname(const char *locale)
|
||||
static const char *libfdk_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
/* TODO: locale */
|
||||
return "libfdk aac encoder";
|
||||
}
|
||||
|
||||
static obs_properties_t libfdk_properties(const char *locale)
|
||||
static obs_properties_t libfdk_properties(void)
|
||||
{
|
||||
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");
|
||||
|
||||
@@ -32,9 +32,9 @@ struct flv_output {
|
||||
int64_t last_packet_ts;
|
||||
};
|
||||
|
||||
static const char *flv_output_getname(const char *locale)
|
||||
static const char *flv_output_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
/* TODO: locale */
|
||||
return "FLV File Output";
|
||||
}
|
||||
|
||||
@@ -189,9 +189,9 @@ static void flv_output_data(void *data, struct encoder_packet *packet)
|
||||
}
|
||||
}
|
||||
|
||||
static obs_properties_t flv_output_properties(const char *locale)
|
||||
static obs_properties_t flv_output_properties(void)
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -61,10 +61,9 @@ struct rtmp_stream {
|
||||
RTMP rtmp;
|
||||
};
|
||||
|
||||
static const char *rtmp_stream_getname(const char *locale)
|
||||
static const char *rtmp_stream_getname(void)
|
||||
{
|
||||
/* TODO: locale stuff */
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "RTMP Stream";
|
||||
}
|
||||
|
||||
@@ -567,9 +566,9 @@ static void rtmp_stream_defaults(obs_data_t defaults)
|
||||
obs_data_set_default_int(defaults, "drop_threshold", 600000);
|
||||
}
|
||||
|
||||
static obs_properties_t rtmp_stream_properties(const char *locale)
|
||||
static obs_properties_t rtmp_stream_properties(void)
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -38,10 +38,9 @@ struct obs_x264 {
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const char *obs_x264_getname(const char *locale)
|
||||
static const char *obs_x264_getname(void)
|
||||
{
|
||||
/* TODO locale lookup */
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "x264";
|
||||
}
|
||||
|
||||
@@ -93,11 +92,11 @@ static inline void add_strings(obs_property_t list, const char *const *strings)
|
||||
}
|
||||
}
|
||||
|
||||
static obs_properties_t obs_x264_props(const char *locale)
|
||||
static obs_properties_t obs_x264_props(void)
|
||||
{
|
||||
/* 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);
|
||||
|
||||
@@ -8,10 +8,8 @@ struct rtmp_common {
|
||||
char *key;
|
||||
};
|
||||
|
||||
static const char *rtmp_common_getname(const char *locale)
|
||||
static const char *rtmp_common_getname(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
|
||||
/* TODO: locale */
|
||||
return "Streaming Services";
|
||||
}
|
||||
@@ -200,9 +198,9 @@ static bool service_selected(obs_properties_t props, obs_property_t p,
|
||||
return true;
|
||||
}
|
||||
|
||||
static obs_properties_t rtmp_common_properties(const char *locale)
|
||||
static obs_properties_t rtmp_common_properties(void)
|
||||
{
|
||||
obs_properties_t ppts = obs_properties_create(locale);
|
||||
obs_properties_t ppts = obs_properties_create();
|
||||
obs_property_t list;
|
||||
char *file;
|
||||
|
||||
|
||||
@@ -4,10 +4,8 @@ struct rtmp_custom {
|
||||
char *server, *key;
|
||||
};
|
||||
|
||||
static const char *rtmp_custom_name(const char *locale)
|
||||
static const char *rtmp_custom_name(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
|
||||
/* TODO: locale */
|
||||
return "Custom Streaming Server";
|
||||
}
|
||||
@@ -41,9 +39,9 @@ static void *rtmp_custom_create(obs_data_t settings, obs_service_t service)
|
||||
return data;
|
||||
}
|
||||
|
||||
static obs_properties_t rtmp_custom_properties(const char *locale)
|
||||
static obs_properties_t rtmp_custom_properties(void)
|
||||
{
|
||||
obs_properties_t ppts = obs_properties_create(locale);
|
||||
obs_properties_t ppts = obs_properties_create();
|
||||
|
||||
/* TODO: locale */
|
||||
|
||||
|
||||
@@ -81,9 +81,9 @@ static inline void update_settings(struct monitor_capture *capture,
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const char *monitor_capture_getname(const char *locale)
|
||||
static const char *monitor_capture_getname(void)
|
||||
{
|
||||
/* TODO: translate */
|
||||
/* TODO: locale */
|
||||
return "Monitor Capture";
|
||||
}
|
||||
|
||||
|
||||
@@ -294,10 +294,9 @@ static HWND find_window(struct window_capture *wc)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const char *wc_getname(const char *locale)
|
||||
static const char *wc_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "Window capture";
|
||||
}
|
||||
|
||||
@@ -362,9 +361,9 @@ static void wc_defaults(obs_data_t defaults)
|
||||
obs_data_setbool(defaults, "compatibility", false);
|
||||
}
|
||||
|
||||
static obs_properties_t wc_properties(const char *locale)
|
||||
static obs_properties_t wc_properties(void)
|
||||
{
|
||||
obs_properties_t ppts = obs_properties_create(locale);
|
||||
obs_properties_t ppts = obs_properties_create();
|
||||
obs_property_t p;
|
||||
|
||||
/* TODO: locale */
|
||||
|
||||
@@ -251,9 +251,9 @@ void DShowInput::Update(obs_data_t settings)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const char *GetDShowInputName(const char *locale)
|
||||
static const char *GetDShowInputName(void)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
/* TODO: locale */
|
||||
return "Video Capture Device";
|
||||
}
|
||||
|
||||
@@ -778,9 +778,9 @@ static bool DeviceIntervalChanged(obs_properties_t props, obs_property_t p,
|
||||
return true;
|
||||
}
|
||||
|
||||
static obs_properties_t GetDShowProperties(const char *locale)
|
||||
static obs_properties_t GetDShowProperties(void)
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -416,13 +416,13 @@ DWORD WINAPI WASAPISource::CaptureThread(LPVOID param)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const char *GetWASAPIInputName(const char *locale)
|
||||
static const char *GetWASAPIInputName(void)
|
||||
{
|
||||
/* TODO: translate */
|
||||
return "Audio Input Capture (WASAPI)";
|
||||
}
|
||||
|
||||
static const char *GetWASAPIOutputName(const char *locale)
|
||||
static const char *GetWASAPIOutputName(void)
|
||||
{
|
||||
/* TODO: translate */
|
||||
return "Audio Output Capture (WASAPI)";
|
||||
@@ -466,9 +466,9 @@ static void UpdateWASAPISource(void *obj, obs_data_t settings)
|
||||
static_cast<WASAPISource*>(obj)->Update(settings);
|
||||
}
|
||||
|
||||
static obs_properties_t GetWASAPIProperties(const char *locale, bool input)
|
||||
static obs_properties_t GetWASAPIProperties(bool input)
|
||||
{
|
||||
obs_properties_t props = obs_properties_create(locale);
|
||||
obs_properties_t props = obs_properties_create();
|
||||
vector<AudioDeviceInfo> devices;
|
||||
|
||||
/* TODO: translate */
|
||||
@@ -494,14 +494,14 @@ static obs_properties_t GetWASAPIProperties(const char *locale, bool input)
|
||||
return props;
|
||||
}
|
||||
|
||||
static obs_properties_t GetWASAPIPropertiesInput(const char *locale)
|
||||
static obs_properties_t GetWASAPIPropertiesInput(void)
|
||||
{
|
||||
return GetWASAPIProperties(locale, true);
|
||||
return GetWASAPIProperties(true);
|
||||
}
|
||||
|
||||
static obs_properties_t GetWASAPIPropertiesOutput(const char *locale)
|
||||
static obs_properties_t GetWASAPIPropertiesOutput(void)
|
||||
{
|
||||
return GetWASAPIProperties(locale, false);
|
||||
return GetWASAPIProperties(false);
|
||||
}
|
||||
|
||||
void RegisterWASAPIInput()
|
||||
|
||||
Reference in New Issue
Block a user