Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  need help with a new feature: checking if next song on playlist is next on album
« previous next »
  • Print
Pages: [1]

Author Topic: need help with a new feature: checking if next song on playlist is next on album  (Read 1969 times)

Offline Falco98

  • Member
  • *
  • Posts: 153
need help with a new feature: checking if next song on playlist is next on album
« on: May 11, 2008, 01:01:02 AM »
For a while I've wanted to write one additional option for "crossfade enable", which I think i would call "album mode".  Simply put, it would enable crossfade in all circumstances except when the next song on the playlist is the next song from the same album / cd / etc. as the current song.
Problem is, I'm not sure how to write the function.  I've written another option for crossfade mode before (i made "shuffle + track skip"), but this one requires a little more coding run-around.  Adding the option itself should be simple, but I need someone to advise me in writing a function that basically checks whether the next track is really "next".

I've asked in IRC before, and people make the suggestion that the function simply check that (album_name) is the same, and (tracknumber_next) == (tracknumber_current + 1).  This seems pretty solid to me (it should work in nearly all cases where users are using properly tagged songs), but I'm just not sure how to do that specific code.  Any pointers, advice, or discussion would be appreciated!
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: need help with a new feature: checking if next song on playlist is next on a
« Reply #1 on: May 11, 2008, 01:29:35 AM »
Matching album_name is not necessarily going to be consistent. There are many albums out there simply called "Greatest Hits." While it'd be an uncommon situation, you'd also want to check other factors. For example, compare the artist string too, and make sure "matching because the tags are missing" actually counts as not matching.

Honestly though, how do you justify a feature that is "always crossfade except in the exceedingly rare chance that two songs from the same album show up in shuffle next to each other in order" in terms of added code complexity, especially considering the additional checks that would need to be made? Crossfade's already been a problematic portion of the code.
« Last Edit: May 11, 2008, 01:32:49 AM by Llorean »
Logged

Offline Falco98

  • Member
  • *
  • Posts: 153
Re: need help with a new feature: checking if next song on playlist is next on a
« Reply #2 on: May 11, 2008, 02:04:08 AM »
checking for artist would be pertinent, too, for the reasons you said.  I had considered that, but had left it out either because I forgot or to be brief.  The checks it does could be tweaked a bit to get the best of all cases, after the core functionality is established.

Regarding the justification for this feature: I have a tendency to listen to big randomized playlists, either a large playlist created then set to shuffle mode, or not in shuffle mode but created using the "insert shuffled" feature (or simply doing a "shuffle list" after constructing a playlist).  When listening in this vein, I want every track transition to be crossfaded -- but occasionally I feel like interjecting a whole album into my playlist.  At the moment, the only way to have such an insertion played without crossfading would be to manually go in and disable crossfade, and remember to reenable it when the album ends.  Perhaps one could simply turn "shuffle mode" off, but what effect would that have on an otherwise-random playlist?  (perhaps I should try, i guess).
Also occasionally while listening in shuffle, one song will start which I know transitions smoothely into another, and I'll manually insert that song after the current one.  It's kindof a corner case, but another example nonetheless.

This is one that perhaps would be just obscure enough that I'd keep it as a patch for personal use -- though as I see it, it would really add no complexity to code, nor to the crossfade routine itself (it would simply do a binary check based on the aforementioned criteria, and if it matches, disable crossfade for the current transition).  In any case, It would be useful to me and it would at least be neat to see if I could get it working, and if I did it well enough it may even be considered for addition to the project.  For now I'm just trying to satisfy my curiosity as to what I need to do the checking, just code-wise.
Logged

Offline Rincewind

  • Member
  • *
  • Posts: 266
Re: need help with a new feature: checking if next song on playlist is next on a
« Reply #3 on: May 13, 2008, 11:57:25 AM »
Quote from: Llorean on May 11, 2008, 01:29:35 AM
Honestly though, how do you justify a feature that is "always crossfade except in the exceedingly rare chance that two songs from the same album show up in shuffle next to each other in order" in terms of added code complexity, especially considering the additional checks that would need to be made? Crossfade's already been a problematic portion of the code.

I don't think that this feature only has it's use in shuffle mode, I think it is useful when you listen to whole albums most of the time but sometimes you queue extra songs or manipulate the playlist in other ways. With the feature the OP wants to implement I would turn this on and have always the behavior I want - no crossfade for albums, where the composer (hopefully) made a nice transition. In other situations I like crossfade very much.
I think this option would have the same justification as "crossfade only on manual track change" - it is nice to have. And this can be said about a lot of things in rockbox, which is ok, imho.

Falco98: please put your work on the tracker when it is (partially) usable, I am very interested!
Logged
Iriver H120, Sansa e280

Offline yapper

  • Rockbox Expert
  • Member
  • *
  • Posts: 794
Re: need help with a new feature: checking if next song on playlist is next on album
« Reply #4 on: May 13, 2008, 12:20:11 PM »
I'm another one in favor of this idea. I love crossfade, so any improvement in its behaviour are appreciated.
Logged
G2 iPod 20GB / Sansa c240 v1 + 2GB microSD / Sansa c250 v1 / Sansa e250 v1 + 8GB microSDHC / Sansa Fuze v2 + 32GB microSDHC

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  need help with a new feature: checking if next song on playlist is next on album
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.129 seconds with 22 queries.