[vlc-commits] macosx/eyetv: simplify header and implementation

Felix Paul Kühne git at videolan.org
Fri Aug 24 18:34:27 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Aug 24 18:06:50 2012 +0200| [add20a103ea54a1dded13578f2e6fbcbf3a9f219] | committer: Felix Paul Kühne

macosx/eyetv: simplify header and implementation

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=add20a103ea54a1dded13578f2e6fbcbf3a9f219
---

 modules/gui/macosx/eyetv.h |    8 ++++----
 modules/gui/macosx/eyetv.m |   22 +++++-----------------
 modules/gui/macosx/open.m  |    8 ++++----
 3 files changed, 13 insertions(+), 25 deletions(-)

diff --git a/modules/gui/macosx/eyetv.h b/modules/gui/macosx/eyetv.h
index dc47ddc..02643c5 100644
--- a/modules/gui/macosx/eyetv.h
+++ b/modules/gui/macosx/eyetv.h
@@ -29,13 +29,13 @@
     BOOL b_eyeTVactive;
     BOOL b_deviceConnected;
 }
+ at property (readonly) BOOL eyeTVRunning;
+ at property (readonly) BOOL deviceConnected;
+ at 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
diff --git a/modules/gui/macosx/eyetv.m b/modules/gui/macosx/eyetv.m
index f1c5957..5b52a93 100644
--- a/modules/gui/macosx/eyetv.m
+++ b/modules/gui/macosx/eyetv.m
@@ -30,6 +30,8 @@
 
 @implementation VLCEyeTVController
 
+ at 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 )
diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
index b9ad62c..9912c9f 100644
--- a/modules/gui/macosx/open.m
+++ b/modules/gui/macosx/open.m
@@ -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 */



More information about the vlc-commits mailing list