+- (void)toggleLoop
+{
+ NS_DURING
+ ITMTRemotePlayerRepeatMode repeatMode = [[self currentRemote] repeatMode];
+ ITDebugLog(@"Toggling repeat mode.");
+ switch (repeatMode) {
+ case ITMTRemotePlayerRepeatOff:
+ repeatMode = ITMTRemotePlayerRepeatAll;
+ break;
+ case ITMTRemotePlayerRepeatAll:
+ repeatMode = ITMTRemotePlayerRepeatOne;
+ break;
+ case ITMTRemotePlayerRepeatOne:
+ repeatMode = ITMTRemotePlayerRepeatOff;
+ break;
+ }
+ ITDebugLog(@"Setting repeat mode to %i", repeatMode);
+ [[self currentRemote] setRepeatMode:repeatMode];
+
+ //Show loop status window
+ [statusWindowController showRepeatWindowWithMode:repeatMode];
+ NS_HANDLER
+ [self networkError:localException];
+ NS_ENDHANDLER
+}
+
+- (void)toggleShuffle
+{
+ NS_DURING
+ BOOL newShuffleEnabled = ( ! [[self currentRemote] shuffleEnabled] );
+ ITDebugLog(@"Toggling shuffle mode.");
+ [[self currentRemote] setShuffleEnabled:newShuffleEnabled];
+ //Show shuffle status window
+ ITDebugLog(@"Setting shuffle mode to %i", newShuffleEnabled);
+ [statusWindowController showShuffleWindow:newShuffleEnabled];
+ NS_HANDLER
+ [self networkError:localException];
+ NS_ENDHANDLER
+}
+
+- (void)registerNowOK