use miette::{miette, IntoDiagnostic, Result}; use std::{fs::File, io::BufReader, path::PathBuf, sync::Arc}; use cosmic::{ iced::{ alignment::Horizontal, font::{Family, Stretch, Style, Weight}, Background, Border, Color, ContentFit, Font, Length, Shadow, Vector, }, iced_widget::{ rich_text, scrollable::{ scroll_to, AbsoluteOffset, Direction, Scrollbar, }, span, stack, text, }, 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 url::Url; use crate::{ core::{service_items::ServiceItemModel, slide::Slide}, BackgroundKind, }; use super::text_svg::{ self, shadow, stroke, Font as SvgFont, TextSvg, }; 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