|
|
@ -24,7 +24,6 @@ |
|
|
#import "VLCControlsBarCommon.h" |
|
|
#import "VLCControlsBarCommon.h" |
|
|
|
|
|
|
|
|
#import "extensions/NSString+Helpers.h" |
|
|
#import "extensions/NSString+Helpers.h" |
|
|
#import "extensions/NSColor+VLCAdditions.h" |
|
|
|
|
|
#import "main/VLCMain.h" |
|
|
#import "main/VLCMain.h" |
|
|
#import "playlist/VLCPlaylistController.h" |
|
|
#import "playlist/VLCPlaylistController.h" |
|
|
#import "playlist/VLCPlayerController.h" |
|
|
#import "playlist/VLCPlayerController.h" |
|
|
@ -51,11 +50,6 @@ |
|
|
NSImage *_pressedPauseImage; |
|
|
NSImage *_pressedPauseImage; |
|
|
NSImage *_playImage; |
|
|
NSImage *_playImage; |
|
|
NSImage *_pressedPlayImage; |
|
|
NSImage *_pressedPlayImage; |
|
|
NSImage *_repeatOffImage; |
|
|
|
|
|
NSImage *_repeatAllImage; |
|
|
|
|
|
NSImage *_repeatOneImage; |
|
|
|
|
|
NSImage *_shuffleOffImage; |
|
|
|
|
|
NSImage *_shuffleOnImage; |
|
|
|
|
|
|
|
|
|
|
|
NSTimeInterval last_fwd_event; |
|
|
NSTimeInterval last_fwd_event; |
|
|
NSTimeInterval last_bwd_event; |
|
|
NSTimeInterval last_bwd_event; |
|
|
@ -100,14 +94,6 @@ |
|
|
selector:@selector(fullscreenStateUpdated:) |
|
|
selector:@selector(fullscreenStateUpdated:) |
|
|
name:VLCPlayerFullscreenChanged |
|
|
name:VLCPlayerFullscreenChanged |
|
|
object:nil]; |
|
|
object:nil]; |
|
|
[notificationCenter addObserver:self |
|
|
|
|
|
selector:@selector(shuffleStateUpdated:) |
|
|
|
|
|
name:VLCPlaybackOrderChanged |
|
|
|
|
|
object:nil]; |
|
|
|
|
|
[notificationCenter addObserver:self |
|
|
|
|
|
selector:@selector(repeatStateUpdated:) |
|
|
|
|
|
name:VLCPlaybackRepeatChanged |
|
|
|
|
|
object:nil]; |
|
|
|
|
|
|
|
|
|
|
|
_nativeFullscreenMode = var_InheritBool(getIntf(), "macosx-nativefullscreenmode"); |
|
|
_nativeFullscreenMode = var_InheritBool(getIntf(), "macosx-nativefullscreenmode"); |
|
|
|
|
|
|
|
|
@ -191,23 +177,11 @@ |
|
|
[self.forwardButton setAction:@selector(fwd:)]; |
|
|
[self.forwardButton setAction:@selector(fwd:)]; |
|
|
[self.backwardButton setAction:@selector(bwd:)]; |
|
|
[self.backwardButton setAction:@selector(bwd:)]; |
|
|
|
|
|
|
|
|
self.repeatButton.action = @selector(repeatAction:); |
|
|
|
|
|
self.shuffleButton.action = @selector(shuffleAction:); |
|
|
|
|
|
|
|
|
|
|
|
[self playerStateUpdated:nil]; |
|
|
[self playerStateUpdated:nil]; |
|
|
[self repeatStateUpdated:nil]; |
|
|
|
|
|
[self shuffleStateUpdated:nil]; |
|
|
|
|
|
|
|
|
|
|
|
[_artworkImageView setCropsImagesToRoundedCorners:YES]; |
|
|
[_artworkImageView setCropsImagesToRoundedCorners:YES]; |
|
|
[_artworkImageView setImage:[NSImage imageNamed:@"noart"]]; |
|
|
[_artworkImageView setImage:[NSImage imageNamed:@"noart"]]; |
|
|
[_artworkImageView setContentGravity:VLCImageViewContentGravityResize]; |
|
|
[_artworkImageView setContentGravity:VLCImageViewContentGravityResize]; |
|
|
|
|
|
|
|
|
_repeatAllImage = [NSImage imageNamed:@"repeatAll"]; |
|
|
|
|
|
_repeatOffImage = [NSImage imageNamed:@"repeatOff"]; |
|
|
|
|
|
_repeatOneImage = [NSImage imageNamed:@"repeatOne"]; |
|
|
|
|
|
|
|
|
|
|
|
_shuffleOffImage = [NSImage imageNamed:@"shuffleOff"]; |
|
|
|
|
|
_shuffleOnImage = [NSImage imageNamed:@"shuffleOn"]; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
- (void)dealloc |
|
|
- (void)dealloc |
|
|
@ -344,32 +318,6 @@ |
|
|
[_playerController toggleFullscreen]; |
|
|
[_playerController toggleFullscreen]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
- (IBAction)shuffleAction:(id)sender |
|
|
|
|
|
{ |
|
|
|
|
|
if (_playlistController.playbackOrder == VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL) { |
|
|
|
|
|
_playlistController.playbackOrder = VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM; |
|
|
|
|
|
} else { |
|
|
|
|
|
_playlistController.playbackOrder = VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (IBAction)repeatAction:(id)sender |
|
|
|
|
|
{ |
|
|
|
|
|
enum vlc_playlist_playback_repeat currentRepeatState = _playlistController.playbackRepeat; |
|
|
|
|
|
switch (currentRepeatState) { |
|
|
|
|
|
case VLC_PLAYLIST_PLAYBACK_REPEAT_ALL: |
|
|
|
|
|
_playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_NONE; |
|
|
|
|
|
break; |
|
|
|
|
|
case VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT: |
|
|
|
|
|
_playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_ALL; |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
|
_playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - |
|
|
#pragma mark - |
|
|
#pragma mark Updaters |
|
|
#pragma mark Updaters |
|
|
|
|
|
|
|
|
@ -451,40 +399,6 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
- (void)repeatStateUpdated:(NSNotification *)aNotification |
|
|
|
|
|
{ |
|
|
|
|
|
enum vlc_playlist_playback_repeat currentRepeatState = _playlistController.playbackRepeat; |
|
|
|
|
|
|
|
|
|
|
|
switch (currentRepeatState) { |
|
|
|
|
|
case VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT: |
|
|
|
|
|
self.repeatButton.image = _repeatOneImage; |
|
|
|
|
|
break; |
|
|
|
|
|
case VLC_PLAYLIST_PLAYBACK_REPEAT_ALL: |
|
|
|
|
|
self.repeatButton.image = _repeatAllImage; |
|
|
|
|
|
break; |
|
|
|
|
|
case VLC_PLAYLIST_PLAYBACK_REPEAT_NONE: |
|
|
|
|
|
default: |
|
|
|
|
|
self.repeatButton.image = _repeatOffImage; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (@available(macOS 11.0, *)) { |
|
|
|
|
|
self.repeatButton.contentTintColor = currentRepeatState == VLC_PLAYLIST_PLAYBACK_REPEAT_NONE ? |
|
|
|
|
|
nil : [NSColor VLCAccentColor]; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (void)shuffleStateUpdated:(NSNotification *)aNotification |
|
|
|
|
|
{ |
|
|
|
|
|
self.shuffleButton.image = _playlistController.playbackOrder == VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL ? |
|
|
|
|
|
_shuffleOffImage : _shuffleOnImage; |
|
|
|
|
|
|
|
|
|
|
|
if (@available(macOS 11.0, *)) { |
|
|
|
|
|
self.shuffleButton.contentTintColor = _playlistController.playbackOrder == VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL ? |
|
|
|
|
|
nil : [NSColor VLCAccentColor]; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (void)updatePlaybackControls:(NSNotification *)aNotification |
|
|
- (void)updatePlaybackControls:(NSNotification *)aNotification |
|
|
{ |
|
|
{ |
|
|
bool b_seekable = _playerController.seekable; |
|
|
bool b_seekable = _playerController.seekable; |
|
|
|