4 * Remote network object that is vended
6 * Original Author : Kent Sutherland <ksutherland@ithinksw.com>
7 * Responsibility : Kent Sutherland <ksutherland@ithinksw.com>
9 * Copyright (c) 2002 - 2003 iThink Software.
12 * This header defines the Objective-C protocol which all MenuTunes Remote
13 * plugins must implement. To build a remote, create a subclass of this
14 * object, and implement each method in the @protocol below.
18 #import "NetworkObject.h"
19 #import "MainController.h"
20 #import <ITMTRemote/ITMTRemote.h>
22 @implementation NetworkObject
26 if ( (self = [super init]) ) {
28 if (![self requiresPassword]) {
37 - (ITMTRemote *)remote
39 if (_authenticated && _valid) {
40 return [[MainController sharedController] currentRemote];
46 - (NSString *)serverName
48 NSString *name = [[NSUserDefaults standardUserDefaults] stringForKey:@"sharedPlayerName"];
50 name = @"MenuTunes Shared Player";
54 - (BOOL)requiresPassword
56 return [[[NSUserDefaults standardUserDefaults] dataForKey:@"sharedPlayerPassword"] length];
59 - (BOOL)sendPassword:(NSData *)password
61 if ([password isEqualToData:[[NSUserDefaults standardUserDefaults] dataForKey:@"sharedPlayerPassword"]]) {