+ //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
+{
+ [[StatusWindow sharedWindow] setLocked:NO];
+ [[StatusWindow sharedWindow] vanish:self];
+ [[StatusWindow sharedWindow] setIgnoresMouseEvents:YES];
+
+ [self blingNow];
+}
+
+- (void)registerNowCancel
+{
+ [[StatusWindow sharedWindow] setLocked:NO];
+ [[StatusWindow sharedWindow] vanish:self];
+ [[StatusWindow sharedWindow] setIgnoresMouseEvents:YES];
+
+ [NSApp terminate:self];
+}
+
+/*************************************************************************/
+#pragma mark -
+#pragma mark NETWORK HANDLERS
+/*************************************************************************/
+
+- (void)setServerStatus:(BOOL)newStatus
+{
+ if (newStatus) {
+ //Turn on
+ [networkController setServerStatus:YES];
+ } else {
+ //Tear down
+ [networkController setServerStatus:NO];
+ }
+}
+
+- (int)connectToServer
+{
+ int result;
+ ITDebugLog(@"Attempting to connect to shared remote.");
+ result = [networkController connectToHost:[df stringForKey:@"sharedPlayerHost"]];
+ //Connect
+ if (result == 1) {
+ [[PreferencesController sharedPrefs] resetRemotePlayerTextFields];
+ currentRemote = [[[networkController networkObject] remote] retain];
+ [refreshTimer invalidate];
+ refreshTimer = [[NSTimer scheduledTimerWithTimeInterval:([networkController isConnectedToServer] ? 10.0 : 0.5)
+ target:self
+ selector:@selector(timerUpdate)
+ userInfo:nil
+ repeats:YES] retain];
+ [self timerUpdate];
+ ITDebugLog(@"Connection successful.");
+ return 1;
+ } else if (result == 0) {
+ ITDebugLog(@"Connection failed.");
+ currentRemote = [remoteArray objectAtIndex:0];
+ return 0;