[vlc-commits] macosx: clean EyeTV integration

Felix Paul Kühne git at videolan.org
Tue Jul 21 19:47:17 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jul 21 18:09:47 2015 +0200| [09cd442576521e927b5bcfb38e26183d129070fa] | committer: Felix Paul Kühne

macosx: clean EyeTV integration

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

 modules/gui/macosx/eyetv.m |   12 ------------
 modules/gui/macosx/intf.h  |    2 --
 modules/gui/macosx/intf.m  |    9 ---------
 modules/gui/macosx/open.m  |   19 +++++++++++--------
 4 files changed, 11 insertions(+), 31 deletions(-)

diff --git a/modules/gui/macosx/eyetv.m b/modules/gui/macosx/eyetv.m
index 66c282a..1b7f463 100644
--- a/modules/gui/macosx/eyetv.m
+++ b/modules/gui/macosx/eyetv.m
@@ -30,18 +30,6 @@
 
 @implementation VLCEyeTVController
 
-+ (VLCEyeTVController *)sharedInstance
-{
-    static VLCEyeTVController *sharedInstance = nil;
-    static dispatch_once_t pred;
-
-    dispatch_once(&pred, ^{
-        sharedInstance = [VLCEyeTVController new];
-    });
-
-    return sharedInstance;
-}
-
 - (id)init
 {
     self = [super init];
diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h
index 2a4f156..77d59e1 100644
--- a/modules/gui/macosx/intf.h
+++ b/modules/gui/macosx/intf.h
@@ -62,7 +62,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
 @class VLCSimplePrefs;
 @class VLCPrefs;
 @class VLCCoreDialogProvider;
- at class VLCEyeTVController;
 @class VLCBookmarks;
 @class VLCOpen;
 
@@ -89,7 +88,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
 - (VLCPlaylist *)playlist;
 - (VLCCoreDialogProvider *)coreDialogProvider;
 - (ResumeDialogController *)resumeDialog;
-- (VLCEyeTVController *)eyeTVController;
 - (VLCInputManager *)inputManager;
 - (void)setActiveVideoPlayback:(BOOL)b_value;
 - (BOOL)activeVideoPlayback;
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 8ae05cc..819529b 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -52,7 +52,6 @@
 #import "open.h"
 #import "bookmarks.h"
 #import "coredialogs.h"
-#import "eyetv.h"
 #import "simple_prefs.h"
 #import "CoreInteraction.h"
 #import "TrackSynchronization.h"
@@ -159,7 +158,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
     VLCSimplePrefs *_sprefs;
     VLCOpen *_open;
     VLCCoreDialogProvider *_coredialogs;
-    VLCEyeTVController *_eyetv;
     VLCBookmarks *_bookmarks;
     VLCCoreInteraction *_coreinteraction;
     ResumeDialogController *_resume_dialog;
@@ -219,7 +217,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
     _sprefs = nil;
     _open = nil;
     _coredialogs = nil;
-    _eyetv = nil;
     _bookmarks = nil;
     _coreinteraction = nil;
     _resume_dialog = nil;
@@ -245,7 +242,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
 
     [NSBundle loadNibNamed:@"MainWindow" owner:[VLCMain sharedInstance]];
     [[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:nil];
-    _eyetv = [[VLCEyeTVController alloc] init];
 
     _coreinteraction = [VLCCoreInteraction sharedInstance];
 
@@ -609,11 +605,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
     return _resume_dialog;
 }
 
-- (VLCEyeTVController *)eyeTVController
-{
-    return _eyetv;
-}
-
 - (BOOL)activeVideoPlayback
 {
     return b_active_videoplayback;
diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
index b9ae604..0031679 100644
--- a/modules/gui/macosx/open.m
+++ b/modules/gui/macosx/open.m
@@ -72,6 +72,7 @@ struct display_info_t
     NSString *_subPath;
     NSString *_MRL;
     NSMutableArray *_displayInfos;
+    VLCEyeTVController *_eyeTVController;
 }
 
 @property (readwrite, assign) NSString *MRL;
@@ -390,6 +391,7 @@ struct display_info_t
     if ([NSApp modalWindow] != nil)
         return;
 
+    _eyeTVController = [[VLCEyeTVController alloc] init];
     int i_result;
 
     [_tabView selectTabViewItemAtIndex: i_type];
@@ -490,6 +492,7 @@ struct display_info_t
 
         [[[VLCMain sharedInstance] playlist] addPlaylistItems:[NSArray arrayWithObject:itemOptionsDictionary]];
     }
+    _eyeTVController = nil;
 }
 
 - (IBAction)screenChanged:(id)sender
@@ -1162,8 +1165,8 @@ struct display_info_t
     intf_thread_t * p_intf = VLCIntf;
 
     if ([[[_captureModePopup selectedItem] title] isEqualToString: @"EyeTV"]) {
-        if ([[[VLCMain sharedInstance] eyeTVController] eyeTVRunning] == YES) {
-            if ([[[VLCMain sharedInstance] eyeTVController] deviceConnected] == YES) {
+        if ([_eyeTVController eyeTVRunning] == YES) {
+            if ([_eyeTVController deviceConnected] == YES) {
                 [self showCaptureView: _eyeTVrunningView];
                 [self setupChannelInfo];
             }
@@ -1250,16 +1253,16 @@ struct display_info_t
 - (IBAction)eyetvSwitchChannel:(id)sender
 {
     if (sender == _eyeTVnextProgramButton) {
-        int chanNum = [[[VLCMain sharedInstance] eyeTVController] switchChannelUp: YES];
+        int chanNum = [_eyeTVController switchChannelUp: YES];
         [_eyeTVchannelsPopup selectItemWithTag:chanNum];
         [self setMRL: [NSString stringWithFormat:@"eyetv:// :eyetv-channel=%d", chanNum]];
     } else if (sender == _eyeTVpreviousProgramButton) {
-        int chanNum = [[[VLCMain sharedInstance] eyeTVController] switchChannelUp: NO];
+        int chanNum = [_eyeTVController switchChannelUp: NO];
         [_eyeTVchannelsPopup selectItemWithTag:chanNum];
         [self setMRL: [NSString stringWithFormat:@"eyetv:// :eyetv-channel=%d", chanNum]];
     } else if (sender == _eyeTVchannelsPopup) {
         int chanNum = [[sender selectedItem] tag];
-        [[[VLCMain sharedInstance] eyeTVController] setChannel:chanNum];
+        [_eyeTVController setChannel:chanNum];
         [self setMRL: [NSString stringWithFormat:@"eyetv:// :eyetv-channel=%d", chanNum]];
     } else
         msg_Err(VLCIntf, "eyetvSwitchChannel sent by unknown object");
@@ -1267,7 +1270,7 @@ struct display_info_t
 
 - (IBAction)eyetvLaunch:(id)sender
 {
-    [[[VLCMain sharedInstance] eyeTVController] launchEyeTV];
+    [_eyeTVController launchEyeTV];
 }
 
 - (IBAction)eyetvGetPlugin:(id)sender
@@ -1317,7 +1320,7 @@ struct display_info_t
     [_eyeTVChannelStatusLabel setHidden: NO];
 
     /* retrieve info */
-    NSEnumerator *channels = [[[VLCMain sharedInstance] eyeTVController] allChannels];
+    NSEnumerator *channels = [_eyeTVController allChannels];
     int x = -2;
     [[[_eyeTVchannelsPopup menu] addItemWithTitle: _NS("Composite input")
                                            action: nil
@@ -1334,7 +1337,7 @@ struct display_info_t
             [[[_eyeTVchannelsPopup menu] addItemWithTitle: channel action: nil keyEquivalent: @""] setTag:++x];
 
         /* make Tuner the default */
-        [_eyeTVchannelsPopup selectItemWithTag:[[[VLCMain sharedInstance] eyeTVController] channel]];
+        [_eyeTVchannelsPopup selectItemWithTag:[_eyeTVController channel]];
     }
 
     /* clean up GUI */



More information about the vlc-commits mailing list