Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Gapless Playback with Gapless-5 #41

Merged
merged 62 commits into from
Nov 22, 2024
Merged

Conversation

johnnyshankman
Copy link
Owner

@johnnyshankman johnnyshankman commented Nov 12, 2024

This PR

Implements gapless playback when the next song autoplays. Also improves a slew of minor user experiences.

New Libraries

https://github.com/regosen/Gapless-5 library

I had to fork it to fix a minor bug that hasn't been merged into the production release yet.

regosen/Gapless-5#59

CR

  1. Moved as much of the player handling into the store as possible
  2. Fixed a minor bug with the placeholder album art being the wrong size
  3. Updated "previous" behavior to match standard music players with regards to song restarting
  4. Updates our time estimation code for importing a new library
  5. Move quiet mode to the menu to declutter the static player a bit
  6. Shuffle history contains the songs a user manually selects while shuffle is engaged
  7. Shuffle history contains the song that was playing when user engaged shuffle
  8. Fixes the flash of full progress bar when importing songs or swapping libs
  9. Makes playcounts more intelligently tracked, requires 10s of the song to "play"
  10. Add volume controls to the hihat menu with accelerators for convenience aka key commands

QA Cases

  • Songs are paused when app opens
  • Song can be played after app opens by just hitting play
  • Autoplaying the next song works as expected in standard play
  • Autoplaying the next song will always have a perfect gapless transition if the next song has had enough time to preload
  • Autoplaying the next song works as expected in repeat mode, plays the same song from the start
  • Autoplaying the next song works as expected in shuffle mode, shuffles to a random song gaplessly
  • Skipping to the next song works as expected in standard play
  • Skipping to the next song will always play the song if in play mode
  • Skipping to the next song stays paused if in pause mode
  • Skipping the next song works as expected in repeat mode, plays the same song from the start
  • Skipping the next song works as expected in shuffle mode, shuffles to a random song
  • Hitting back anytime at 3 seconds or later into a song just causes it to restart from the beginning
  • Hitting back anytime before 3 seconds skips to the previous song in the visual library
  • Skipping back to the previous song in repeat mode just restarts the song
  • Skipping back to the previous song in shuffle mode goes to the last shuffled song and fallsback to just normal previous behavior if there are no more songs in the shuffle history
  • The media session in the top bar on OSX always displays the right song name, artist, and album artwork but no current position
  • Can seek as expected using the media session
  • The media session in the top bar correctly pauses and plays the song using the UX in the media session
  • The media session in the top bar correctly prev and skips the song using the UX in the media session
  • Taking out an airpod correctly pauses the currently playing song
  • Putting the airpod back in continues playback if you were in play mode before you took it out
  • Putting the airpod back in does not continue playback if you were in pause mode before you took it out
  • Can skip a song using headphones/bluetooth skipping
  • Quiet down works from the menu
  • Volume slider works as expected
  • Mute and full volume buttons work as expected
  • Max volume, mute volume and quiet work from the menu
  • Seeking through songs works as expected
  • Album art is resizable and dynamically resizes according to window size
  • Placeholder album art is also resizable and dynamically resized for the window size
  • Search works
  • When shuffling with a filter present, the filter is respected
  • Playcounts are both respected in real time, and upon reload of the app
  • When listening to Cambridge by MCS into Shiver by MCS the rhythm is perfectly maintained
  • When listening to You Can Do Better Than Me by DCFC into Grapevine Fires by DCFC the rhythm is perfectly maintained
  • When listening to The Suburbs by Arcade Fire into Ready to Start by Arcade Fire there is no audible gap and it sounds smooth

Comment on lines -43 to -46
/**
* @dev a hook for when the song is double clicked
*/
playSong: (song: string, info: StoreStructure['library'][string]) => void;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super happy to be rid of this awful pattern

@johnnyshankman
Copy link
Owner Author

johnnyshankman commented Nov 16, 2024

LFG it's working REALLY well now. will test more tomorrow etc and then release tuesday.

@johnnyshankman
Copy link
Owner Author

johnnyshankman commented Nov 18, 2024

okay successfully got it so that gapless playback works perfectly on albums that just put identical noise between the songs BUT ALSO ones that have a rhythmic element which spans the two tracks. that way you don't get bad mixes that've been track'd out on DJ releases and stuff. i put some specific examples from songs i listen to above (DCFC and MCS).

@johnnyshankman johnnyshankman merged commit 73ce834 into main Nov 22, 2024
1 check passed
@johnnyshankman johnnyshankman deleted the johnny/gapless-5 branch November 22, 2024 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant