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
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« previous next »
  • Print
Pages: [1]

Author Topic: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button  (Read 6146 times)

Offline NukesGoBoom

  • Member
  • *
  • Posts: 6
Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« on: February 23, 2011, 08:59:15 PM »
I have rockbox installed on my sansa clip+ and was wondering if it was possible to have the current track repeat forever, but if I press the next track button manually, if Rockbox will then move to the next track? Basically I am looking for a repeat mode that will repeat the track only if it naturally finishes with no interaction from the user, but also allow the player to progress to the next track if the next track button is pressed.

Rockbox will refuse to go to the next track if Repeat One is the repeat mode, I think this might be a bug. When I press the next track button, Rockbox will simply play the current track over again, not the desired operation.

Currently, I have to switch between Repeat One mode and Repeat All mode to get this functionality and it is quite annoying to switch between the two different modes so frequently. Even the Original Firmware will allow this repeat mode to work - the Repeat Track mode on the original firmware allows the song to repeat forever but still allow the user to press the next track button and go to the next track.

 Is there anyway to get the repeating fucntionality but still allow manual track progression with the next track button at the same time in Rockbox on the Sansa Clip+?
Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #1 on: February 24, 2011, 11:10:02 AM »
If you have "follow playlist" turned on then pressing Select should take you to the folder containing the currently playing track if you are using the file browser.  If you used the database to start playback then it should return you to the database screen that you used to initiate playback.  Then you can easily select the next track (or any of the others from the same directory).  So, pressing Select > Submenu (Down) > Select should result in the action you want.*

*: Actually, I have found this is only true on my v1 Clip when using the file browser.  When I use the database, pressing Select returns me to the screen that I used to initiate playback but does not highlight the currently playing track.  When using the file browser it returns me to the right directory with the currently playing track highlighted.

==========
Of course, this provides a workaround to get the same end result you're after.  I don't have any strong opposition to the change that you actually want, since under the current state of things (with Repeat One turned on) FF and REW perform exactly the same function.  Meanwhile with the behavior that you want REW would return you to the start of the currently playing/repeating track and FF would advance you to the next track for repeated playback. 

As with many things probably the best way to make this happen is to implement this change for yourself and submit a patch for it.  Or, maybe someone will agree that this is a useful feature and decide to implement it for you.
« Last Edit: February 24, 2011, 11:32:48 AM by Chronon »
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #2 on: February 24, 2011, 01:16:45 PM »
The current repeat one behaviour is not a bug as such, as it is intended.  However it is wrong IMO - repeat one should not disable manual track skipping, it should just keep repeating the same track until the user changes it.

I suspect that if someone were to produce a patch to change this that it'd have a reasonable chance of being accepted (following a bit of an argument of course :)).
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

Offline NukesGoBoom

  • Member
  • *
  • Posts: 6
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #3 on: February 25, 2011, 08:19:57 PM »
Gentlemen. I know nothing of computer coding. This is why I am appealing to your powerful abilities. I HAVE to use rockbox - the equalizer on rockbox is so much better than the original equalizer from the original firmware. And I also get gapless playback, another missing feature from the original firmware.

But the one thing the original firmware had that I wish rock box did, was the ability to manually progress through tracks while still having the repeat track option turned on. Every mp3 player I've ever owned has had this exact ability - repeating the current track and still allowing me to manually progress to the next track with the next track button. Rockbox is the first firmware I've encountered that takes this function away.

It sounds like the best thing for me to do is take up Chronon's suggestion by asking someone with more intelligence and experience in coding to create a patch for me that would implement this change I was asking for.

Should I make my request in the 'Starting Development and Compiling' forum or the 'Feature Ideas' forum? Which would be appropriate. What do you think :)
Logged

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #4 on: February 26, 2011, 05:18:58 AM »
Starting development is where you ask for help on doing things yourself; so not there.

Feature ideas is the best fit, but it is for ideas and not for requests; i.e. to get feedback on your idea.  Then you hope someone sees it and decides to have a go at it.

What might be an idea is to post to the development mailing list to check that other devs agree that you should be able to skip tracks - no point in implementing it if it won't be accepted.
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

Offline NukesGoBoom

  • Member
  • *
  • Posts: 6
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #5 on: February 26, 2011, 08:50:25 AM »
I tried to find the link to post to the mailing list but could not find it, where should I go to be able to post to this mailing list so that the developers can consider my idea?

For the time being I will post in the feature ideas forum and hope that someone else agrees with me and decides to have a go at it. Hopefully it should be a relatively simple change and not cause that much difficulty to code, but then again I have no experience in such matter.

Thanks for your help so far and I will go over there and post it right now.
Logged

Offline yapper

  • Rockbox Expert
  • Member
  • *
  • Posts: 794
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #6 on: February 26, 2011, 11:11:18 AM »
http://www.rockbox.org/mail/
Logged
G2 iPod 20GB / Sansa c240 v1 + 2GB microSD / Sansa c250 v1 / Sansa e250 v1 + 8GB microSDHC / Sansa Fuze v2 + 32GB microSDHC

Offline adw

  • Member
  • *
  • Posts: 9
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #7 on: October 26, 2012, 11:42:38 AM »
I'm trying to find out how to implement this. I have traced the processing of ACTION_WPS_SKIPNEXT across several files to "apps/playback.c" where I see
Code: [Select]
/* Skip the specified number of tracks forward or backward from the current */
void audio_skip(int offset)
{
     /* If offset has to be backed-out to stay in range, no skip is done */
    int accum = skip_offset + offset;

    while (offset != 0 && !playlist_check(accum))
    {
        offset += offset < 0 ? 1 : -1;
        accum = skip_offset + offset;
    }

    if (offset != 0)
    {
        ...
    }
    else
    {
        /* No more tracks */
    }

This makes me think that, when global_settings.repeat_mode = REPEAT_ONE, the playlist contains only the one track to be repeated?

If so, it would be difficult to skip to the next track as it is not in the playlist.

Am I on the right track? Can anyone give me a hint?
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #8 on: October 26, 2012, 12:51:13 PM »
In repeat mode only one track is in the playlist and hence buffered. Buffering other tracks that weren't going to be played would waste power.

You probably need to find the next track and insert it into a new playlist.
Logged

Offline adw

  • Member
  • *
  • Posts: 9
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #9 on: October 26, 2012, 03:19:57 PM »
Saratoga, thanks for clarifying.

Instead of finding the next track and replacing the old track by the new track in the single-item playlist, would it be an option to

Code: [Select]
if (global_settings.repeat_mode == REPEAT_ONE) {
    global_settings.repeat_mode = REPEAT_OFF;
    [skip track];
    global_settings.repeat_mode = REPEAT_ONE;
}

or am I missing something?
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #10 on: October 26, 2012, 05:29:21 PM »
Quote from: adw on October 26, 2012, 03:19:57 PM
Instead of finding the next track and replacing the old track by the new track in the single-item playlist, would it be an option to

I have no idea.
Logged

Offline adw

  • Member
  • *
  • Posts: 9
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #11 on: October 29, 2012, 09:29:28 AM »
I have tried it out, didn't work, same behavior as before. I have even stolen "settings_save" and "audio_flush_and_reload_tracks" from another file where "global_settings.repeat_mode" was changed, but that didn't help either. Obviously I'm lacking basics of playlist control.

apps/playback.c:
Code: [Select]
/* Skip one track forward from the current */
void audio_next(void)
{
    if (global_settings.repeat_mode == REPEAT_ONE) {
        /* repeat current track but allow skip to next track button */
        global_settings.repeat_mode = REPEAT_OFF;
        settings_save();
        if (audio_status() & AUDIO_STATUS_PLAY) audio_flush_and_reload_tracks();           
        audio_skip(1);
        global_settings.repeat_mode = REPEAT_ONE;
        settings_save();
        if (audio_status() & AUDIO_STATUS_PLAY) audio_flush_and_reload_tracks();           
    } else {
        audio_skip(1);
    }
}

/* Skip one track backward from the current */
void audio_prev(void)
{
    if (global_settings.repeat_mode == REPEAT_ONE) {
        /* repeat current track but allow skip to next track button */
        global_settings.repeat_mode = REPEAT_OFF;
        settings_save();
        if (audio_status() & AUDIO_STATUS_PLAY) audio_flush_and_reload_tracks();           
        audio_skip(-1);
        global_settings.repeat_mode = REPEAT_ONE;
        settings_save();
        if (audio_status() & AUDIO_STATUS_PLAY) audio_flush_and_reload_tracks();           
    } else {
        audio_skip(-1);
    }
}

Probably "audio_flush_and_reload_tracks" is not the correct function to re-build the playlist, required to skip to the next track. Any clue?


Post Merge: October 29, 2012, 02:21:58 PM
Sorry, "same behavior as before" wasn't correct. For a fraction of a second I can see the next title on the display, so I assume the skipping is correct, but then I fall back into the old single-track playlist.
« Last Edit: October 29, 2012, 02:21:58 PM by adw »
Logged

Offline adw

  • Member
  • *
  • Posts: 9
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #12 on: November 03, 2012, 06:49:33 AM »
I'm lost. Does anyone have a hint for me? Thanks!
Logged

Offline Looted

  • Member
  • *
  • Posts: 1
Re: Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
« Reply #13 on: June 03, 2013, 01:48:31 PM »
I'm also in dire need of that function, did anyone have any success implementing it?
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Sansa Clip+ can Rockbox repeat current track but allow skip to next track button
 

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

Page created in 0.114 seconds with 16 queries.