use miette::{miette, IntoDiagnostic, Result}; use std::{fs::File, io::BufReader, path::PathBuf, sync::Arc}; use cosmic::{ dialog::ashpd::url::Url, iced::{ alignment::Horizontal, font::{Family, Stretch, Style, Weight}, Background, Border, Color, ContentFit, Font, Length, Shadow, Vector, }, iced_core::text::Span, iced_widget::{ rich_text, scrollable::{ scroll_to, AbsoluteOffset, Direction, Scrollbar, }, span, stack, }, prelude::*, widget::{ container, image, mouse_area, responsive, scrollable, Column, Container, Id, Row, Space, }, Task, }; use iced_video_player::{gst_pbutils, Position, Video, VideoPlayer}; use rodio::{Decoder, OutputStream, Sink}; use tracing::{debug, error, info, warn}; use crate::{ core::{service_items::ServiceItemModel, slide::Slide}, BackgroundKind, }; const REFERENCE_WIDTH: f32 = 1920.0; const REFERENCE_HEIGHT: f32 = 1080.0; // #[derive(Default, Clone, Debug)] pub(crate) struct Presenter { pub slides: Vec, pub items: ServiceItemModel, pub current_slide: Slide, pub current_slide_index: u16, pub video: Option