Skip to content

Commit

Permalink
Add UI to enable / disable auto splitter settings
Browse files Browse the repository at this point in the history
This patch adds UI elements to be able to set the auto splitter custom settings .
The list of settings gets refreshed every time the user opens the properties window, you can then select a setting to change and you will be able to see it's tooltip, current value and enable or disable it.
There surely are things to improve in this but i think it's a good starting point.
  • Loading branch information
Refragg committed Sep 3, 2023
1 parent 018b349 commit 5a4caeb
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 38 deletions.
48 changes: 14 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ reqwest = { version = "0.11.18", features = [
"blocking",
"rustls-tls-native-roots",
], default-features = false, optional = true }
serde = { version = "1.0.166", features = ["derive"], optional = true }
serde = { version = "1.0.188", features = ["derive"], optional = true }

[features]
default = ["auto-splitting"]
Expand Down
30 changes: 30 additions & 0 deletions obs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,33 @@ pub extern "C" fn obs_module_get_config_path(
) -> *const c_char {
panic!()
}
#[no_mangle]
pub extern "C" fn obs_properties_add_list(
_props: *mut obs_properties_t,
_name: *const c_char,
_description: *const c_char,
_combo_type: obs_combo_type,
_combo_format: obs_combo_format,
) -> *mut obs_property_t {
panic!()
}
#[no_mangle]
pub extern "C" fn obs_property_list_add_string(
_prop: *mut obs_property_t,
_name: *const c_char,
_val: *const c_char,
) -> size_t {
panic!()
}
#[no_mangle]
pub extern "C" fn obs_data_set_bool(_data: *mut obs_data_t, _name: *const c_char, _val: bool) {
panic!()
}
#[no_mangle]
pub extern "C" fn obs_data_set_string(
_data: *mut obs_data_t,
_name: *const c_char,
_val: *const c_char,
) {
panic!()
}
18 changes: 18 additions & 0 deletions src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ extern "C" {
description: *const c_char,
text_type: obs_text_type,
) -> *mut obs_property_t;
#[cfg(feature = "auto-splitting")]
pub fn obs_properties_add_list(
props: *mut obs_properties_t,
name: *const c_char,
description: *const c_char,
combo_type: obs_combo_type,
combo_format: obs_combo_format,
) -> *mut obs_property_t;
#[cfg(feature = "auto-splitting")]
pub fn obs_property_list_add_string(
prop: *mut obs_property_t,
name: *const c_char,
val: *const c_char,
) -> size_t;
pub fn obs_properties_add_int(
props: *mut obs_properties_t,
name: *const c_char,
Expand Down Expand Up @@ -118,4 +132,8 @@ extern "C" {
module: *mut obs_module_t,
file: *const c_char,
) -> *const c_char;
#[cfg(feature = "auto-splitting")]
pub fn obs_data_set_bool(data: *mut obs_data_t, name: *const c_char, val: bool);
#[cfg(feature = "auto-splitting")]
pub fn obs_data_set_string(data: *mut obs_data_t, name: *const c_char, val: *const c_char);
}
13 changes: 13 additions & 0 deletions src/ffi_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ pub const OBS_TEXT_PASSWORD: obs_text_type = 1;
pub const OBS_TEXT_MULTILINE: obs_text_type = 2;
pub const OBS_TEXT_INFO: obs_text_type = 3;

pub type obs_combo_type = u32;
pub const OBS_COMBO_TYPE_INVALID: obs_combo_type = 0;
pub const OBS_COMBO_TYPE_EDITABLE: obs_combo_type = 1;
pub const OBS_COMBO_TYPE_LIST: obs_combo_type = 2;
pub const OBS_COMBO_TYPE_RADIO: obs_combo_type = 3;

pub type obs_combo_format = u32;
pub const OBS_COMBO_FORMAT_INVALID: obs_combo_format = 0;
pub const OBS_COMBO_FORMAT_INT: obs_combo_format = 1;
pub const OBS_COMBO_FORMAT_FLOAT: obs_combo_format = 2;
pub const OBS_COMBO_FORMAT_STRING: obs_combo_format = 3;
pub const OBS_COMBO_FORMAT_BOOL: obs_combo_format = 4;

pub type obs_data_t = obs_data;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down
Loading

0 comments on commit 5a4caeb

Please sign in to comment.