parent
a06890d9e1
commit
10fbbe5a65
5 changed files with 37 additions and 9 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -3632,6 +3632,7 @@ dependencies = [
|
|||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-log",
|
||||
"tracing-subscriber",
|
||||
"url",
|
||||
]
|
||||
|
|
|
@ -15,6 +15,7 @@ pretty_assertions = "1.4.1"
|
|||
serde = { version = "1.0.213", features = ["derive"] }
|
||||
serde-lexpr = "0.1.3"
|
||||
tracing = "0.1.40"
|
||||
tracing-log = "0.2.0"
|
||||
tracing-subscriber = { version = "0.3.18", features = ["fmt", "std", "chrono", "time", "local-time", "env-filter"] }
|
||||
strum = "0.26.3"
|
||||
strum_macros = "0.26.4"
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
wayland-protocols
|
||||
libxkbcommon
|
||||
pkg-config
|
||||
sccache
|
||||
];
|
||||
|
||||
bi = with pkgs; [
|
||||
|
@ -72,7 +73,7 @@
|
|||
in rec
|
||||
{
|
||||
devShell = pkgs.mkShell.override {
|
||||
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv;
|
||||
# stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv;
|
||||
} {
|
||||
nativeBuildInputs = nbi;
|
||||
buildInputs = bi;
|
||||
|
|
5
justfile
5
justfile
|
@ -5,8 +5,12 @@ default:
|
|||
just --list
|
||||
build:
|
||||
RUST_LOG=debug cargo build
|
||||
sbuild:
|
||||
RUST_LOG=debug sccache cargo build
|
||||
run:
|
||||
RUST_LOG=debug cargo run -- {{ui}} {{file}}
|
||||
srun:
|
||||
RUST_LOG=debug sccache cargo run -- {{ui}} {{file}}
|
||||
clean:
|
||||
RUST_LOG=debug cargo clean
|
||||
test:
|
||||
|
@ -15,4 +19,5 @@ profile:
|
|||
cargo flamegraph --image-width 8000 -- {{ui}} {{file}}
|
||||
|
||||
alias r := run
|
||||
alias sr := srun
|
||||
alias c := clean
|
||||
|
|
|
@ -124,7 +124,7 @@ impl Presenter {
|
|||
let path = slide.background().path.clone();
|
||||
if path.exists() {
|
||||
let url = Url::from_file_path(path).unwrap();
|
||||
let result = Self::create_video(url);
|
||||
let result = Video::new(&url);
|
||||
match result {
|
||||
Ok(mut v) => {
|
||||
v.set_paused(true);
|
||||
|
@ -303,10 +303,10 @@ impl Presenter {
|
|||
}
|
||||
}
|
||||
Message::VideoFrame => {
|
||||
if let Some(video) = &self.video {
|
||||
self.video_position =
|
||||
video.position().as_secs_f32();
|
||||
}
|
||||
// if let Some(video) = &self.video {
|
||||
// self.video_position =
|
||||
// video.position().as_secs_f32();
|
||||
// }
|
||||
}
|
||||
Message::MissingPlugin(element) => {
|
||||
if let Some(video) = &mut self.video {
|
||||
|
@ -545,7 +545,7 @@ pub(crate) fn slide_view(
|
|||
delegate: bool,
|
||||
hide_mouse: bool,
|
||||
) -> Element<'_, Message> {
|
||||
responsive(move |size| {
|
||||
let res = responsive(move |size| {
|
||||
let width = size.height * 16.0 / 9.0;
|
||||
let slide_text = slide.text();
|
||||
|
||||
|
@ -687,6 +687,7 @@ pub(crate) fn slide_view(
|
|||
)
|
||||
.center(Length::Shrink)
|
||||
.clip(true)
|
||||
// Container::new(Space::new(0, 0))
|
||||
} else {
|
||||
Container::new(Space::new(0, 0))
|
||||
}
|
||||
|
@ -698,6 +699,25 @@ pub(crate) fn slide_view(
|
|||
text_container
|
||||
);
|
||||
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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue