diff --git a/Cargo.lock b/Cargo.lock index 6b20047..7d7ab29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -289,7 +289,7 @@ version = "0.38.0+1.3.281" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" dependencies = [ - "libloading 0.8.5", + "libloading", ] [[package]] @@ -1287,7 +1287,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbd1f579714e3c809ebd822c81ef148b1ceaeb3d535352afc73fd0c4c6a0017" dependencies = [ "bitflags 2.6.0", - "libloading 0.7.4", + "libloading", "winapi", ] @@ -1413,7 +1413,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.5", + "libloading", ] [[package]] @@ -2123,7 +2123,7 @@ dependencies = [ "bitflags 2.6.0", "com", "libc", - "libloading 0.8.5", + "libloading", "thiserror", "widestring", "winapi", @@ -2607,7 +2607,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.8.5", + "libloading", "pkg-config", ] @@ -2747,16 +2747,6 @@ dependencies = [ "zbus 4.4.0", ] -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "libloading" version = "0.8.5" @@ -4858,7 +4848,7 @@ checksum = "1d52f22673960ad13af14ff4025997312def1223bfa7c8e4949d099e6b3d5d1c" dependencies = [ "as-raw-xcb-connection", "ctor-lite", - "libloading 0.8.5", + "libloading", "pkg-config", "tracing", ] @@ -5462,7 +5452,7 @@ dependencies = [ "js-sys", "log", "naga", - "parking_lot 0.11.2", + "parking_lot 0.12.3", "profiling", "raw-window-handle", "smallvec", @@ -5490,7 +5480,7 @@ dependencies = [ "log", "naga", "once_cell", - "parking_lot 0.11.2", + "parking_lot 0.12.3", "profiling", "raw-window-handle", "rustc-hash 1.1.0", @@ -5524,14 +5514,14 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.7.4", + "libloading", "log", "metal", "naga", "ndk-sys 0.5.0+25.2.9519653", "objc", "once_cell", - "parking_lot 0.11.2", + "parking_lot 0.12.3", "profiling", "range-alloc", "raw-window-handle", @@ -5983,7 +5973,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.5", + "libloading", "once_cell", "rustix 0.38.37", "x11rb-protocol", diff --git a/Cargo.toml b/Cargo.toml index b234d7d..3e31731 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,3 +18,4 @@ serde = { version = "1.0.213", features = ["derive"] } serde-lexpr = "0.1.3" tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["fmt", "std", "chrono", "time", "local-time", "env-filter"] } +# iced_video_player = "0.5.0" diff --git a/flake.nix b/flake.nix index 9992e19..3fcf513 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,15 @@ wayland-protocols libxkbcommon pkg-config + gst_all_1.gst-devtools + gst_all_1.gst-libav + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-good + gst_all_1.gst-plugins-ugly + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-rs + gst_all_1.gst-vaapi + gst_all_1.gstreamer ]; bi = with pkgs; [ diff --git a/src/main.rs b/src/main.rs index 4427886..525b8e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,12 @@ use clap::{command, Parser}; use cosmic::app::{Core, Settings, Task}; +use cosmic::dialog::ashpd::url::Url; use cosmic::iced::window::Position; use cosmic::iced::{self, event, window, ContentFit, Font, Length, Point}; use cosmic::iced_core::id; use cosmic::iced_widget::{stack, text}; use cosmic::widget::{button, image, nav_bar}; -use cosmic::{executor, Also, Application, ApplicationExt, Element}; +use cosmic::{executor, iced_wgpu, Also, Application, ApplicationExt, Element}; use cosmic::{widget::Container, Theme}; use lexpr::{parse, Value}; use miette::{miette, Result}; @@ -69,11 +70,6 @@ struct App { windows: Vec, } -struct Window { - id: id::Id, - value: String, -} - #[derive(Debug, Clone)] enum Message { Enchant(String), @@ -193,11 +189,7 @@ impl cosmic::Application for App { Message::CloseWindow(id) => window::close(id), Message::WindowOpened(id, _) => { debug!(?id, "Window opened"); - if let Some(window) = self.windows.get(&id) { - cosmic::widget::text_input::focus(window.id.clone()) - } else { - Task::none() - } + Task::none() } Message::WindowClosed(id) => { let window = self.windows.iter().position(|w| *w == id).unwrap(); @@ -219,18 +211,40 @@ impl cosmic::Application for App { } // View for presentation - fn view_window(&self, id: window::Id) -> Element { - if let Some(_window) = self.windows.get(&id) {} + fn view_window(&self, _id: window::Id) -> Element { + // let window = self.windows.iter().position(|w| *w == id).unwrap(); + // if let Some(_window) = self.windows.get(window) {} + // let video = Video::new(&Url::parse("/home/chris/vids/test/camprules2024.mp4").unwrap()) let text = text!("This is frodo").size(50); let text = Container::new(text).center(Length::Fill); - let image = - Container::new(image("/home/chris/pics/frodo.jpg").content_fit(ContentFit::Cover)) - .center(Length::Fill); + let image = Container::new( + image("/home/chris/pics/frodo.jpg") + .content_fit(ContentFit::Cover) + .width(Length::Fill) + .height(Length::Fill), + ); + // let video = Container::new(VideoPlayer::new(&video)) + // .width(Length::Fill) + // .height(Length::Fill); let stack = stack!(image, text).width(Length::Fill).height(Length::Fill); stack.into() } } +// struct VidPlayer<'a, Message, Theme, Renderer>(VideoPlayer<'a, Message, Theme, Renderer>); + +// impl<'a, Message, Theme, Renderer> Into> +// for VidPlayer<'a, Message, Theme, Renderer> +// where +// Renderer: 'a + iced_wgpu::primitive::Renderer, +// Message: 'a + Clone, +// Theme: 'a, +// { +// fn into(self) -> Element<'a, Message> { +// Element::new(&self) +// } +// } + impl App where Self: cosmic::Application, @@ -254,13 +268,15 @@ where } fn show_window(&mut self) -> Task { - let (id, task) = window::open(window::Settings { + let (id, spawn_window) = window::open(window::Settings { position: Position::Centered, exit_on_close_request: true, decorations: false, ..Default::default() }); - task.map(|id| cosmic::app::Message::App(Message::WindowOpened(id, None))) + self.windows.push(id); + _ = self.set_window_title("Lumina Presenter".to_owned(), id); + spawn_window.map(|id| cosmic::app::Message::App(Message::WindowOpened(id, None))) } }