1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#![allow(non_camel_case_types, non_snake_case)]
use crate::decl::*;
use crate::mf::vts::*;
use crate::ole::privs::*;
use crate::prelude::*;
com_interface! { IMFTopology: "83cf873a-f6da-4bc8-823f-bacfd55dc433";
/// [`IMFTopology`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nn-mfidl-imftopology)
/// COM interface.
///
/// Automatically calls
/// [`Release`](https://learn.microsoft.com/en-us/windows/win32/api/unknwn/nf-unknwn-iunknown-release)
/// when the object goes out of scope.
///
/// Usually created with [`MFCreateTopology`](crate::MFCreateTopology)
/// function.
///
/// # Examples
///
/// ```no_run
/// use winsafe::{self as w, prelude::*};
///
/// let topology = w::MFCreateTopology()?;
/// # w::HrResult::Ok(())
/// ```
}
impl mf_IMFAttributes for IMFTopology {}
impl mf_IMFTopology for IMFTopology {}
/// This trait is enabled with the `mf` feature, and provides methods for
/// [`IMFTopology`](crate::IMFTopology).
///
/// Prefer importing this trait through the prelude:
///
/// ```no_run
/// use winsafe::prelude::*;
/// ```
pub trait mf_IMFTopology: mf_IMFAttributes {
/// [`IMFTopology::AddNode`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-addnode)
/// method.
fn AddNode(&self, node: &impl mf_IMFTopologyNode) -> HrResult<()> {
HrRet(unsafe { (vt::<IMFTopologyVT>(self).AddNode)(self.ptr(), node.ptr()) }).to_hrresult()
}
fn_com_noparm! { Clear: IMFTopologyVT;
/// [`IMFTopology::Clear`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-clear)
/// method.
}
/// [`IMFTopology::CloneFrom`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-clonefrom)
/// method.
fn CloneFrom(&self, topology: &impl mf_IMFTopology) -> HrResult<()> {
HrRet(unsafe { (vt::<IMFTopologyVT>(self).CloneFrom)(self.ptr(), topology.ptr()) })
.to_hrresult()
}
/// [`IMFTopology::GetNode`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-getnode)
/// method.
#[must_use]
fn GetNode(&self, index: u16) -> HrResult<IMFTopologyNode> {
let mut queried = unsafe { IMFTopologyNode::null() };
HrRet(unsafe { (vt::<IMFTopologyVT>(self).GetNode)(self.ptr(), index, queried.as_mut()) })
.to_hrresult()
.map(|_| queried)
}
/// [`IMFTopology::GetNodeByID`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-getnodebyid)
/// method.
#[must_use]
fn GetNodeByID(&self, topo_node_id: u64) -> HrResult<IMFTopologyNode> {
let mut queried = unsafe { IMFTopologyNode::null() };
HrRet(unsafe {
(vt::<IMFTopologyVT>(self).GetNodeByID)(self.ptr(), topo_node_id, queried.as_mut())
})
.to_hrresult()
.map(|_| queried)
}
/// [`IMFTopology::GetNodeCount`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-getnodecount)
/// method.
#[must_use]
fn GetNodeCount(&self) -> HrResult<u16> {
let mut nodes = 0u16;
HrRet(unsafe { (vt::<IMFTopologyVT>(self).GetNodeCount)(self.ptr(), &mut nodes) })
.to_hrresult()
.map(|_| nodes)
}
fn_com_interface_get! { GetOutputNodeCollection: IMFTopologyVT => IMFCollection;
/// [`IMFTopology::GetOutputNodeCollection`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-getoutputnodecollection)
/// method.
}
fn_com_interface_get! { GetSourceNodeCollection: IMFTopologyVT => IMFCollection;
/// [`IMFTopology::GetSourceNodeCollection`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-getsourcenodecollection)
/// method.
}
/// [`IMFTopology::GetTopologyID`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-gettopologyid)
/// method.
#[must_use]
fn GetTopologyID(&self) -> HrResult<u64> {
let mut id = 0u64;
HrRet(unsafe { (vt::<IMFTopologyVT>(self).GetTopologyID)(self.ptr(), &mut id) })
.to_hrresult()
.map(|_| id)
}
/// [`IMFTopology::RemoveNode`](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imftopology-removenode)
/// method.
fn RemoveNode(&self, node: &impl mf_IMFTopologyNode) -> HrResult<()> {
HrRet(unsafe { (vt::<IMFTopologyVT>(self).RemoveNode)(self.ptr(), node.ptr()) })
.to_hrresult()
}
}