Skip to content

Instantly share code, notes, and snippets.

@saivert
Created June 26, 2023 20:32
Show Gist options
  • Save saivert/4b2c98e2aef4fd3e285d28afde97427d to your computer and use it in GitHub Desktop.
Save saivert/4b2c98e2aef4fd3e285d28afde97427d to your computer and use it in GitHub Desktop.
// Is this currently the only way to set enums without type information in the rust bindings (e.g from foreign code)
let t = glib::Type::from_name("WpMixerApiVolumeScale").unwrap();
let v = glib::Value::from_type(t);
unsafe {
glib::gobject_ffi::g_value_set_enum(v.as_ptr(), 1);
}
mixerapi.set_property("scale", v);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment