some more updates
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Chris Cochrun 2025-08-14 09:19:30 -05:00
parent a06890d9e1
commit 10fbbe5a65
5 changed files with 37 additions and 9 deletions

1
Cargo.lock generated
View file

@ -3632,6 +3632,7 @@ dependencies = [
"strum_macros", "strum_macros",
"tokio", "tokio",
"tracing", "tracing",
"tracing-log",
"tracing-subscriber", "tracing-subscriber",
"url", "url",
] ]

View file

@ -15,6 +15,7 @@ pretty_assertions = "1.4.1"
serde = { version = "1.0.213", features = ["derive"] } serde = { version = "1.0.213", features = ["derive"] }
serde-lexpr = "0.1.3" serde-lexpr = "0.1.3"
tracing = "0.1.40" tracing = "0.1.40"
tracing-log = "0.2.0"
tracing-subscriber = { version = "0.3.18", features = ["fmt", "std", "chrono", "time", "local-time", "env-filter"] } tracing-subscriber = { version = "0.3.18", features = ["fmt", "std", "chrono", "time", "local-time", "env-filter"] }
strum = "0.26.3" strum = "0.26.3"
strum_macros = "0.26.4" strum_macros = "0.26.4"

View file

@ -34,6 +34,7 @@
wayland-protocols wayland-protocols
libxkbcommon libxkbcommon
pkg-config pkg-config
sccache
]; ];
bi = with pkgs; [ bi = with pkgs; [
@ -72,7 +73,7 @@
in rec in rec
{ {
devShell = pkgs.mkShell.override { devShell = pkgs.mkShell.override {
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv; # stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv;
} { } {
nativeBuildInputs = nbi; nativeBuildInputs = nbi;
buildInputs = bi; buildInputs = bi;

View file

@ -5,8 +5,12 @@ default:
just --list just --list
build: build:
RUST_LOG=debug cargo build RUST_LOG=debug cargo build
sbuild:
RUST_LOG=debug sccache cargo build
run: run:
RUST_LOG=debug cargo run -- {{ui}} {{file}} RUST_LOG=debug cargo run -- {{ui}} {{file}}
srun:
RUST_LOG=debug sccache cargo run -- {{ui}} {{file}}
clean: clean:
RUST_LOG=debug cargo clean RUST_LOG=debug cargo clean
test: test:
@ -15,4 +19,5 @@ profile:
cargo flamegraph --image-width 8000 -- {{ui}} {{file}} cargo flamegraph --image-width 8000 -- {{ui}} {{file}}
alias r := run alias r := run
alias sr := srun
alias c := clean alias c := clean

View file

@ -124,7 +124,7 @@ impl Presenter {
let path = slide.background().path.clone(); let path = slide.background().path.clone();
if path.exists() { if path.exists() {
let url = Url::from_file_path(path).unwrap(); let url = Url::from_file_path(path).unwrap();
let result = Self::create_video(url); let result = Video::new(&url);
match result { match result {
Ok(mut v) => { Ok(mut v) => {
v.set_paused(true); v.set_paused(true);
@ -303,10 +303,10 @@ impl Presenter {
} }
} }
Message::VideoFrame => { Message::VideoFrame => {
if let Some(video) = &self.video { // if let Some(video) = &self.video {
self.video_position = // self.video_position =
video.position().as_secs_f32(); // video.position().as_secs_f32();
} // }
} }
Message::MissingPlugin(element) => { Message::MissingPlugin(element) => {
if let Some(video) = &mut self.video { if let Some(video) = &mut self.video {
@ -545,7 +545,7 @@ pub(crate) fn slide_view(
delegate: bool, delegate: bool,
hide_mouse: bool, hide_mouse: bool,
) -> Element<'_, Message> { ) -> Element<'_, Message> {
responsive(move |size| { let res = responsive(move |size| {
let width = size.height * 16.0 / 9.0; let width = size.height * 16.0 / 9.0;
let slide_text = slide.text(); let slide_text = slide.text();
@ -687,6 +687,7 @@ pub(crate) fn slide_view(
) )
.center(Length::Shrink) .center(Length::Shrink)
.clip(true) .clip(true)
// Container::new(Space::new(0, 0))
} else { } else {
Container::new(Space::new(0, 0)) Container::new(Space::new(0, 0))
} }
@ -698,6 +699,25 @@ pub(crate) fn slide_view(
text_container text_container
); );
Container::new(stack).center(Length::Fill).into() Container::new(stack).center(Length::Fill).into()
}) });
.into() // let vid = if let Some(video) = &video {
// Container::new(
// VideoPlayer::new(video)
// .mouse_hidden(hide_mouse)
// .width(Length::Fill)
// .height(Length::Fill)
// .on_end_of_stream(Message::EndVideo)
// .on_new_frame(Message::VideoFrame)
// .on_missing_plugin(Message::MissingPlugin)
// .on_warning(|w| Message::Error(w.to_string()))
// .on_error(|e| Message::Error(e.to_string()))
// .content_fit(ContentFit::Cover),
// )
// .center(Length::Shrink)
// .clip(true)
// } else {
// Container::new(Space::new(0, 0))
// };
// stack!(vid, res).into()
res.into()
} }