From 2714d5f6f9bd9ea49ad96a13f9af7ef84cfc690b Mon Sep 17 00:00:00 2001 From: finsofblueimnotyou <93227270+finsofblueimnotyou@users.noreply.github.com> Date: Tue, 25 Feb 2025 03:34:55 -0500 Subject: [PATCH] Implement basic volume scrolling interaction --- .gitattributes | 5 +++++ README.md | 4 ++-- dmp-core/.gitignore | 34 +++++++++++++++++----------------- src/App.tsx | 12 +++++++++++- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/.gitattributes b/.gitattributes index 176a458..a80dc23 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,6 @@ * text=auto +* text eol=lf + +*.png binary +*.ico binary +*.icns binary \ No newline at end of file diff --git a/README.md b/README.md index 8bb5bfa..710ad46 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Dango Music Player +# Dango Music Player +![Dango Music Player logo](https://github.com/Dangoware/dango-music-player/blob/main/src-tauri/icons/128x128.png?raw=true) -![Dango Music Player logo](https://github.com/Dangoware/dango-music-player/blob/main/src-tauri/icons/icon.png) ### Dango Music Player is an easy to use Music Player for all users to enjoy their music! ## Features diff --git a/dmp-core/.gitignore b/dmp-core/.gitignore index 0714bdf..16f2974 100644 --- a/dmp-core/.gitignore +++ b/dmp-core/.gitignore @@ -1,18 +1,18 @@ -# Rust binary output dir -target/ -test-config/ -# Rust configuration -Cargo.lock -.cargo/ - -# Database files -*.db3* -music_database* - -# Storage formats -*.kate-swp* -*.m3u -*.m3u8 -*.json -*.zip +# Rust binary output dir +target/ +test-config/ +# Rust configuration +Cargo.lock +.cargo/ + +# Database files +*.db3* +music_database* + +# Storage formats +*.kate-swp* +*.m3u +*.m3u8 +*.json +*.zip *.xml \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 86ad12b..7c6581d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -309,6 +309,16 @@ function PlayBar({ playing, setPlaying }: PlayBarProps) { invoke('seek', { time: Math.round(val * 1000) }).then() }; + + const wheelVolume = (event: React.WheelEvent) => { + let x = volumeSlider.value; + if (event.deltaY < 0) { + volumeSlider.value++; + } else { + volumeSlider.value--; + } + invoke('set_volume', { volume: volumeSlider.value }).then(() => {}) + }; return (
@@ -328,7 +338,7 @@ function PlayBar({ playing, setPlaying }: PlayBarProps) {
- { + { invoke('set_volume', { volume: volume.target.value }).then(() => {}) }} />