@@ -96,7 +96,7 @@ impl PWClient {
96
96
#[ derive( Default ) ]
97
97
struct State {
98
98
settings : Settings ,
99
- nodes : Vec < Node > ,
99
+ nodes : Vec < ProxyItem > ,
100
100
}
101
101
102
102
#[ derive( Default , Clone , Debug ) ]
@@ -125,7 +125,7 @@ fn pw_thread(
125
125
pipewire:: init ( ) ;
126
126
// let state = Rc::new(State::default());
127
127
let state = Rc :: new ( RefCell :: new ( State :: default ( ) ) ) ;
128
- let proxies = Rc :: new ( RefCell :: new ( HashMap :: < u32 , ProxyItem > :: new ( ) ) ) ;
128
+ let proxies = Rc :: new ( RefCell :: new ( HashMap :: new ( ) ) ) ;
129
129
130
130
let mainloop = pipewire:: MainLoop :: new ( ) . expect ( "Failed to create PipeWire Mainloop" ) ;
131
131
@@ -142,6 +142,7 @@ fn pw_thread(
142
142
let state = state. clone ( ) ;
143
143
let main_sender = main_sender. clone ( ) ;
144
144
let core = core. clone ( ) ;
145
+ let proxies = proxies. clone ( ) ;
145
146
146
147
move |msg| match msg {
147
148
Message :: Terminate => mainloop. quit ( ) ,
@@ -177,8 +178,8 @@ fn pw_thread(
177
178
178
179
let _listener = node
179
180
. add_listener_local ( )
180
- . info ( |f | {
181
- println ! ( "{:?}" , f ) ;
181
+ . info ( |info | {
182
+ // println!("{:?}", info );
182
183
} )
183
184
. param ( |a, b, c, d| {
184
185
println ! ( "{}, {}, {}, {}" , a, b, c, d) ;
@@ -187,15 +188,10 @@ fn pw_thread(
187
188
188
189
println ! ( "{:?}" , node) ;
189
190
190
- state. as_ref ( ) . borrow_mut ( ) . nodes . push ( node) ;
191
-
192
- // proxies.as_ref().borrow_mut().insert(
193
- // node.proxy.id(),
194
- // ProxyItem::Node {
195
- // _proxy: node,
196
- // _listener,
197
- // },
198
- // );
191
+ state. as_ref ( ) . borrow_mut ( ) . nodes . push ( ProxyItem :: Node {
192
+ _proxy : node,
193
+ _listener,
194
+ } ) ;
199
195
200
196
main_sender. send ( MessageRepl :: NodeInfo ( NodeInfo { name } ) ) ;
201
197
}
0 commit comments