remove continuous shuffle
This commit is contained in:
parent
dce8974445
commit
22bf1db8bd
@ -67,9 +67,4 @@ THE SOFTWARE.
|
|||||||
android:fragment="ch.blinkenlights.android.vanilla.PreferencesActivity$HeadsetLaunchFragment"
|
android:fragment="ch.blinkenlights.android.vanilla.PreferencesActivity$HeadsetLaunchFragment"
|
||||||
android:title="@string/headset_launch_title"
|
android:title="@string/headset_launch_title"
|
||||||
android:summary="@string/headset_launch_summary" />
|
android:summary="@string/headset_launch_summary" />
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="cycle_continuous_shuffling"
|
|
||||||
android:title="@string/cycle_continuous_shuffling"
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:summary="@string/cycle_continuous_shuffling_summary" />
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@ -644,7 +644,6 @@ public abstract class PlaybackActivity extends Activity
|
|||||||
if (view == mShuffleButton) {
|
if (view == mShuffleButton) {
|
||||||
menu.add(CTX_MENU_GRP_SHUFFLE, SongTimeline.SHUFFLE_NONE, 0, R.string.no_shuffle);
|
menu.add(CTX_MENU_GRP_SHUFFLE, SongTimeline.SHUFFLE_NONE, 0, R.string.no_shuffle);
|
||||||
menu.add(CTX_MENU_GRP_SHUFFLE, SongTimeline.SHUFFLE_SONGS, 0, R.string.shuffle_songs);
|
menu.add(CTX_MENU_GRP_SHUFFLE, SongTimeline.SHUFFLE_SONGS, 0, R.string.shuffle_songs);
|
||||||
menu.add(CTX_MENU_GRP_SHUFFLE, SongTimeline.SHUFFLE_CONTINUOUS, 0, R.string.shuffle_songs_continuously);
|
|
||||||
menu.add(CTX_MENU_GRP_SHUFFLE, SongTimeline.SHUFFLE_ALBUMS, 0, R.string.shuffle_albums);
|
menu.add(CTX_MENU_GRP_SHUFFLE, SongTimeline.SHUFFLE_ALBUMS, 0, R.string.shuffle_albums);
|
||||||
} else if (view == mEndButton) {
|
} else if (view == mEndButton) {
|
||||||
menu.add(CTX_MENU_GRP_FINISH, SongTimeline.FINISH_STOP, 0, R.string.no_repeat);
|
menu.add(CTX_MENU_GRP_FINISH, SongTimeline.FINISH_STOP, 0, R.string.no_repeat);
|
||||||
|
@ -315,10 +315,6 @@ public final class PlaybackService extends Service
|
|||||||
* {@link PlaybackService#createNotificationAction(SharedPreferences)}.
|
* {@link PlaybackService#createNotificationAction(SharedPreferences)}.
|
||||||
*/
|
*/
|
||||||
private PendingIntent mNotificationAction;
|
private PendingIntent mNotificationAction;
|
||||||
/**
|
|
||||||
* If true, use SongTimeline.SHUFFLE_CONTINUOUS while cycling shuffle modes
|
|
||||||
*/
|
|
||||||
private boolean mCycleContinuousShuffling;
|
|
||||||
|
|
||||||
private Looper mLooper;
|
private Looper mLooper;
|
||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
@ -464,7 +460,6 @@ public final class PlaybackService extends Service
|
|||||||
CoverCache.mCoverLoadMode = settings.getBoolean(PrefKeys.COVERLOADER_SHADOW , PrefDefaults.COVERLOADER_SHADOW) ? CoverCache.mCoverLoadMode | CoverCache.COVER_MODE_SHADOW : CoverCache.mCoverLoadMode & ~(CoverCache.COVER_MODE_SHADOW);
|
CoverCache.mCoverLoadMode = settings.getBoolean(PrefKeys.COVERLOADER_SHADOW , PrefDefaults.COVERLOADER_SHADOW) ? CoverCache.mCoverLoadMode | CoverCache.COVER_MODE_SHADOW : CoverCache.mCoverLoadMode & ~(CoverCache.COVER_MODE_SHADOW);
|
||||||
|
|
||||||
mHeadsetOnly = settings.getBoolean(PrefKeys.HEADSET_ONLY, PrefDefaults.HEADSET_ONLY);
|
mHeadsetOnly = settings.getBoolean(PrefKeys.HEADSET_ONLY, PrefDefaults.HEADSET_ONLY);
|
||||||
mCycleContinuousShuffling = settings.getBoolean(PrefKeys.CYCLE_CONTINUOUS_SHUFFLING, PrefDefaults.CYCLE_CONTINUOUS_SHUFFLING);
|
|
||||||
mStockBroadcast = settings.getBoolean(PrefKeys.STOCK_BROADCAST, PrefDefaults.STOCK_BROADCAST);
|
mStockBroadcast = settings.getBoolean(PrefKeys.STOCK_BROADCAST, PrefDefaults.STOCK_BROADCAST);
|
||||||
mNotificationAction = createNotificationAction(settings);
|
mNotificationAction = createNotificationAction(settings);
|
||||||
mHeadsetPause = getSettings(this).getBoolean(PrefKeys.HEADSET_PAUSE, PrefDefaults.HEADSET_PAUSE);
|
mHeadsetPause = getSettings(this).getBoolean(PrefKeys.HEADSET_PAUSE, PrefDefaults.HEADSET_PAUSE);
|
||||||
@ -853,9 +848,6 @@ public final class PlaybackService extends Service
|
|||||||
mHeadsetOnly = settings.getBoolean(key, PrefDefaults.HEADSET_ONLY);
|
mHeadsetOnly = settings.getBoolean(key, PrefDefaults.HEADSET_ONLY);
|
||||||
if (mHeadsetOnly && isSpeakerOn())
|
if (mHeadsetOnly && isSpeakerOn())
|
||||||
unsetFlag(FLAG_PLAYING);
|
unsetFlag(FLAG_PLAYING);
|
||||||
} else if (PrefKeys.CYCLE_CONTINUOUS_SHUFFLING.equals(key)) {
|
|
||||||
mCycleContinuousShuffling = settings.getBoolean(key, PrefDefaults.CYCLE_CONTINUOUS_SHUFFLING);
|
|
||||||
setShuffleMode(SongTimeline.SHUFFLE_NONE);
|
|
||||||
} else if (PrefKeys.STOCK_BROADCAST.equals(key)) {
|
} else if (PrefKeys.STOCK_BROADCAST.equals(key)) {
|
||||||
mStockBroadcast = settings.getBoolean(key, PrefDefaults.STOCK_BROADCAST);
|
mStockBroadcast = settings.getBoolean(key, PrefDefaults.STOCK_BROADCAST);
|
||||||
} else if (PrefKeys.ENABLE_SHAKE.equals(key) || PrefKeys.SHAKE_ACTION.equals(key)) {
|
} else if (PrefKeys.ENABLE_SHAKE.equals(key) || PrefKeys.SHAKE_ACTION.equals(key)) {
|
||||||
@ -1257,10 +1249,6 @@ public final class PlaybackService extends Service
|
|||||||
{
|
{
|
||||||
synchronized (mStateLock) {
|
synchronized (mStateLock) {
|
||||||
int mode = shuffleMode(mState) + 1;
|
int mode = shuffleMode(mState) + 1;
|
||||||
if (mCycleContinuousShuffling == true && mode == SongTimeline.SHUFFLE_SONGS)
|
|
||||||
mode++; // skip this mode, advance to continuous
|
|
||||||
if (mCycleContinuousShuffling == false && mode == SongTimeline.SHUFFLE_CONTINUOUS)
|
|
||||||
mode++; // skip this mode, advance to albums
|
|
||||||
if (mode > SongTimeline.SHUFFLE_ALBUMS)
|
if (mode > SongTimeline.SHUFFLE_ALBUMS)
|
||||||
mode = SongTimeline.SHUFFLE_NONE; // end reached: switch to none
|
mode = SongTimeline.SHUFFLE_NONE; // end reached: switch to none
|
||||||
return setShuffleMode(mode);
|
return setShuffleMode(mode);
|
||||||
|
@ -39,7 +39,6 @@ public class PrefDefaults {
|
|||||||
public static final boolean DOUBLE_TAP = false;
|
public static final boolean DOUBLE_TAP = false;
|
||||||
public static final boolean ENABLE_SHAKE = false;
|
public static final boolean ENABLE_SHAKE = false;
|
||||||
public static final boolean HEADSET_ONLY = false;
|
public static final boolean HEADSET_ONLY = false;
|
||||||
public static final boolean CYCLE_CONTINUOUS_SHUFFLING = false;
|
|
||||||
public static final boolean HEADSET_PAUSE = true;
|
public static final boolean HEADSET_PAUSE = true;
|
||||||
public static final int IDLE_TIMEOUT = 3600;
|
public static final int IDLE_TIMEOUT = 3600;
|
||||||
public static final int LIBRARY_PAGE = 0;
|
public static final int LIBRARY_PAGE = 0;
|
||||||
|
@ -40,7 +40,6 @@ public class PrefKeys {
|
|||||||
public static final String DOUBLE_TAP = "double_tap";
|
public static final String DOUBLE_TAP = "double_tap";
|
||||||
public static final String ENABLE_SHAKE = "enable_shake";
|
public static final String ENABLE_SHAKE = "enable_shake";
|
||||||
public static final String HEADSET_ONLY = "headset_only";
|
public static final String HEADSET_ONLY = "headset_only";
|
||||||
public static final String CYCLE_CONTINUOUS_SHUFFLING = "cycle_continuous_shuffling";
|
|
||||||
public static final String HEADSET_PAUSE = "headset_pause";
|
public static final String HEADSET_PAUSE = "headset_pause";
|
||||||
public static final String IDLE_TIMEOUT = "idle_timeout";
|
public static final String IDLE_TIMEOUT = "idle_timeout";
|
||||||
public static final String LIBRARY_PAGE = "library_page";
|
public static final String LIBRARY_PAGE = "library_page";
|
||||||
|
@ -167,25 +167,19 @@ public final class SongTimeline {
|
|||||||
* @see SongTimeline#setShuffleMode(int)
|
* @see SongTimeline#setShuffleMode(int)
|
||||||
*/
|
*/
|
||||||
public static final int SHUFFLE_SONGS = 1;
|
public static final int SHUFFLE_SONGS = 1;
|
||||||
/**
|
|
||||||
* Randomize order of songs and re-shuffle continuously
|
|
||||||
*
|
|
||||||
* @see SongTimeline@setShuffleMode(int)
|
|
||||||
*/
|
|
||||||
public static final int SHUFFLE_CONTINUOUS = 2;
|
|
||||||
/**
|
/**
|
||||||
* Randomize order of albums, preserving the order of tracks inside the
|
* Randomize order of albums, preserving the order of tracks inside the
|
||||||
* albums.
|
* albums.
|
||||||
*
|
*
|
||||||
* @see SongTimeline#setShuffleMode(int)
|
* @see SongTimeline#setShuffleMode(int)
|
||||||
*/
|
*/
|
||||||
public static final int SHUFFLE_ALBUMS = 3;
|
public static final int SHUFFLE_ALBUMS = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Icons corresponding to each of the shuffle actions.
|
* Icons corresponding to each of the shuffle actions.
|
||||||
*/
|
*/
|
||||||
public static final int[] SHUFFLE_ICONS =
|
public static final int[] SHUFFLE_ICONS =
|
||||||
{ R.drawable.shuffle_inactive, R.drawable.shuffle_active, R.drawable.shuffle_active, R.drawable.shuffle_album_active };
|
{ R.drawable.shuffle_inactive, R.drawable.shuffle_active, R.drawable.shuffle_album_active };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move current position to the previous album.
|
* Move current position to the previous album.
|
||||||
@ -614,11 +608,6 @@ public final class SongTimeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mCurrentPos = pos;
|
mCurrentPos = pos;
|
||||||
|
|
||||||
if (mShuffleMode == SHUFFLE_CONTINUOUS) {
|
|
||||||
reshuffleTimeline();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user