Commit add20a10 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/eyetv: simplify header and implementation

parent 746edb20
......@@ -29,13 +29,13 @@
BOOL b_eyeTVactive;
BOOL b_deviceConnected;
}
@property (readonly) BOOL eyeTVRunning;
@property (readonly) BOOL deviceConnected;
@property (readwrite) int channel;
- (void)globalNotificationReceived: (NSNotification *)theNotification;
- (BOOL)isEyeTVrunning;
- (BOOL)isDeviceConnected;
- (void)launchEyeTV;
- (int)currentChannel;
- (int)switchChannelUp:(BOOL)b_yesOrNo;
- (void)selectChannel:(int)theChannelNum;
- (NSEnumerator *)allChannels;
@end
......@@ -30,6 +30,8 @@
@implementation VLCEyeTVController
@synthesize eyeTVRunning = b_eyeTVactive, deviceConnected = b_deviceConnected;
static VLCEyeTVController *_o_sharedInstance = nil;
+ (VLCEyeTVController *)sharedInstance
......@@ -70,17 +72,6 @@ static VLCEyeTVController *_o_sharedInstance = nil;
b_eyeTVactive = NO;
}
- (BOOL)isEyeTVrunning
{
return b_eyeTVactive;
}
- (BOOL)isDeviceConnected
{
return b_deviceConnected;
}
- (void)launchEyeTV
{
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:
......@@ -97,7 +88,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
[script release];
}
- (int)currentChannel
- (int)channel
{
int currentChannel = 0;
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:
......@@ -108,11 +99,8 @@ static VLCEyeTVController *_o_sharedInstance = nil;
{
NSString *errorString = [errorDict objectForKey:NSAppleScriptErrorMessage];
NSLog( @"EyeTV channel inventory failed with error status '%@'", errorString );
}
else
{
} else
currentChannel = (int)[descriptor int32Value];
}
[script release];
return currentChannel;
}
......@@ -157,7 +145,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
return currentChannel;
}
- (void)selectChannel: (int)theChannelNum
- (void)setChannel: (int)theChannelNum
{
NSAppleScript *script;
switch( theChannelNum )
......
......@@ -1346,9 +1346,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
if( [[[o_capture_mode_pop selectedItem] title] isEqualToString: @"EyeTV"] )
{
if( [[[VLCMain sharedInstance] eyeTVController] isEyeTVrunning] == YES )
if( [[[VLCMain sharedInstance] eyeTVController] eyeTVRunning] == YES )
{
if( [[[VLCMain sharedInstance] eyeTVController] isDeviceConnected] == YES )
if( [[[VLCMain sharedInstance] eyeTVController] deviceConnected] == YES )
{
[self showCaptureView: o_eyetv_running_view];
[self setupChannelInfo];
......@@ -1458,7 +1458,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
else if( sender == o_eyetv_channels_pop )
{
int chanNum = [[sender selectedItem] tag];
[[[VLCMain sharedInstance] eyeTVController] selectChannel:chanNum];
[[[VLCMain sharedInstance] eyeTVController] setChannel:chanNum];
[self setMRL: [NSString stringWithFormat:@"eyetv:// :eyetv-channel=%d", chanNum]];
}
else
......@@ -1536,7 +1536,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
keyEquivalent: @""] setTag:++x];
}
/* make Tuner the default */
[o_eyetv_channels_pop selectItemWithTag:[[[VLCMain sharedInstance] eyeTVController] currentChannel]];
[o_eyetv_channels_pop selectItemWithTag:[[[VLCMain sharedInstance] eyeTVController] channel]];
}
/* clean up GUI */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment