Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (23)
Showing
with 97 additions and 122 deletions
......@@ -216,7 +216,7 @@ static int Open(vlc_object_t *p_this)
return VLC_EGENERIC;
}
if ([device isInUseByAnotherApplication]) {
if (device.isInUseByAnotherApplication) {
msg_Err(p_demux, "Capture device is exclusively in use by another application");
return VLC_EGENERIC;
}
......
......@@ -402,7 +402,7 @@ static int Control(demux_t *p_demux, int i_query, va_list args)
AVCaptureDevice *device = _device;
if ( [device isInUseByAnotherApplication] == YES )
if ( device.isInUseByAnotherApplication == YES )
{
msg_Err(_demux, "default capture device is exclusively in use by another application");
return nil;
......
......@@ -79,7 +79,7 @@
- (BOOL)handleVideoOutputKeyDown:(id)anEvent forVideoOutput:(vout_thread_t *)p_vout
{
VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController];
VLCPlayerController * const playerController = VLCMain.sharedInstance.playlistController.playerController;
unichar key = 0;
vlc_value_t val;
NSEventModifierFlags i_pressed_modifiers = 0;
......@@ -173,8 +173,8 @@
unichar key = [characters characterAtIndex: 0];
if (key) {
VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController];
vout_thread_t *p_vout = [playerController mainVideoOutputThread];
VLCPlayerController * const playerController = VLCMain.sharedInstance.playlistController.playerController;
vout_thread_t * const p_vout = playerController.mainVideoOutputThread;
if (p_vout != NULL) {
/* Escape */
if (key == (unichar) 0x1b) {
......@@ -221,7 +221,7 @@
/* handle Lion's default key combo for fullscreen-toggle in addition to our own hotkeys */
if (key == 'f' && i_pressed_modifiers & NSControlKeyMask && i_pressed_modifiers & NSCommandKeyMask) {
[[[[VLCMain sharedInstance] playlistController] playerController] toggleFullscreen];
[VLCMain.sharedInstance.playlistController.playerController toggleFullscreen];
return YES;
}
......
......@@ -66,7 +66,7 @@
return;
}
VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController];
VLCPlayerController *playerController = VLCMain.sharedInstance.playlistController.playerController;
vout_thread_t *vout = [playerController mainVideoOutputThread];
if (!vout)
return;
......@@ -128,7 +128,7 @@
return;
}
VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController];
VLCPlayerController *playerController = VLCMain.sharedInstance.playlistController.playerController;
vout_thread_t *vout = [playerController mainVideoOutputThread];
if (!vout)
return;
......
......@@ -26,24 +26,18 @@ NS_ASSUME_NONNULL_BEGIN
@interface NSColor (VLCAdditions)
+ (instancetype)VLCAccentColor;
+ (instancetype)VLCOrangeElementColor;
+ (instancetype)VLClibraryLightTitleColor;
+ (instancetype)VLClibraryDarkTitleColor;
+ (instancetype)VLClibrarySubtitleColor;
+ (instancetype)VLClibraryAnnotationColor;
+ (instancetype)VLClibraryAnnotationBackgroundColor;
+ (instancetype)VLClibrarySeparatorLightColor;
+ (instancetype)VLClibrarySeparatorDarkColor;
+ (instancetype)VLClibraryProgressIndicatorBackgroundColor;
+ (instancetype)VLClibraryItemBorderLightColor;
+ (instancetype)VLClibraryItemBorderDarkColor;
+ (instancetype)VLClibraryCollectionViewItemBackgroundLightColor;
+ (instancetype)VLClibraryCollectionViewItemBackgroundDarkColor;
+ (instancetype)VLCSliderFillColor;
+ (instancetype)VLCSliderLightBackgroundColor;
+ (instancetype)VLCSliderDarkBackgroundColor;
@property (class, readonly) NSColor *VLCAccentColor;
@property (class, readonly) NSColor *VLClibraryLightTitleColor;
@property (class, readonly) NSColor *VLClibraryDarkTitleColor;
@property (class, readonly) NSColor *VLClibrarySubtitleColor;
@property (class, readonly) NSColor *VLClibraryAnnotationColor;
@property (class, readonly) NSColor *VLClibraryAnnotationBackgroundColor;
@property (class, readonly) NSColor *VLClibrarySeparatorLightColor;
@property (class, readonly) NSColor *VLClibrarySeparatorDarkColor;
@property (class, readonly) NSColor *VLClibraryProgressIndicatorBackgroundColor;
@property (class, readonly) NSColor *VLCSliderFillColor;
@property (class, readonly) NSColor *VLCSliderLightBackgroundColor;
@property (class, readonly) NSColor *VLCSliderDarkBackgroundColor;
@property (class, readonly) NSColor *VLCSubtleBorderColor;
@end
......
......@@ -24,7 +24,7 @@
@implementation NSColor (VLCAdditions)
+ (instancetype)VLCAccentColor
+ (NSColor *)VLCAccentColor
{
if (@available(macOS 10.14, *)) {
return [NSColor controlAccentColor];
......@@ -33,83 +33,63 @@
return [NSColor VLCOrangeElementColor];
}
+ (instancetype)VLCOrangeElementColor
+ (NSColor *)VLCOrangeElementColor
{
return [NSColor colorWithRed:1. green:.38 blue:.04 alpha:1.];
}
+ (instancetype)VLClibraryLightTitleColor
+ (NSColor *)VLClibraryLightTitleColor
{
return [NSColor colorWithRed:0.15 green:0.16 blue:0.17 alpha:1.];
}
+ (instancetype)VLClibraryDarkTitleColor
+ (NSColor *)VLClibraryDarkTitleColor
{
return [NSColor colorWithRed:0.85 green:0.84 blue:0.83 alpha:1.];
}
+ (instancetype)VLClibrarySubtitleColor
+ (NSColor *)VLClibrarySubtitleColor
{
return [NSColor colorWithRed:0.52 green:0.57 blue:0.61 alpha:1.];
}
+ (instancetype)VLClibraryAnnotationColor
+ (NSColor *)VLClibraryAnnotationColor
{
return [NSColor whiteColor];
}
+ (instancetype)VLClibraryAnnotationBackgroundColor
+ (NSColor *)VLClibraryAnnotationBackgroundColor
{
return [NSColor colorWithRed:0. green:0. blue:0. alpha:.4];
}
+ (instancetype)VLClibrarySeparatorLightColor
+ (NSColor *)VLClibrarySeparatorLightColor
{
return [NSColor colorWithRed:0.89 green:0.91 blue:0.93 alpha:1.];
}
+ (instancetype)VLClibrarySeparatorDarkColor
+ (NSColor *)VLClibrarySeparatorDarkColor
{
return [NSColor colorWithRed:0.11 green:0.09 blue:0.07 alpha:1.];
}
+ (instancetype)VLClibraryProgressIndicatorBackgroundColor
+ (NSColor *)VLClibraryProgressIndicatorBackgroundColor
{
return [NSColor colorWithRed:37./255. green:41./255. blue:44./255. alpha:.8];
}
+ (instancetype)VLClibraryItemBorderLightColor
+ (NSColor *)VLCSliderFillColor
{
return [NSColor colorWithRed:0.89 green:0.89 blue:0.91 alpha:1.];
}
+ (instancetype)VLClibraryItemBorderDarkColor
{
return [NSColor colorWithRed:0.48 green:0.48 blue:0.48 alpha:1.];
}
+ (instancetype)VLClibraryCollectionViewItemBackgroundLightColor
{
return [NSColor colorWithRed:0.23 green:0.23 blue:0.23 alpha:1.];
}
+ (instancetype)VLClibraryCollectionViewItemBackgroundDarkColor
{
return [NSColor colorWithRed:0.23 green:0.23 blue:0.23 alpha:1.];
}
+ (instancetype)VLCSliderFillColor
{
return [NSColor VLCAccentColor];
return NSColor.VLCAccentColor;
}
+ (instancetype)VLCSliderLightBackgroundColor
+ (NSColor *)VLCSliderLightBackgroundColor
{
return [NSColor colorWithCalibratedWhite:0.5 alpha:0.5];
}
+ (instancetype)VLCSliderDarkBackgroundColor
+ (NSColor *)VLCSliderDarkBackgroundColor
{
return [NSColor colorWithCalibratedWhite:1 alpha:0.2];
}
......
......@@ -26,9 +26,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface NSFont (VLCAdditions)
+ (instancetype)VLClibrarySectionHeaderFont;
+ (instancetype)VLCLibrarySubsectionHeaderFont;
+ (instancetype)VLCLibrarySubsectionSubheaderFont;
@property (class, readonly) NSFont *VLClibrarySectionHeaderFont;
@property (class, readonly) NSFont *VLCLibrarySubsectionHeaderFont;
@property (class, readonly) NSFont *VLCLibrarySubsectionSubheaderFont;
@end
......
......@@ -24,17 +24,17 @@
@implementation NSFont (VLCAdditions)
+ (instancetype)VLClibrarySectionHeaderFont
+ (NSFont *)VLClibrarySectionHeaderFont
{
return [NSFont systemFontOfSize:24. weight:NSFontWeightBold];
}
+ (instancetype)VLCLibrarySubsectionHeaderFont
+ (NSFont *)VLCLibrarySubsectionHeaderFont
{
return [NSFont systemFontOfSize:17. weight:NSFontWeightSemibold];
}
+ (instancetype)VLCLibrarySubsectionSubheaderFont
+ (NSFont *)VLCLibrarySubsectionSubheaderFont
{
return [NSFont systemFontOfSize:15. weight:NSFontWeightMedium];
}
......
......@@ -148,7 +148,7 @@ The class is not thread safe
@interface AppleRemote (Singleton)
+ (AppleRemote*) sharedRemote;
@property (class, readonly) AppleRemote *sharedRemote;
@end
......
......@@ -174,19 +174,19 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
}
- (BOOL) listeningOnAppActivate {
id appDelegate = [NSApp delegate];
id appDelegate = NSApp.delegate;
return (appDelegate!=nil && [appDelegate isKindOfClass: [AppleRemoteApplicationDelegate class]]);
}
- (void) setListeningOnAppActivate: (BOOL) value {
if (value) {
if ([self listeningOnAppActivate]) return;
AppleRemoteApplicationDelegate* appDelegate = [[AppleRemoteApplicationDelegate alloc] initWithApplicationDelegate: [NSApp delegate]];
AppleRemoteApplicationDelegate* appDelegate = [[AppleRemoteApplicationDelegate alloc] initWithApplicationDelegate: NSApp.delegate];
/* NSApp does not retain its delegate therefore we keep retain count on 1 */
[(NSApplication *)NSApp setDelegate: appDelegate];
} else {
if ([self listeningOnAppActivate]==NO) return;
AppleRemoteApplicationDelegate* appDelegate = (AppleRemoteApplicationDelegate*)[NSApp delegate];
id previousAppDelegate = [appDelegate applicationDelegate];
AppleRemoteApplicationDelegate* appDelegate = (AppleRemoteApplicationDelegate*)NSApp.delegate;
id previousAppDelegate = appDelegate.applicationDelegate;
[(NSApplication *)NSApp setDelegate: previousAppDelegate];
}
}
......@@ -643,14 +643,14 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
}
}
- (void)applicationDidBecomeActive:(NSNotification *)aNotification {
[[AppleRemote sharedRemote] setListeningToRemote: YES];
[AppleRemote.sharedRemote setListeningToRemote: YES];
if ([applicationDelegate respondsToSelector: @selector(applicationDidBecomeActive:)]) {
[applicationDelegate applicationDidBecomeActive: aNotification];
}
}
- (void)applicationWillResignActive:(NSNotification *)aNotification {
[[AppleRemote sharedRemote] setListeningToRemote: NO];
[AppleRemote.sharedRemote setListeningToRemote: NO];
if ([applicationDelegate respondsToSelector: @selector(applicationWillResignActive:)]) {
[applicationDelegate applicationWillResignActive: aNotification];
......
......@@ -30,9 +30,10 @@
@interface SPMediaKeyTap : NSObject
@property (class, readonly) BOOL usesGlobalMediaKeyTap;
- (id)initWithDelegate:(id)delegate;
+ (BOOL)usesGlobalMediaKeyTap;
- (BOOL)startWatchingMediaKeys;
- (void)stopWatchingMediaKeys;
- (void)handleAndReleaseMediaKeyEvent:(NSEvent *)event;
......
......@@ -79,13 +79,13 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
// Listen to "app switched" event, so that we don't intercept media keys if we
// weren't the last "media key listening" app to be active
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
[NSWorkspace.sharedWorkspace.notificationCenter addObserver:self
selector:@selector(frontmostAppChanged:)
name:NSWorkspaceDidActivateApplicationNotification
object:nil];
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
[NSWorkspace.sharedWorkspace.notificationCenter addObserver:self
selector:@selector(appTerminated:)
name:NSWorkspaceDidTerminateApplicationNotification
object:nil];
......@@ -93,7 +93,7 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
- (void)stopWatchingAppSwitching
{
[[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self];
[NSWorkspace.sharedWorkspace.notificationCenter removeObserver:self];
}
- (BOOL)startWatchingMediaKeys
......@@ -324,7 +324,7 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
if([_mediaKeyAppList count] == 0)
return;
NSRunningApplication *thisApp = [NSRunningApplication currentApplication];
NSRunningApplication *thisApp = NSRunningApplication.currentApplication;
NSRunningApplication *otherApp = [_mediaKeyAppList firstObject];
BOOL isCurrent = [thisApp isEqual:otherApp];
......
......@@ -518,7 +518,7 @@ static const struct vlc_metadata_cbs preparseCallbacks = {
- (void)parsingEnded:(int)status
{
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
if (status) {
[notificationCenter postNotificationName:VLCInputItemParsingSucceeded object:self];
} else {
......@@ -546,7 +546,7 @@ static const struct vlc_metadata_cbs preparseCallbacks = {
- (void)preparsingEnded:(enum input_item_preparse_status)status
{
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
switch (status) {
case ITEM_PREPARSE_SKIPPED:
[notificationCenter postNotificationName:VLCInputItemPreparsingSkipped object:self];
......@@ -582,7 +582,7 @@ static const struct vlc_metadata_cbs preparseCallbacks = {
- (void)subTreeAdded:(input_item_node_t *)p_node
{
_subTree = p_node;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCInputItemSubtreeAdded object:self];
[NSNotificationCenter.defaultCenter postNotificationName:VLCInputItemSubtreeAdded object:self];
}
- (int)writeMetadataToFile
......@@ -607,7 +607,7 @@ static const struct vlc_metadata_cbs preparseCallbacks = {
withSize:size];
if (!image) {
image = [[NSWorkspace sharedWorkspace] iconForFile:path];
image = [NSWorkspace.sharedWorkspace iconForFile:path];
image.size = size;
}
}
......
......@@ -34,7 +34,7 @@
self = [super init];
if (self) {
_dynamicItemSizing = YES;
_staticItemSize = [VLCLibraryCollectionViewItem defaultSize];
_staticItemSize = VLCLibraryCollectionViewItem.defaultSize;
_itemsAspectRatio = VLCLibraryCollectionViewItemAspectRatioDefaultItem;
}
return self;
......
......@@ -84,8 +84,8 @@ static CVReturn detailViewAnimationCallback(CVDisplayLinkRef displayLink,
{
self = [super init];
if (self) {
_defaultHeightAnimationSteps = [NSArray arrayWithArray:[self generateAnimationStepsForExpandedViewHeight:[VLCLibraryUIUnits mediumDetailSupplementaryViewCollectionViewHeight]]];
_largeHeightAnimationSteps = [NSArray arrayWithArray:[self generateAnimationStepsForExpandedViewHeight:[VLCLibraryUIUnits largeDetailSupplementaryViewCollectionViewHeight]]];
_defaultHeightAnimationSteps = [NSArray arrayWithArray:[self generateAnimationStepsForExpandedViewHeight:VLCLibraryUIUnits.mediumDetailSupplementaryViewCollectionViewHeight]];
_largeHeightAnimationSteps = [NSArray arrayWithArray:[self generateAnimationStepsForExpandedViewHeight:VLCLibraryUIUnits.largeDetailSupplementaryViewCollectionViewHeight]];
_animationType = VLCExpandAnimationTypeDefault;
_prevProvidedAnimationStep = 0;
......@@ -278,7 +278,7 @@ static CVReturn detailViewAnimationCallback(CVDisplayLinkRef displayLink,
float selectedItemFrameMaxY = _selectedIndexPath == nil ? 0 : NSMaxY([[self layoutAttributesForItemAtIndexPath:_selectedIndexPath] frame]);
detailViewAttributes.frame = NSMakeRect(NSMinX(self.collectionView.frame) + self.minimumInteritemSpacing,
selectedItemFrameMaxY + [VLCLibraryUIUnits mediumSpacing],
selectedItemFrameMaxY + VLCLibraryUIUnits.mediumSpacing,
self.collectionViewContentSize.width - (self.minimumInteritemSpacing * 2),
[self currentAnimationStep]);
......@@ -322,7 +322,7 @@ static CVReturn detailViewAnimationCallback(CVDisplayLinkRef displayLink,
NSRect selectedItemFrame = selectedItemLayoutAttributes.frame;
if (NSMinY(attributesFrame) > (NSMaxY(selectedItemFrame))) {
attributesFrame.origin.y += [self currentAnimationStep] + [VLCLibraryUIUnits mediumSpacing];
attributesFrame.origin.y += [self currentAnimationStep] + VLCLibraryUIUnits.mediumSpacing;
}
}
......
......@@ -33,11 +33,11 @@ extern NSString *VLCLibraryCellIdentifier;
@interface VLCLibraryCollectionViewItem : NSCollectionViewItem
// NOTE: These will need to be changed after changes to XIB
+ (const NSSize)defaultSize;
+ (const NSSize)defaultVideoItemSize;
+ (const CGFloat)defaultWidth;
+ (const CGFloat)bottomTextViewsHeight;
+ (const CGFloat)videoHeightAspectRatioMultiplier;
@property (class, readonly) const NSSize defaultSize;
@property (class, readonly) const NSSize defaultVideoItemSize;
@property (class, readonly) const CGFloat defaultWidth;
@property (class, readonly) const CGFloat bottomTextViewsHeight;
@property (class, readonly) const CGFloat videoHeightAspectRatioMultiplier;
@property (readwrite, assign) IBOutlet NSTextField *mediaTitleTextField;
@property (readwrite, assign) IBOutlet NSTextField *annotationTextField;
......
......@@ -60,15 +60,15 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
+ (const NSSize)defaultSize
{
const CGFloat width = [VLCLibraryCollectionViewItem defaultWidth];
return CGSizeMake(width, width + [self bottomTextViewsHeight]);
const CGFloat width = VLCLibraryCollectionViewItem.defaultWidth;
return CGSizeMake(width, width + self.bottomTextViewsHeight);
}
+ (const NSSize)defaultVideoItemSize
{
const CGFloat width = [VLCLibraryCollectionViewItem defaultWidth];
const CGFloat width = VLCLibraryCollectionViewItem.defaultWidth;
const CGFloat imageViewHeight = width * [VLCLibraryCollectionViewItem videoHeightAspectRatioMultiplier];
return CGSizeMake(width, imageViewHeight + [self bottomTextViewsHeight]);
return CGSizeMake(width, imageViewHeight + self.bottomTextViewsHeight);
}
+ (const CGFloat)defaultWidth
......@@ -78,11 +78,11 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
+ (const CGFloat)bottomTextViewsHeight
{
return [VLCLibraryUIUnits smallSpacing] +
return VLCLibraryUIUnits.smallSpacing +
16 +
[VLCLibraryUIUnits smallSpacing] +
VLCLibraryUIUnits.smallSpacing +
16 +
[VLCLibraryUIUnits smallSpacing];
VLCLibraryUIUnits.smallSpacing;
}
+ (const CGFloat)videoHeightAspectRatioMultiplier
......@@ -94,7 +94,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self
selector:@selector(mediaItemThumbnailGenerated:)
name:VLCLibraryModelMediaItemThumbnailGenerated
......@@ -105,9 +105,9 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
if (@available(macOS 10.14, *)) {
[[NSApplication sharedApplication] removeObserver:self forKeyPath:@"effectiveAppearance"];
[NSApplication.sharedApplication removeObserver:self forKeyPath:@"effectiveAppearance"];
}
}
......@@ -124,17 +124,17 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
_videoImageViewAspectRatioConstraint.active = NO;
[(VLCTrackingView *)self.view setViewToHide:self.playInstantlyButton];
self.secondaryInfoTextField.textColor = [NSColor VLClibrarySubtitleColor];
self.secondaryInfoTextField.textColor = NSColor.VLClibrarySubtitleColor;
self.annotationTextField.font = [NSFont systemFontOfSize:NSFont.systemFontSize weight:NSFontWeightBold];
self.annotationTextField.textColor = [NSColor VLClibraryAnnotationColor];
self.annotationTextField.backgroundColor = [NSColor VLClibraryAnnotationBackgroundColor];
self.annotationTextField.textColor = NSColor.VLClibraryAnnotationColor;
self.annotationTextField.backgroundColor = NSColor.VLClibraryAnnotationBackgroundColor;
self.unplayedIndicatorTextField.stringValue = _NS("NEW");
self.unplayedIndicatorTextField.font = [NSFont systemFontOfSize:NSFont.systemFontSize weight:NSFontWeightBold];
self.highlightBox.borderColor = [NSColor VLCAccentColor];
self.unplayedIndicatorTextField.textColor = [NSColor VLCAccentColor];
self.highlightBox.borderColor = NSColor.VLCAccentColor;
self.unplayedIndicatorTextField.textColor = NSColor.VLCAccentColor;
if (@available(macOS 10.14, *)) {
[[NSApplication sharedApplication] addObserver:self
[NSApplication.sharedApplication addObserver:self
forKeyPath:@"effectiveAppearance"
options:NSKeyValueObservingOptionNew
context:nil];
......@@ -165,7 +165,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
isDark = [appearance.name isEqualToString:NSAppearanceNameDarkAqua] || [appearance.name isEqualToString:NSAppearanceNameVibrantDark];
}
self.mediaTitleTextField.textColor = isDark ? [NSColor VLClibraryDarkTitleColor] : [NSColor VLClibraryLightTitleColor];
self.mediaTitleTextField.textColor = isDark ? NSColor.VLClibraryDarkTitleColor : NSColor.VLClibraryLightTitleColor;
}
#pragma mark - view representation
......@@ -187,7 +187,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
- (void)setRepresentedItem:(id<VLCMediaLibraryItemProtocol>)representedItem
{
if (!_libraryController) {
_libraryController = [[VLCMain sharedInstance] libraryController];
_libraryController = VLCMain.sharedInstance.libraryController;
}
_representedItem = representedItem;
......@@ -280,7 +280,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
- (IBAction)playInstantly:(id)sender
{
if (!_libraryController) {
_libraryController = [[VLCMain sharedInstance] libraryController];
_libraryController = VLCMain.sharedInstance.libraryController;
}
// We want to add all the tracks to the playlist but only play the first one immediately,
......@@ -298,7 +298,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
- (IBAction)addToPlaylist:(id)sender
{
if (!_libraryController) {
_libraryController = [[VLCMain sharedInstance] libraryController];
_libraryController = VLCMain.sharedInstance.libraryController;
}
[_representedItem iterateMediaItemsWithBlock:^(VLCMediaLibraryMediaItem* mediaItem) {
......
......@@ -52,12 +52,12 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
- (void)awakeFromNib
{
_mediaItemTitleTextField.font = [NSFont VLCLibrarySubsectionHeaderFont];
_mediaItemDetailTextField.font = [NSFont VLCLibrarySubsectionSubheaderFont];
_mediaItemDetailTextField.textColor = [NSColor VLCAccentColor];
_mediaItemTitleTextField.font = NSFont.VLCLibrarySubsectionHeaderFont;
_mediaItemDetailTextField.font = NSFont.VLCLibrarySubsectionSubheaderFont;
_mediaItemDetailTextField.textColor = NSColor.VLCAccentColor;
if(@available(macOS 10.12.2, *)) {
_playMediaItemButton.bezelColor = [NSColor VLCAccentColor];
_playMediaItemButton.bezelColor = NSColor.VLCAccentColor;
}
}
......@@ -106,7 +106,7 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
- (IBAction)playAction:(id)sender
{
if (!_libraryController) {
_libraryController = [[VLCMain sharedInstance] libraryController];
_libraryController = VLCMain.sharedInstance.libraryController;
}
[_libraryController appendItemToPlaylist:_representedMediaItem playImmediately:YES];
......@@ -115,7 +115,7 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
- (IBAction)enqueueAction:(id)sender
{
if (!_libraryController) {
_libraryController = [[VLCMain sharedInstance] libraryController];
_libraryController = VLCMain.sharedInstance.libraryController;
}
[_libraryController appendItemToPlaylist:_representedMediaItem playImmediately:NO];
......
......@@ -28,7 +28,7 @@ extern NSString *VLCLibrarySupplementaryElementViewIdentifier;
@interface VLCLibraryCollectionViewSupplementaryElementView : NSTextField
+ (CGSize)defaultHeaderSize;
@property (class, readonly) const CGSize defaultHeaderSize;
@end
......
......@@ -38,8 +38,8 @@ NSString *VLCLibrarySupplementaryElementViewIdentifier = @"VLCLibrarySupplementa
{
self = [super initWithFrame:frameRect];
if (self) {
self.font = [NSFont VLClibrarySectionHeaderFont];
self.textColor = self.shouldShowDarkAppearance ? [NSColor VLClibraryDarkTitleColor] : [NSColor VLClibraryLightTitleColor];
self.font = NSFont.VLClibrarySectionHeaderFont;
self.textColor = self.shouldShowDarkAppearance ? NSColor.VLClibraryDarkTitleColor : NSColor.VLClibraryLightTitleColor;
self.editable = NO;
self.selectable = NO;
self.bordered = NO;
......@@ -52,7 +52,7 @@ NSString *VLCLibrarySupplementaryElementViewIdentifier = @"VLCLibrarySupplementa
- (void)viewDidChangeEffectiveAppearance
{
self.textColor = self.shouldShowDarkAppearance ? [NSColor VLClibraryDarkTitleColor] : [NSColor VLClibraryLightTitleColor];
self.textColor = self.shouldShowDarkAppearance ? NSColor.VLClibraryDarkTitleColor : NSColor.VLClibraryLightTitleColor;
}
@end