mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-11-15 21:31:03 +00:00
6756b34919
rename pluginlist module to plugindialogs Add display_plugin_properties to modify properties from an element. Add a way to modify the location if element is URI_TYPE_SRC Able to remove a node from the graph
33 lines
773 B
Rust
33 lines
773 B
Rust
// Macro for upgrading a weak reference or returning the given value
|
|
//
|
|
// This works for glib/gtk objects as well as anything else providing an upgrade method
|
|
macro_rules! upgrade_weak {
|
|
($x:ident, $r:expr) => {{
|
|
match $x.upgrade() {
|
|
Some(o) => o,
|
|
None => return $r,
|
|
}
|
|
}};
|
|
($x:ident) => {
|
|
upgrade_weak!($x, ())
|
|
};
|
|
}
|
|
|
|
macro_rules! str_some_value (
|
|
($value:expr, $t:ty) => (
|
|
{
|
|
let value = $value.get::<$t>().expect("ser_some_value macro");
|
|
value
|
|
}
|
|
);
|
|
);
|
|
macro_rules! str_opt_value (
|
|
($value:expr, $t:ty) => (
|
|
{
|
|
match $value.get::<$t>() {
|
|
Ok(v) => Some(v),
|
|
Err(_e) => None
|
|
}
|
|
}
|
|
);
|
|
);
|