This commit is contained in:
parent
49117a39a3
commit
144fba3706
25 changed files with 392 additions and 346 deletions
431
Cargo.lock
generated
431
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
24
flake.lock
generated
24
flake.lock
generated
|
|
@ -6,11 +6,11 @@
|
||||||
"rust-analyzer-src": "rust-analyzer-src"
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1758177713,
|
"lastModified": 1759214609,
|
||||||
"narHash": "sha256-4Mesi0sOxCzrwnFHeAhL/vv1K1Wcwsl4D9duQ7ndYS8=",
|
"narHash": "sha256-+V3SeMjAMd9j9JTECk9oc0gWhtsk79rFEbYf/tHjywo=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "fenix",
|
"repo": "fenix",
|
||||||
"rev": "60316bdc00603b483992560baa14841e42e58a7b",
|
"rev": "f93a2d7225bc7a93d3379acff8fe722e21d97852",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -80,11 +80,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1758035966,
|
"lastModified": 1759036355,
|
||||||
"narHash": "sha256-qqIJ3yxPiB0ZQTT9//nFGQYn8X/PBoJbofA7hRKZnmE=",
|
"narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "8d4ddb19d03c65a36ad8d189d001dc32ffb0306b",
|
"rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -112,11 +112,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1758035966,
|
"lastModified": 1759036355,
|
||||||
"narHash": "sha256-qqIJ3yxPiB0ZQTT9//nFGQYn8X/PBoJbofA7hRKZnmE=",
|
"narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "8d4ddb19d03c65a36ad8d189d001dc32ffb0306b",
|
"rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -137,11 +137,11 @@
|
||||||
"rust-analyzer-src": {
|
"rust-analyzer-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1757362324,
|
"lastModified": 1759134797,
|
||||||
"narHash": "sha256-/PAhxheUq4WBrW5i/JHzcCqK5fGWwLKdH6/Lu1tyS18=",
|
"narHash": "sha256-YPi+jL3tx/yC5J5l7/OB7Lnlr9BMTzYnZtm7tRJzUNg=",
|
||||||
"owner": "rust-lang",
|
"owner": "rust-lang",
|
||||||
"repo": "rust-analyzer",
|
"repo": "rust-analyzer",
|
||||||
"rev": "9edc9cbe5d8e832b5864e09854fa94861697d2fd",
|
"rev": "062ac7a5451e8e92a32e22a60d86882d6a034f3f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
13
flake.nix
13
flake.nix
|
|
@ -67,8 +67,6 @@
|
||||||
gst_all_1.gst-plugins-rs
|
gst_all_1.gst-plugins-rs
|
||||||
gst_all_1.gst-vaapi
|
gst_all_1.gst-vaapi
|
||||||
gst_all_1.gstreamer
|
gst_all_1.gstreamer
|
||||||
# podofo
|
|
||||||
# mpv
|
|
||||||
ffmpeg-full
|
ffmpeg-full
|
||||||
mupdf
|
mupdf
|
||||||
# yt-dlp
|
# yt-dlp
|
||||||
|
|
@ -90,6 +88,17 @@
|
||||||
LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${
|
LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${
|
||||||
with pkgs;
|
with pkgs;
|
||||||
pkgs.lib.makeLibraryPath [
|
pkgs.lib.makeLibraryPath [
|
||||||
|
pkgs.alsa-lib
|
||||||
|
pkgs.gst_all_1.gst-libav
|
||||||
|
pkgs.gst_all_1.gstreamer
|
||||||
|
pkgs.gst_all_1.gst-plugins-bad
|
||||||
|
pkgs.gst_all_1.gst-plugins-good
|
||||||
|
pkgs.gst_all_1.gst-plugins-ugly
|
||||||
|
pkgs.gst_all_1.gst-plugins-base
|
||||||
|
pkgs.gst_all_1.gst-plugins-rs
|
||||||
|
pkgs.gst_all_1.gst-vaapi
|
||||||
|
pkgs.glib
|
||||||
|
pkgs.fontconfig
|
||||||
pkgs.vulkan-loader
|
pkgs.vulkan-loader
|
||||||
pkgs.wayland
|
pkgs.wayland
|
||||||
pkgs.wayland-protocols
|
pkgs.wayland-protocols
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
max_width = 70
|
max_width = 70
|
||||||
# style_edition = "2018"
|
# style_edition = "2024"
|
||||||
# version = "Two"
|
# version = "Two"
|
||||||
|
|
@ -10,8 +10,8 @@ use crisp::types::{Keyword, Symbol, Value};
|
||||||
use miette::{IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sqlx::{
|
use sqlx::{
|
||||||
pool::PoolConnection, query, query_as, Sqlite, SqliteConnection,
|
Sqlite, SqliteConnection, SqlitePool, pool::PoolConnection,
|
||||||
SqlitePool,
|
query, query_as,
|
||||||
};
|
};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use tracing::{debug, error};
|
use tracing::{debug, error};
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ use std::{error::Error, fmt::Display};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
core::{content::Content, service_items::ServiceItem},
|
|
||||||
Slide,
|
Slide,
|
||||||
|
core::{content::Content, service_items::ServiceItem},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use std::{borrow::Cow, mem::replace};
|
use std::{borrow::Cow, mem::replace};
|
||||||
|
|
||||||
use cosmic::iced::clipboard::mime::{AllowedMimeTypes, AsMimeTypes};
|
use cosmic::iced::clipboard::mime::{AllowedMimeTypes, AsMimeTypes};
|
||||||
use miette::{miette, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, miette};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sqlx::{Connection, SqliteConnection};
|
use sqlx::{Connection, SqliteConnection};
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ use miette::{IntoDiagnostic, Result};
|
||||||
use mupdf::{Colorspace, Document, Matrix};
|
use mupdf::{Colorspace, Document, Matrix};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sqlx::{
|
use sqlx::{
|
||||||
pool::PoolConnection, prelude::FromRow, query, sqlite::SqliteRow,
|
Row, Sqlite, SqliteConnection, SqlitePool, pool::PoolConnection,
|
||||||
Row, Sqlite, SqliteConnection, SqlitePool,
|
prelude::FromRow, query, sqlite::SqliteRow,
|
||||||
};
|
};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use tracing::{debug, error};
|
use tracing::{debug, error};
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ use crate::Slide;
|
||||||
|
|
||||||
use super::images::Image;
|
use super::images::Image;
|
||||||
use super::presentations::Presentation;
|
use super::presentations::Presentation;
|
||||||
use super::songs::{lisp_to_song, Song};
|
use super::songs::{Song, lisp_to_song};
|
||||||
use super::videos::Video;
|
use super::videos::Video;
|
||||||
|
|
||||||
use super::kinds::ServiceItemKind;
|
use super::kinds::ServiceItemKind;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use cosmic::widget::image::Handle;
|
||||||
// use cosmic::dialog::ashpd::url::Url;
|
// use cosmic::dialog::ashpd::url::Url;
|
||||||
use crisp::types::{Keyword, Symbol, Value};
|
use crisp::types::{Keyword, Symbol, Value};
|
||||||
use iced_video_player::Video;
|
use iced_video_player::Video;
|
||||||
use miette::{miette, Result};
|
use miette::{Result, miette};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{
|
use std::{
|
||||||
fmt::Display,
|
fmt::Display,
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
use std::{collections::HashMap, option::Option, path::PathBuf};
|
use std::{collections::HashMap, option::Option, path::PathBuf};
|
||||||
|
|
||||||
use crisp::types::{Keyword, Symbol, Value};
|
use crisp::types::{Keyword, Symbol, Value};
|
||||||
use miette::{miette, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, miette};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sqlx::{
|
use sqlx::{
|
||||||
pool::PoolConnection, query, sqlite::SqliteRow, Acquire, FromRow,
|
Acquire, FromRow, Row, Sqlite, SqliteConnection, SqlitePool,
|
||||||
Row, Sqlite, SqliteConnection, SqlitePool,
|
pool::PoolConnection, query, sqlite::SqliteRow,
|
||||||
};
|
};
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
use crate::{core::slide, Slide, SlideBuilder};
|
use crate::{Slide, SlideBuilder, core::slide};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
content::Content,
|
content::Content,
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ use crisp::types::{Keyword, Symbol, Value};
|
||||||
use miette::{IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sqlx::{
|
use sqlx::{
|
||||||
pool::PoolConnection, query, query_as, Sqlite, SqliteConnection,
|
Sqlite, SqliteConnection, SqlitePool, pool::PoolConnection,
|
||||||
SqlitePool,
|
query, query_as,
|
||||||
};
|
};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use tracing::{debug, error};
|
use tracing::{debug, error};
|
||||||
|
|
|
||||||
|
|
@ -40,11 +40,11 @@ mod test {
|
||||||
use std::{fs::read_to_string, path::PathBuf};
|
use std::{fs::read_to_string, path::PathBuf};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
Background, TextAlignment,
|
||||||
core::{
|
core::{
|
||||||
images::Image, kinds::ServiceItemKind,
|
images::Image, kinds::ServiceItemKind,
|
||||||
service_items::ServiceTrait, songs::Song, videos::Video,
|
service_items::ServiceTrait, songs::Song, videos::Video,
|
||||||
},
|
},
|
||||||
Background, TextAlignment,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
||||||
64
src/main.rs
64
src/main.rs
|
|
@ -1,4 +1,4 @@
|
||||||
use clap::{command, Parser};
|
use clap::{Parser, command};
|
||||||
use core::service_items::ServiceItem;
|
use core::service_items::ServiceItem;
|
||||||
use core::slide::{
|
use core::slide::{
|
||||||
Background, BackgroundKind, Slide, SlideBuilder, TextAlignment,
|
Background, BackgroundKind, Slide, SlideBuilder, TextAlignment,
|
||||||
|
|
@ -9,8 +9,8 @@ use cosmic::iced::alignment::Vertical;
|
||||||
use cosmic::iced::keyboard::{Key, Modifiers};
|
use cosmic::iced::keyboard::{Key, Modifiers};
|
||||||
use cosmic::iced::window::{Mode, Position};
|
use cosmic::iced::window::{Mode, Position};
|
||||||
use cosmic::iced::{
|
use cosmic::iced::{
|
||||||
self, event, window, Background as IcedBackground, Border, Color,
|
self, Background as IcedBackground, Border, Color, Length, event,
|
||||||
Length,
|
window,
|
||||||
};
|
};
|
||||||
use cosmic::iced_core::text::Wrapping;
|
use cosmic::iced_core::text::Wrapping;
|
||||||
use cosmic::iced_futures::Subscription;
|
use cosmic::iced_futures::Subscription;
|
||||||
|
|
@ -22,18 +22,18 @@ use cosmic::widget::menu::key_bind::Modifier;
|
||||||
use cosmic::widget::menu::{ItemWidth, KeyBind};
|
use cosmic::widget::menu::{ItemWidth, KeyBind};
|
||||||
use cosmic::widget::nav_bar::nav_bar_style;
|
use cosmic::widget::nav_bar::nav_bar_style;
|
||||||
use cosmic::widget::tooltip::Position as TPosition;
|
use cosmic::widget::tooltip::Position as TPosition;
|
||||||
|
use cosmic::widget::{Container, menu};
|
||||||
use cosmic::widget::{
|
use cosmic::widget::{
|
||||||
button, context_menu, horizontal_space, mouse_area, nav_bar,
|
Space, button, context_menu, horizontal_space, mouse_area,
|
||||||
nav_bar_toggle, responsive, scrollable, search_input, tooltip,
|
nav_bar, nav_bar_toggle, responsive, scrollable, search_input,
|
||||||
vertical_space, Space,
|
tooltip,
|
||||||
};
|
};
|
||||||
use cosmic::widget::{container, text};
|
use cosmic::widget::{container, text};
|
||||||
use cosmic::widget::{icon, slider};
|
use cosmic::widget::{icon, slider};
|
||||||
use cosmic::widget::{menu, Container};
|
use cosmic::{Application, ApplicationExt, Element, executor};
|
||||||
use cosmic::{executor, Application, ApplicationExt, Element};
|
|
||||||
use crisp::types::Value;
|
use crisp::types::Value;
|
||||||
use lisp::parse_lisp;
|
use lisp::parse_lisp;
|
||||||
use miette::{miette, Result};
|
use miette::{Result, miette};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use resvg::usvg::fontdb;
|
use resvg::usvg::fontdb;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
@ -43,10 +43,10 @@ use std::sync::Arc;
|
||||||
use tracing::{debug, level_filters::LevelFilter};
|
use tracing::{debug, level_filters::LevelFilter};
|
||||||
use tracing::{error, warn};
|
use tracing::{error, warn};
|
||||||
use tracing_subscriber::EnvFilter;
|
use tracing_subscriber::EnvFilter;
|
||||||
|
use ui::EditorMode;
|
||||||
use ui::library::{self, Library};
|
use ui::library::{self, Library};
|
||||||
use ui::presenter::{self, Presenter};
|
use ui::presenter::{self, Presenter};
|
||||||
use ui::song_editor::{self, SongEditor};
|
use ui::song_editor::{self, SongEditor};
|
||||||
use ui::EditorMode;
|
|
||||||
|
|
||||||
use crate::core::content::Content;
|
use crate::core::content::Content;
|
||||||
use crate::core::kinds::ServiceItemKind;
|
use crate::core::kinds::ServiceItemKind;
|
||||||
|
|
@ -597,8 +597,10 @@ impl cosmic::Application for App {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn subscription(&self) -> Subscription<Self::Message> {
|
fn subscription(&self) -> Subscription<Self::Message> {
|
||||||
event::listen_with(|event, _, id| {
|
event::listen_with(|event, status, id| {
|
||||||
// debug!(?event);
|
// debug!(?event);
|
||||||
|
match status {
|
||||||
|
event::Status::Ignored => {
|
||||||
match event {
|
match event {
|
||||||
iced::Event::Keyboard(event) => match event {
|
iced::Event::Keyboard(event) => match event {
|
||||||
iced::keyboard::Event::KeyReleased {
|
iced::keyboard::Event::KeyReleased {
|
||||||
|
|
@ -639,8 +641,8 @@ impl cosmic::Application for App {
|
||||||
}
|
}
|
||||||
iced::Event::Touch(_touch) => None,
|
iced::Event::Touch(_touch) => None,
|
||||||
iced::Event::A11y(_id, _action_request) => None,
|
iced::Event::A11y(_id, _action_request) => None,
|
||||||
iced::Event::Dnd(_dnd_event) => {
|
iced::Event::Dnd(dnd_event) => {
|
||||||
// debug!(?dnd_event);
|
debug!(?dnd_event);
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
iced::Event::PlatformSpecific(_platform_specific) => {
|
iced::Event::PlatformSpecific(_platform_specific) => {
|
||||||
|
|
@ -648,6 +650,9 @@ impl cosmic::Application for App {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
event::Status::Captured => None,
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -886,16 +891,13 @@ impl cosmic::Application for App {
|
||||||
slide_index,
|
slide_index,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
match action {
|
if let presenter::Action::Task(task) = action {
|
||||||
presenter::Action::Task(task) => {
|
|
||||||
tasks.push(task.map(|m| {
|
tasks.push(task.map(|m| {
|
||||||
cosmic::Action::App(
|
cosmic::Action::App(
|
||||||
Message::Present(m),
|
Message::Present(m),
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
self.current_item =
|
self.current_item =
|
||||||
(item_index, slide_index + 1);
|
(item_index, slide_index + 1);
|
||||||
Task::batch(tasks)
|
Task::batch(tasks)
|
||||||
|
|
@ -909,10 +911,9 @@ impl cosmic::Application for App {
|
||||||
.is_some()
|
.is_some()
|
||||||
{
|
{
|
||||||
let action = self.presenter.update(presenter::Message::ActivateSlide(self.current_item.0, self.current_item.1));
|
let action = self.presenter.update(presenter::Message::ActivateSlide(self.current_item.0, self.current_item.1));
|
||||||
match action {
|
if let presenter::Action::Task(
|
||||||
presenter::Action::Task(
|
|
||||||
task,
|
task,
|
||||||
) => {
|
) = action {
|
||||||
tasks
|
tasks
|
||||||
.push(task.map(|m| {
|
.push(task.map(|m| {
|
||||||
cosmic::Action::App(
|
cosmic::Action::App(
|
||||||
|
|
@ -922,8 +923,6 @@ impl cosmic::Application for App {
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Task::batch(tasks)
|
Task::batch(tasks)
|
||||||
}
|
}
|
||||||
|
|
@ -946,16 +945,13 @@ impl cosmic::Application for App {
|
||||||
slide_index,
|
slide_index,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
match action {
|
if let presenter::Action::Task(task) = action {
|
||||||
presenter::Action::Task(task) => {
|
|
||||||
tasks.push(task.map(|m| {
|
tasks.push(task.map(|m| {
|
||||||
cosmic::Action::App(
|
cosmic::Action::App(
|
||||||
Message::Present(m),
|
Message::Present(m),
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
self.current_item =
|
self.current_item =
|
||||||
(item_index, slide_index - 1);
|
(item_index, slide_index - 1);
|
||||||
Task::batch(tasks)
|
Task::batch(tasks)
|
||||||
|
|
@ -984,10 +980,9 @@ impl cosmic::Application for App {
|
||||||
.is_some()
|
.is_some()
|
||||||
{
|
{
|
||||||
let action = self.presenter.update(presenter::Message::ActivateSlide(self.current_item.0, self.current_item.1));
|
let action = self.presenter.update(presenter::Message::ActivateSlide(self.current_item.0, self.current_item.1));
|
||||||
match action {
|
if let presenter::Action::Task(
|
||||||
presenter::Action::Task(
|
|
||||||
task,
|
task,
|
||||||
) => {
|
) = action {
|
||||||
tasks
|
tasks
|
||||||
.push(task.map(|m| {
|
.push(task.map(|m| {
|
||||||
cosmic::Action::App(
|
cosmic::Action::App(
|
||||||
|
|
@ -997,8 +992,6 @@ impl cosmic::Application for App {
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Task::batch(tasks)
|
Task::batch(tasks)
|
||||||
}
|
}
|
||||||
|
|
@ -1084,7 +1077,7 @@ impl cosmic::Application for App {
|
||||||
let (id, spawn_window) =
|
let (id, spawn_window) =
|
||||||
window::open(window::Settings {
|
window::open(window::Settings {
|
||||||
position: Position::Centered,
|
position: Position::Centered,
|
||||||
exit_on_close_request: count % 2 == 0,
|
exit_on_close_request: count.is_multiple_of(2),
|
||||||
decorations: false,
|
decorations: false,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
@ -1293,7 +1286,7 @@ impl cosmic::Application for App {
|
||||||
}
|
}
|
||||||
Message::AppendServiceItemKind(item) => {
|
Message::AppendServiceItemKind(item) => {
|
||||||
let item = item.to_service_item();
|
let item = item.to_service_item();
|
||||||
return self.update(Message::AppendServiceItem(item));
|
self.update(Message::AppendServiceItem(item))
|
||||||
}
|
}
|
||||||
Message::ReorderService(index, target_index) => {
|
Message::ReorderService(index, target_index) => {
|
||||||
let item = self.service.remove(index);
|
let item = self.service.remove(index);
|
||||||
|
|
@ -1317,6 +1310,9 @@ impl cosmic::Application for App {
|
||||||
}
|
}
|
||||||
Message::OpenEditor(item) => {
|
Message::OpenEditor(item) => {
|
||||||
let kind = item.kind;
|
let kind = item.kind;
|
||||||
|
self.search_query = String::new();
|
||||||
|
self.search_results = vec![];
|
||||||
|
self.searching = false;
|
||||||
match kind {
|
match kind {
|
||||||
ServiceItemKind::Song(song) => {
|
ServiceItemKind::Song(song) => {
|
||||||
self.editor_mode = Some(EditorMode::Song);
|
self.editor_mode = Some(EditorMode::Song);
|
||||||
|
|
@ -1348,7 +1344,7 @@ impl cosmic::Application for App {
|
||||||
}
|
}
|
||||||
Message::OpenEditorKind(item) => {
|
Message::OpenEditorKind(item) => {
|
||||||
let item = item.to_service_item();
|
let item = item.to_service_item();
|
||||||
return self.update(Message::OpenEditor(item));
|
self.update(Message::OpenEditor(item))
|
||||||
}
|
}
|
||||||
Message::New => {
|
Message::New => {
|
||||||
debug!("new file");
|
debug!("new file");
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,15 @@ use std::{io, path::PathBuf};
|
||||||
|
|
||||||
use crate::core::images::Image;
|
use crate::core::images::Image;
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
dialog::file_chooser::{open::Dialog, FileFilter},
|
Element, Task,
|
||||||
iced::{alignment::Vertical, Length},
|
dialog::file_chooser::{FileFilter, open::Dialog},
|
||||||
|
iced::{Length, alignment::Vertical},
|
||||||
iced_widget::{column, row},
|
iced_widget::{column, row},
|
||||||
theme,
|
theme,
|
||||||
widget::{
|
widget::{
|
||||||
self, button, container, horizontal_space, icon, text,
|
self, Space, button, container, horizontal_space, icon, text,
|
||||||
text_input, Space,
|
text_input,
|
||||||
},
|
},
|
||||||
Element, Task,
|
|
||||||
};
|
};
|
||||||
use tracing::{debug, error, warn};
|
use tracing::{debug, error, warn};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,39 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
|
Element, Task,
|
||||||
dialog::file_chooser::open::Dialog,
|
dialog::file_chooser::open::Dialog,
|
||||||
iced::{
|
iced::{
|
||||||
alignment::Vertical, clipboard::dnd::DndAction,
|
Background, Border, Color, Length, alignment::Vertical,
|
||||||
keyboard::Modifiers, wgpu::core::command::DynComputePass,
|
clipboard::dnd::DndAction, keyboard::Modifiers,
|
||||||
Background, Border, Color, Length,
|
|
||||||
},
|
},
|
||||||
iced_core::widget::tree::State,
|
iced_core::widget::tree::State,
|
||||||
iced_widget::{column, row as rowm, text as textm},
|
iced_widget::{column, row as rowm, text as textm},
|
||||||
theme,
|
theme,
|
||||||
widget::{
|
widget::{
|
||||||
button, container, context_menu, dnd_destination,
|
Container, DndSource, Space, button, container, context_menu,
|
||||||
horizontal_space, icon,
|
dnd_destination, horizontal_space, icon,
|
||||||
menu::{self, Action as MenuAction},
|
menu::{self, Action as MenuAction},
|
||||||
mouse_area, responsive, row, scrollable, text, text_input,
|
mouse_area, responsive, row, scrollable, text, text_input,
|
||||||
Container, DndSource, Space,
|
|
||||||
},
|
},
|
||||||
Element, Task,
|
|
||||||
};
|
};
|
||||||
use miette::{IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result};
|
||||||
use rapidfuzz::distance::levenshtein;
|
use rapidfuzz::distance::levenshtein;
|
||||||
use sqlx::{migrate, SqlitePool};
|
use sqlx::{SqlitePool, migrate};
|
||||||
use tracing::{debug, error, warn};
|
use tracing::{debug, error, warn};
|
||||||
|
|
||||||
use crate::core::{
|
use crate::core::{
|
||||||
content::Content,
|
content::Content,
|
||||||
images::{self, update_image_in_db, Image},
|
images::{self, Image, update_image_in_db},
|
||||||
kinds::ServiceItemKind,
|
kinds::ServiceItemKind,
|
||||||
model::{KindWrapper, LibraryKind, Model},
|
model::{KindWrapper, LibraryKind, Model},
|
||||||
presentations::{
|
presentations::{
|
||||||
self, add_presentation_to_db, update_presentation_in_db,
|
self, Presentation, add_presentation_to_db,
|
||||||
Presentation,
|
update_presentation_in_db,
|
||||||
},
|
},
|
||||||
service_items::{ServiceItem, ServiceTrait},
|
service_items::{ServiceItem, ServiceTrait},
|
||||||
songs::{self, update_song_in_db, Song},
|
songs::{self, Song, update_song_in_db},
|
||||||
videos::{self, update_video_in_db, Video},
|
videos::{self, Video, update_video_in_db},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
@ -557,7 +555,7 @@ impl<'a> Library {
|
||||||
};
|
};
|
||||||
|
|
||||||
if items.contains(&(kind, index)) {
|
if items.contains(&(kind, index)) {
|
||||||
()
|
|
||||||
} else {
|
} else {
|
||||||
items.push((kind, index));
|
items.push((kind, index));
|
||||||
}
|
}
|
||||||
|
|
@ -930,7 +928,7 @@ impl<'a> Library {
|
||||||
.clone()
|
.clone()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|song| song.title.to_lowercase().contains(&query))
|
.filter(|song| song.title.to_lowercase().contains(&query))
|
||||||
.map(|song| ServiceItemKind::Song(song))
|
.map(ServiceItemKind::Song)
|
||||||
.collect();
|
.collect();
|
||||||
let videos: Vec<ServiceItemKind> = self
|
let videos: Vec<ServiceItemKind> = self
|
||||||
.video_library
|
.video_library
|
||||||
|
|
@ -938,7 +936,7 @@ impl<'a> Library {
|
||||||
.clone()
|
.clone()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|vid| vid.title.to_lowercase().contains(&query))
|
.filter(|vid| vid.title.to_lowercase().contains(&query))
|
||||||
.map(|video| ServiceItemKind::Video(video))
|
.map(ServiceItemKind::Video)
|
||||||
.collect();
|
.collect();
|
||||||
let images: Vec<ServiceItemKind> = self
|
let images: Vec<ServiceItemKind> = self
|
||||||
.image_library
|
.image_library
|
||||||
|
|
@ -948,7 +946,7 @@ impl<'a> Library {
|
||||||
.filter(|image| {
|
.filter(|image| {
|
||||||
image.title.to_lowercase().contains(&query)
|
image.title.to_lowercase().contains(&query)
|
||||||
})
|
})
|
||||||
.map(|image| ServiceItemKind::Image(image))
|
.map(ServiceItemKind::Image)
|
||||||
.collect();
|
.collect();
|
||||||
let presentations: Vec<ServiceItemKind> = self
|
let presentations: Vec<ServiceItemKind> = self
|
||||||
.presentation_library
|
.presentation_library
|
||||||
|
|
@ -956,7 +954,7 @@ impl<'a> Library {
|
||||||
.clone()
|
.clone()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|pres| pres.title.to_lowercase().contains(&query))
|
.filter(|pres| pres.title.to_lowercase().contains(&query))
|
||||||
.map(|pres| ServiceItemKind::Presentation(pres))
|
.map(ServiceItemKind::Presentation)
|
||||||
.collect();
|
.collect();
|
||||||
items.extend(videos);
|
items.extend(videos);
|
||||||
items.extend(images);
|
items.extend(images);
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,15 @@ use std::{io, path::PathBuf};
|
||||||
|
|
||||||
use crate::core::presentations::Presentation;
|
use crate::core::presentations::Presentation;
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
dialog::file_chooser::{open::Dialog, FileFilter},
|
Element, Task,
|
||||||
iced::{alignment::Vertical, ContentFit, Length},
|
dialog::file_chooser::{FileFilter, open::Dialog},
|
||||||
|
iced::{ContentFit, Length, alignment::Vertical},
|
||||||
iced_widget::{column, row},
|
iced_widget::{column, row},
|
||||||
theme,
|
theme,
|
||||||
widget::{
|
widget::{
|
||||||
self, button, container, horizontal_space, icon,
|
self, Space, button, container, horizontal_space, icon,
|
||||||
image::Handle, text, text_input, Space,
|
image::Handle, text, text_input,
|
||||||
},
|
},
|
||||||
Element, Task,
|
|
||||||
};
|
};
|
||||||
use miette::IntoDiagnostic;
|
use miette::IntoDiagnostic;
|
||||||
use mupdf::{Colorspace, Document, Matrix};
|
use mupdf::{Colorspace, Document, Matrix};
|
||||||
|
|
|
||||||
|
|
@ -7,32 +7,32 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
|
Task,
|
||||||
iced::{
|
iced::{
|
||||||
font::{Family, Stretch, Style, Weight},
|
|
||||||
Background, Border, Color, ContentFit, Font, Length, Shadow,
|
Background, Border, Color, ContentFit, Font, Length, Shadow,
|
||||||
Vector,
|
Vector,
|
||||||
|
font::{Family, Stretch, Style, Weight},
|
||||||
},
|
},
|
||||||
iced_widget::{
|
iced_widget::{
|
||||||
scrollable::{
|
scrollable::{
|
||||||
scroll_to, AbsoluteOffset, Direction, Scrollbar,
|
AbsoluteOffset, Direction, Scrollbar, scroll_to,
|
||||||
},
|
},
|
||||||
stack, vertical_rule,
|
stack, vertical_rule,
|
||||||
},
|
},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
widget::{
|
widget::{
|
||||||
container, image, mouse_area, responsive, scrollable, text,
|
Container, Id, Row, Space, container, image, mouse_area,
|
||||||
Container, Id, Row, Space,
|
responsive, scrollable, text,
|
||||||
},
|
},
|
||||||
Task,
|
|
||||||
};
|
};
|
||||||
use iced_video_player::{gst_pbutils, Position, Video, VideoPlayer};
|
use iced_video_player::{Position, Video, VideoPlayer, gst_pbutils};
|
||||||
use rodio::{Decoder, OutputStream, OutputStreamBuilder, Sink};
|
use rodio::{Decoder, OutputStream, OutputStreamBuilder, Sink};
|
||||||
use tracing::{debug, error, info, warn};
|
use tracing::{debug, error, info, warn};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
core::{service_items::ServiceItem, slide::Slide},
|
|
||||||
BackgroundKind,
|
BackgroundKind,
|
||||||
|
core::{service_items::ServiceItem, slide::Slide},
|
||||||
};
|
};
|
||||||
|
|
||||||
const REFERENCE_WIDTH: f32 = 1920.0;
|
const REFERENCE_WIDTH: f32 = 1920.0;
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,16 @@ use cosmic::iced::Size;
|
||||||
|
|
||||||
use cosmic::iced_core::widget::tree;
|
use cosmic::iced_core::widget::tree;
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
|
Element,
|
||||||
iced::{
|
iced::{
|
||||||
|
Event, Length, Point, Rectangle, Vector,
|
||||||
clipboard::dnd::{DndEvent, SourceEvent},
|
clipboard::dnd::{DndEvent, SourceEvent},
|
||||||
event, mouse, Event, Length, Point, Rectangle, Vector,
|
event, mouse,
|
||||||
},
|
},
|
||||||
iced_core::{
|
iced_core::{
|
||||||
self, layout, renderer, widget::Tree, Clipboard, Shell,
|
self, Clipboard, Shell, layout, renderer, widget::Tree,
|
||||||
},
|
},
|
||||||
widget::Widget,
|
widget::Widget,
|
||||||
Element,
|
|
||||||
};
|
};
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
use std::{io, path::PathBuf};
|
use std::{io, path::PathBuf};
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
|
Renderer,
|
||||||
iced::{Color, Font, Length, Size},
|
iced::{Color, Font, Length, Size},
|
||||||
widget::{
|
widget::{
|
||||||
self,
|
self,
|
||||||
canvas::{self, Program, Stroke},
|
canvas::{self, Program, Stroke},
|
||||||
container,
|
container,
|
||||||
},
|
},
|
||||||
Renderer,
|
|
||||||
};
|
};
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
use std::{io, path::PathBuf, sync::Arc};
|
use std::{io, path::PathBuf, sync::Arc};
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
dialog::file_chooser::{open::Dialog, FileFilter},
|
Element, Task,
|
||||||
iced::{alignment::Vertical, Length},
|
dialog::file_chooser::{FileFilter, open::Dialog},
|
||||||
|
iced::{Length, alignment::Vertical},
|
||||||
iced_wgpu::graphics::text::cosmic_text::fontdb,
|
iced_wgpu::graphics::text::cosmic_text::fontdb,
|
||||||
iced_widget::{column, row},
|
iced_widget::{column, row},
|
||||||
theme,
|
theme,
|
||||||
|
|
@ -10,7 +11,6 @@ use cosmic::{
|
||||||
button, combo_box, container, horizontal_space, icon,
|
button, combo_box, container, horizontal_space, icon,
|
||||||
progress_bar, scrollable, text, text_editor, text_input,
|
progress_bar, scrollable, text, text_editor, text_input,
|
||||||
},
|
},
|
||||||
Element, Task,
|
|
||||||
};
|
};
|
||||||
use dirs::font_dir;
|
use dirs::font_dir;
|
||||||
use iced_video_player::Video;
|
use iced_video_player::Video;
|
||||||
|
|
@ -18,11 +18,11 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||||
use tracing::{debug, error};
|
use tracing::{debug, error};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
Background, BackgroundKind,
|
||||||
core::{service_items::ServiceTrait, slide::Slide, songs::Song},
|
core::{service_items::ServiceTrait, slide::Slide, songs::Song},
|
||||||
ui::{
|
ui::{
|
||||||
presenter::slide_view, slide_editor::SlideEditor, text_svg,
|
presenter::slide_view, slide_editor::SlideEditor, text_svg,
|
||||||
},
|
},
|
||||||
Background, BackgroundKind,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,16 @@ use std::{
|
||||||
use colors_transform::Rgb;
|
use colors_transform::Rgb;
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
iced::{
|
iced::{
|
||||||
font::{Style, Weight},
|
|
||||||
ContentFit, Length, Size,
|
ContentFit, Length, Size,
|
||||||
|
font::{Style, Weight},
|
||||||
},
|
},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
widget::{image::Handle, Image},
|
widget::{Image, image::Handle},
|
||||||
};
|
};
|
||||||
use rapidhash::v3::rapidhash_v3;
|
use rapidhash::v3::rapidhash_v3;
|
||||||
use resvg::{
|
use resvg::{
|
||||||
tiny_skia::{self, Pixmap},
|
tiny_skia::{self, Pixmap},
|
||||||
usvg::{fontdb, Tree},
|
usvg::{Tree, fontdb},
|
||||||
};
|
};
|
||||||
use tracing::{debug, error};
|
use tracing::{debug, error};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
use std::{io, path::PathBuf};
|
use std::{io, path::PathBuf};
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
dialog::file_chooser::{open::Dialog, FileFilter},
|
Element, Task,
|
||||||
iced::{alignment::Vertical, Length},
|
dialog::file_chooser::{FileFilter, open::Dialog},
|
||||||
|
iced::{Length, alignment::Vertical},
|
||||||
iced_widget::{column, row},
|
iced_widget::{column, row},
|
||||||
theme,
|
theme,
|
||||||
widget::{
|
widget::{
|
||||||
button, container, horizontal_space, icon, progress_bar,
|
Space, button, container, horizontal_space, icon,
|
||||||
text, text_input, Space,
|
progress_bar, text, text_input,
|
||||||
},
|
},
|
||||||
Element, Task,
|
|
||||||
};
|
};
|
||||||
use iced_video_player::{Video, VideoPlayer};
|
use iced_video_player::{Video, VideoPlayer};
|
||||||
use tracing::{debug, error, warn};
|
use tracing::{debug, error, warn};
|
||||||
|
|
|
||||||
|
|
@ -22,18 +22,17 @@
|
||||||
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
use cosmic::Theme;
|
||||||
use cosmic::iced::advanced::layout::{self, Layout};
|
use cosmic::iced::advanced::layout::{self, Layout};
|
||||||
use cosmic::iced::advanced::widget::{tree, Operation, Tree, Widget};
|
use cosmic::iced::advanced::widget::{Operation, Tree, Widget, tree};
|
||||||
use cosmic::iced::advanced::{overlay, renderer, Clipboard, Shell};
|
use cosmic::iced::advanced::{Clipboard, Shell, overlay, renderer};
|
||||||
use cosmic::iced::alignment::{self, Alignment};
|
use cosmic::iced::alignment::{self, Alignment};
|
||||||
use cosmic::iced::event::{self, Event};
|
use cosmic::iced::event::{self, Event};
|
||||||
use cosmic::iced::{self, mouse, Transformation};
|
use cosmic::iced::{self, Transformation, mouse};
|
||||||
use cosmic::iced::{
|
use cosmic::iced::{
|
||||||
Background, Border, Color, Element, Length, Padding, Pixels,
|
Background, Border, Color, Element, Length, Padding, Pixels,
|
||||||
Point, Rectangle, Size, Vector,
|
Point, Rectangle, Size, Vector,
|
||||||
};
|
};
|
||||||
use cosmic::Theme;
|
|
||||||
use tracing::debug;
|
|
||||||
|
|
||||||
use super::{Action, DragEvent, DropPosition};
|
use super::{Action, DragEvent, DropPosition};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,11 @@
|
||||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
use cosmic::iced::advanced::layout::{self, Layout};
|
use cosmic::iced::advanced::layout::{self, Layout};
|
||||||
use cosmic::iced::advanced::widget::{tree, Operation, Tree, Widget};
|
use cosmic::iced::advanced::widget::{Operation, Tree, Widget, tree};
|
||||||
use cosmic::iced::advanced::{overlay, renderer, Clipboard, Shell};
|
use cosmic::iced::advanced::{Clipboard, Shell, overlay, renderer};
|
||||||
use cosmic::iced::alignment::{self, Alignment};
|
use cosmic::iced::alignment::{self, Alignment};
|
||||||
use cosmic::iced::event::{self, Event};
|
use cosmic::iced::event::{self, Event};
|
||||||
use cosmic::iced::{self, mouse, Transformation};
|
use cosmic::iced::{self, Transformation, mouse};
|
||||||
use cosmic::iced::{
|
use cosmic::iced::{
|
||||||
Background, Border, Color, Element, Length, Padding, Pixels,
|
Background, Border, Color, Element, Length, Padding, Pixels,
|
||||||
Point, Rectangle, Size, Theme, Vector,
|
Point, Rectangle, Size, Theme, Vector,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue