11

As is stated in Apple documents:

enum {
   MPMusicRepeatModeDefault,
   MPMusicRepeatModeNone,
   MPMusicRepeatModeOne,
   MPMusicRepeatModeAll
};
typedef NSInteger MPMusicRepeatMode;

Yet, MPMusicRepeatModeDefault is described as The user’s preferred repeat mode. Since I am writing a music player I require to know every time what is the current repeat mode, and when this is returned, what of the "actual" modes:

  • MPMusicRepeatModeNone
  • MPMusicRepeatModeOne
  • MPMusicRepeatModeAll

shall be chosen? Or is there no way to get such information?

Mehul Mistri
  • 15,037
  • 14
  • 70
  • 94
Matoe
  • 2,742
  • 6
  • 33
  • 52
  • No. Since I was in fact developing a "tweak" for jailbroken iPhones, I managed to obtain that information by looking over some data into the iPod.app preference plist (located at `~/Library/Preferences/com.apple.mobileipod.plist`), but I never found anything out really for what could be an actual app. – Matoe Oct 13 '12 at 00:23
  • Have you tried to get this info via repeatMode property of the player? – EugeneK Nov 26 '12 at 16:03

1 Answers1

4

My understanding is that MPMusicRepeatModeDefault is only used for instantiating your own player as described here.

MPMusicPlayerController* appMusicPlayer = [MPMusicPlayerController applicationMusicPlayer];

// Use whatever the user has set in their iPod settings
// Omitting this line has no real effect because deferring to the
// user mode is the default setting for new players
[appMusicPlayer setRepeatMode: MPMusicRepeatModeDefault];

If you want to know what that default setting actually is, you should be able to get it from the iPodMusicPlayer instance:

MPMusicPlayerController* iPodMusicPlayer =
    [MPMusicPlayerController iPodMusicPlayer];

MPMusicRepeatMode theDefaultMode = [iPodMusicPlayer repeatMode];
lfalin
  • 4,219
  • 5
  • 31
  • 57