updating obws to 0.13.0

This commit is contained in:
Chris Cochrun 2024-09-25 12:52:52 -05:00
parent 444df4eacc
commit 7fd5926fd4

View file

@ -1,7 +1,7 @@
use core::fmt;
use cxx_qt::CxxQtType;
use cxx_qt_lib::{QString, QStringList};
use obws::responses::scenes::Scenes;
use obws::responses::scenes::{CurrentProgramScene, Scenes};
use obws::Client;
@ -14,7 +14,7 @@ use crate::obs::obs::QList_QString;
pub struct Obs {
scenes: Scenes,
client: Option<Client>,
current_program_scene: Option<String>,
current_program_scene: Option<CurrentProgramScene>,
}
impl fmt::Debug for Obs {
@ -60,7 +60,7 @@ impl Obs {
.scenes
.scenes
.iter()
.map(|x| x.name.clone())
.map(|x| x.id.name.clone())
.collect::<Vec<String>>();
if !scenes.is_empty() {
Ok(scenes)
@ -83,7 +83,7 @@ impl Obs {
debug!("in spawn: before setting");
let res = client
.scenes()
.set_current_program_scene(&scene)
.set_current_program_scene(scene.as_str())
.await;
match res {
Ok(_o) => {
@ -162,7 +162,7 @@ impl obs::ObsModel {
debug!("found obs");
for scene in obs.scenes.scenes.iter().rev() {
debug!(?scene);
scenes_list.append(QString::from(&scene.name));
scenes_list.append(QString::from(&scene.id.name));
}
}
for s in scenes_list.iter() {
@ -181,7 +181,7 @@ impl obs::ObsModel {
match Obs::new().await {
Ok(o) => {
if let Some(scene) = &o.current_program_scene {
let scene = QString::from(scene);
let scene = QString::from(&scene.id.name);
self.as_mut()
.set_current_program_scene(scene);
}
@ -227,7 +227,7 @@ mod test {
let client = runtime.block_on(future).unwrap();
let scene = String::from("me");
let res = runtime.block_on(
client.scenes().set_current_program_scene(&scene),
client.scenes().set_current_program_scene(scene.as_str()),
);
debug_assert!(res.is_ok());
}