Commit 09cd4425 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: clean EyeTV integration

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