parent
b9a9dda233
commit
28a18819cf
4 changed files with 306 additions and 286 deletions
563
Cargo.lock
generated
563
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -20,10 +20,10 @@ strum = "0.26.3"
|
||||||
strum_macros = "0.26.4"
|
strum_macros = "0.26.4"
|
||||||
ron = "0.8.1"
|
ron = "0.8.1"
|
||||||
sqlx = { version = "0.8.2", features = ["sqlite", "runtime-tokio"] }
|
sqlx = { version = "0.8.2", features = ["sqlite", "runtime-tokio"] }
|
||||||
dirs = "5.0.1"
|
dirs = "6.0.0"
|
||||||
tokio = "1.41.1"
|
tokio = "1.41.1"
|
||||||
crisp = { git = "https://git.tfcconnection.org/chris/crisp", version = "0.1.3" }
|
crisp = { git = "https://git.tfcconnection.org/chris/crisp", version = "0.1.3" }
|
||||||
rodio = { version = "0.20.1", features = ["symphonia-all", "tracing"] }
|
rodio = { version = "0.21.1", features = ["symphonia-all", "tracing"] }
|
||||||
gstreamer = "0.23"
|
gstreamer = "0.23"
|
||||||
gstreamer-app = "0.23"
|
gstreamer-app = "0.23"
|
||||||
# gstreamer-video = "0.23"
|
# gstreamer-video = "0.23"
|
||||||
|
|
|
@ -15,13 +15,13 @@ use cosmic::iced_widget::{column, row, stack};
|
||||||
use cosmic::theme;
|
use cosmic::theme;
|
||||||
use cosmic::widget::dnd_destination::dnd_destination;
|
use cosmic::widget::dnd_destination::dnd_destination;
|
||||||
use cosmic::widget::nav_bar::nav_bar_style;
|
use cosmic::widget::nav_bar::nav_bar_style;
|
||||||
use cosmic::widget::text;
|
|
||||||
use cosmic::widget::tooltip::Position as TPosition;
|
use cosmic::widget::tooltip::Position as TPosition;
|
||||||
use cosmic::widget::Container;
|
use cosmic::widget::Container;
|
||||||
use cosmic::widget::{
|
use cosmic::widget::{
|
||||||
button, horizontal_space, mouse_area, nav_bar, search_input,
|
button, horizontal_space, mouse_area, nav_bar, search_input,
|
||||||
tooltip, vertical_space, Space,
|
tooltip, vertical_space, Space,
|
||||||
};
|
};
|
||||||
|
use cosmic::widget::{container, text};
|
||||||
use cosmic::widget::{icon, slider};
|
use cosmic::widget::{icon, slider};
|
||||||
use cosmic::{executor, Application, ApplicationExt, Element};
|
use cosmic::{executor, Application, ApplicationExt, Element};
|
||||||
use crisp::types::Value;
|
use crisp::types::Value;
|
||||||
|
@ -1115,7 +1115,9 @@ impl cosmic::Application for App {
|
||||||
];
|
];
|
||||||
|
|
||||||
if let Some(_editor) = &self.editor_mode {
|
if let Some(_editor) = &self.editor_mode {
|
||||||
Element::from(song_editor)
|
container(song_editor)
|
||||||
|
.padding(cosmic::theme::spacing().space_xxl)
|
||||||
|
.into()
|
||||||
} else {
|
} else {
|
||||||
Element::from(column)
|
Element::from(column)
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ use cosmic::{
|
||||||
Task,
|
Task,
|
||||||
};
|
};
|
||||||
use iced_video_player::{gst_pbutils, Position, Video, VideoPlayer};
|
use iced_video_player::{gst_pbutils, Position, Video, VideoPlayer};
|
||||||
use rodio::{Decoder, OutputStream, 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;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ pub(crate) struct Presenter {
|
||||||
pub video: Option<Video>,
|
pub video: Option<Video>,
|
||||||
pub video_position: f32,
|
pub video_position: f32,
|
||||||
pub audio: Option<PathBuf>,
|
pub audio: Option<PathBuf>,
|
||||||
sink: (OutputStream, Arc<Sink>),
|
sink: (Arc<Sink>, OutputStream),
|
||||||
hovered_slide: Option<(usize, usize)>,
|
hovered_slide: Option<(usize, usize)>,
|
||||||
scroll_id: Id,
|
scroll_id: Id,
|
||||||
current_font: Font,
|
current_font: Font,
|
||||||
|
@ -159,11 +159,14 @@ impl Presenter {
|
||||||
video_position: 0.0,
|
video_position: 0.0,
|
||||||
hovered_slide: None,
|
hovered_slide: None,
|
||||||
sink: {
|
sink: {
|
||||||
let (stream, stream_handle) =
|
let stream_handle =
|
||||||
OutputStream::try_default().unwrap();
|
OutputStreamBuilder::open_default_stream()
|
||||||
|
.expect("Can't open default rodio stream");
|
||||||
(
|
(
|
||||||
stream,
|
Arc::new(Sink::connect_new(
|
||||||
Arc::new(Sink::try_new(&stream_handle).unwrap()),
|
&stream_handle.mixer(),
|
||||||
|
)),
|
||||||
|
stream_handle,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
scroll_id: Id::unique(),
|
scroll_id: Id::unique(),
|
||||||
|
@ -385,7 +388,7 @@ impl Presenter {
|
||||||
return Action::Task(self.start_audio());
|
return Action::Task(self.start_audio());
|
||||||
}
|
}
|
||||||
Message::EndAudio => {
|
Message::EndAudio => {
|
||||||
self.sink.1.stop();
|
self.sink.0.stop();
|
||||||
}
|
}
|
||||||
Message::None => debug!("Presenter Message::None"),
|
Message::None => debug!("Presenter Message::None"),
|
||||||
Message::Error(error) => {
|
Message::Error(error) => {
|
||||||
|
@ -660,7 +663,7 @@ impl Presenter {
|
||||||
debug!(?audio, "This is where audio should be changing");
|
debug!(?audio, "This is where audio should be changing");
|
||||||
let audio = audio.clone();
|
let audio = audio.clone();
|
||||||
Task::perform(
|
Task::perform(
|
||||||
start_audio(Arc::clone(&self.sink.1), audio),
|
start_audio(Arc::clone(&self.sink.0), audio),
|
||||||
|()| Message::None,
|
|()| Message::None,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue