Make functions needed for queue public and add trash icon dependency
This commit is contained in:
parent
604e2c9c7f
commit
b8d2fca0ee
@ -24,6 +24,7 @@ leptos_icons = { version = "0.1.0", default_features = false, features = [
|
||||
"BsSkipStartFill",
|
||||
"BsSkipEndFill",
|
||||
"RiPlayListMediaFill",
|
||||
"BsTrashFill",
|
||||
] }
|
||||
dotenv = { version = "0.15.0", optional = true }
|
||||
diesel = { version = "2.1.4", features = ["postgres", "r2d2"], optional = true }
|
||||
|
@ -36,7 +36,7 @@ const ARROW_KEY_SKIP_TIME: f64 = 5.0;
|
||||
/// * `None` if the audio element is not available
|
||||
/// * `Some((current_time, duration))` if the audio element is available
|
||||
///
|
||||
fn get_song_time_duration(status: impl SignalWithUntracked<Value = PlayStatus>) -> Option<(f64, f64)> {
|
||||
pub fn get_song_time_duration(status: impl SignalWithUntracked<Value = PlayStatus>) -> Option<(f64, f64)> {
|
||||
status.with_untracked(|status| {
|
||||
if let Some(audio) = status.get_audio() {
|
||||
Some((audio.current_time(), audio.duration()))
|
||||
@ -57,7 +57,7 @@ fn get_song_time_duration(status: impl SignalWithUntracked<Value = PlayStatus>)
|
||||
/// * `status` - The `PlayStatus` to get the audio element from, as a signal
|
||||
/// * `time` - The time to skip to, in seconds
|
||||
///
|
||||
fn skip_to(status: impl SignalUpdate<Value = PlayStatus>, time: f64) {
|
||||
pub fn skip_to(status: impl SignalUpdate<Value = PlayStatus>, time: f64) {
|
||||
if time.is_infinite() || time.is_nan() {
|
||||
error!("Unable to skip to non-finite time: {}", time);
|
||||
return
|
||||
@ -81,7 +81,7 @@ fn skip_to(status: impl SignalUpdate<Value = PlayStatus>, time: f64) {
|
||||
/// * `status` - The `PlayStatus` to get the audio element from, as a signal
|
||||
/// * `play` - `true` to play the song, `false` to pause it
|
||||
///
|
||||
fn set_playing(status: impl SignalUpdate<Value = PlayStatus>, play: bool) {
|
||||
pub fn set_playing(status: impl SignalUpdate<Value = PlayStatus>, play: bool) {
|
||||
status.update(|status| {
|
||||
if let Some(audio) = status.get_audio() {
|
||||
if play {
|
||||
|
Loading…
x
Reference in New Issue
Block a user