updates to try to connect obs to service items
This commit is contained in:
parent
039b116498
commit
4cb57b0b96
2 changed files with 8 additions and 4 deletions
|
@ -3,19 +3,18 @@ use std::error::Error;
|
|||
use obws::Client;
|
||||
use obws::responses::scenes::Scenes;
|
||||
use tracing::debug;
|
||||
|
||||
pub struct Obs {
|
||||
scenes: Scenes,
|
||||
client: Client,
|
||||
}
|
||||
|
||||
impl Obs {
|
||||
pub async fn setup(mut self) -> Result<(), Box<dyn Error>> {
|
||||
pub async fn new() -> Result<Self, Box<dyn Error>> {
|
||||
let client = Client::connect("localhost", 4455, Some("")).await?;
|
||||
let scene_list = client.scenes().list().await?;
|
||||
debug!(?scene_list);
|
||||
self.scenes = scene_list;
|
||||
self.client = client;
|
||||
Ok(())
|
||||
Ok(Self{scenes: scene_list, client})
|
||||
}
|
||||
|
||||
pub fn get_list(self) -> Result<Vec<String>, Box<dyn Error>> {
|
||||
|
|
|
@ -87,6 +87,7 @@ mod service_item_model {
|
|||
pub struct ServiceItemMod {
|
||||
id: i32,
|
||||
service_items: Vec<ServiceItm>,
|
||||
obs: Obs,
|
||||
}
|
||||
|
||||
#[cxx_qt::qsignals(ServiceItemMod)]
|
||||
|
@ -153,6 +154,10 @@ mod service_item_model {
|
|||
|
||||
use crate::obs::Obs;
|
||||
impl qobject::ServiceItemMod {
|
||||
pub fn setup(mut self: Pin<&mut Self>) {
|
||||
todo!()
|
||||
}
|
||||
|
||||
#[qinvokable]
|
||||
pub fn clear(mut self: Pin<&mut Self>) {
|
||||
println!("CLEARING ALL ITEMS");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue