|
|
|
@ -115,105 +115,8 @@ |
|
|
|
[_checkForUpdate setEnabled:NO]; |
|
|
|
#endif |
|
|
|
|
|
|
|
NSString* keyString; |
|
|
|
char *key; |
|
|
|
|
|
|
|
/* Get ExtensionsManager */ |
|
|
|
intf_thread_t *p_intf = getIntf(); |
|
|
|
|
|
|
|
[self initStrings]; |
|
|
|
|
|
|
|
key = config_GetPsz("key-quit"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_quit setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_quit setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
// do not assign play/pause key |
|
|
|
|
|
|
|
key = config_GetPsz("key-stop"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_stop setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_stop setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-prev"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_previous setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_previous setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-next"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_next setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_next setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-jump+short"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_fwd setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_fwd setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-jump-short"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_bwd setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_bwd setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-vol-up"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_vol_up setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_vol_up setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-vol-down"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_vol_down setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_vol_down setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-vol-mute"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_mute setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_mute setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-toggle-fullscreen"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_fullscreenItem setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_fullscreenItem setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-snapshot"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_snapshot setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_snapshot setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-random"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_random setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_random setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-zoom-half"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_half_window setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_half_window setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-zoom-original"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_normal_window setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_normal_window setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-zoom-double"); |
|
|
|
keyString = [NSString stringWithFormat:@"%s", key]; |
|
|
|
[_double_window setKeyEquivalent: VLCKeyToString(keyString)]; |
|
|
|
[_double_window setKeyEquivalentModifierMask: VLCModifiersToCocoa(keyString)]; |
|
|
|
FREENULL(key); |
|
|
|
[self setupKeyboardShortcuts]; |
|
|
|
|
|
|
|
[self setSubmenusEnabled: YES]; |
|
|
|
|
|
|
|
@ -250,8 +153,10 @@ |
|
|
|
name:VLCPlaybackOrderChanged |
|
|
|
object:self]; |
|
|
|
|
|
|
|
[self setupVarMenuItem:_add_intf target: (vlc_object_t *)p_intf |
|
|
|
var:"intf-add" selector: @selector(toggleVar:)]; |
|
|
|
[self setupVarMenuItem:_add_intf |
|
|
|
target:VLC_OBJECT(getIntf()) |
|
|
|
var:"intf-add" |
|
|
|
selector:@selector(toggleVar:)]; |
|
|
|
|
|
|
|
/* setup extensions menu */ |
|
|
|
/* Let the ExtensionsManager itself build the menu */ |
|
|
|
@ -260,26 +165,22 @@ |
|
|
|
[_extensions setEnabled: ([_extensionsMenu numberOfItems] > 0)]; |
|
|
|
|
|
|
|
// FIXME: Implement preference for autoloading extensions on mac |
|
|
|
// FIXME: this is definitely the wrong place to do this. |
|
|
|
if (![extMgr isLoaded] && ![extMgr cannotLoad]) |
|
|
|
[extMgr loadExtensions]; |
|
|
|
|
|
|
|
/* setup post-proc menu */ |
|
|
|
NSUInteger count = (NSUInteger) [_postprocessingMenu numberOfItems]; |
|
|
|
if (count > 0) |
|
|
|
[_postprocessingMenu removeAllItems]; |
|
|
|
|
|
|
|
// FIXME: re-write the following using VLCPlayerController |
|
|
|
NSMenuItem *mitem; |
|
|
|
[_postprocessingMenu removeAllItems]; |
|
|
|
[_postprocessingMenu setAutoenablesItems: YES]; |
|
|
|
[_postprocessingMenu addItemWithTitle: _NS("Disable") action:@selector(togglePostProcessing:) keyEquivalent:@""]; |
|
|
|
mitem = [_postprocessingMenu itemAtIndex: 0]; |
|
|
|
NSMenuItem *mitem = [_postprocessingMenu itemAtIndex: 0]; |
|
|
|
[mitem setTag: -1]; |
|
|
|
[mitem setEnabled: YES]; |
|
|
|
[mitem setTarget: self]; |
|
|
|
for (NSUInteger x = 1; x < 7; x++) { |
|
|
|
[_postprocessingMenu addItemWithTitle:[NSString stringWithFormat:_NS("Level %i"), x] |
|
|
|
action:@selector(togglePostProcessing:) |
|
|
|
keyEquivalent:@""]; |
|
|
|
action:@selector(togglePostProcessing:) |
|
|
|
keyEquivalent:@""]; |
|
|
|
mitem = [_postprocessingMenu itemAtIndex:x]; |
|
|
|
[mitem setEnabled:YES]; |
|
|
|
[mitem setTag:x]; |
|
|
|
@ -327,14 +228,14 @@ |
|
|
|
{ NULL, 0 } |
|
|
|
}; |
|
|
|
|
|
|
|
for(int i = 0; scaleValues[i].name; i++) { |
|
|
|
for (int i = 0; scaleValues[i].name; i++) { |
|
|
|
NSMenuItem *menuItem = [_subtitle_sizeMenu addItemWithTitle: _NS(scaleValues[i].name) action:@selector(switchSubtitleSize:) keyEquivalent:@""]; |
|
|
|
[menuItem setTag:scaleValues[i].scaleValue]; |
|
|
|
[menuItem setTarget: self]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
- (void)setupMenu: (NSMenu*)menu withIntList: (char *)psz_name andSelector:(SEL)selector |
|
|
|
- (void)setupMenu:(NSMenu *)menu withIntList:(char *)psz_name andSelector:(SEL)selector |
|
|
|
{ |
|
|
|
module_config_t *p_item; |
|
|
|
|
|
|
|
@ -548,6 +449,88 @@ |
|
|
|
[_voutMenusnapshot setTitle: _NS("Snapshot")]; |
|
|
|
} |
|
|
|
|
|
|
|
- (void)setupKeyboardShortcuts |
|
|
|
{ |
|
|
|
char *key; |
|
|
|
|
|
|
|
key = config_GetPsz("key-quit"); |
|
|
|
[_quit setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_quit setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
// do not assign play/pause key |
|
|
|
|
|
|
|
key = config_GetPsz("key-stop"); |
|
|
|
[_stop setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_stop setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-prev"); |
|
|
|
[_previous setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_previous setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-next"); |
|
|
|
[_next setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_next setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-jump+short"); |
|
|
|
[_fwd setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_fwd setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-jump-short"); |
|
|
|
[_bwd setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_bwd setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-vol-up"); |
|
|
|
[_vol_up setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_vol_up setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-vol-down"); |
|
|
|
[_vol_down setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_vol_down setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-vol-mute"); |
|
|
|
[_mute setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_mute setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-toggle-fullscreen"); |
|
|
|
[_fullscreenItem setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_fullscreenItem setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-snapshot"); |
|
|
|
[_snapshot setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_snapshot setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-random"); |
|
|
|
[_random setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_random setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-zoom-half"); |
|
|
|
[_half_window setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_half_window setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-zoom-original"); |
|
|
|
[_normal_window setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_normal_window setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
|
|
|
|
key = config_GetPsz("key-zoom-double"); |
|
|
|
[_double_window setKeyEquivalent: VLCKeyToString(key)]; |
|
|
|
[_double_window setKeyEquivalentModifierMask: VLCModifiersToCocoa(key)]; |
|
|
|
FREENULL(key); |
|
|
|
} |
|
|
|
|
|
|
|
#pragma mark - Termination |
|
|
|
|
|
|
|
- (void)releaseRepresentedObjects:(NSMenu *)the_menu |
|
|
|
@ -567,10 +550,10 @@ |
|
|
|
|
|
|
|
- (void)setupMenus |
|
|
|
{ |
|
|
|
playlist_t *p_playlist = pl_Get(getIntf()); |
|
|
|
input_thread_t *p_input = playlist_CurrentInput(p_playlist); |
|
|
|
if (p_input != NULL) { |
|
|
|
[self setupVarMenuItem:_program target: (vlc_object_t *)p_input |
|
|
|
input_item_t *p_mediaItem = _playerController.currentMedia; |
|
|
|
|
|
|
|
if (p_mediaItem != NULL) { |
|
|
|
/* [self setupVarMenuItem:_program target: (vlc_object_t *)p_input |
|
|
|
var:"program" selector: @selector(toggleVar:)]; |
|
|
|
|
|
|
|
[self setupVarMenuItem:_title target: (vlc_object_t *)p_input |
|
|
|
@ -586,39 +569,38 @@ |
|
|
|
var:"video-es" selector: @selector(toggleVar:)]; |
|
|
|
|
|
|
|
[self setupVarMenuItem:_subtitle_track target: (vlc_object_t *)p_input |
|
|
|
var:"spu-es" selector: @selector(toggleVar:)]; |
|
|
|
var:"spu-es" selector: @selector(toggleVar:)];*/ |
|
|
|
|
|
|
|
audio_output_t *p_aout = [_playerController mainAudioOutput]; |
|
|
|
if (p_aout != NULL) { |
|
|
|
[self setupVarMenuItem:_channels target: (vlc_object_t *)p_aout |
|
|
|
var:"stereo-mode" selector: @selector(toggleVar:)]; |
|
|
|
[self setupVarMenuItem:_channels target:VLC_OBJECT(p_aout) |
|
|
|
var:"stereo-mode" selector:@selector(toggleVar:)]; |
|
|
|
|
|
|
|
[self setupVarMenuItem:_visual target: (vlc_object_t *)p_aout |
|
|
|
var:"visual" selector: @selector(toggleVar:)]; |
|
|
|
[self setupVarMenuItem:_visual target:VLC_OBJECT(p_aout) |
|
|
|
var:"visual" selector:@selector(toggleVar:)]; |
|
|
|
aout_Release(p_aout); |
|
|
|
} |
|
|
|
|
|
|
|
vout_thread_t *p_vout = [_playerController videoOutputThreadForKeyWindow]; |
|
|
|
|
|
|
|
if (p_vout != NULL) { |
|
|
|
[self setupVarMenuItem:_aspect_ratio target: (vlc_object_t *)p_vout |
|
|
|
var:"aspect-ratio" selector: @selector(toggleVar:)]; |
|
|
|
[self setupVarMenuItem:_aspect_ratio target:VLC_OBJECT(p_vout) |
|
|
|
var:"aspect-ratio" selector: @selector(toggleVar:)]; |
|
|
|
|
|
|
|
[self setupVarMenuItem:_crop target: (vlc_object_t *) p_vout |
|
|
|
var:"crop" selector: @selector(toggleVar:)]; |
|
|
|
[self setupVarMenuItem:_crop target:VLC_OBJECT(p_vout) |
|
|
|
var:"crop" selector: @selector(toggleVar:)]; |
|
|
|
|
|
|
|
[self setupVarMenuItem:_deinterlace target: (vlc_object_t *)p_vout |
|
|
|
var:"deinterlace" selector: @selector(toggleVar:)]; |
|
|
|
[self setupVarMenuItem:_deinterlace target:VLC_OBJECT(p_vout) |
|
|
|
var:"deinterlace" selector: @selector(toggleVar:)]; |
|
|
|
|
|
|
|
[self setupVarMenuItem:_deinterlace_mode target: (vlc_object_t *)p_vout |
|
|
|
var:"deinterlace-mode" selector: @selector(toggleVar:)]; |
|
|
|
[self setupVarMenuItem:_deinterlace_mode target:VLC_OBJECT(p_vout) |
|
|
|
var:"deinterlace-mode" selector: @selector(toggleVar:)]; |
|
|
|
|
|
|
|
vout_Release(p_vout); |
|
|
|
|
|
|
|
[self refreshVoutDeviceMenu:nil]; |
|
|
|
} |
|
|
|
[_postprocessing setEnabled:YES]; |
|
|
|
input_Release(p_input); |
|
|
|
input_item_Release(p_mediaItem); |
|
|
|
} else { |
|
|
|
[_postprocessing setEnabled:NO]; |
|
|
|
} |
|
|
|
@ -626,29 +608,28 @@ |
|
|
|
|
|
|
|
- (void)refreshVoutDeviceMenu:(NSNotification *)notification |
|
|
|
{ |
|
|
|
NSUInteger count = (NSUInteger) [_screenMenu numberOfItems]; |
|
|
|
NSMenu *submenu = _screenMenu; |
|
|
|
if (count > 0) |
|
|
|
[submenu removeAllItems]; |
|
|
|
[submenu removeAllItems]; |
|
|
|
|
|
|
|
NSArray *screens = [NSScreen screens]; |
|
|
|
NSMenuItem *mitem; |
|
|
|
count = [screens count]; |
|
|
|
NSMenuItem *menuItem; |
|
|
|
NSUInteger numberOfScreens = [screens count]; |
|
|
|
[_screen setEnabled: YES]; |
|
|
|
[submenu addItemWithTitle: _NS("Default") action:@selector(toggleFullscreenDevice:) keyEquivalent:@""]; |
|
|
|
mitem = [submenu itemAtIndex: 0]; |
|
|
|
[mitem setTag: 0]; |
|
|
|
[mitem setEnabled: YES]; |
|
|
|
[mitem setTarget: self]; |
|
|
|
menuItem = [submenu itemAtIndex: 0]; |
|
|
|
[menuItem setTag: 0]; |
|
|
|
[menuItem setEnabled: YES]; |
|
|
|
[menuItem setTarget: self]; |
|
|
|
NSRect s_rect; |
|
|
|
for (NSUInteger i = 0; i < count; i++) { |
|
|
|
for (NSUInteger i = 0; i < numberOfScreens; i++) { |
|
|
|
s_rect = [[screens objectAtIndex:i] frame]; |
|
|
|
[submenu addItemWithTitle: [NSString stringWithFormat: @"%@ %li (%ix%i)", _NS("Screen"), i+1, |
|
|
|
(int)s_rect.size.width, (int)s_rect.size.height] action:@selector(toggleFullscreenDevice:) keyEquivalent:@""]; |
|
|
|
mitem = [submenu itemAtIndex:i+1]; |
|
|
|
[mitem setTag: (int)[[screens objectAtIndex:i] displayID]]; |
|
|
|
[mitem setEnabled: YES]; |
|
|
|
[mitem setTarget: self]; |
|
|
|
[submenu addItemWithTitle:[NSString stringWithFormat: @"%@ %li (%ix%i)", _NS("Screen"), i+1, (int)s_rect.size.width, (int)s_rect.size.height] |
|
|
|
action:@selector(toggleFullscreenDevice:) |
|
|
|
keyEquivalent:@""]; |
|
|
|
menuItem = [submenu itemAtIndex:i+1]; |
|
|
|
[menuItem setTag: (int)[[screens objectAtIndex:i] displayID]]; |
|
|
|
[menuItem setEnabled: YES]; |
|
|
|
[menuItem setTarget: self]; |
|
|
|
} |
|
|
|
[[submenu itemWithTag: var_InheritInteger(getIntf(), "macosx-vdev")] setState: NSOnState]; |
|
|
|
} |
|
|
|
@ -744,27 +725,31 @@ |
|
|
|
|
|
|
|
- (IBAction)play:(id)sender |
|
|
|
{ |
|
|
|
[[VLCCoreInteraction sharedInstance] playOrPause]; |
|
|
|
[_playerController togglePlayPause]; |
|
|
|
} |
|
|
|
|
|
|
|
- (IBAction)stop:(id)sender |
|
|
|
{ |
|
|
|
[[VLCCoreInteraction sharedInstance] stop]; |
|
|
|
[_playerController stop]; |
|
|
|
} |
|
|
|
|
|
|
|
- (IBAction)prev:(id)sender |
|
|
|
{ |
|
|
|
[[VLCCoreInteraction sharedInstance] previous]; |
|
|
|
[_playlistController playPreviousItem]; |
|
|
|
} |
|
|
|
|
|
|
|
- (IBAction)next:(id)sender |
|
|
|
{ |
|
|
|
[[VLCCoreInteraction sharedInstance] next]; |
|
|
|
[_playlistController playNextItem]; |
|
|
|
} |
|
|
|
|
|
|
|
- (IBAction)random:(id)sender |
|
|
|
{ |
|
|
|
[[VLCCoreInteraction sharedInstance] shuffle]; |
|
|
|
if (_playlistController.playbackOrder == VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM) { |
|
|
|
_playlistController.playbackOrder = VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL; |
|
|
|
} else { |
|
|
|
_playlistController.playbackOrder = VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
- (IBAction)repeat:(id)sender |
|
|
|
@ -819,7 +804,11 @@ |
|
|
|
|
|
|
|
- (IBAction)quitAfterPlayback:(id)sender |
|
|
|
{ |
|
|
|
_playerController.actionAfterStop = VLC_PLAYER_MEDIA_STOPPED_EXIT; |
|
|
|
if (_playerController.actionAfterStop != VLC_PLAYER_MEDIA_STOPPED_EXIT) { |
|
|
|
_playerController.actionAfterStop = VLC_PLAYER_MEDIA_STOPPED_EXIT; |
|
|
|
} else { |
|
|
|
_playerController.actionAfterStop = VLC_PLAYER_MEDIA_STOPPED_CONTINUE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
- (IBAction)toggleRecord:(id)sender |
|
|
|
@ -891,8 +880,8 @@ |
|
|
|
if (!p_aout) |
|
|
|
return; |
|
|
|
|
|
|
|
int n = aout_DevicesList(p_aout, &ids, &names); |
|
|
|
if (n == -1) { |
|
|
|
int numberOfAudioDevices = aout_DevicesList(p_aout, &ids, &names); |
|
|
|
if (numberOfAudioDevices == -1) { |
|
|
|
aout_Release(p_aout); |
|
|
|
return; |
|
|
|
} |
|
|
|
@ -900,7 +889,7 @@ |
|
|
|
currentDevice = aout_DeviceGet(p_aout); |
|
|
|
NSMenuItem *_tmp; |
|
|
|
|
|
|
|
for (NSUInteger x = 0; x < n; x++) { |
|
|
|
for (NSUInteger x = 0; x < numberOfAudioDevices; x++) { |
|
|
|
_tmp = [_audioDeviceMenu addItemWithTitle:toNSStr(names[x]) action:@selector(toggleAudioDevice:) keyEquivalent:@""]; |
|
|
|
[_tmp setTarget:self]; |
|
|
|
[_tmp setTag:[[NSString stringWithFormat:@"%s", ids[x]] intValue]]; |
|
|
|
@ -911,7 +900,7 @@ |
|
|
|
|
|
|
|
free(currentDevice); |
|
|
|
|
|
|
|
for (NSUInteger x = 0; x < n; x++) { |
|
|
|
for (NSUInteger x = 0; x < numberOfAudioDevices; x++) { |
|
|
|
free(ids[x]); |
|
|
|
free(names[x]); |
|
|
|
} |
|
|
|
@ -1356,7 +1345,7 @@ |
|
|
|
|
|
|
|
#pragma mark - Dynamic menu creation and validation |
|
|
|
|
|
|
|
- (void)setupVarMenuItem:(NSMenuItem *)mi |
|
|
|
- (void)setupVarMenuItem:(NSMenuItem *)menuItem |
|
|
|
target:(vlc_object_t *)p_object |
|
|
|
var:(const char *)psz_variable |
|
|
|
selector:(SEL)pf_callback |
|
|
|
@ -1379,12 +1368,12 @@ |
|
|
|
|
|
|
|
/* Get the descriptive name of the variable */ |
|
|
|
var_Change(p_object, psz_variable, VLC_VAR_GETTEXT, &text); |
|
|
|
[mi setTitle: _NS(text ? text : psz_variable)]; |
|
|
|
[menuItem setTitle: _NS(text ? text : psz_variable)]; |
|
|
|
|
|
|
|
if (i_type & VLC_VAR_HASCHOICE) { |
|
|
|
NSMenu *menu = [mi submenu]; |
|
|
|
NSMenu *menu = [menuItem submenu]; |
|
|
|
|
|
|
|
[self setupVarMenu:menu forMenuItem:mi target:p_object |
|
|
|
[self setupVarMenu:menu forMenuItem:menuItem target:p_object |
|
|
|
var:psz_variable selector:pf_callback]; |
|
|
|
|
|
|
|
free(text); |
|
|
|
@ -1399,15 +1388,15 @@ |
|
|
|
case VLC_VAR_VOID: |
|
|
|
data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: psz_variable ofObject: p_object |
|
|
|
andValue: val ofType: i_type]; |
|
|
|
[mi setRepresentedObject:data]; |
|
|
|
[menuItem setRepresentedObject:data]; |
|
|
|
break; |
|
|
|
|
|
|
|
case VLC_VAR_BOOL: |
|
|
|
data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: psz_variable ofObject: p_object |
|
|
|
andValue: val ofType: i_type]; |
|
|
|
[mi setRepresentedObject:data]; |
|
|
|
[menuItem setRepresentedObject:data]; |
|
|
|
if (!(i_type & VLC_VAR_ISCOMMAND)) |
|
|
|
[mi setState: val.b_bool ? TRUE : FALSE ]; |
|
|
|
[menuItem setState: val.b_bool ? TRUE : FALSE ]; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|