[vlc-commits] macosx/image view: allow setting images with URLs and placeholders

2019-06-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun 30 14:14:26 
2019 +0200| [a094528a49d9bd7e515a81d9b89fb3845eb71995] | committer: Felix Paul 
Kühne

macosx/image view: allow setting images with URLs and placeholders

This downloads and allocates the image on a background thread without blocking 
the UI.

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

 modules/gui/macosx/views/VLCImageView.h |  2 ++
 modules/gui/macosx/views/VLCImageView.m | 11 +++
 2 files changed, 13 insertions(+)

diff --git a/modules/gui/macosx/views/VLCImageView.h 
b/modules/gui/macosx/views/VLCImageView.h
index 46e73f95c1..4008d299da 100644
--- a/modules/gui/macosx/views/VLCImageView.h
+++ b/modules/gui/macosx/views/VLCImageView.h
@@ -42,4 +42,6 @@ typedef NS_ENUM(NSInteger, VLCImageViewContentGravity) {
 @property (readwrite, retain, nonatomic, nullable) NSImage *image;
 @property (readwrite) VLCImageViewContentGravity contentGravity;
 
+- (void)setImageURL:(NSURL * _Nonnull)url placeholderImage:(NSImage * 
_Nullable)image;
+
 @end
diff --git a/modules/gui/macosx/views/VLCImageView.m 
b/modules/gui/macosx/views/VLCImageView.m
index c0015df9d5..bd4184cbfd 100644
--- a/modules/gui/macosx/views/VLCImageView.m
+++ b/modules/gui/macosx/views/VLCImageView.m
@@ -121,4 +121,15 @@
 [self setupBorderColor];
 }
 
+- (void)setImageURL:(NSURL * _Nonnull)artworkURL placeholderImage:(NSImage * 
_Nullable)image
+{
+[self setImage:image];
+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 
0), ^{
+NSImage *downloadedImage = [[NSImage alloc] 
initWithContentsOfURL:artworkURL];
+dispatch_async(dispatch_get_main_queue(), ^{
+[self setImage:downloadedImage];
+});
+});
+}
+
 @end

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: iterate on media source UI

2019-06-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun 30 09:59:30 
2019 +0200| [1daec27bd354c944b6f34aee1e5ad295f42057d5] | committer: Felix Paul 
Kühne

macosx: iterate on media source UI

Add button and path control UI elements, minor refactoring

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   | 12 +--
 modules/gui/macosx/Makefile.am |  4 +-
 modules/gui/macosx/UI/VLCLibraryWindow.xib | 92 +++---
 modules/gui/macosx/library/VLCLibraryWindow.h  |  4 +-
 modules/gui/macosx/library/VLCLibraryWindow.m  | 32 
 ...DataSource.h => VLCMediaSourceBaseDataSource.h} | 11 +--
 ...DataSource.m => VLCMediaSourceBaseDataSource.m} |  8 +-
 po/POTFILES.in |  4 +-
 8 files changed, 102 insertions(+), 65 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index e2aef9ee67..36168f2fcc 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -172,7 +172,7 @@
7DFBDCBB226CED6300B700A5 /* VLCMediaSourceProvider.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7DFBDCBA226CED6300B700A5 /* 
VLCMediaSourceProvider.m */; };
7DFBDCBE226CED7200B700A5 /* VLCMediaSource.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7DFBDCBD226CED7200B700A5 /* VLCMediaSource.m */; 
};
7DFBDCC1226DC16200B700A5 /* VLCInputItem.m in Sources */ = {isa 
= PBXBuildFile; fileRef = 7DFBDCC0226DC16200B700A5 /* VLCInputItem.m */; };
-   7DFBDCC4226E445500B700A5 /* VLCMediaSourceDataSource.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCC3226E445500B700A5 /* 
VLCMediaSourceDataSource.m */; };
+   7DFBDCC4226E445500B700A5 /* VLCMediaSourceBaseDataSource.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCC3226E445500B700A5 /* 
VLCMediaSourceBaseDataSource.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -590,8 +590,8 @@
7DFBDCBD226CED7200B700A5 /* VLCMediaSource.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCMediaSource.m; sourceTree = ""; };
7DFBDCBF226DC16200B700A5 /* VLCInputItem.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCInputItem.h; 
sourceTree = ""; };
7DFBDCC0226DC16200B700A5 /* VLCInputItem.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCInputItem.m; 
sourceTree = ""; };
-   7DFBDCC2226E445500B700A5 /* VLCMediaSourceDataSource.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCMediaSourceDataSource.h; sourceTree = ""; };
-   7DFBDCC3226E445500B700A5 /* VLCMediaSourceDataSource.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCMediaSourceDataSource.m; sourceTree = ""; };
+   7DFBDCC2226E445500B700A5 /* VLCMediaSourceBaseDataSource.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCMediaSourceBaseDataSource.h; sourceTree = ""; };
+   7DFBDCC3226E445500B700A5 /* VLCMediaSourceBaseDataSource.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCMediaSourceBaseDataSource.m; sourceTree = ""; };
8E49720006417F6800370C9F /* VLCInformationWindowController.h */ 
= {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.h; path = VLCInformationWindowController.h; sourceTree = 
""; };
8E49720106417F6800370C9F /* VLCInformationWindowController.m */ 
= {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = VLCInformationWindowController.m; sourceTree = 
""; };
8E55FB7F0459B0FD00FB3317 /* VLCOutput.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
VLCOutput.h; sourceTree = ""; };
@@ -1416,8 +1416,8 @@
7DFBDCBA226CED6300B700A5 /* 
VLCMediaSourceProvider.m */,
7DFBDCBC226CED7200B700A5 /* VLCMediaSource.h */,
7DFBDCBD226CED7200B700A5 /* VLCMediaSource.m */,
-   7DFBDCC2226E445500B700A5 /* 
VLCMediaSourceDataSource.h */,
-   7DFBDCC3226E445500B700A5 /* 
VLCMediaSourceDataSource.m */,
+   7DFBDCC2226E445500B700A5 /* 
VLCMediaSourceBaseDataSource.h */,
+   7DFBDCC3226E445500B700A5 /* 
VLCMediaSourceBaseDataSource.m */,
7DF14FBA2270CB1C0008ABE4 /* 
VLCMediaSourceCollectionV

[vlc-commits] macosx/input item: implement parsing

2019-06-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun 30 11:33:42 
2019 +0200| [91a29caca83526a97cae648d1c008b97629ce3c3] | committer: Felix Paul 
Kühne

macosx/input item: implement parsing

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

 modules/gui/macosx/library/VLCInputItem.h |  8 
 modules/gui/macosx/library/VLCInputItem.m | 75 +++
 2 files changed, 83 insertions(+)

diff --git a/modules/gui/macosx/library/VLCInputItem.h 
b/modules/gui/macosx/library/VLCInputItem.h
index 8554dd793e..a9e9690a9d 100644
--- a/modules/gui/macosx/library/VLCInputItem.h
+++ b/modules/gui/macosx/library/VLCInputItem.h
@@ -28,6 +28,10 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+extern NSString *VLCInputItemParsingSucceeded;
+extern NSString *VLCInputItemParsingFailed;
+extern NSString *VLCInputItemSubtreeAdded;
+
 @interface VLCInputItem : NSObject
 
 - (instancetype)initWithInputItem:(struct input_item_t *)p_inputItem;
@@ -37,6 +41,10 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readonly) NSString *MRL;
 @property (readonly) vlc_tick_t duration;
 @property (readonly) enum input_item_type_e inputType;
+@property (readonly) struct input_item_node_t *subTree;
+
+- (void)parseInputItem;
+- (void)cancelParsing;
 
 @end
 
diff --git a/modules/gui/macosx/library/VLCInputItem.m 
b/modules/gui/macosx/library/VLCInputItem.m
index b20f4ead45..394114cef4 100644
--- a/modules/gui/macosx/library/VLCInputItem.m
+++ b/modules/gui/macosx/library/VLCInputItem.m
@@ -22,8 +22,47 @@
 
 #import "VLCInputItem.h"
 
+#import "main/VLCMain.h"
 #import "extensions/NSString+Helpers.h"
 
+NSString *VLCInputItemParsingSucceeded = @"VLCInputItemParsingSucceeded";
+NSString *VLCInputItemParsingFailed = @"VLCInputItemParsingFailed";
+NSString *VLCInputItemSubtreeAdded = @"VLCInputItemSubtreeAdded";
+
+@interface VLCInputItem()
+{
+input_item_parser_id_t *_p_parserID;
+}
+
+- (void)parsingEnded:(int)status;
+- (void)subTreeAdded:(input_item_node_t *)p_node;
+
+@end
+
+static void cb_parsing_ended(input_item_t *p_item, int status, void *p_data)
+{
+VLC_UNUSED(p_item);
+dispatch_async(dispatch_get_main_queue(), ^{
+VLCInputItem *inputItem = (__bridge VLCInputItem *)p_data;
+[inputItem parsingEnded:status];
+});
+}
+
+static void cb_subtree_added(input_item_t *p_item, input_item_node_t *p_node, 
void *p_data)
+{
+VLC_UNUSED(p_item);
+dispatch_async(dispatch_get_main_queue(), ^{
+VLCInputItem *inputItem = (__bridge VLCInputItem *)p_data;
+[inputItem subTreeAdded:p_node];
+});
+}
+
+static const struct input_item_parser_cbs_t parserCallbacks =
+{
+cb_parsing_ended,
+cb_subtree_added,
+};
+
 @implementation VLCInputItem
 
 - (instancetype)initWithInputItem:(struct input_item_t *)p_inputItem
@@ -38,6 +77,9 @@
 
 - (void)dealloc
 {
+if (_p_parserID) {
+input_item_parser_id_Release(_p_parserID);
+}
 input_item_Release(_vlcInputItem);
 }
 
@@ -73,6 +115,39 @@
 return ITEM_TYPE_UNKNOWN;
 }
 
+- (void)parseInputItem
+{
+_p_parserID = input_item_Parse(_vlcInputItem,
+   (vlc_object_t *)getIntf(),
+   ,
+   (__bridge void *) self);
+}
+
+- (void)cancelParsing
+{
+if (_p_parserID) {
+input_item_parser_id_Interrupt(_p_parserID);
+}
+}
+
+- (void)parsingEnded:(int)status
+{
+NSNotificationCenter *notificationCenter = [NSNotificationCenter 
defaultCenter];
+if (status) {
+[notificationCenter postNotificationName:VLCInputItemParsingSucceeded 
object:self];
+} else {
+[notificationCenter postNotificationName:VLCInputItemParsingFailed 
object:self];
+}
+input_item_parser_id_Release(_p_parserID);
+_p_parserID = NULL;
+}
+
+- (void)subTreeAdded:(input_item_node_t *)p_node
+{
+_subTree = p_node;
+[[NSNotificationCenter defaultCenter] 
postNotificationName:VLCInputItemSubtreeAdded object:self];
+}
+
 @end
 
 @interface VLCInputNode()

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: implement media source tree navigation and playback

2019-06-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun 30 13:20:29 
2019 +0200| [26770609541412e04235fecf4e99f24b0a3d1f1a] | committer: Felix Paul 
Kühne

macosx: implement media source tree navigation and playback

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |   6 ++
 modules/gui/macosx/Makefile.am |   2 +
 modules/gui/macosx/UI/VLCLibraryWindow.xib |   3 +-
 .../media-source/VLCMediaSourceBaseDataSource.m|  41 -
 .../macosx/media-source/VLCMediaSourceDataSource.h |  39 
 .../macosx/media-source/VLCMediaSourceDataSource.m | 100 +
 po/POTFILES.in |   2 +
 7 files changed, 189 insertions(+), 4 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 36168f2fcc..2cacc3b003 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -106,6 +106,7 @@
7D1BF28D22A19227C50F /* VLCPlaylistSortingMenuController.m 
in Sources */ = {isa = PBXBuildFile; fileRef = 7D1BF28C22A19227C50F /* 
VLCPlaylistSortingMenuController.m */; };
7D20081A2289835C002679DF /* VLCTrackingView.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D2008192289835C002679DF /* VLCTrackingView.m 
*/; };
7D22A8F422BC14F80063ECD2 /* VLCLibrarySortingMenuController.m 
in Sources */ = {isa = PBXBuildFile; fileRef = 7D22A8F322BC14F80063ECD2 /* 
VLCLibrarySortingMenuController.m */; };
+   7D2554C222C8A39300F2D9C2 /* VLCMediaSourceDataSource.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D2554C122C8A39300F2D9C2 /* 
VLCMediaSourceDataSource.m */; };
7D28E6362275B4820098D30E /* NSColor+VLCAdditions.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D28E6352275B4820098D30E /* 
NSColor+VLCAdditions.m */; };
7D28E6392275B7340098D30E /* NSFont+VLCAdditions.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7D28E6382275B7340098D30E /* 
NSFont+VLCAdditions.m */; };
7D2E0EDB20CD204D0033A221 /* VLCWindow.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 7D2E0ED920CD204D0033A221 /* VLCWindow.m */; };
@@ -460,6 +461,8 @@
7D2008192289835C002679DF /* VLCTrackingView.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCTrackingView.m; sourceTree = ""; };
7D22A8F222BC14F80063ECD2 /* VLCLibrarySortingMenuController.h 
*/ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibrarySortingMenuController.h; sourceTree = ""; };
7D22A8F322BC14F80063ECD2 /* VLCLibrarySortingMenuController.m 
*/ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibrarySortingMenuController.m; sourceTree = ""; };
+   7D2554C022C8A39300F2D9C2 /* VLCMediaSourceDataSource.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCMediaSourceDataSource.h; sourceTree = ""; };
+   7D2554C122C8A39300F2D9C2 /* VLCMediaSourceDataSource.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCMediaSourceDataSource.m; sourceTree = ""; };
7D28E6342275B4820098D30E /* NSColor+VLCAdditions.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"NSColor+VLCAdditions.h"; sourceTree = ""; };
7D28E6352275B4820098D30E /* NSColor+VLCAdditions.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
"NSColor+VLCAdditions.m"; sourceTree = ""; };
7D28E6372275B7340098D30E /* NSFont+VLCAdditions.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"NSFont+VLCAdditions.h"; sourceTree = ""; };
@@ -1418,6 +1421,8 @@
7DFBDCBD226CED7200B700A5 /* VLCMediaSource.m */,
7DFBDCC2226E445500B700A5 /* 
VLCMediaSourceBaseDataSource.h */,
7DFBDCC3226E445500B700A5 /* 
VLCMediaSourceBaseDataSource.m */,
+   7D2554C022C8A39300F2D9C2 /* 
VLCMediaSourceDataSource.h */,
+   7D2554C122C8A39300F2D9C2 /* 
VLCMediaSourceDataSource.m */,
7DF14FBA2270CB1C0008ABE4 /* 
VLCMediaSourceCollectionViewItem.h */,
7DF14FBB2270CB1C0008ABE4 /* 
VLCMediaSourceCollectionViewItem.m */,
);
@@ -1721,6 +1726,7 @@
1C3113AB1E508C6900D4DD76 /* 
VLCExtensionsDialogProvider.m in Sources */,
7D460B0C229EB4C700097948 /* VLCDragDrop

[vlc-commits] macosx/player controller: handle delays for individual ES streams

2019-06-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun 29 01:18:56 
2019 +0200| [1475c0fc31b03a71f5c69a2c2f8ed8fef728a59f] | committer: Felix Paul 
Kühne

macosx/player controller: handle delays for individual ES streams

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

 modules/gui/macosx/playlist/VLCPlayerController.h | 26 ++
 modules/gui/macosx/playlist/VLCPlayerController.m | 42 +++
 2 files changed, 68 insertions(+)

diff --git a/modules/gui/macosx/playlist/VLCPlayerController.h 
b/modules/gui/macosx/playlist/VLCPlayerController.h
index 7ae1c11254..dd1f1f38d8 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.h
+++ b/modules/gui/macosx/playlist/VLCPlayerController.h
@@ -29,6 +29,9 @@ NS_ASSUME_NONNULL_BEGIN
 @class VLCTrackMetaData;
 @class VLCProgramMetaData;
 
+extern NSString *VLCPlayerElementaryStreamID;
+extern NSString *VLCTick;
+
 /**
  * Listen to VLCPlayerCurrentMediaItemChanged to notified if the current media 
item changes for the player
  * @note the affected player object will be the object of the notification
@@ -160,6 +163,13 @@ extern NSString *VLCPlayerAudioDelayChanged;
 extern NSString *VLCPlayerSubtitlesDelayChanged;
 
 /**
+ * Listen to VLCPlayerDelayChangedForSpecificElementaryStream to be notified 
if the delay of a specific elementary stream changes
+ * @note the affected player object will be the object of the notification
+ * @return the notification's userInfo dictionary will hold key/value pairs 
for VLCPlayerElementaryStreamID and VLCTick to describe the changes
+ */
+extern NSString *VLCPlayerDelayChangedForSpecificElementaryStream;
+
+/**
  * Listen to VLCPlayerSubtitlesFPSChanged to be notified if the subtitles FPS 
of the current media changes
  * @note the affected player object will be the object of the notification
  */
@@ -628,6 +638,22 @@ extern const CGFloat VLCVolumeDefault;
 @property (readwrite, nonatomic) vlc_tick_t subtitlesDelay;
 
 /**
+ * fetch the delay for a specific track identified through its elementary 
stream ID
+ * @return the delay for the track or INT64_MAX if none is set
+ */
+- (vlc_tick_t)delayForElementaryStreamID:(vlc_es_id_t *)esID;
+
+/**
+ * set the delay of a specific track identified through its elementary stream 
ID
+ * @warning Setting the delay of one specific track will override previous and 
future changes of delay made through generic calls
+ * @param delay the delay as a valid time or INT64_MAX to reset to the default 
for the ES category
+ * @param esID the ID for the elementary stream
+ * @param relative use an absolute or relative whence to describe the time
+ * @return VLC_SUCCESS on success
+ */
+- (int)setDelay:(vlc_tick_t)delay forElementaryStreamID:(vlc_es_id_t *)esID 
relativeWhence:(BOOL)relative;
+
+/**
  * the subtitles fps to correct mismatch between video and text
  * the default value shall be 1.0
  * @note listen to VLCPlayerSubtitlesFPSChanged to be notified about changes 
to this property
diff --git a/modules/gui/macosx/playlist/VLCPlayerController.m 
b/modules/gui/macosx/playlist/VLCPlayerController.m
index 5c966aacd5..ca310e0bc6 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.m
+++ b/modules/gui/macosx/playlist/VLCPlayerController.m
@@ -35,6 +35,8 @@
 
 #import 
 
+NSString *VLCPlayerElementaryStreamID = @"VLCPlayerElementaryStreamID";
+NSString *VLCTick = @"VLCTick";
 NSString *VLCPlayerCurrentMediaItemChanged = 
@"VLCPlayerCurrentMediaItemChanged";
 NSString *VLCPlayerMetadataChangedForCurrentMedia = 
@"VLCPlayerMetadataChangedForCurrentMedia";
 NSString *VLCPlayerStateChanged = @"VLCPlayerStateChanged";
@@ -57,6 +59,7 @@ NSString *VLCPlayerTeletextPageChanged = 
@"VLCPlayerTeletextPageChanged";
 NSString *VLCPlayerTeletextTransparencyChanged = 
@"VLCPlayerTeletextTransparencyChanged";
 NSString *VLCPlayerAudioDelayChanged = @"VLCPlayerAudioDelayChanged";
 NSString *VLCPlayerSubtitlesDelayChanged = @"VLCPlayerSubtitlesDelayChanged";
+NSString *VLCPlayerDelayChangedForSpecificElementaryStream = 
@"VLCPlayerDelayChangedForSpecificElementaryStream";
 NSString *VLCPlayerSubtitlesFPSChanged = @"VLCPlayerSubtitlesFPSChanged";
 NSString *VLCPlayerSubtitleTextScalingFactorChanged = 
@"VLCPlayerSubtitleTextScalingFactorChanged";
 NSString *VLCPlayerRecordingChanged = @"VLCPlayerRecordingChanged";
@@ -111,6 +114,7 @@ const CGFloat VLCVolumeDefault = 1.;
 - (void)audioDelayChanged:(vlc_tick_t)audioDelay;
 - (void)rendererChanged:(vlc_renderer_item_t *)newRendererItem;
 - (void)subtitlesDelayChanged:(vlc_tick_t)subtitlesDelay;
+- (void)delayChanged:(vlc_tick_t)trackDelay forTrack:(vlc_es_id_t *)esID;
 - (void)subtitlesFPSChanged:(float)subtitlesFPS;
 - (void)recordingChanged:(BOOL)recording;
 - (void)inputStatsUpdated:(VLCInputStats *)inputStats;
@@ -372,6 +376,18 @@ static void cb_pl

[vlc-commits] macosx: fix compilation broken in 5961eeaa

2019-06-26 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed Jun 26 20:21:26 
2019 +0200| [1ccb8dfc7a96545e3194dd6740803171d05d5aa9] | committer: Felix Paul 
Kühne

macosx: fix compilation broken in 5961eeaa

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

 modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m |  6 +++---
 modules/gui/macosx/library/VLCLibraryAudioDataSource.m|  6 +++---
 modules/gui/macosx/library/VLCLibraryCollectionViewItem.m |  4 ++--
 modules/gui/macosx/library/VLCLibraryController.m | 11 ++-
 modules/gui/macosx/library/VLCLibraryDataTypes.h  |  4 ++--
 modules/gui/macosx/library/VLCLibraryDataTypes.m  | 10 +-
 6 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m 
b/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
index ec216b9415..5c670a119d 100644
--- a/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
+++ b/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
@@ -159,9 +159,9 @@ const CGFloat VLCLibraryTracksRowHeight = 50.;
 VLCMediaLibraryMediaItem *mediaItem = _tracks[row];
 
 NSImage *image;
-if (mediaItem.artworkGenerated) {
-if (mediaItem.artworkMRL.length > 0) {
-image = [[NSImage alloc] initWithContentsOfURL:[NSURL 
URLWithString:mediaItem.artworkMRL]];
+if (mediaItem.smallArtworkGenerated) {
+if (mediaItem.smallArtworkMRL.length > 0) {
+image = [[NSImage alloc] initWithContentsOfURL:[NSURL 
URLWithString:mediaItem.smallArtworkMRL]];
 }
 }
 if (!image) {
diff --git a/modules/gui/macosx/library/VLCLibraryAudioDataSource.m 
b/modules/gui/macosx/library/VLCLibraryAudioDataSource.m
index c0713eb6c4..cb3adc788e 100644
--- a/modules/gui/macosx/library/VLCLibraryAudioDataSource.m
+++ b/modules/gui/macosx/library/VLCLibraryAudioDataSource.m
@@ -156,9 +156,9 @@ static NSString *VLCAudioLibraryCellIdentifier = 
@"VLCAudioLibraryCellIdentifier
 VLCMediaLibraryMediaItem *mediaItem = listOfAudioMedia[row];
 
 NSImage *image;
-if (mediaItem.artworkGenerated) {
-if (mediaItem.artworkMRL.length > 0) {
-image = [[NSImage alloc] initWithContentsOfURL:[NSURL 
URLWithString:mediaItem.artworkMRL]];
+if (mediaItem.smallArtworkGenerated) {
+if (mediaItem.smallArtworkMRL.length > 0) {
+image = [[NSImage alloc] initWithContentsOfURL:[NSURL 
URLWithString:mediaItem.smallArtworkMRL]];
 }
 }
 if (!image) {
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index a35a9ff405..ac97cfe211 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -186,8 +186,8 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 - (NSImage *)imageForMedia
 {
 NSImage *image;
-if (_representedMediaItem.artworkGenerated) {
-image = [[NSImage alloc] initWithContentsOfURL:[NSURL 
URLWithString:_representedMediaItem.artworkMRL]];
+if (_representedMediaItem.smallArtworkGenerated) {
+image = [[NSImage alloc] initWithContentsOfURL:[NSURL 
URLWithString:_representedMediaItem.smallArtworkMRL]];
 } else {
 if (_representedMediaItem.mediaType != VLC_ML_MEDIA_TYPE_AUDIO) {
 [_libraryController 
attemptToGenerateThumbnailForMediaItem:_representedMediaItem];
diff --git a/modules/gui/macosx/library/VLCLibraryController.m 
b/modules/gui/macosx/library/VLCLibraryController.m
index 0d882e72e3..2a2194b670 100644
--- a/modules/gui/macosx/library/VLCLibraryController.m
+++ b/modules/gui/macosx/library/VLCLibraryController.m
@@ -30,6 +30,10 @@
 
 #import 
 
+uint32_t kVLCDesiredThumbnailWidth = 512;
+uint32_t kVLCDesiredThumbnailHeight = 320;
+float kVLCDefaultThumbnailPosition = .15;
+
 @interface VLCLibraryController()
 {
 vlc_medialibrary_t *_p_libraryInstance;
@@ -125,7 +129,12 @@
 
 - (int)attemptToGenerateThumbnailForMediaItem:(VLCMediaLibraryMediaItem 
*)mediaItem
 {
-return vlc_ml_media_generate_thumbnail(_p_libraryInstance, 
mediaItem.libraryID);
+return vlc_ml_media_generate_thumbnail(_p_libraryInstance,
+   mediaItem.libraryID,
+   VLC_ML_THUMBNAIL_SMALL,
+   kVLCDesiredThumbnailWidth,
+   kVLCDesiredThumbnailHeight,
+   kVLCDefaultThumbnailPosition);
 }
 
 #pragma mark - folder management
diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.h 
b/modules/gui/macosx/library/VLCLibraryDataTypes.h
index 5d50c69e5b..aa27b7133d 100644
--- a/module

[vlc-commits] macosx: iterate on media discovery

2019-06-26 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed Jun 26 14:18:04 
2019 +0200| [55a92b318bec18a6c31424f3ffdd8a9e80dd0bc3] | committer: Felix Paul 
Kühne

macosx: iterate on media discovery

This shows discovered devices now instead of services capable of discovering 
something.

Browsing will be implement in subsequent commits.

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

 modules/gui/macosx/library/VLCInputItem.m  | 10 +++
 modules/gui/macosx/media-source/VLCMediaSource.m   |  9 +-
 .../macosx/media-source/VLCMediaSourceDataSource.h |  1 -
 .../macosx/media-source/VLCMediaSourceDataSource.m | 95 +++---
 4 files changed, 80 insertions(+), 35 deletions(-)

diff --git a/modules/gui/macosx/library/VLCInputItem.m 
b/modules/gui/macosx/library/VLCInputItem.m
index 9f998ec2f4..b20f4ead45 100644
--- a/modules/gui/macosx/library/VLCInputItem.m
+++ b/modules/gui/macosx/library/VLCInputItem.m
@@ -92,6 +92,16 @@
 return self;
 }
 
+- (NSString *)description
+{
+NSString *inputItemName;
+if (_p_inputNode->p_item)
+inputItemName = toNSStr(_p_inputNode->p_item->psz_name);
+else
+inputItemName = @"p_item == nil";
+return [NSString stringWithFormat:@"%@: node: %p input name: %@, number of 
children: %i", NSStringFromClass([self class]), _p_inputNode, inputItemName, 
self.numberOfChildren];
+}
+
 - (VLCInputItem *)inputItem
 {
 if (_p_inputNode->p_item) {
diff --git a/modules/gui/macosx/media-source/VLCMediaSource.m 
b/modules/gui/macosx/media-source/VLCMediaSource.m
index 7e09931002..d02bee24f7 100644
--- a/modules/gui/macosx/media-source/VLCMediaSource.m
+++ b/modules/gui/macosx/media-source/VLCMediaSource.m
@@ -43,8 +43,9 @@ static void cb_children_reset(vlc_media_tree_t *p_tree,
   void *p_data)
 {
 dispatch_async(dispatch_get_main_queue(), ^{
+VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
 [[NSNotificationCenter defaultCenter] 
postNotificationName:VLCMediaSourceChildrenReset
-
object:[[VLCInputNode alloc] initWithInputNode:p_node]];
+
object:mediaSource];
 });
 }
 
@@ -55,8 +56,9 @@ static void cb_children_added(vlc_media_tree_t *p_tree,
   void *p_data)
 {
 dispatch_async(dispatch_get_main_queue(), ^{
+VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
 [[NSNotificationCenter defaultCenter] 
postNotificationName:VLCMediaSourceChildrenAdded
-
object:[[VLCInputNode alloc] initWithInputNode:p_node]];
+
object:mediaSource];
 });
 }
 
@@ -67,8 +69,9 @@ static void cb_children_removed(vlc_media_tree_t *p_tree,
 void *p_data)
 {
 dispatch_async(dispatch_get_main_queue(), ^{
+VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
 [[NSNotificationCenter defaultCenter] 
postNotificationName:VLCMediaSourceChildrenRemoved
-
object:[[VLCInputNode alloc] initWithInputNode:p_node]];
+
object:mediaSource];
 });
 }
 
diff --git a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h 
b/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h
index 897231ed68..8c6b6143cf 100644
--- a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h
+++ b/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h
@@ -31,7 +31,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface VLCMediaSourceDataSource : NSObject 
 
-@property (readwrite) VLCMediaSourceMode mediaSourceMode;
 @property (readwrite) NSCollectionView *collectionView;
 
 - (void)loadMediaSources;
diff --git a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m 
b/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m
index c07245761b..c55bbbf8a4 100644
--- a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m
+++ b/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m
@@ -32,7 +32,7 @@
 
 @interface VLCMediaSourceDataSource ()
 {
-NSArray *_mediaDiscovery;
+NSArray *_mediaSources;
 }
 @end
 
@@ -42,39 +42,55 @@
 {
 self = [super init];
 if (self) {
-_mediaDiscovery = @[];
+_mediaSources = @[];
+NSNotificationCenter *notificationCenter = [NSNotificationCenter 
defaultCenter];
+[notificationCenter addObserver:self
+   selector:@selector(mediaSourceChildrenReset:)
+   name:VLCMediaSourceChildrenReset
+ object:nil];
+[notificationCenter addObserver:self
+   selector

[vlc-commits] macosx/library: implement sorting

2019-06-20 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu Jun 20 22:07:47 
2019 +0200| [e78831df7bdc537a12001b30a8a18ba345deb734] | committer: Felix Paul 
Kühne

macosx/library: implement sorting

Note that this respected by the video view only for now

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |   6 +
 modules/gui/macosx/Makefile.am |   2 +
 modules/gui/macosx/UI/VLCLibraryWindow.xib |  17 +--
 modules/gui/macosx/library/VLCLibraryController.h  |  25 
 modules/gui/macosx/library/VLCLibraryController.m  |   9 ++
 modules/gui/macosx/library/VLCLibraryModel.h   |   2 +
 modules/gui/macosx/library/VLCLibraryModel.m   |  26 +++-
 .../library/VLCLibrarySortingMenuController.h  |  33 +
 .../library/VLCLibrarySortingMenuController.m  | 134 +
 modules/gui/macosx/library/VLCLibraryWindow.h  |   1 +
 modules/gui/macosx/library/VLCLibraryWindow.m  |  10 ++
 po/POTFILES.in |   2 +
 12 files changed, 259 insertions(+), 8 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 88cfed3435..e2aef9ee67 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -105,6 +105,7 @@
7D1BF28A22A153E20027C50F /* VLCRoundedCornerTextField.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D1BF28922A153E20027C50F /* 
VLCRoundedCornerTextField.m */; };
7D1BF28D22A19227C50F /* VLCPlaylistSortingMenuController.m 
in Sources */ = {isa = PBXBuildFile; fileRef = 7D1BF28C22A19227C50F /* 
VLCPlaylistSortingMenuController.m */; };
7D20081A2289835C002679DF /* VLCTrackingView.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D2008192289835C002679DF /* VLCTrackingView.m 
*/; };
+   7D22A8F422BC14F80063ECD2 /* VLCLibrarySortingMenuController.m 
in Sources */ = {isa = PBXBuildFile; fileRef = 7D22A8F322BC14F80063ECD2 /* 
VLCLibrarySortingMenuController.m */; };
7D28E6362275B4820098D30E /* NSColor+VLCAdditions.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D28E6352275B4820098D30E /* 
NSColor+VLCAdditions.m */; };
7D28E6392275B7340098D30E /* NSFont+VLCAdditions.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7D28E6382275B7340098D30E /* 
NSFont+VLCAdditions.m */; };
7D2E0EDB20CD204D0033A221 /* VLCWindow.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 7D2E0ED920CD204D0033A221 /* VLCWindow.m */; };
@@ -457,6 +458,8 @@
7D1BF28C22A19227C50F /* VLCPlaylistSortingMenuController.m 
*/ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPlaylistSortingMenuController.m; sourceTree = ""; };
7D2008182289835C002679DF /* VLCTrackingView.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCTrackingView.h; 
sourceTree = ""; };
7D2008192289835C002679DF /* VLCTrackingView.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCTrackingView.m; sourceTree = ""; };
+   7D22A8F222BC14F80063ECD2 /* VLCLibrarySortingMenuController.h 
*/ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibrarySortingMenuController.h; sourceTree = ""; };
+   7D22A8F322BC14F80063ECD2 /* VLCLibrarySortingMenuController.m 
*/ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibrarySortingMenuController.m; sourceTree = ""; };
7D28E6342275B4820098D30E /* NSColor+VLCAdditions.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"NSColor+VLCAdditions.h"; sourceTree = ""; };
7D28E6352275B4820098D30E /* NSColor+VLCAdditions.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
"NSColor+VLCAdditions.m"; sourceTree = ""; };
7D28E6372275B7340098D30E /* NSFont+VLCAdditions.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"NSFont+VLCAdditions.h"; sourceTree = ""; };
@@ -1030,6 +1033,8 @@
7DE2F0432282C84A0040DD0A /* 
VLCLibraryAudioDataSource.m */,
7DFBDCAF226A518400B700A5 /* 
VLCLibraryMenuController.h */,
7DFBDCB0226A518400B700A5 /* 
VLCLibraryMenuController.m */,
+   7D22A8F222BC14F80063ECD2 /* 
VLCLibrarySortingMenuController.h */,
+   7D22A8F322BC14F80063ECD2 /* 
VLCLibrarySortingMenuController.m */,
7DFBDCBF226DC16200B700A5 /* VLCInputItem.h */,
   

[vlc-commits] macosx/applescript: fix type mismatch

2019-06-16 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun 16 17:46:27 
2019 +0200| [20a2fd8a5a09e91c45b04e6db5816aff9b198546] | committer: Felix Paul 
Kühne

macosx/applescript: fix type mismatch

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

 modules/gui/macosx/Resources/vlc.scriptSuite | Bin 2987 -> 2979 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/modules/gui/macosx/Resources/vlc.scriptSuite 
b/modules/gui/macosx/Resources/vlc.scriptSuite
index 539da9df53..d93b081416 100644
Binary files a/modules/gui/macosx/Resources/vlc.scriptSuite and 
b/modules/gui/macosx/Resources/vlc.scriptSuite differ

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/main: move activePlayback property to player controller as it does not belong in the main singleton

2019-06-16 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun 16 13:10:15 
2019 +0200| [f5824de9ec61c0dedebe6e714f8de8ac55f32592] | committer: Felix Paul 
Kühne

macosx/main: move activePlayback property to player controller as it does not 
belong in the main singleton

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

 modules/gui/macosx/library/VLCLibraryWindow.m   |  3 ++-
 modules/gui/macosx/main/VLCMain.h   |  1 -
 modules/gui/macosx/main/VLCMain.m   | 17 +
 modules/gui/macosx/playlist/VLCPlayerController.h   |  5 +
 .../macosx/windows/video/VLCVideoOutputProvider.m   |  6 +++---
 .../gui/macosx/windows/video/VLCVideoWindowCommon.m | 21 +++--
 6 files changed, 22 insertions(+), 31 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index f714ed9eb4..f19475b84b 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -27,6 +27,7 @@
 #import "extensions/NSView+VLCAdditions.h"
 #import "main/VLCMain.h"
 
+#import "playlist/VLCPlayerController.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlaylistDataSource.h"
 #import "playlist/VLCPlaylistSortingMenuController.h"
@@ -623,7 +624,7 @@ static int ShowController(vlc_object_t *p_this, const char 
*psz_variable,
 id currentWindow = [NSApp keyWindow];
 if ([currentWindow respondsToSelector:@selector(hasActiveVideo)] && 
[currentWindow hasActiveVideo]) {
 if ([currentWindow respondsToSelector:@selector(fullscreen)] && 
[currentWindow fullscreen] && ![[currentWindow videoView] isHidden]) {
-if ([[VLCMain sharedInstance] activeVideoPlayback]) {
+if ([_playlistController.playerController activeVideoPlayback]) {
 [_fspanel fadeIn];
 }
 }
diff --git a/modules/gui/macosx/main/VLCMain.h 
b/modules/gui/macosx/main/VLCMain.h
index 77dbc82054..b03d0767f4 100644
--- a/modules/gui/macosx/main/VLCMain.h
+++ b/modules/gui/macosx/main/VLCMain.h
@@ -67,7 +67,6 @@ extern NSString *VLCConfigurationChangedNotification;
 
 + (VLCMain *)sharedInstance;
 
-@property (readwrite) BOOL activeVideoPlayback;
 @property (readonly) BOOL isTerminating;
 
 @property (readonly) VLCAudioEffectsWindowController *audioEffectsPanel;
diff --git a/modules/gui/macosx/main/VLCMain.m 
b/modules/gui/macosx/main/VLCMain.m
index 93917c8cdb..cdd90699f4 100644
--- a/modules/gui/macosx/main/VLCMain.m
+++ b/modules/gui/macosx/main/VLCMain.m
@@ -346,7 +346,7 @@ static VLCMain *sharedInstance = nil;
 /* don't be enthusiastic about an update if we currently play a video */
 - (BOOL)updaterMayCheckForUpdates:(SUUpdater *)bundle
 {
-if ([self activeVideoPlayback])
+if ([_playlistController.playerController activeVideoPlayback])
 return NO;
 
 return YES;
@@ -408,16 +408,6 @@ static VLCMain *sharedInstance = nil;
 return YES;
 }
 
-- (void)setActiveVideoPlayback:(BOOL)b_value
-{
-assert([NSThread isMainThread]);
-
-b_active_videoplayback = b_value;
-if ([self libraryWindow]) {
-//[[self libraryWindow] toggleVideoPlaybackAppearance];
-}
-}
-
 #pragma mark -
 #pragma mark Other objects getters
 
@@ -523,9 +513,4 @@ static VLCMain *sharedInstance = nil;
 return _resume_dialog;
 }
 
-- (BOOL)activeVideoPlayback
-{
-return b_active_videoplayback;
-}
-
 @end
diff --git a/modules/gui/macosx/playlist/VLCPlayerController.h 
b/modules/gui/macosx/playlist/VLCPlayerController.h
index 1909beac13..7ae1c11254 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.h
+++ b/modules/gui/macosx/playlist/VLCPlayerController.h
@@ -771,6 +771,11 @@ extern const CGFloat VLCVolumeDefault;
 @property (readwrite, nonatomic) BOOL fullscreen;
 
 /**
+ * indicates whether we currently have an active video playback session
+ */
+@property (readwrite) BOOL activeVideoPlayback;
+
+/**
  * helper function to inverse the current fullscreen state
  */
 - (void)toggleFullscreen;
diff --git a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m 
b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
index 378dce3f2d..928928c58f 100644
--- a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
+++ b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
@@ -355,7 +355,7 @@ int WindowOpen(vout_window_t *p_wnd)
 [newVideoWindow setHasActiveVideo: YES];
 [_voutWindows setObject:newVideoWindow forKey:[NSValue 
valueWithPointer:p_wnd]];
 
-[mainInstance setActiveVideoPlayback: YES];
+[_playerController setActiveVideoPlayback: YES];
 [[mainInstance libraryWindow] setNonembedded:!b_mainWindowHasVideo];
 
 // TODO: find a cleaner way for "start in fullscreen"
@@ -418,7 +418,7 @@ int WindowOpen(vout_window_t *p_wnd)
 
 [_

[vlc-commits] macosx/main: lazy load main menu and library window controller

2019-06-16 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun 16 13:29:18 
2019 +0200| [3b5314faead54f94696b016d31006bbcf33ccef6] | committer: Felix Paul 
Kühne

macosx/main: lazy load main menu and library window controller

This improves launch speed of the macOS interface module by up to 20%

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

 modules/gui/macosx/main/VLCMain.m | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/main/VLCMain.m 
b/modules/gui/macosx/main/VLCMain.m
index cdd90699f4..fb3e215462 100644
--- a/modules/gui/macosx/main/VLCMain.m
+++ b/modules/gui/macosx/main/VLCMain.m
@@ -151,9 +151,6 @@ int OpenIntf (vlc_object_t *p_this)
 [VLCApplication sharedApplication];
 [VLCMain sharedInstance];
 
-[[NSBundle mainBundle] loadNibNamed:@"MainMenu" owner:[[VLCMain 
sharedInstance] mainMenu] topLevelObjects:nil];
-[[[VLCMain sharedInstance] libraryWindow] 
makeKeyAndOrderFront:nil];
-
 msg_Dbg(p_intf, "Finished loading macosx interface");
 return VLC_SUCCESS;
 } @catch (NSException *exception) {
@@ -233,7 +230,7 @@ static VLCMain *sharedInstance = nil;
 _coredialogs = [[VLCCoreDialogProvider alloc] init];
 
 _mainmenu = [[VLCMainMenu alloc] init];
-_statusBarIcon = [[VLCStatusBarIcon  alloc] init];
+_statusBarIcon = [[VLCStatusBarIcon alloc] init];
 
 _voutProvider = [[VLCVideoOutputProvider alloc] init];
 
@@ -272,6 +269,8 @@ static VLCMain *sharedInstance = nil;
 {
 _clickerManager = [[VLCClickerManager alloc] init];
 
+[[NSBundle mainBundle] loadNibNamed:@"MainMenu" owner:_mainmenu 
topLevelObjects:nil];
+
 #ifdef HAVE_SPARKLE
 [[SUUpdater sharedUpdater] setDelegate:self];
 #endif
@@ -280,6 +279,7 @@ static VLCMain *sharedInstance = nil;
 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
 {
 launched = YES;
+[_libraryWindowController.window makeKeyAndOrderFront:nil];
 
 if (!p_intf)
 return;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: move show controller callbacks away from the main singleton

2019-06-11 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue Jun 11 12:08:45 
2019 +0200| [883c17dd20d2865fa8c45a4b621109ef104e0902] | committer: Felix Paul 
Kühne

macosx: move show controller callbacks away from the main singleton

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

 modules/gui/macosx/library/VLCLibraryWindow.m  | 46 +-
 modules/gui/macosx/main/VLCMain.m  | 32 ---
 .../macosx/windows/video/VLCVideoWindowCommon.h|  1 +
 .../macosx/windows/video/VLCVideoWindowCommon.m|  1 +
 4 files changed, 47 insertions(+), 33 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index 1b9409d179..f714ed9eb4 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -52,6 +52,7 @@
 #import "windows/VLCOpenWindowController.h"
 #import "windows/VLCOpenInputMetadata.h"
 
+#import 
 #import 
 
 const CGFloat VLCLibraryWindowMinimalWidth = 604.;
@@ -81,6 +82,32 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
 }
 @end
 
+static int ShowFullscreenController(vlc_object_t *p_this, const char 
*psz_variable,
+vlc_value_t old_val, vlc_value_t new_val, 
void *param)
+{
+@autoreleasepool {
+dispatch_async(dispatch_get_main_queue(), ^{
+[[NSNotificationCenter defaultCenter] 
postNotificationName:VLCVideoWindowShouldShowFullscreenController
+object:nil];
+});
+
+return VLC_SUCCESS;
+}
+}
+
+static int ShowController(vlc_object_t *p_this, const char *psz_variable,
+  vlc_value_t old_val, vlc_value_t new_val, void 
*param)
+{
+@autoreleasepool {
+dispatch_async(dispatch_get_main_queue(), ^{
+[[NSNotificationCenter defaultCenter] 
postNotificationName:VLCWindowShouldShowController
+object:nil];
+});
+
+return VLC_SUCCESS;
+}
+}
+
 @implementation VLCLibraryWindow
 
 - (void)awakeFromNib
@@ -88,6 +115,10 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
 VLCMain *mainInstance = [VLCMain sharedInstance];
 _playlistController = [mainInstance playlistController];
 
+libvlc_int_t *libvlc = vlc_object_instance(getIntf());
+var_AddCallback(libvlc, "intf-toggle-fscontrol", ShowFullscreenController, 
(__bridge void *)self);
+var_AddCallback(libvlc, "intf-show", ShowController, (__bridge void 
*)self);
+
 self.videoView = [[VLCVoutView alloc] 
initWithFrame:self.mainSplitView.frame];
 self.videoView.hidden = YES;
 self.videoView.translatesAutoresizingMaskIntoConstraints = NO;
@@ -103,6 +134,10 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;

name:VLCVideoWindowShouldShowFullscreenController
  object:nil];
 [notificationCenter addObserver:self
+   selector:@selector(shouldShowController:)
+   name:VLCWindowShouldShowController
+ object:nil];
+[notificationCenter addObserver:self
selector:@selector(updateLibraryRepresentation:)
name:VLCLibraryModelAudioMediaListUpdated
  object:nil];
@@ -229,6 +264,10 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
 if (@available(macOS 10_14, *)) {
 [[NSApplication sharedApplication] removeObserver:self 
forKeyPath:@"effectiveAppearance"];
 }
+
+libvlc_int_t *libvlc = vlc_object_instance(getIntf());
+var_DelCallback(libvlc, "intf-toggle-fscontrol", ShowFullscreenController, 
(__bridge void *)self);
+var_DelCallback(libvlc, "intf-show", ShowController, (__bridge void 
*)self);
 }
 
 #pragma mark - appearance setters
@@ -572,7 +611,12 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
 }
 
 #pragma mark -
-#pragma mark Fullscreen support
+#pragma mark respond to core events
+
+- (void)shouldShowController:(NSNotification *)aNotification
+{
+[self makeKeyAndOrderFront:nil];
+}
 
 - (void)shouldShowFullscreenController:(NSNotification *)aNotification
 {
diff --git a/modules/gui/macosx/main/VLCMain.m 
b/modules/gui/macosx/main/VLCMain.m
index 3aa0808a86..d33e8ea0e6 100644
--- a/modules/gui/macosx/main/VLCMain.m
+++ b/modules/gui/macosx/main/VLCMain.m
@@ -177,34 +177,6 @@ void CloseIntf (vlc_object_t *p_this)
 #pragma mark -
 #pragma mark Variables Callback
 
-/*
- * ShowController: Callback triggered by the show-intf playlist variable
- * through the ShowIntf-control-int

[vlc-commits] macosx: replace remaining synchronize calls on NSUserDefaults

2019-06-11 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue Jun 11 12:23:10 
2019 +0200| [69f8e5da874389360d461cece17a60747012cf32] | committer: Felix Paul 
Kühne

macosx: replace remaining synchronize calls on NSUserDefaults

In these specific spots, we need to force the write-to-disk so use a 
non-deprecated call.

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

 modules/gui/macosx/main/VLCMain+OldPrefs.m | 6 +++---
 modules/gui/macosx/main/VLCMain.m  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/main/VLCMain+OldPrefs.m 
b/modules/gui/macosx/main/VLCMain+OldPrefs.m
index 356839993a..6860b254a6 100644
--- a/modules/gui/macosx/main/VLCMain+OldPrefs.m
+++ b/modules/gui/macosx/main/VLCMain+OldPrefs.m
@@ -54,7 +54,7 @@ static const int kCurrentPreferencesVersion = 4;
 
 // set correct version to avoid question about outdated config
 [standardUserDefaults setInteger:kCurrentPreferencesVersion 
forKey:kVLCPreferencesVersion];
-[standardUserDefaults synchronize];
+CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
 }
 
 - (void)migrateOldPreferences
@@ -78,7 +78,7 @@ static const int kCurrentPreferencesVersion = 4;
 
 if (version == 1) {
 [defaults setInteger:kCurrentPreferencesVersion 
forKey:kVLCPreferencesVersion];
-[defaults synchronize];
+CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
 
 if (!fixIntfSettings())
 return;
@@ -93,7 +93,7 @@ static const int kCurrentPreferencesVersion = 4;
 /* version 4 (introduced in 3.0.0) adds RTL settings depending on 
stored language */
 [defaults setInteger:kCurrentPreferencesVersion 
forKey:kVLCPreferencesVersion];
 [VLCSimplePrefsController updateRightToLeftSettings];
-[defaults synchronize];
+CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
 
 // In VLC 2.2.x, config for filters was fully controlled by audio and 
video effects panel.
 // In VLC 3.0, this is no longer the case and VLCs config is not 
touched anymore. Therefore,
diff --git a/modules/gui/macosx/main/VLCMain.m 
b/modules/gui/macosx/main/VLCMain.m
index ce1d839691..93917c8cdb 100644
--- a/modules/gui/macosx/main/VLCMain.m
+++ b/modules/gui/macosx/main/VLCMain.m
@@ -329,7 +329,7 @@ static VLCMain *sharedInstance = nil;
 _voutProvider = nil;
 
 /* write cached user defaults to disk */
-[[NSUserDefaults standardUserDefaults] synchronize];
+CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
 }
 
 #pragma mark -

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: don't make the main singleton responsible for saving window states

2019-06-11 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue Jun 11 12:20:16 
2019 +0200| [cce17dd0943774df175b9213fa26e6b4dfebb4f3] | committer: Felix Paul 
Kühne

macosx: don't make the main singleton responsible for saving window states

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

 modules/gui/macosx/main/VLCMain.m | 12 +---
 .../gui/macosx/panels/VLCAudioEffectsWindowController.h   |  1 -
 .../gui/macosx/panels/VLCAudioEffectsWindowController.m   | 15 ++-
 .../gui/macosx/panels/VLCVideoEffectsWindowController.h   |  2 --
 .../gui/macosx/panels/VLCVideoEffectsWindowController.m   | 15 ++-
 5 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/modules/gui/macosx/main/VLCMain.m 
b/modules/gui/macosx/main/VLCMain.m
index d33e8ea0e6..ce1d839691 100644
--- a/modules/gui/macosx/main/VLCMain.m
+++ b/modules/gui/macosx/main/VLCMain.m
@@ -312,20 +312,18 @@ static VLCMain *sharedInstance = nil;
 if (b_intf_terminating)
 return;
 b_intf_terminating = true;
+NSNotificationCenter *notiticationCenter = [NSNotificationCenter 
defaultCenter];
 
 _continuityController = nil;
 
-if (notification == nil)
-[[NSNotificationCenter defaultCenter] postNotificationName: 
NSApplicationWillTerminateNotification object: nil];
-
-/* save current video and audio profiles */
-[[self videoEffectsPanel] saveCurrentProfileAtTerminate];
-[[self audioEffectsPanel] saveCurrentProfileAtTerminate];
+if (notification == nil) {
+[notiticationCenter postNotificationName: 
NSApplicationWillTerminateNotification object: nil];
+}
 
 libvlc_int_t *libvlc = vlc_object_instance(p_intf);
 var_DelCallback(libvlc, "intf-boss", BossCallback, (__bridge void *)self);
 
-[[NSNotificationCenter defaultCenter] removeObserver: self];
+[notiticationCenter removeObserver: self];
 
 // closes all open vouts
 _voutProvider = nil;
diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h 
b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
index 4eb4635a38..bb5a1c8c08 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
@@ -114,7 +114,6 @@
 - (IBAction)applyProfileCheckboxChanged:(id)sender;
 
 - (void)toggleWindow:(id)sender;
-- (void)saveCurrentProfileAtTerminate;
 
 /* Equalizer */
 - (IBAction)equalizerBandSliderUpdated:(id)sender;
diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
index 2b4af84f4e..2929cb85b2 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
@@ -204,10 +204,15 @@ NSString *VLCAudioEffectsProfileNamesKey = 
@"AudioEffectProfileNames";
 
 - (void)windowDidLoad
 {
-[[NSNotificationCenter defaultCenter] addObserver:self
- 
selector:@selector(updateCocoaWindowLevel:)
- 
name:VLCWindowShouldUpdateLevel
-   object:nil];
+NSNotificationCenter *notificationCenter = [NSNotificationCenter 
defaultCenter];
+[notificationCenter addObserver:self
+   selector:@selector(updateCocoaWindowLevel:)
+   name:VLCWindowShouldUpdateLevel
+ object:nil];
+[notificationCenter addObserver:self
+   selector:@selector(saveCurrentProfileAtTerminate:)
+   name:NSApplicationWillTerminateNotification
+ object:nil];
 
 [_applyProfileCheckbox setState:[[NSUserDefaults standardUserDefaults] 
boolForKey:@"AudioEffectApplyProfileOnStartup"]];
 [_applyProfileCheckbox setTitle:_NS("Apply profile at next launch")];
@@ -403,7 +408,7 @@ NSString *VLCAudioEffectsProfileNamesKey = 
@"AudioEffectProfileNames";
 [defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:VLCAudioEffectsProfilesKey];
 }
 
-- (void)saveCurrentProfileAtTerminate
+- (void)saveCurrentProfileAtTerminate:(NSNotification *)notification
 {
 if ([self currentProfileIndex] > 0) {
 [self saveCurrentProfile];
diff --git a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.h 
b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.h
index cab80a0de6..2adee19826 100644
--- a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.h
+++ b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.h
@@ -167,8 +167,6 @@
 @property (nonatomic) int posterizeValue;
 
 /* generic */
-- (void)saveCurrentProfileAtTerminate;
-
 - (void)toggleWindow:(id)sender;
 - (IBAction)profileSelectorAction:(id)sender;
 - (IBAction)applyProfileCheckboxCh

[vlc-commits] macosx/player controller: adapt to core API changes

2019-06-11 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue Jun 11 11:46:08 
2019 +0200| [9c36eeed4e2e41ee825da73f04b437b86cf2d23b] | committer: Felix Paul 
Kühne

macosx/player controller: adapt to core API changes

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

 modules/gui/macosx/playlist/VLCPlayerController.m | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/playlist/VLCPlayerController.m 
b/modules/gui/macosx/playlist/VLCPlayerController.m
index 64dc7de0e6..04f71258d0 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.m
+++ b/modules/gui/macosx/playlist/VLCPlayerController.m
@@ -348,10 +348,10 @@ static void cb_player_stats_changed(vlc_player_t 
*p_player,
 
 static void cb_player_track_list_changed(vlc_player_t *p_player,
  enum vlc_player_list_action action,
- vlc_es_id_t *es_id,
+ const struct vlc_player_track *track,
  void *p_data)
 {
-VLC_UNUSED(p_player); VLC_UNUSED(action); VLC_UNUSED(es_id);
+VLC_UNUSED(p_player); VLC_UNUSED(action); VLC_UNUSED(track);
 dispatch_async(dispatch_get_main_queue(), ^{
 VLCPlayerController *playerController = (__bridge VLCPlayerController 
*)p_data;
 [playerController trackListChanged];
@@ -432,12 +432,12 @@ static void cb_player_item_meta_changed(vlc_player_t 
*p_player,
 static void cb_player_vout_changed(vlc_player_t *p_player,
enum vlc_player_vout_action action,
vout_thread_t *p_vout,
-   const struct vlc_player_track *track,
+   vlc_es_id_t *es_id,
void *p_data)
 {
 VLC_UNUSED(p_player);
 VLC_UNUSED(p_vout);
-VLC_UNUSED(track);
+VLC_UNUSED(es_id);
 dispatch_async(dispatch_get_main_queue(), ^{
 VLCPlayerController *playerController = (__bridge VLCPlayerController 
*)p_data;
 [playerController voutListUpdated];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: use a notification to update the window level instead of calling the singleton directly

2019-06-11 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue Jun 11 11:41:22 
2019 +0200| [cf6a86401878ee618fe1aead26729f9ee4e8fb48] | committer: Felix Paul 
Kühne

macosx: use a notification to update the window level instead of calling the 
singleton directly

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

 .../gui/macosx/panels/VLCAudioEffectsWindowController.h   |  1 -
 .../gui/macosx/panels/VLCAudioEffectsWindowController.m   | 13 -
 modules/gui/macosx/panels/VLCBookmarksWindowController.h  |  1 -
 modules/gui/macosx/panels/VLCBookmarksWindowController.m  |  7 +--
 .../gui/macosx/panels/VLCInformationWindowController.h|  1 -
 .../gui/macosx/panels/VLCInformationWindowController.m|  7 ++-
 .../panels/VLCTrackSynchronizationWindowController.h  |  2 --
 .../panels/VLCTrackSynchronizationWindowController.m  |  7 ++-
 .../gui/macosx/panels/VLCVideoEffectsWindowController.h   |  1 -
 .../gui/macosx/panels/VLCVideoEffectsWindowController.m   |  8 +++-
 .../gui/macosx/panels/dialogs/VLCResumeDialogController.h |  2 --
 .../gui/macosx/panels/dialogs/VLCResumeDialogController.m | 15 +--
 modules/gui/macosx/windows/video/VLCVideoOutputProvider.h |  3 +++
 modules/gui/macosx/windows/video/VLCVideoOutputProvider.m | 13 +
 modules/gui/macosx/windows/video/VLCVideoWindowCommon.m   | 12 +++-
 15 files changed, 64 insertions(+), 29 deletions(-)

diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h 
b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
index dff29b2dad..4eb4635a38 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
@@ -114,7 +114,6 @@
 - (IBAction)applyProfileCheckboxChanged:(id)sender;
 
 - (void)toggleWindow:(id)sender;
-- (void)updateCocoaWindowLevel:(NSInteger)i_level;
 - (void)saveCurrentProfileAtTerminate;
 
 /* Equalizer */
diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
index 4db5dc00c6..2b4af84f4e 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
@@ -204,6 +204,11 @@ NSString *VLCAudioEffectsProfileNamesKey = 
@"AudioEffectProfileNames";
 
 - (void)windowDidLoad
 {
+[[NSNotificationCenter defaultCenter] addObserver:self
+ 
selector:@selector(updateCocoaWindowLevel:)
+ 
name:VLCWindowShouldUpdateLevel
+   object:nil];
+
 [_applyProfileCheckbox setState:[[NSUserDefaults standardUserDefaults] 
boolForKey:@"AudioEffectApplyProfileOnStartup"]];
 [_applyProfileCheckbox setTitle:_NS("Apply profile at next launch")];
 
@@ -281,6 +286,11 @@ NSString *VLCAudioEffectsProfileNamesKey = 
@"AudioEffectProfileNames";
 [self resetProfileSelector];
 }
 
+- (void)dealloc
+{
+[[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
 #pragma mark -
 #pragma mark internal functions
 
@@ -333,8 +343,9 @@ NSString *VLCAudioEffectsProfileNamesKey = 
@"AudioEffectProfileNames";
 
 #pragma mark -
 #pragma mark generic code
-- (void)updateCocoaWindowLevel:(NSInteger)i_level
+- (void)updateCocoaWindowLevel:(NSNotification *)aNotification
 {
+NSInteger i_level = [aNotification.userInfo[VLCWindowLevelKey] 
integerValue];
 if (self.isWindowLoaded && [self.window isVisible] && [self.window level] 
!= i_level)
 [self.window setLevel: i_level];
 }
diff --git a/modules/gui/macosx/panels/VLCBookmarksWindowController.h 
b/modules/gui/macosx/panels/VLCBookmarksWindowController.h
index 1fa07e3ced..b2b99a9971 100644
--- a/modules/gui/macosx/panels/VLCBookmarksWindowController.h
+++ b/modules/gui/macosx/panels/VLCBookmarksWindowController.h
@@ -42,7 +42,6 @@
 @property (readwrite, weak) IBOutlet NSTextField *editNameTextField;
 @property (readwrite, weak) IBOutlet NSTextField *editTimeTextField;
 
-- (void)updateCocoaWindowLevel:(NSInteger)i_level;
 - (IBAction)toggleWindow:(id)sender;
 
 - (IBAction)add:(id)sender;
diff --git a/modules/gui/macosx/panels/VLCBookmarksWindowController.m 
b/modules/gui/macosx/panels/VLCBookmarksWindowController.m
index 7bbfdf23e6..1fc85a 100644
--- a/modules/gui/macosx/panels/VLCBookmarksWindowController.m
+++ b/modules/gui/macosx/panels/VLCBookmarksWindowController.m
@@ -54,7 +54,9 @@
 - (id)init
 {
 self = [super initWithWindowNibName:@"Bookmarks"];
-
+if (self) {
+[[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(updateCocoaWindowLevel:) name:VLCWindowShouldUpdateLevel 
object:nil];
+}
 return self;
 }
 
@@ -93,8 +95,9 @@
 [_editTimeLabel setStringValue: _NS("Time")]

[vlc-commits] macosx/open: modernize coding style

2019-06-11 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue Jun 11 11:14:42 
2019 +0200| [52eb94a956fb2579cfe3ba5310c99749922990bd] | committer: Felix Paul 
Kühne

macosx/open: modernize coding style

This replaces a struct with manual memory management through an ObjC class and 
some more nitpicks

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

 .../gui/macosx/windows/VLCOpenWindowController.m   | 115 +
 1 file changed, 51 insertions(+), 64 deletions(-)

diff --git a/modules/gui/macosx/windows/VLCOpenWindowController.m 
b/modules/gui/macosx/windows/VLCOpenWindowController.m
index f6457df10e..d731ec8c4d 100644
--- a/modules/gui/macosx/windows/VLCOpenWindowController.m
+++ b/modules/gui/macosx/windows/VLCOpenWindowController.m
@@ -39,6 +39,10 @@
 #import "windows/convertandsave/VLCOutput.h"
 #import "windows/VLCOpenInputMetadata.h"
 
+NSString *const VLCOpenFileTabViewId = @"file";
+NSString *const VLCOpenDiscTabViewId = @"disc";
+NSString *const VLCOpenNetworkTabViewId = @"network";
+NSString *const VLCOpenCaptureTabViewId = @"capture";
 NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
 
 @interface VLCOpenBlockDeviceDescription : NSObject
@@ -51,11 +55,20 @@ NSString *const VLCOpenTextFieldWasClicked = 
@"VLCOpenTextFieldWasClicked";
 @end
 
 @implementation VLCOpenBlockDeviceDescription
+@end
+
+@interface VLCOpenDisplayInformation : NSObject
+
+@property (readwrite) CGRect displayBounds;
+@property (readwrite) CGDirectDisplayID displayID;
 
 @end
 
+@implementation VLCOpenDisplayInformation
+@end
+
 @interface VLCOpenTextField : NSTextField
-- (void)mouseDown:(NSEvent *)theEvent;
+
 @end
 
 @implementation VLCOpenTextField
@@ -69,12 +82,6 @@ NSString *const VLCOpenTextFieldWasClicked = 
@"VLCOpenTextFieldWasClicked";
 
 @end
 
-struct display_info_t
-{
-CGRect rect;
-CGDirectDisplayID id;
-};
-
 @interface VLCOpenWindowController()
 {
 VLCOutput *_output;
@@ -104,11 +111,6 @@ struct display_info_t
 
 @implementation VLCOpenWindowController
 
-static NSString *kFileTabViewId = @"file";
-static NSString *kDiscTabViewId = @"disc";
-static NSString *kNetworkTabViewId  = @"network";
-static NSString *kCaptureTabViewId  = @"capture";
-
 #pragma mark -
 #pragma mark Init
 
@@ -118,15 +120,6 @@ static NSString *kCaptureTabViewId  = @"capture";
 return self;
 }
 
-- (void)dealloc
-{
-NSUInteger displayInfoCount = [_displayInfos count];
-for (int i = 0; i < displayInfoCount; i ++) {
-NSValue *v = [_displayInfos objectAtIndex:i];
-free([v pointerValue]);
-}
-}
-
 - (void)windowDidLoad
 {
 _output = [VLCOutput new];
@@ -418,7 +411,7 @@ static NSString *kCaptureTabViewId  = @"capture";
 }
 if ([_fileSlaveCheckbox state] && _fileSlavePath)
 [options addObject: [NSString stringWithFormat: @"input-slave=%@", 
_fileSlavePath]];
-if ([[[_tabView selectedTabViewItem] identifier] isEqualToString: 
kCaptureTabViewId]) {
+if ([[[_tabView selectedTabViewItem] identifier] isEqualToString: 
VLCOpenCaptureTabViewId]) {
 if ([[[_captureModePopup selectedItem] title] isEqualToString: 
_NS("Screen")]) {
 [self addScreenRecordingOptionsToArray:options];
 }
@@ -480,11 +473,10 @@ static NSString *kCaptureTabViewId  = @"capture";
 - (void)addScreenRecordingOptionsToArray:(NSMutableArray *)options
 {
 NSInteger selected_index = [_screenPopup indexOfSelectedItem];
-NSValue *v = [_displayInfos objectAtIndex:selected_index];
-struct display_info_t *item = (struct display_info_t *)[v pointerValue];
+VLCOpenDisplayInformation *displayInformation = [_displayInfos 
objectAtIndex:selected_index];
 
 [options addObject: [NSString stringWithFormat: @"screen-fps=%f", 
[_screenFPSTextField floatValue]]];
-[options addObject: [NSString stringWithFormat: @"screen-display-id=%i", 
item->id]];
+[options addObject: [NSString stringWithFormat: @"screen-display-id=%i", 
displayInformation.displayID]];
 [options addObject: [NSString stringWithFormat: @"screen-left=%i", 
[_screenLeftTextField intValue]]];
 [options addObject: [NSString stringWithFormat: @"screen-top=%i", 
[_screenTopTextField intValue]]];
 [options addObject: [NSString stringWithFormat: @"screen-width=%i", 
[_screenWidthTextField intValue]]];
@@ -511,14 +503,14 @@ static NSString *kCaptureTabViewId  = @"capture";
 {
 NSString *identifier = [tabViewItem identifier];
 
-if ([identifier isEqualToString: kFileTabViewId])
+if ([identifier isEqualToString: VLCOpenFileTabViewId])
 [self openFilePathChanged: nil];
-else if ([identifier isEqualToString: kDiscTabViewId])
+el

[vlc-commits] macosx: replace beep by assert

2019-06-11 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed Jun  5 11:17:47 
2019 +0200| [8a1321f65232133958134cbd56b3863d2148b942] | committer: Felix Paul 
Kühne

macosx: replace beep by assert

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

 modules/gui/macosx/windows/VLCOpenWindowController.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/macosx/windows/VLCOpenWindowController.m 
b/modules/gui/macosx/windows/VLCOpenWindowController.m
index 327183503e..f6457df10e 100644
--- a/modules/gui/macosx/windows/VLCOpenWindowController.m
+++ b/modules/gui/macosx/windows/VLCOpenWindowController.m
@@ -1297,7 +1297,7 @@ static NSString *kCaptureTabViewId  = @"capture";
 if ([[self MRL] length])
 [NSApp stopModalWithCode: 1];
 else
-NSBeep();
+vlc_assert_unreachable();
 }
 
 #pragma mark - audio and video device management

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/playback UI: cosmetics

2019-06-03 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Jun  3 12:57:45 
2019 +0200| [1e6859bcba7b8652abb64b7140452f4fc65d64ac] | committer: Felix Paul 
Kühne

macosx/playback UI: cosmetics

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

 modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h | 3 ++-
 modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m | 1 +
 modules/gui/macosx/windows/video/VLCFSPanelController.h  | 7 +++
 modules/gui/macosx/windows/video/VLCFSPanelController.m  | 8 ++--
 modules/gui/macosx/windows/video/VLCVideoOutputProvider.h| 2 --
 modules/gui/macosx/windows/video/VLCVideoOutputProvider.m| 1 +
 modules/gui/macosx/windows/video/VLCVideoWindowCommon.h  | 6 +-
 modules/gui/macosx/windows/video/VLCVideoWindowCommon.m  | 5 +++--
 8 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h 
b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h
index 8dfb54e335..a998fffdbb 100644
--- a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h
+++ b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h
@@ -23,9 +23,10 @@
 
 #import 
 
-#import "views/VLCVolumeSlider.h"
 #import "windows/mainwindow/VLCControlsBarCommon.h"
 
+@class VLCVolumeSlider;
+
 /*
  * VLCMainWindowControlsBar
  *
diff --git a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m 
b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
index f66d1ca27b..51fcf457c6 100644
--- a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
+++ b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
@@ -28,6 +28,7 @@
 #import "main/VLCMain.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
+#import "views/VLCVolumeSlider.h"
 
 /*
  * VLCMainWindowControlsBar
diff --git a/modules/gui/macosx/windows/video/VLCFSPanelController.h 
b/modules/gui/macosx/windows/video/VLCFSPanelController.h
index 88e65ff9c0..a6c3bf96dc 100644
--- a/modules/gui/macosx/windows/video/VLCFSPanelController.h
+++ b/modules/gui/macosx/windows/video/VLCFSPanelController.h
@@ -25,10 +25,9 @@
 
 #import 
 
-#import "windows/video/VLCWindow.h"
-#import "views/VLCDefaultValueSlider.h"
-#import "views/VLCTimeField.h"
-#import "views/VLCSlider.h"
+@class VLCTimeField;
+@class VLCSlider;
+@class VLCDefaultValueSlider;
 
 extern NSString *VLCFSPanelShouldBecomeActive;
 extern NSString *VLCFSPanelShouldBecomeInactive;
diff --git a/modules/gui/macosx/windows/video/VLCFSPanelController.m 
b/modules/gui/macosx/windows/video/VLCFSPanelController.m
index 7db573123f..8b260cd07c 100644
--- a/modules/gui/macosx/windows/video/VLCFSPanelController.m
+++ b/modules/gui/macosx/windows/video/VLCFSPanelController.m
@@ -30,11 +30,16 @@
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
 #import "windows/video/VLCVideoWindowCommon.h"
+#import "windows/video/VLCWindow.h"
+#import "views/VLCDefaultValueSlider.h"
+#import "views/VLCTimeField.h"
+#import "views/VLCSlider.h"
 
 NSString *VLCFSPanelShouldBecomeActive = @"VLCFSPanelShouldBecomeActive";
 NSString *VLCFSPanelShouldBecomeInactive = @"VLCFSPanelShouldBecomeInactive";
 
-@interface VLCFSPanelController () {
+@interface VLCFSPanelController ()
+{
 BOOL _isCounting;
 
 // Only used to track changes and trigger centering of FS panel
@@ -45,7 +50,6 @@ NSString *VLCFSPanelShouldBecomeInactive = 
@"VLCFSPanelShouldBecomeInactive";
 VLCPlaylistController *_playlistController;
 VLCPlayerController *_playerController;
 }
-
 @end
 
 @implementation VLCFSPanelController
diff --git a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.h 
b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.h
index 6de04160b6..716ed439c8 100644
--- a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.h
+++ b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.h
@@ -25,8 +25,6 @@
 
 #import 
 
-#import "os-integration/VLCKeyboardBacklightControl.h"
-
 @class VLCControlsBarCommon;
 @class VLCVideoWindowCommon;
 @class VLCVoutView;
diff --git a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m 
b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
index 5e77c1a85c..d9d6ce2026 100644
--- a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
+++ b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
@@ -34,6 +34,7 @@
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlay

[vlc-commits] macosx/extensions: cosmetics

2019-06-03 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Jun  3 12:41:42 
2019 +0200| [4a3b698bae42383357b85ac2d76433e416d06aa8] | committer: Felix Paul 
Kühne

macosx/extensions: cosmetics

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

 modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.h | 6 ++
 modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m | 3 +--
 modules/gui/macosx/windows/extensions/VLCExtensionsManager.h| 3 ++-
 modules/gui/macosx/windows/extensions/VLCExtensionsManager.m| 1 +
 modules/gui/macosx/windows/extensions/VLCUIWidgets.m| 4 
 5 files changed, 6 insertions(+), 11 deletions(-)

diff --git 
a/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.h 
b/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.h
index b4e805ddb7..7b69875768 100644
--- a/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.h
+++ b/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.h
@@ -22,15 +22,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 
USA.
  */
 
-#import "main/VLCMain.h"
+#import 
 
 #import 
 #import 
 #import 
 
-#import 
-
-#import "windows/extensions/VLCUIWidgets.h"
+@class VLCDialogWindow;
 
 /*
  * ExtensionsDialogProvider interface
diff --git 
a/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m 
b/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m
index 97160b336c..a8952632d6 100644
--- a/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m
+++ b/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m
@@ -28,10 +28,9 @@
 #import "main/VLCMain.h"
 #import "VLCExtensionsManager.h"
 #import "extensions/NSString+Helpers.h"
-#import "VLCUIWidgets.h"
+#import "windows/extensions/VLCUIWidgets.h"
 
 #import 
-#import 
 
 /*
  * VLCExtensionsDialogProvider implementation
diff --git a/modules/gui/macosx/windows/extensions/VLCExtensionsManager.h 
b/modules/gui/macosx/windows/extensions/VLCExtensionsManager.h
index 4147c5d56a..870a0b9b82 100644
--- a/modules/gui/macosx/windows/extensions/VLCExtensionsManager.h
+++ b/modules/gui/macosx/windows/extensions/VLCExtensionsManager.h
@@ -20,12 +20,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 
USA.
  */
 
+#import 
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
 #import "VLCExtensionsDialogProvider.h"
-#import "main/VLCMain.h"
 
 @interface VLCExtensionsManager : NSObject
 
diff --git a/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m 
b/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m
index 86b921d8a6..6efafabfb1 100644
--- a/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m
+++ b/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m
@@ -28,6 +28,7 @@
 #import 
 #import 
 
+#import "main/VLCMain.h"
 #import "extensions/NSString+Helpers.h"
 #import "windows/extensions/VLCExtensionsDialogProvider.h"
 
diff --git a/modules/gui/macosx/windows/extensions/VLCUIWidgets.m 
b/modules/gui/macosx/windows/extensions/VLCUIWidgets.m
index fc4a78e087..e198993e23 100644
--- a/modules/gui/macosx/windows/extensions/VLCUIWidgets.m
+++ b/modules/gui/macosx/windows/extensions/VLCUIWidgets.m
@@ -23,10 +23,6 @@
 
 #import "VLCUIWidgets.h"
 
-#import 
-
-#import "main/CompatibilityFixes.h"
-
 @implementation VLCDialogButton
 
 @end

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/CAS: cleanup

2019-06-03 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Jun  3 12:25:14 
2019 +0200| [38dc0d339832bce0fae1c7036fa02d2dd79cbe8a] | committer: Felix Paul 
Kühne

macosx/CAS: cleanup

Define constants at the top and internalize some properties

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

 .../VLCConvertAndSaveWindowController.h|   7 --
 .../VLCConvertAndSaveWindowController.m| 106 +
 2 files changed, 65 insertions(+), 48 deletions(-)

diff --git 
a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.h 
b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.h
index e6b24981f2..7c4c573762 100644
--- 
a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.h
+++ 
b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.h
@@ -132,13 +132,6 @@
 @property (strong) VLCPopupPanelController *popupPanel;
 @property (strong) VLCTextfieldPanelController *textfieldPanel;
 
-
-@property (readwrite, nonatomic, retain) NSString * MRL;
-@property (readwrite, nonatomic, retain) NSString * outputDestination;
-@property (readwrite, retain) NSArray * profileNames;
-@property (readwrite, retain) NSArray * profileValueList;
-@property (readwrite, retain) NSMutableArray * currentProfile;
-
 // Bindings for field / stepper combis
 @property (nonatomic) int vidBitrate;
 @property (nonatomic) int vidFramerate;
diff --git 
a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m 
b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
index 1e27e23735..13a4248dcd 100644
--- 
a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
+++ 
b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
@@ -51,6 +51,9 @@
 #define ASF 12
 /* 13-15 are present, but not set */
 
+NSString *VLCConvertAndSaveProfilesKey = @"CASProfiles";
+NSString *VLCConvertAndSaveProfileNamesKey = @"CASProfileNames";
+
 @interface VLCConvertAndSaveWindowController() 
 {
 NSArray *_videoCodecs;
@@ -58,6 +61,11 @@
 NSArray *_subsCodecs;
 BOOL b_streaming;
 }
+@property (readwrite, nonatomic, retain) NSString *MRL;
+@property (readwrite, nonatomic, retain) NSString *outputDestination;
+@property (readwrite, retain) NSArray *profileNames;
+@property (readwrite, retain) NSArray *profileValueList;
+@property (readwrite, retain) NSMutableArray *currentProfile;
 
 - (void)updateDropView;
 - (void)updateOKButton;
@@ -118,7 +126,8 @@
  @"Audio - CD",
  nil];
 
-NSDictionary *appDefaults = [NSDictionary 
dictionaryWithObjectsAndKeys:defaultProfiles, @"CASProfiles", 
defaultProfileNames, @"CASProfileNames", nil];
+NSDictionary *appDefaults = @{defaultProfiles : 
VLCConvertAndSaveProfilesKey,
+  defaultProfileNames : 
VLCConvertAndSaveProfileNamesKey};
 
 [defaults registerDefaults:appDefaults];
 }
@@ -135,6 +144,36 @@
 
 - (void)windowDidLoad
 {
+[self initStrings];
+
+/* there is no way to hide single cells, so replace the existing ones with 
empty cells.. */
+NSCell *blankCell = [[NSCell alloc] init];
+[blankCell setEnabled:NO];
+[_customizeEncapMatrix putCell:blankCell atRow:3 column:1];
+[_customizeEncapMatrix putCell:blankCell atRow:3 column:2];
+[_customizeEncapMatrix putCell:blankCell atRow:3 column:3];
+
+/* fetch profiles from defaults */
+NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+[self setProfileValueList: [defaults 
arrayForKey:VLCConvertAndSaveProfilesKey]];
+[self setProfileNames: [defaults 
arrayForKey:VLCConvertAndSaveProfileNamesKey]];
+[self recreateProfilePopup];
+
+[self initCodecStructures];
+
+[self populatePopupButtons];
+
+[_okButton setEnabled: NO];
+
+// setup drop view
+[_dropBox enablePlaylistItems];
+[_dropBox setDropTarget:self];
+
+[self resetCustomizationSheetBasedOnProfile:[self.profileValueList 
firstObject]];
+}
+
+- (void)initStrings
+{
 [self.window setTitle: _NS("Convert & Stream")];
 [_okButton setTitle: _NS("Go!")];
 [_dropLabel setStringValue: _NS("Drop media here")];
@@ -199,33 +238,26 @@
 [_streamSDPFileBrowseButton setStringValue:_NS("Browse...")];
 [_streamChannelLabel setStringValue:_NS("Channel Name")];
 [_streamSDPLabel setStringValue:_NS("SDP URL")];
+}
 
-/* there is no way to hide single cells, so replace the existing ones with 
empty cells.. */
-id blankCell = [[NSCell alloc] init];
-[blankCell setEnabled:NO];
-[_customizeEncapMatrix putCell:blankCell atRow:3 column:1];
-[_customizeEncapMatrix putCell:blankCell atRow:3 column:2];
-[_customizeEncapMatrix putCell:b

[vlc-commits] macosx/open: replace dictionary and keys with a storage structure

2019-06-03 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Jun  3 13:36:39 
2019 +0200| [e6552f5e558dfa8c84b240f462a7c9923d5d11b9] | committer: Felix Paul 
Kühne

macosx/open: replace dictionary and keys with a storage structure

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

 .../gui/macosx/windows/VLCOpenWindowController.m   | 57 ++
 1 file changed, 36 insertions(+), 21 deletions(-)

diff --git a/modules/gui/macosx/windows/VLCOpenWindowController.m 
b/modules/gui/macosx/windows/VLCOpenWindowController.m
index a25f103180..327183503e 100644
--- a/modules/gui/macosx/windows/VLCOpenWindowController.m
+++ b/modules/gui/macosx/windows/VLCOpenWindowController.m
@@ -41,6 +41,19 @@
 
 NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
 
+@interface VLCOpenBlockDeviceDescription : NSObject
+
+@property (readwrite, retain) NSString *path;
+@property (readwrite, retain) NSString *devicePath;
+@property (readwrite, retain) NSString *mediaType;
+@property (readwrite, retain) NSImage *mediaIcon;
+
+@end
+
+@implementation VLCOpenBlockDeviceDescription
+
+@end
+
 @interface VLCOpenTextField : NSTextField
 - (void)mouseDown:(NSEvent *)theEvent;
 @end
@@ -715,12 +728,12 @@ static NSString *kCaptureTabViewId  = @"capture";
 [opticalTabView displayIfNeeded];
 }
 
-- (void)showOpticalAtPath: (NSDictionary *)valueDictionary
+- (void)showOpticalAtPath:(VLCOpenBlockDeviceDescription *)deviceDescription
 {
-NSString *diskType = [valueDictionary objectForKey:@"mediaType"];
-NSString *opticalDevicePath = [valueDictionary objectForKey:@"path"];
-NSString *devicePath = [valueDictionary objectForKey:@"devicePath"];
-NSImage *image = [valueDictionary objectForKey:@"image"];
+NSString *diskType = deviceDescription.mediaType;
+NSString *opticalDevicePath = deviceDescription.path;
+NSString *devicePath = deviceDescription.devicePath;
+NSImage *mediaIcon = deviceDescription.mediaIcon;
 
 if ([diskType isEqualToString: kVLCMediaDVD] || [diskType isEqualToString: 
kVLCMediaVideoTSFolder]) {
 [_discDVDLabel setStringValue: [[NSFileManager defaultManager] 
displayNameAtPath:opticalDevicePath]];
@@ -728,27 +741,27 @@ static NSString *kCaptureTabViewId  = @"capture";
 
 if (!b_nodvdmenus) {
 [self setMRL: [NSString stringWithFormat: @"dvdnav://%@", 
devicePath]];
-[self showOpticalMediaView: _discDVDView withIcon:image];
+[self showOpticalMediaView: _discDVDView withIcon:mediaIcon];
 } else {
 [self setMRL: [NSString stringWithFormat: @"dvdread://%@#%i:%i-", 
devicePath, [_discDVDwomenusTitleTextField intValue], 
[_discDVDwomenusChapterTextField intValue]]];
-[self showOpticalMediaView: _discDVDwomenusView withIcon:image];
+[self showOpticalMediaView: _discDVDwomenusView 
withIcon:mediaIcon];
 }
 } else if ([diskType isEqualToString: kVLCMediaAudioCD]) {
 [_discAudioCDLabel setStringValue: [[NSFileManager defaultManager] 
displayNameAtPath: opticalDevicePath]];
 [_discAudioCDTrackCountLabel setStringValue: [NSString 
stringWithFormat:_NS("%i tracks"), [[[NSFileManager defaultManager] 
subpathsOfDirectoryAtPath: opticalDevicePath error:NULL] count] - 1]]; // minus 
.TOC.plist
-[self showOpticalMediaView: _discAudioCDView withIcon: image];
+[self showOpticalMediaView: _discAudioCDView withIcon: mediaIcon];
 [self setMRL: [NSString stringWithFormat: @"cdda://%@", devicePath]];
 } else if ([diskType isEqualToString: kVLCMediaVCD]) {
 [_discVCDLabel setStringValue: [[NSFileManager defaultManager] 
displayNameAtPath: opticalDevicePath]];
-[self showOpticalMediaView: _discVCDView withIcon: image];
+[self showOpticalMediaView: _discVCDView withIcon: mediaIcon];
 [self setMRL: [NSString stringWithFormat: @"vcd://%@#%i:%i", 
devicePath, [_discVCDTitleTextField intValue], [_discVCDChapterTextField 
intValue]]];
 } else if ([diskType isEqualToString: kVLCMediaSVCD]) {
 [_discVCDLabel setStringValue: [[NSFileManager defaultManager] 
displayNameAtPath: opticalDevicePath]];
-[self showOpticalMediaView: _discVCDView withIcon: image];
+[self showOpticalMediaView: _discVCDView withIcon: mediaIcon];
 [self setMRL: [NSString stringWithFormat: @"vcd://%@@%i:%i", 
devicePath, [_discVCDTitleTextField intValue], [_discVCDChapterTextField 
intValue]]];
 } else if ([diskType isEqualToString: kVLCMediaBD] || [diskType 
isEqualToString: kVLCMediaBDMVFolder]) {
 [_discBDLabel setStringValue: [[NSFileManager defaultManager] 
displayNameAtPath: opticalDevicePath]];
-[self showOpticalMediaView: _discBDView withIcon: image];
+[self showOpticalMediaView: _discBDView withIcon:

[vlc-commits] macosx/open: split single worker method into maintainable parts and optimize

2019-06-03 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Jun  3 13:26:34 
2019 +0200| [aacd3dffb087498ecfd57eddeb360915b2521b37] | committer: Felix Paul 
Kühne

macosx/open: split single worker method into maintainable parts and optimize

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

 modules/gui/macosx/extensions/NSString+Helpers.h   |   7 +
 modules/gui/macosx/extensions/NSString+Helpers.m   |  22 +
 .../gui/macosx/windows/VLCOpenWindowController.h   |   1 -
 .../gui/macosx/windows/VLCOpenWindowController.m   | 464 +++--
 4 files changed, 278 insertions(+), 216 deletions(-)

diff --git a/modules/gui/macosx/extensions/NSString+Helpers.h 
b/modules/gui/macosx/extensions/NSString+Helpers.h
index 2fc405851c..ddea76a610 100644
--- a/modules/gui/macosx/extensions/NSString+Helpers.h
+++ b/modules/gui/macosx/extensions/NSString+Helpers.h
@@ -109,6 +109,13 @@ NSImage *imageFromRes(NSString *name);
 + (instancetype)stringWithTimeFromTicks:(vlc_tick_t)time;
 
 /**
+ Returns a time in seconds from strings formatted with colons (aka ##, ##:##, 
##:##:##)
+
+ \param aString the string to parse
+ */
++ (NSInteger)timeInSecondsFromStringWithColons:(NSString *)aString;
+
+/**
  Creates an NSString from the given null-terminated C string
  buffer encoded as base64
 
diff --git a/modules/gui/macosx/extensions/NSString+Helpers.m 
b/modules/gui/macosx/extensions/NSString+Helpers.m
index 44e142d39c..cbb3cbb31d 100644
--- a/modules/gui/macosx/extensions/NSString+Helpers.m
+++ b/modules/gui/macosx/extensions/NSString+Helpers.m
@@ -113,6 +113,28 @@ NSString *const kVLCMediaUnknown = @"Unknown";
 }
 }
 
++ (NSInteger)timeInSecondsFromStringWithColons:(NSString *)aString
+{
+NSArray *components = [aString componentsSeparatedByString:@":"];
+NSUInteger componentCount = [components count];
+NSInteger returnValue = 0;
+switch (componentCount) {
+case 3:
+returnValue = [[components firstObject] intValue] * 3600 + 
[[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] 
intValue];
+break;
+
+case 2:
+returnValue = [[components firstObject] intValue] * 60 + 
[[components objectAtIndex:1] intValue];
+break;
+
+default:
+returnValue = [[components firstObject] intValue];
+break;
+}
+
+return returnValue;
+}
+
 + (instancetype)base64StringWithCString:(const char *)cstring
 {
 if (cstring == NULL)
diff --git a/modules/gui/macosx/windows/VLCOpenWindowController.h 
b/modules/gui/macosx/windows/VLCOpenWindowController.h
index 66fb276590..c103167869 100644
--- a/modules/gui/macosx/windows/VLCOpenWindowController.h
+++ b/modules/gui/macosx/windows/VLCOpenWindowController.h
@@ -187,7 +187,6 @@
 @property (nonatomic) float fileSubFps;
 
 - (IBAction)outputSettings:(id)sender;
-- (void)setSubPanel;
 - (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi;
 - (void)textFieldWasClicked:(NSNotification *)o_notification;
 - (IBAction)expandMRLfieldAction:(id)sender;
diff --git a/modules/gui/macosx/windows/VLCOpenWindowController.m 
b/modules/gui/macosx/windows/VLCOpenWindowController.m
index 1c3884655f..a25f103180 100644
--- a/modules/gui/macosx/windows/VLCOpenWindowController.m
+++ b/modules/gui/macosx/windows/VLCOpenWindowController.m
@@ -120,6 +120,67 @@ static NSString *kCaptureTabViewId  = @"capture";
 
 [self.window setCollectionBehavior: 
NSWindowCollectionBehaviorFullScreenAuxiliary];
 
+[self initStrings];
+
+// setup start / stop time fields
+[_fileStartTimeTextField setFormatter:[[VLCPositionFormatter alloc] init]];
+[_fileStopTimeTextField setFormatter:[[VLCPositionFormatter alloc] init]];
+
+// Auto collapse MRL field
+self.mrlViewHeightConstraint.constant = 0;
+
+[self updateVideoDevicesAndRepresentation];
+
+[self updateAudioDevicesAndRepresentation];
+
+[self setupSubtitlesPanel];
+
+NSNotificationCenter *notificationCenter = [NSNotificationCenter 
defaultCenter];
+[notificationCenter addObserver: self
+   selector: @selector(openNetInfoChanged:)
+   name: NSControlTextDidChangeNotification
+ object: _netUDPPortTextField];
+[notificationCenter addObserver: self
+   selector: @selector(openNetInfoChanged:)
+   name: NSControlTextDidChangeNotification
+ object: _netUDPMAddressTextField];
+[notificationCenter addObserver: self
+   selector: @selector(openNetInfoChanged:)
+   name: NSControlTextDidChangeNotification
+ object: _netUDPMPortTextField];
+[notificationCenter addObserver: self
+   selector: @selector(openNetInfoChanged:)
+  

[vlc-commits] macosx/VLCTimeField: correctly define magic key

2019-06-03 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Jun  3 11:21:12 
2019 +0200| [a528817492447b03e3a078ac939cd829e3bb0b4b] | committer: Felix Paul 
Kühne

macosx/VLCTimeField: correctly define magic key

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

 modules/gui/macosx/views/VLCTimeField.h  | 2 ++
 modules/gui/macosx/views/VLCTimeField.m  | 5 +++--
 modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m | 2 +-
 modules/gui/macosx/windows/video/VLCFSPanelController.m  | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/views/VLCTimeField.h 
b/modules/gui/macosx/views/VLCTimeField.h
index e688596c06..7b4b37464b 100644
--- a/modules/gui/macosx/views/VLCTimeField.h
+++ b/modules/gui/macosx/views/VLCTimeField.h
@@ -30,6 +30,8 @@
  * we need the implementation to catch our click-event in the controller window
  */
 
+extern NSString *VLCTimeFieldDisplayTimeAsRemaining;
+
 @interface VLCTimeField : NSTextField
 
 @property (readonly) BOOL timeRemaining;
diff --git a/modules/gui/macosx/views/VLCTimeField.m 
b/modules/gui/macosx/views/VLCTimeField.m
index e349a04401..578cb9b6f7 100644
--- a/modules/gui/macosx/views/VLCTimeField.m
+++ b/modules/gui/macosx/views/VLCTimeField.m
@@ -27,6 +27,8 @@
 #import "main/VLCMain.h"
 #import "menus/VLCMainMenu.h"
 
+NSString *VLCTimeFieldDisplayTimeAsRemaining = @"DisplayTimeAsTimeRemaining";
+
 @interface VLCTimeField ()
 {
 NSString *o_remaining_identifier;
@@ -39,8 +41,7 @@
 {
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
 NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
- @"NO", @"DisplayTimeAsTimeRemaining",
- @"YES", 
@"DisplayFullscreenTimeAsTimeRemaining",
+ @"NO", VLCTimeFieldDisplayTimeAsRemaining,
  nil];
 
 [defaults registerDefaults:appDefaults];
diff --git a/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m 
b/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
index 1471454c59..916f506b56 100644
--- a/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
+++ b/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
@@ -117,7 +117,7 @@
 [self.timeField setFont:[NSFont titleBarFontOfSize:10.0]];
 [self.timeField setAlignment: NSCenterTextAlignment];
 [self.timeField setNeedsDisplay:YES];
-[self.timeField setRemainingIdentifier:@"DisplayTimeAsTimeRemaining"];
+[self.timeField setRemainingIdentifier:VLCTimeFieldDisplayTimeAsRemaining];
 self.timeField.accessibilityLabel = _NS("Playback time");
 
 // remove fullscreen button for lion fullscreen
diff --git a/modules/gui/macosx/windows/video/VLCFSPanelController.m 
b/modules/gui/macosx/windows/video/VLCFSPanelController.m
index 9e4e7e038f..7db573123f 100644
--- a/modules/gui/macosx/windows/video/VLCFSPanelController.m
+++ b/modules/gui/macosx/windows/video/VLCFSPanelController.m
@@ -156,7 +156,7 @@ static NSString *kAssociatedFullscreenRect = 
@"VLCFullscreenAssociatedWindowRect
  * this is the same identifier as used for the window playback cotrols
  * so the state is shared between those.
  */
-[_remainingOrTotalTime 
setRemainingIdentifier:@"DisplayTimeAsTimeRemaining"];
+[_remainingOrTotalTime 
setRemainingIdentifier:VLCTimeFieldDisplayTimeAsRemaining];
 }
 
 #undef setupButton

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/audio & video effects: define magic strings at the top of the file

2019-06-03 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Jun  3 11:15:43 
2019 +0200| [13bd7d00fe7978d30fda064452383196f73f1ea0] | committer: Felix Paul 
Kühne

macosx/audio & video effects: define magic strings at the top of the file

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

 .../panels/VLCAudioEffectsWindowController.m   | 138 +++--
 .../panels/VLCVideoEffectsWindowController.h   |   5 +-
 .../panels/VLCVideoEffectsWindowController.m   |  53 
 3 files changed, 105 insertions(+), 91 deletions(-)

diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
index 3dbe07e943..4db5dc00c6 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
@@ -3,7 +3,8 @@
  *
  * Copyright (C) 2004-2019 VLC authors and VideoLAN
  *
- * Authors: Felix Paul Kühne 
+ * Authors: Felix Paul Kühne 
+ *  David Fuhrmann 
  *  Jérôme Decoodt 
  *
  * This program is free software; you can redistribute it and/or modify
@@ -42,6 +43,13 @@
 #import "playlist/VLCPlayerController.h"
 #import "windows/video/VLCVideoOutputProvider.h"
 
+NSString *VLCAudioEffectsEqualizerValuesKey = @"EQValues";
+NSString *VLCAudioEffectsEqualizerPreampValuesKey = @"EQPreampValues";
+NSString *VLCAudioEffectsEqualizerProfileTitlesKey = @"EQTitles";
+NSString *VLCAudioEffectsEqualizerProfileNamesKey = @"EQNames";
+NSString *VLCAudioEffectsProfilesKey = @"AudioEffectProfiles";
+NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
+
 @interface VLCAudioEffectsWindowController ()
 {
 VLCPlayerController *_playerController;
@@ -82,12 +90,12 @@
 }
 
 NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSArray arrayWithArray:workValues], 
@"EQValues",
- [NSArray arrayWithArray:workPreamp], 
@"EQPreampValues",
- [NSArray arrayWithArray:workTitles], 
@"EQTitles",
- [NSArray arrayWithArray:workNames], 
@"EQNames",
- [NSArray 
arrayWithObject:[VLCAudioEffectsWindowController defaultProfileString]], 
@"AudioEffectProfiles",
- [NSArray arrayWithObject:_NS("Default")], 
@"AudioEffectProfileNames",
+ [NSArray arrayWithArray:workValues], 
VLCAudioEffectsEqualizerValuesKey,
+ [NSArray arrayWithArray:workPreamp], 
VLCAudioEffectsEqualizerPreampValuesKey,
+ [NSArray arrayWithArray:workTitles], 
VLCAudioEffectsEqualizerProfileTitlesKey,
+ [NSArray arrayWithArray:workNames], 
VLCAudioEffectsEqualizerProfileNamesKey,
+ [NSArray 
arrayWithObject:[VLCAudioEffectsWindowController defaultProfileString]], 
VLCAudioEffectsProfilesKey,
+ [NSArray arrayWithObject:_NS("Default")], 
VLCAudioEffectsProfileNamesKey,
   nil];
 [defaults registerDefaults:appDefaults];
 }
@@ -130,9 +138,9 @@
 - (NSInteger)getPresetIndexForProfile:(NSInteger)profileIndex
 {
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-NSString *profile = [[defaults objectForKey:@"AudioEffectProfiles"] 
objectAtIndex:profileIndex];
+NSString *profile = [[defaults objectForKey:VLCAudioEffectsProfilesKey] 
objectAtIndex:profileIndex];
 NSString *presetName = B64DecNSStr([[profile 
componentsSeparatedByString:@";"] firstObject]);
-return [[defaults objectForKey:@"EQNames"] indexOfObject:presetName];
+return [[defaults objectForKey:VLCAudioEffectsEqualizerProfileNamesKey] 
indexOfObject:presetName];
 }
 
 /// Loads values from profile into variables
@@ -158,7 +166,7 @@
 if (profileIndex == 0)
 profileString = [VLCAudioEffectsWindowController defaultProfileString];
 else
-profileString = [[defaults objectForKey:@"AudioEffectProfiles"] 
objectAtIndex:profileIndex];
+profileString = [[defaults objectForKey:VLCAudioEffectsProfilesKey] 
objectAtIndex:profileIndex];
 
 NSArray *items = [profileString componentsSeparatedByString:@";"];
 
@@ -187,9 +195,9 @@
 var_SetFloat(p_aout, "spatializer-damp", [[items objectAtIndex:13] 
floatValue]);
 var_SetFloat(p_aout, "norm-max-level", [[items objectAtIndex:14] 
floatValue]);
 var_SetBool(p_aout, "equalizer-2pass", (BOOL)[[items objectAtIndex:15] 
intValu

[vlc-commits] macosx: remove VLCByteCountFormatter

2019-06-03 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Jun  3 11:27:10 
2019 +0200| [c72a2cb1490151aaa3cfca4923175ab75e8a1f5c] | committer: Felix Paul 
Kühne

macosx: remove VLCByteCountFormatter

Targetted macOS versions include NSByteFormatter which should be used instead.

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

 modules/gui/macosx/extensions/misc.h |  8 -
 modules/gui/macosx/extensions/misc.m | 68 
 2 files changed, 76 deletions(-)

diff --git a/modules/gui/macosx/extensions/misc.h 
b/modules/gui/macosx/extensions/misc.h
index 0317ae718e..75b3474464 100644
--- a/modules/gui/macosx/extensions/misc.h
+++ b/modules/gui/macosx/extensions/misc.h
@@ -41,11 +41,3 @@
 errorDescription:(NSString**)error;
 
 @end
-
-/*
- * VLCByteCountFormatter addition
- */
-
-@interface VLCByteCountFormatter : NSFormatter
-+ (NSString *)stringFromByteCount:(long long)byteCount 
countStyle:(NSByteCountFormatterCountStyle)countStyle;
-@end
diff --git a/modules/gui/macosx/extensions/misc.m 
b/modules/gui/macosx/extensions/misc.m
index d81d758c56..2f46b73e14 100644
--- a/modules/gui/macosx/extensions/misc.m
+++ b/modules/gui/macosx/extensions/misc.m
@@ -68,71 +68,3 @@
 }
 
 @end
-
-/*
- * VLCByteCountFormatter addition
- */
-
-@implementation VLCByteCountFormatter
-
-+ (NSString *)stringFromByteCount:(long long)byteCount 
countStyle:(NSByteCountFormatterCountStyle)countStyle
-{
-// Use native implementation on >= mountain lion
-Class byteFormatterClass = NSClassFromString(@"NSByteCountFormatter");
-if (byteFormatterClass && [byteFormatterClass 
respondsToSelector:@selector(stringFromByteCount:countStyle:)]) {
-return [byteFormatterClass stringFromByteCount:byteCount 
countStyle:NSByteCountFormatterCountStyleFile];
-}
-
-float devider = 0.;
-float returnValue = 0.;
-NSString *suffix;
-
-NSNumberFormatter *theFormatter = [[NSNumberFormatter alloc] init];
-[theFormatter setLocale:[NSLocale currentLocale]];
-[theFormatter setAllowsFloats:YES];
-
-NSString *returnString = @"";
-
-if (countStyle != NSByteCountFormatterCountStyleDecimal)
-devider = 1024.;
-else
-devider = 1000.;
-
-if (byteCount < 1000) {
-returnValue = byteCount;
-suffix = _NS("B");
-[theFormatter setMaximumFractionDigits:0];
-goto end;
-}
-
-if (byteCount < 100) {
-returnValue = byteCount / devider;
-suffix = _NS("KB");
-[theFormatter setMaximumFractionDigits:0];
-goto end;
-}
-
-if (byteCount < 10) {
-returnValue = byteCount / devider / devider;
-suffix = _NS("MB");
-[theFormatter setMaximumFractionDigits:1];
-goto end;
-}
-
-[theFormatter setMaximumFractionDigits:2];
-if (byteCount < 1) {
-returnValue = byteCount / devider / devider / devider;
-suffix = _NS("GB");
-goto end;
-}
-
-returnValue = byteCount / devider / devider / devider / devider;
-suffix = _NS("TB");
-
-end:
-returnString = [NSString stringWithFormat:@"%@ %@", [theFormatter 
stringFromNumber:[NSNumber numberWithFloat:returnValue]], suffix];
-
-return returnString;
-}
-
-@end

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: move VLCPositionFormatter to a file of its own

2019-06-03 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Jun  3 11:33:44 
2019 +0200| [3baac77bd959beed105e6326b7726a7fc9be7e81] | committer: Felix Paul 
Kühne

macosx: move VLCPositionFormatter to a file of its own

This way, the umbrella file misc.* can be finally removed.

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   | 12 +--
 modules/gui/macosx/Makefile.am |  4 ++--
 .../extensions/{misc.h => VLCPositionFormatter.h}  | 16 +--
 .../extensions/{misc.m => VLCPositionFormatter.m}  | 23 +++---
 .../panels/VLCTimeSelectionPanelController.m   |  1 -
 .../macosx/panels/dialogs/VLCCoreDialogProvider.m  |  1 -
 .../macosx/preferences/VLCSimplePrefsController.m  |  1 -
 .../gui/macosx/windows/VLCOpenWindowController.m   |  6 +++---
 .../extensions/VLCExtensionsDialogProvider.m   |  1 -
 .../windows/mainwindow/VLCMainWindowControlsBar.h  |  1 -
 po/POTFILES.in |  4 ++--
 11 files changed, 29 insertions(+), 41 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 7afc0f126c..88cfed3435 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -31,7 +31,6 @@
1C3113BA1E508C6900D4DD76 /* VLCApplication.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D5678EC1D5BA1DC002698F3 /* VLCApplication.m */; 
};
1C3113BC1E508C6900D4DD76 /* VLCKeyboardBacklightControl.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DF812F01B555C8E0052293C /* 
VLCKeyboardBacklightControl.m */; };
1C3113BD1E508C6900D4DD76 /* macosx.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 8ED6C27E03E2EB1C0059A3A7 /* macosx.m */; };
-   1C3113C51E508C6900D4DD76 /* misc.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 8ED6C28003E2EB1C0059A3A7 /* misc.m */; };
1C3113C71E508C6900D4DD76 /* VLCOpenWindowController.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 8ED6C28203E2EB1C0059A3A7 /* 
VLCOpenWindowController.m */; };
1C3113C91E508C6900D4DD76 /* VLCOutput.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 8E55FB800459B0FD00FB3317 /* VLCOutput.m */; };
1C3113CF1E508C6900D4DD76 /* prefs_widgets.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 8E9CA1A406D7DEE800B7186C /* prefs_widgets.m */; 
};
@@ -158,6 +157,7 @@
7DD2F5C52081B73B007EE187 /* VLCRemoteControlService.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DD2F5C42081B73B007EE187 /* 
VLCRemoteControlService.m */; };
7DE2F0442282C84A0040DD0A /* VLCLibraryAudioDataSource.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DE2F0432282C84A0040DD0A /* 
VLCLibraryAudioDataSource.m */; };
7DE2F0472282D5D10040DD0A /* VLCLibraryTableCellView.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DE2F0462282D5D10040DD0A /* 
VLCLibraryTableCellView.m */; };
+   7DE7232E22A51F8D00D72616 /* VLCPositionFormatter.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7DE7232D22A51F8D00D72616 /* 
VLCPositionFormatter.m */; };
7DE7E72F228C795B00D6EA38 /* 
VLCLibraryAlternativeAudioViewController.m in Sources */ = {isa = PBXBuildFile; 
fileRef = 7DE7E72E228C795B00D6EA38 /* 
VLCLibraryAlternativeAudioViewController.m */; };
7DE82E7922843781002D341A /* VLCLibraryAlbumTableCellView.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DE82E7822843781002D341A /* 
VLCLibraryAlbumTableCellView.m */; };
7DE9C7DD220728420089108F /* VLCPlayerController.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7DE9C7DC220728420089108F /* 
VLCPlayerController.m */; };
@@ -551,6 +551,8 @@
7DE2F0452282D5D10040DD0A /* VLCLibraryTableCellView.h */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryTableCellView.h; sourceTree = ""; };
7DE2F0462282D5D10040DD0A /* VLCLibraryTableCellView.m */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryTableCellView.m; sourceTree = ""; };
7DE2F0482282D7980040DD0A /* VLCLibraryTableCellView.xib */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = 
VLCLibraryTableCellView.xib; sourceTree = ""; };
+   7DE7232C22A51F8C00D72616 /* VLCPositionFormatter.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCPositionFormatter.h; sourceTree = ""; };
+   7DE7232D22A51F8D00D72616 /* VLCPositionFormatter.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPositionFormatter.m; sourceTree = ""; };
7DE7E72D228C795B00D6EA38 /* 
VLCLibraryAlternativeAudioViewCo

[vlc-commits] macosx/sprefs: save 2 of 3 array allocations

2019-06-02 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun  2 11:55:55 
2019 +0200| [d951d70fba096b330c05a44ba2f3634d13ca30c7] | committer: Felix Paul 
Kühne

macosx/sprefs: save 2 of 3 array allocations

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

 .../macosx/preferences/VLCSimplePrefsController.m  | 29 --
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.m 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
index c9d163476c..888d039117 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
@@ -299,24 +299,37 @@ create_toolbar_item(NSString *itemIdent, NSString *name, 
NSString *desc, NSStrin
 return toolbarItem;
 }
 
+- (NSArray *)toolbarIdentifiers {
+static dispatch_once_t onceToken;
+static NSArray *toolbarIdentifiers = nil;
+
+dispatch_once(, ^{
+toolbarIdentifiers = @[VLCIntfSettingToolbarIdentifier,
+   VLCAudioSettingToolbarIdentifier,
+   VLCVideoSettingToolbarIdentifier,
+   VLCOSDSettingToolbarIdentifier,
+   VLCInputSettingToolbarIdentifier,
+   VLCMediaLibrarySettingToolbarIdentifier,
+   VLCHotkeysSettingToolbarIdentifier,
+   NSToolbarFlexibleSpaceItemIdentifier];
+});
+
+return toolbarIdentifiers;
+}
+
 - (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar
 {
-return [NSArray arrayWithObjects:VLCIntfSettingToolbarIdentifier, 
VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
- VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, 
VLCMediaLibrarySettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier,
- NSToolbarFlexibleSpaceItemIdentifier, nil];
+return [self toolbarIdentifiers];
 }
 
 - (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar
 {
-return [NSArray arrayWithObjects:VLCIntfSettingToolbarIdentifier, 
VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
- VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, 
VLCMediaLibrarySettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier,
- NSToolbarFlexibleSpaceItemIdentifier, nil];
+return [self toolbarIdentifiers];
 }
 
 - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
 {
-return [NSArray arrayWithObjects:VLCIntfSettingToolbarIdentifier, 
VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
- VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, 
VLCMediaLibrarySettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, 
nil];
+return [self toolbarIdentifiers];
 }
 
 - (void)initStrings

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/status icon: fix 'show main menu' and micro-optimize

2019-06-02 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun  2 11:49:07 
2019 +0200| [baabf167ee80d75fa76c013365c2182f84b26164] | committer: Felix Paul 
Kühne

macosx/status icon: fix 'show main menu' and micro-optimize

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

 modules/gui/macosx/UI/VLCStatusBarIconMainMenu.xib |  8 
 modules/gui/macosx/menus/VLCStatusBarIcon.h|  2 +-
 modules/gui/macosx/menus/VLCStatusBarIcon.m| 16 +++-
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCStatusBarIconMainMenu.xib 
b/modules/gui/macosx/UI/VLCStatusBarIconMainMenu.xib
index 8788a3df77..06057a3346 100755
--- a/modules/gui/macosx/UI/VLCStatusBarIconMainMenu.xib
+++ b/modules/gui/macosx/UI/VLCStatusBarIconMainMenu.xib
@@ -1,8 +1,8 @@
 
-
+
 
 
-
+
 
 
 
@@ -21,7 +21,7 @@
 
 
 
-
+
 
 
 
@@ -54,7 +54,7 @@
 
 
 
-
+
 
 
 
diff --git a/modules/gui/macosx/menus/VLCStatusBarIcon.h 
b/modules/gui/macosx/menus/VLCStatusBarIcon.h
index 494e1a21f6..10aed3365b 100644
--- a/modules/gui/macosx/menus/VLCStatusBarIcon.h
+++ b/modules/gui/macosx/menus/VLCStatusBarIcon.h
@@ -30,7 +30,7 @@
 @property (strong) IBOutlet NSView *playbackInfoView;
 @property (strong) IBOutlet NSView *controlsView;
 
-- (IBAction)restoreMainWindow:(id)sender;
+- (IBAction)statusBarIconShowMainWindow:(id)sender;
 - (IBAction)statusBarIconTogglePlayPause:(id)sender;
 - (IBAction)statusBarIconStop:(id)sender;
 - (IBAction)statusBarIconNext:(id)sender;
diff --git a/modules/gui/macosx/menus/VLCStatusBarIcon.m 
b/modules/gui/macosx/menus/VLCStatusBarIcon.m
index ad325a0da8..45cfd93ce1 100644
--- a/modules/gui/macosx/menus/VLCStatusBarIcon.m
+++ b/modules/gui/macosx/menus/VLCStatusBarIcon.m
@@ -56,7 +56,6 @@
 IBOutlet NSMenuItem *showMainWindowItem;
 IBOutlet NSMenuItem *quitItem;
 
-BOOL isStopped;
 BOOL _showTimeElapsed;
 NSString *_currentPlaybackUrl;
 }
@@ -128,6 +127,10 @@
selector:@selector(configurationChanged:)
name:VLCConfigurationChangedNotification
  object:nil];
+
+[self inputItemChanged:nil];
+
+[self setMetadataTitle:_NS("VLC media player") artist:_NS("Nothing 
playing") album:nil andCover:[NSImage imageNamed:@"noart.png"]];
 }
 
 - (void)observeValueForKeyPath:(NSString *)keyPath
@@ -236,11 +239,7 @@
 vlc_tick_t duration = input_item_GetDuration(p_item);
 vlc_tick_t time = playerController.time;
 
-if (duration == -1) {
-/* Unknown duration, possibly due to buffering */
-[progressField setStringValue:@"--:--"];
-[totalField setStringValue:@"--:--"];
-} else if (duration == 0) {
+if (duration == 0) {
 /* Infinite duration */
 [progressField setStringValue:[NSString 
stringWithDuration:duration currentTime:time negative:NO]];
 [totalField setStringValue:@"∞"];
@@ -442,7 +441,6 @@
 // Set the play/pause menu item status
 - (void)setStoppedStatus:(BOOL)stopped
 {
-isStopped = stopped;
 if (stopped) {
 [playPauseButton setState:NSOffState];
 } else {
@@ -486,9 +484,9 @@
 }
 
 // Action: Show VLC main window
-- (IBAction)restoreMainWindow:(id)sender
+- (IBAction)statusBarIconShowMainWindow:(id)sender
 {
-[[NSApp sharedApplication] activateIgnoringOtherApps:YES];
+[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
 [(NSWindow *)[[VLCMain sharedInstance] libraryWindow] 
makeKeyAndOrderFront:sender];
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library menu: implement menu item to add more folders to monitor

2019-06-02 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun  2 11:30:08 
2019 +0200| [1e2dfd6af9faa3d812645a1ac9703ee46ec406b4] | committer: Felix Paul 
Kühne

macosx/library menu: implement menu item to add more folders to monitor

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

 modules/gui/macosx/library/VLCLibraryMenuController.m | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryMenuController.m 
b/modules/gui/macosx/library/VLCLibraryMenuController.m
index 355e3a8181..69284fb5e5 100644
--- a/modules/gui/macosx/library/VLCLibraryMenuController.m
+++ b/modules/gui/macosx/library/VLCLibraryMenuController.m
@@ -51,7 +51,7 @@
 playItem.target = self;
 NSMenuItem *appendItem = [[NSMenuItem alloc] initWithTitle:_NS("Append to 
Playlist") action:@selector(appendToPlaylist:) keyEquivalent:@""];
 appendItem.target = self;
-NSMenuItem *addItem = [[NSMenuItem alloc] initWithTitle:_NS("Add 
Media...") action:@selector(addMedia:) keyEquivalent:@""];
+NSMenuItem *addItem = [[NSMenuItem alloc] initWithTitle:_NS("Add Media 
Folder...") action:@selector(addMedia:) keyEquivalent:@""];
 addItem.target = self;
 NSMenuItem *revealItem = [[NSMenuItem alloc] initWithTitle:_NS("Reveal in 
Finder") action:@selector(revealInFinder:) keyEquivalent:@""];
 revealItem.target = self;
@@ -79,7 +79,22 @@
 
 - (void)addMedia:(id)sender
 {
-
+NSOpenPanel *openPanel = [NSOpenPanel openPanel];
+[openPanel setCanChooseFiles: NO];
+[openPanel setCanChooseDirectories: YES];
+[openPanel setAllowsMultipleSelection: YES];
+
+NSModalResponse modalResponse = [openPanel runModal];
+
+if (modalResponse == NSModalResponseOK) {
+NSArray *URLs = [openPanel URLs];
+NSUInteger count = [URLs count];
+VLCLibraryController *libraryController = [[VLCMain sharedInstance] 
libraryController];
+for (NSUInteger i = 0; i < count ; i++) {
+NSURL *url = URLs[i];
+[libraryController addFolderWithFileURL:url];
+}
+}
 }
 
 - (void)revealInFinder:(id)sender

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/backlight control: turn error into warning as this is normal for MacBooks with a touchbar

2019-06-02 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun Jun  2 11:30:37 
2019 +0200| [3a62b6fc5fe9764441f09ca32c7a84b79843d6ee] | committer: Felix Paul 
Kühne

macosx/backlight control: turn error into warning as this is normal for 
MacBooks with a touchbar

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

 modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.m 
b/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.m
index 3bba8e7c3c..261963f893 100644
--- a/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.m
+++ b/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.m
@@ -63,7 +63,7 @@ enum {
 io_service_t serviceObject = 
IOServiceGetMatchingService(kIOMasterPortDefault, 
IOServiceMatching("AppleLMUController"));
 
 if (!serviceObject) {
-msg_Err(getIntf(), "Failed to get an AppleLMUController service, 
keyboard dimming will not work");
+msg_Warn(getIntf(), "Failed to get an AppleLMUController service, 
keyboard dimming will not work");
 return 0;
 }
 
@@ -71,7 +71,7 @@ enum {
 IOObjectRelease(serviceObject);
 
 if (kr != KERN_SUCCESS) {
-msg_Err(getIntf(), "Failed to open an AppleLMUController service, 
keyboard dimming will not work");
+msg_Warn(getIntf(), "Failed to open an AppleLMUController service, 
keyboard dimming will not work");
 return 0;
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: remove write-only variables

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 15:37:01 
2019 +0200| [160c29f73d110ed9b4eae69bf8df5ebf839ec592] | committer: Felix Paul 
Kühne

macosx: remove write-only variables

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

 modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m   | 1 -
 modules/gui/macosx/panels/VLCAudioEffectsWindowController.m | 3 +--
 modules/gui/macosx/panels/VLCVideoEffectsWindowController.m | 3 ---
 3 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m 
b/modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m
index fb6627fb9f..e0ef0cd438 100644
--- a/modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m
+++ b/modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m
@@ -121,7 +121,6 @@
 return;
 
 int i_type = 0;
-bool b_is_command = false;
 char const *psz_filter_type = [self getFilterType: psz_filter];
 if (!psz_filter_type) {
 msg_Err(p_intf, "Unable to find filter module \"%s\".", psz_filter);
diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
index 20b3c74c21..b91069c471 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
@@ -103,7 +103,7 @@
 self = [super initWithWindowNibName:@"AudioEffects"];
 if (self) {
 dispatch_async(dispatch_get_main_queue(), ^{
-_playerController = [[[VLCMain sharedInstance] playlistController] 
playerController];
+self->_playerController = [[[VLCMain sharedInstance] 
playlistController] playerController];
 
 self.popupPanel = [[VLCPopupPanelController alloc] init];
 self.textfieldPanel = [[VLCTextfieldPanelController alloc] init];
@@ -138,7 +138,6 @@
 /// Loads values from profile into variables
 - (void)loadProfile
 {
-intf_thread_t *p_intf = getIntf();
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
 NSInteger profileIndex = [self currentProfileIndex];
 audio_output_t *p_aout = [_playerController mainAudioOutput];
diff --git a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
index 254b04f6cc..39a0c1efac 100644
--- a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
@@ -25,7 +25,6 @@
 #import "coreinteraction/VLCVideoFilterHelper.h"
 #import "extensions/VLCHexNumberFormatter.h"
 #import "extensions/NSString+Helpers.h"
-#import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 #import "panels/dialogs/VLCPopupPanelController.h"
 #import "panels/dialogs/VLCTextfieldPanelController.h"
@@ -471,7 +470,6 @@
 /// Sets widget values based on variables
 - (void)resetValues
 {
-intf_thread_t *p_intf = getIntf();
 VLCPlayerController *playerController = [[[VLCMain sharedInstance] 
playlistController] playerController];
 vout_thread_t *vout = [playerController mainVideoOutputThread];
 if (!vout)
@@ -647,7 +645,6 @@
 
 - (NSString *)generateProfileString
 {
-intf_thread_t *p_intf = getIntf();
 VLCPlayerController *playerController = [[[VLCMain sharedInstance] 
playlistController] playerController];
 vout_thread_t *vout = [playerController mainVideoOutputThread];
 if (!vout)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: remove occurances of unsafe_unretained

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 15:38:36 
2019 +0200| [1c8ad8f231b358d47945a6f88776ed9a53b3d93a] | committer: Felix Paul 
Kühne

macosx: remove occurances of unsafe_unretained

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

 modules/gui/macosx/panels/VLCAudioEffectsWindowController.m   | 8 
 modules/gui/macosx/panels/VLCVideoEffectsWindowController.m   | 6 ++
 modules/gui/macosx/preferences/prefs.m| 2 +-
 .../windows/convertandsave/VLCConvertAndSaveWindowController.m| 4 ++--
 modules/gui/macosx/windows/video/VLCWindow.m  | 4 ++--
 5 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
index b91069c471..7606b12569 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
@@ -497,7 +497,7 @@
 [_textfieldPanel setCancelButtonString:_NS("Cancel")];
 [_textfieldPanel setOkButtonString:_NS("Save")];
 
-__unsafe_unretained typeof(self) _self = self;
+__weak typeof(self) _self = self;
 [_textfieldPanel runModalForWindow:self.window 
completionHandler:^(NSInteger returnCode, NSString *resultingText) {
 
 NSInteger currentProfileIndex = [_self currentProfileIndex];
@@ -552,7 +552,7 @@
 [_popupPanel setCancelButtonString:_NS("Cancel")];
 [_popupPanel setPopupButtonContent:[self nonDefaultProfileNames]];
 
-__unsafe_unretained typeof(self) _self = self;
+__weak typeof(self) _self = self;
 [_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger 
returnCode, NSInteger selectedIndex) {
 
 NSInteger currentProfileIndex = [_self currentProfileIndex];
@@ -798,7 +798,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 [_textfieldPanel setCancelButtonString:_NS("Cancel")];
 [_textfieldPanel setOkButtonString:_NS("Save")];
 
-__unsafe_unretained typeof(self) _self = self;
+__weak typeof(self) _self = self;
 [_textfieldPanel runModalForWindow:self.window 
completionHandler:^(NSInteger returnCode, NSString *resultingText) {
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
 
@@ -842,7 +842,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 [_popupPanel setCancelButtonString:_NS("Cancel")];
 [_popupPanel setPopupButtonContent:[[NSUserDefaults standardUserDefaults] 
objectForKey:@"EQTitles"]];
 
-__unsafe_unretained typeof(self) _self = self;
+__weak typeof(self) _self = self;
 [_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger 
returnCode, NSInteger selectedIndex) {
 
 if (returnCode != NSModalResponseOK)
diff --git a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
index 39a0c1efac..b4d3ef7d82 100644
--- a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
@@ -783,8 +783,7 @@
 [_textfieldPanel setCancelButtonString:_NS("Cancel")];
 [_textfieldPanel setOkButtonString:_NS("Save")];
 
-// TODO: Change to weak, when dropping 10.7 support
-__unsafe_unretained typeof(self) _self = self;
+__weak typeof(self) _self = self;
 [_textfieldPanel runModalForWindow:self.window 
completionHandler:^(NSInteger returnCode, NSString *resultingText) {
 
 NSInteger currentProfileIndex = [_self currentProfileIndex];
@@ -842,8 +841,7 @@
 [_popupPanel setCancelButtonString:_NS("Cancel")];
 [_popupPanel setPopupButtonContent:[self nonDefaultProfileNames]];
 
-// TODO: Change to weak, when dropping 10.7 support
-__unsafe_unretained typeof(self) _self = self;
+__weak typeof(self) _self = self;
 [_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger 
returnCode, NSInteger selectedIndex) {
 
 
diff --git a/modules/gui/macosx/preferences/prefs.m 
b/modules/gui/macosx/preferences/prefs.m
index f62a3bc02c..f74afc9752 100644
--- a/modules/gui/macosx/preferences/prefs.m
+++ b/modules/gui/macosx/preferences/prefs.m
@@ -86,7 +86,7 @@
 NSMutableArray *_options;
 NSMutableArray *_subviews;
 }
-@property (readwrite, unsafe_unretained) VLCPrefs *prefsViewController;
+@property (readwrite, weak) VLCPrefs *prefsViewController;
 
 - (id)initWithName:(NSString*)name;
 
diff --git 
a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m 
b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
index 1cf8bf93f1..8c409eafdc 100644
--- 
a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
+++ 
b/modules/gui/

[vlc-commits] macosx: remove most occurances of NSUserDefaults synchronize

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 15:42:11 
2019 +0200| [f55b8f87e3d195dc2a375245a392e6e29f1299ea] | committer: Felix Paul 
Kühne

macosx: remove most occurances of NSUserDefaults synchronize

On the targetted macOS versions, this mainly a sleep timer on the main thread, 
which is not needed.

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

 modules/gui/macosx/os-integration/VLCDocumentController.m|  1 -
 modules/gui/macosx/panels/VLCAudioEffectsWindowController.m  | 12 
 modules/gui/macosx/panels/VLCVideoEffectsWindowController.m  |  9 -
 .../gui/macosx/playlist/VLCPlaybackContinuityController.m|  1 -
 modules/gui/macosx/preferences/VLCSimplePrefsController.m|  1 -
 .../convertandsave/VLCConvertAndSaveWindowController.m   |  1 -
 6 files changed, 25 deletions(-)

diff --git a/modules/gui/macosx/os-integration/VLCDocumentController.m 
b/modules/gui/macosx/os-integration/VLCDocumentController.m
index 9d71932a76..471a204b75 100644
--- a/modules/gui/macosx/os-integration/VLCDocumentController.m
+++ b/modules/gui/macosx/os-integration/VLCDocumentController.m
@@ -40,7 +40,6 @@
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
 [defaults setObject:[NSDictionary dictionary] 
forKey:@"recentlyPlayedMedia"];
 [defaults setObject:[NSArray array] forKey:@"recentlyPlayedMediaList"];
-[defaults synchronize];
 
 [super clearRecentDocuments:sender];
 }
diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m 
b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
index 7606b12569..3dbe07e943 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
@@ -382,7 +382,6 @@
 
 [workArray replaceObjectAtIndex:currentProfileIndex withObject:newProfile];
 [defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"AudioEffectProfiles"];
-[defaults synchronize];
 }
 
 - (void)saveCurrentProfileAtTerminate
@@ -470,8 +469,6 @@
 [defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"AudioEffectProfileNames"];
 
 [self saveCurrentProfileIndex:([workArray count] - 1)];
-
-[defaults synchronize];
 }
 
 - (IBAction)profileSelectorAction:(id)sender
@@ -535,11 +532,7 @@
 
 [_self saveCurrentProfileIndex:([workArray count] - 1)];
 
-
-/* save defaults */
-[defaults synchronize];
 [_self resetProfileSelector];
-
 }];
 }
 
@@ -576,8 +569,6 @@
 if (currentProfileIndex >= selectedIndex)
 [_self saveCurrentProfileIndex:(currentProfileIndex - 1)];
 
-/* save defaults */
-[defaults synchronize];
 [_self resetProfileSelector];
 }];
 }
@@ -819,7 +810,6 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 workArray = [[NSMutableArray alloc] initWithArray:[defaults 
objectForKey:@"EQNames"]];
 [workArray addObject:decomposedStringWithCanonicalMapping];
 [defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"EQNames"];
-[defaults synchronize];
 
 /* update VLC internals */
 char const *psz_eq_preset = [decomposedStringWithCanonicalMapping 
UTF8String];
@@ -862,7 +852,6 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 workArray = [[NSMutableArray alloc] initWithArray:[defaults 
objectForKey:@"EQNames"]];
 [workArray removeObjectAtIndex:selectedIndex];
 [defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"EQNames"];
-[defaults synchronize];
 
 /* update UI */
 [_self updatePresetSelector];
@@ -873,7 +862,6 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 #pragma mark Compressor
 - (void)resetCompressor
 {
-intf_thread_t *p_intf = getIntf();
 audio_output_t *p_aout = [_playerController mainAudioOutput];
 if (!p_aout)
 return;
diff --git a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m 
b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
index b4d3ef7d82..7dc676a47b 100644
--- a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
@@ -713,7 +713,6 @@
 
 [workArray replaceObjectAtIndex:currentProfileIndex withObject:newProfile];
 [defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"VideoEffectProfiles"];
-[defaults synchronize];
 }
 
 - (void)saveCurrentProfileAtTerminate
@@ -750,8 +749,6 @@
 [defaults setObject:[NSArray arrayWithArray:workArray] 
forKey:@"VideoEffectProfileNames"];
 
 [self saveCurrentProfileIndex:([workArray count] - 1)];
-
-[defaults synchronize];
 }
 
 - (IBAction)toggleWindow:(id)sender
@@ -823,9 +820,6 @@
 [workArray addObject:resulti

[vlc-commits] macosx/keyboard backlight control: add debug information and clean coding style

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 12:55:12 
2019 +0200| [2e3fc8687b2e3f31613ea040d119deba7171133c] | committer: Felix Paul 
Kühne

macosx/keyboard backlight control: add debug information and clean coding style

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

 .../os-integration/VLCKeyboardBacklightControl.h   |  8 --
 .../os-integration/VLCKeyboardBacklightControl.m   | 95 ++
 2 files changed, 62 insertions(+), 41 deletions(-)

diff --git a/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.h 
b/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.h
index ecbb308f6c..f590a12cc5 100644
--- a/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.h
+++ b/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.h
@@ -26,14 +26,6 @@
 @interface VLCKeyboardBacklightControl : NSObject
 
 /*!
- *  Initialize an instance of KeyboardBacklight.
- *
- *  Note: this will return nil if the connection to
- *  the controller could not be opened.
- */
-- (id)init;
-
-/*!
  *  Smoothly turn on backlight on MacBook keyboard.
  *
  *  Try to restore the previous brightness level. If the user has put
diff --git a/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.m 
b/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.m
index 55cf2b0b7f..3bba8e7c3c 100644
--- a/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.m
+++ b/modules/gui/macosx/os-integration/VLCKeyboardBacklightControl.m
@@ -1,8 +1,7 @@
 /*
  * VLCKeyboardBlacklightControl.m: MacBook keyboard backlight control for VLC
  *
- * Copyright (C) 2015 VLC authors and VideoLAN
- *
+ * Copyright (C) 2015, 2019 VLC authors and VideoLAN
  *
  * Authors: Maxime Mouchet 
  *
@@ -23,6 +22,7 @@
 
 #import "VLCKeyboardBacklightControl.h"
 #import 
+#import "main/VLCMain.h"
 
 enum {
 kGetSensorReadingID = 0, // getSensorReading(int *, int *)
@@ -31,40 +31,57 @@ enum {
 kSetLEDFadeID = 3// setLEDFade(int, int, int, int *)
 };
 
-@implementation VLCKeyboardBacklightControl {
-io_connect_t dataPort;
+@interface VLCKeyboardBacklightControl ()
+{
+io_connect_t _dataPort;
+float _lastBrightnessLevel;
 }
+@end
 
-static float lastBrightnessLevel;
+@implementation VLCKeyboardBacklightControl
 
-- (id)init {
-dataPort = [self getDataPort];
-lastBrightnessLevel = [self getBrightness];
+- (id)init
+{
+self = [super init];
+if (self) {
+_dataPort = [self getDataPort];
+_lastBrightnessLevel = [self getBrightness];
+}
 return self;
 }
 
-- (void)dealloc {
-if (dataPort)
-IOServiceClose(dataPort);
+- (void)dealloc
+{
+if (_dataPort)
+IOServiceClose(_dataPort);
 }
 
 - (io_connect_t)getDataPort {
-if (dataPort) return dataPort;
+if (_dataPort)
+return _dataPort;
 
 io_service_t serviceObject = 
IOServiceGetMatchingService(kIOMasterPortDefault, 
IOServiceMatching("AppleLMUController"));
 
-if (!serviceObject) return 0;
+if (!serviceObject) {
+msg_Err(getIntf(), "Failed to get an AppleLMUController service, 
keyboard dimming will not work");
+return 0;
+}
 
-kern_return_t kr = IOServiceOpen(serviceObject, mach_task_self(), 0, 
);
+kern_return_t kr = IOServiceOpen(serviceObject, mach_task_self(), 0, 
&_dataPort);
 IOObjectRelease(serviceObject);
 
-if (kr != KERN_SUCCESS) return 0;
+if (kr != KERN_SUCCESS) {
+msg_Err(getIntf(), "Failed to open an AppleLMUController service, 
keyboard dimming will not work");
+return 0;
+}
 
-return dataPort;
+return _dataPort;
 }
 
-- (void)setBrightness:(float)brightness {
-if (!dataPort) return;
+- (void)setBrightness:(float)brightness
+{
+if (!_dataPort)
+return;
 
 UInt32 inputCount = 2;
 UInt64 inputValues[2] = { 0, brightness * 0xfff };
@@ -72,18 +89,21 @@ static float lastBrightnessLevel;
 UInt32 outputCount = 1;
 UInt64 outputValues[1];
 
-kern_return_t kr = IOConnectCallScalarMethod(dataPort,
+kern_return_t kr = IOConnectCallScalarMethod(_dataPort,
  kSetLEDBrightnessID,
  inputValues,
  inputCount,
  outputValues,
  );
 
-if (kr != KERN_SUCCESS) return;
+if (kr != KERN_SUCCESS)
+return;
 }
 
-- (float)getBrightness {
-if (!dataPort) return 0.0;
+- (float)getBrightness
+{
+if (!_dataPort)
+return 0.0;
 
 uint32_t inputCount = 1;
 uint64_t inputValues[1] = { 0 };
@@ -91,7 +111,7 @@ static

[vlc-commits] macosx: make sure to also update the UI when using the advanced preferences

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 11:53:18 
2019 +0200| [15c0c88e820d46a4ec0050198c2f5c128912dfa0] | committer: Felix Paul 
Kühne

macosx: make sure to also update the UI when using the advanced preferences

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

 modules/gui/macosx/preferences/VLCSimplePrefsController.m | 1 -
 modules/gui/macosx/preferences/prefs.m| 7 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.m 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
index 8719245d8c..be4ae46b60 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
@@ -43,7 +43,6 @@
 #import "extensions/NSScreen+VLCAdditions.h"
 #import "extensions/NSString+Helpers.h"
 #import "extensions/NSFont+VLCAdditions.h"
-#import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 #import "main/VLCMain+OldPrefs.h"
 #import "os-integration/VLCClickerManager.h"
diff --git a/modules/gui/macosx/preferences/prefs.m 
b/modules/gui/macosx/preferences/prefs.m
index 5f870970a3..d186e0 100644
--- a/modules/gui/macosx/preferences/prefs.m
+++ b/modules/gui/macosx/preferences/prefs.m
@@ -57,11 +57,12 @@
 #import 
 
 #import "extensions/NSString+Helpers.h"
-#import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 #import "preferences/prefs.h"
 #import "preferences/VLCSimplePrefsController.h"
 #import "preferences/prefs_widgets.h"
+#import "extensions/NSFont+VLCAdditions.h"
+#import "os-integration/VLCClickerManager.h"
 
 #define LEFTMARGIN  18
 #define RIGHTMARGIN 18
@@ -217,6 +218,10 @@
 [_rootTreeItem applyChanges];
 fixIntfSettings();
 config_SaveConfigFile(getIntf());
+NSNotificationCenter *notificationCenter = [NSNotificationCenter 
defaultCenter];
+[notificationCenter 
postNotificationName:VLCMediaKeySupportSettingChangedNotification object:nil];
+[notificationCenter 
postNotificationName:VLCMacOSXInterfaceLargeTextSettingChanged object:nil];
+[notificationCenter 
postNotificationName:VLCConfigurationChangedNotification object:nil];
 [self.window orderOut:self];
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: unify to a single notification in case the preferences were updated

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 12:36:40 
2019 +0200| [bf29748e452efa0e3a018f550ee68be71a1bb9be] | committer: Felix Paul 
Kühne

macosx: unify to a single notification in case the preferences were updated

Performance and logically wise, there is no need to differentiate between the 
settings as users rarely change settings repeatedly.

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

 modules/gui/macosx/extensions/NSFont+VLCAdditions.h   | 2 --
 modules/gui/macosx/extensions/NSFont+VLCAdditions.m   | 2 --
 modules/gui/macosx/library/VLCLibraryCollectionViewItem.m | 2 +-
 modules/gui/macosx/library/VLCLibraryWindow.m | 2 +-
 modules/gui/macosx/os-integration/VLCClickerManager.h | 2 --
 modules/gui/macosx/os-integration/VLCClickerManager.m | 4 +---
 modules/gui/macosx/playlist/VLCPlaylistTableCellView.m| 3 ++-
 modules/gui/macosx/preferences/VLCSimplePrefsController.m | 6 +-
 modules/gui/macosx/preferences/prefs.m| 7 +--
 9 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h 
b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
index bb23598fb0..bd191ef836 100644
--- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
@@ -24,8 +24,6 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-extern NSString *VLCMacOSXInterfaceLargeTextSettingChanged;
-
 @interface NSFont (VLCAdditions)
 
 + (instancetype)VLClibrarySectionHeaderFont;
diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m 
b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
index 98692a08a5..97bce61bcd 100644
--- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
@@ -22,8 +22,6 @@
 
 #import "NSFont+VLCAdditions.h"
 
-NSString *VLCMacOSXInterfaceLargeTextSettingChanged = 
@"VLCMacOSXInterfaceLargeTextSettingChanged";
-
 @implementation NSFont (VLCAdditions)
 
 + (instancetype)VLClibrarySectionHeaderFont
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index 293ad84ff9..a35a9ff405 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -59,7 +59,7 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
  object:nil];
 [notificationCenter addObserver:self
selector:@selector(updateFontBasedOnSetting:)
-   
name:VLCMacOSXInterfaceLargeTextSettingChanged
+   name:VLCConfigurationChangedNotification
  object:nil];
 }
 return self;
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index ddcf11708d..1b9409d179 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -124,7 +124,7 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
  object:nil];
 [notificationCenter addObserver:self

selector:@selector(updateViewCellDimensionsBasedOnSetting:)
-   name:VLCMacOSXInterfaceLargeTextSettingChanged
+   name:VLCConfigurationChangedNotification
  object:nil];
 
 if (@available(macOS 10_14, *)) {
diff --git a/modules/gui/macosx/os-integration/VLCClickerManager.h 
b/modules/gui/macosx/os-integration/VLCClickerManager.h
index e3bf7dfd2b..13f09de528 100644
--- a/modules/gui/macosx/os-integration/VLCClickerManager.h
+++ b/modules/gui/macosx/os-integration/VLCClickerManager.h
@@ -22,8 +22,6 @@
 
 #import 
 
-extern NSString *VLCMediaKeySupportSettingChangedNotification;
-
 @interface VLCClickerManager : NSObject
 
 @end
diff --git a/modules/gui/macosx/os-integration/VLCClickerManager.m 
b/modules/gui/macosx/os-integration/VLCClickerManager.m
index 6762b2368f..cefd370507 100644
--- a/modules/gui/macosx/os-integration/VLCClickerManager.m
+++ b/modules/gui/macosx/os-integration/VLCClickerManager.m
@@ -30,8 +30,6 @@
 #import "playlist/VLCPlaylistModel.h"
 #import "playlist/VLCPlayerController.h"
 
-NSString *VLCMediaKeySupportSettingChangedNotification = 
@"VLCMediaKeySupportSettingChangedNotification";
-
 @interface VLCClickerManager()
 {
 VLCPlaylistController *_playlistController;
@@ -65,7 +63,7 @@ NSString *VLCMediaKeySupportSettingChangedNotification = 
@"VLCMediaKeySupportSet
 }
 [notificationCenter addObserver:self

selector:@selector(coreChangedMediaKeySupportSetting:)
-   

[vlc-commits] macosx/vout provider: also dim keyboard when not using the native fullscreen mode

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 12:49:44 
2019 +0200| [a7ff1b7f035777b136e75d1b3a631bd5fa6da2fa] | committer: Felix Paul 
Kühne

macosx/vout provider: also dim keyboard when not using the native fullscreen 
mode

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

 modules/gui/macosx/windows/video/VLCVideoOutputProvider.m | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m 
b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
index b9acdc0cb8..5e77c1a85c 100644
--- a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
+++ b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
@@ -469,21 +469,22 @@ int WindowOpen(vout_window_t *p_wnd)
 {
 intf_thread_t *p_intf = getIntf();
 BOOL b_nativeFullscreenMode = var_InheritBool(getIntf(), 
"macosx-nativefullscreenmode");
+BOOL b_fullscreen = i_full != 0;
+
+if (var_InheritBool(p_intf, "macosx-dim-keyboard")) {
+[_keyboardBacklight switchLightsAsync:!b_fullscreen];
+}
 
 if (!p_intf || (!b_nativeFullscreenMode && !p_wnd))
 return;
-BOOL b_fullscreen = i_full != 0;
 
 if (!_playerController.fullscreen != !b_fullscreen) {
 _playerController.fullscreen = b_fullscreen;
 }
 
 VLCVideoWindowCommon *o_current_window = nil;
-if(p_wnd)
+if (p_wnd) {
 o_current_window = [_voutWindows objectForKey:[NSValue 
valueWithPointer:p_wnd]];
-
-if (var_InheritBool(p_intf, "macosx-dim-keyboard")) {
-[_keyboardBacklight switchLightsAsync:!b_fullscreen];
 }
 
 if (b_nativeFullscreenMode) {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: allow dynamic changes to the large-text option at runtime

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 11:35:29 
2019 +0200| [15da1c0165099ee8791c9d55ffa259a7b0c6fd34] | committer: Felix Paul 
Kühne

macosx: allow dynamic changes to the large-text option at runtime

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

 modules/gui/macosx/extensions/NSFont+VLCAdditions.h   |  2 ++
 modules/gui/macosx/extensions/NSFont+VLCAdditions.m   |  2 ++
 modules/gui/macosx/library/VLCLibraryWindow.m | 13 -
 modules/gui/macosx/playlist/VLCPlaylistTableCellView.m| 13 +++--
 modules/gui/macosx/preferences/VLCSimplePrefsController.m |  2 ++
 5 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h 
b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
index f797317b5f..b2957c53ed 100644
--- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
@@ -24,6 +24,8 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+extern NSString *VLCMacOSXInterfaceLargeTextSettingChanged;
+
 @interface NSFont (VLCAdditions)
 
 + (instancetype)VLClibrarySectionHeaderFont;
diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m 
b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
index 2da703aa1c..fddd4dede2 100644
--- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
@@ -22,6 +22,8 @@
 
 #import "NSFont+VLCAdditions.h"
 
+NSString *VLCMacOSXInterfaceLargeTextSettingChanged = 
@"VLCMacOSXInterfaceLargeTextSettingChanged";
+
 @implementation NSFont (VLCAdditions)
 
 + (instancetype)VLClibrarySectionHeaderFont
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index 9142868f07..ddcf11708d 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -122,6 +122,10 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
selector:@selector(repeatStateUpdated:)
name:VLCPlaybackRepeatChanged
  object:nil];
+[notificationCenter addObserver:self
+   
selector:@selector(updateViewCellDimensionsBasedOnSetting:)
+   name:VLCMacOSXInterfaceLargeTextSettingChanged
+ object:nil];
 
 if (@available(macOS 10_14, *)) {
 [[NSApplication sharedApplication] addObserver:self
@@ -159,7 +163,7 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
 
 _playlistTableView.dataSource = _playlistDataSource;
 _playlistTableView.delegate = _playlistDataSource;
-_playlistTableView.rowHeight = config_GetInt("macosx-large-text") ? 
VLCLibraryWindowLargePlaylistRowHeight : VLCLibraryWindowSmallPlaylistRowHeight;
+[self updateViewCellDimensionsBasedOnSetting:nil];
 [_playlistTableView reloadData];
 
 _libraryVideoDataSource = [[VLCLibraryVideoDataSource alloc] init];
@@ -227,6 +231,8 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
 }
 }
 
+#pragma mark - appearance setters
+
 - (void)observeValueForKeyPath:(NSString *)keyPath
   ofObject:(id)object
 change:(NSDictionary *)change
@@ -248,6 +254,11 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
 }
 }
 
+- (void)updateViewCellDimensionsBasedOnSetting:(NSNotification *)aNotification
+{
+_playlistTableView.rowHeight = config_GetInt("macosx-large-text") ? 
VLCLibraryWindowLargePlaylistRowHeight : VLCLibraryWindowSmallPlaylistRowHeight;
+}
+
 #pragma mark - playmode state display and interaction
 
 - (IBAction)shuffleAction:(id)sender
diff --git a/modules/gui/macosx/playlist/VLCPlaylistTableCellView.m 
b/modules/gui/macosx/playlist/VLCPlaylistTableCellView.m
index bd635b4c63..b136aa4576 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistTableCellView.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistTableCellView.m
@@ -37,7 +37,16 @@
 
 - (void)awakeFromNib
 {
-[self updateFontsBasedOnSetting];
+[self updateFontsBasedOnSetting:nil];
+[[NSNotificationCenter defaultCenter] addObserver:self
+ 
selector:@selector(updateFontsBasedOnSetting:)
+ 
name:VLCMacOSXInterfaceLargeTextSettingChanged
+   object:nil];
+}
+
+- (void)dealloc
+{
+[[NSNotificationCenter defaultCenter] removeObserver:self];
 }
 
 - (void)setRepresentsCurrentPlaylistItem:(BOOL)representsCurrentPlaylistItem
@@ -77,7 +86,7 @@
 _representedPlaylistItem = item;
 }
 
-- (void)updateFontsBasedOnSetting
+- (void)updateFontsBasedOnSetting:(NSNotification *)aNotification
 {
 BOOL largeText = config_GetInt("macosx-large-text");
 if (lar

[vlc-commits] macosx/library: adapt large-text setting and print everything smaller

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 11:48:59 
2019 +0200| [7a706f2031cd58b8f199d16053d0077dcd9fb4a6] | committer: Felix Paul 
Kühne

macosx/library: adapt large-text setting and print everything smaller

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

 .../gui/macosx/UI/VLCLibraryCollectionViewItem.xib | 10 
 .../gui/macosx/extensions/NSFont+VLCAdditions.h|  6 +++--
 .../gui/macosx/extensions/NSFont+VLCAdditions.m| 14 +--
 .../macosx/library/VLCLibraryAlbumTableCellView.m  |  6 ++---
 .../macosx/library/VLCLibraryCollectionViewItem.m  | 28 ++
 .../gui/macosx/library/VLCLibraryTableCellView.m   |  6 ++---
 6 files changed, 50 insertions(+), 20 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib 
b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
index 42d21fd6fa..d919779119 100644
--- a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
+++ b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
@@ -25,7 +25,7 @@
 
 
 
-
+
 
 
 
@@ -34,7 +34,7 @@
 
 
 
-
+
 
 
 
@@ -44,7 +44,7 @@
 
 
 
-
+
 
 
 
@@ -61,7 +61,7 @@
 
 
 
-
+
 
 
 
@@ -103,7 +103,7 @@
 
 
 
-
+
 
 
 
diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h 
b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
index b2957c53ed..bb23598fb0 100644
--- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
@@ -32,8 +32,10 @@ extern NSString *VLCMacOSXInterfaceLargeTextSettingChanged;
 + (instancetype)VLClibraryHighlightCellTitleFont;
 + (instancetype)VLClibraryHighlightCellSubtitleFont;
 + (instancetype)VLClibraryHighlightCellHighlightLabelFont;
-+ (instancetype)VLClibraryCellTitleFont;
-+ (instancetype)VLClibraryCellSubtitleFont;
++ (instancetype)VLClibraryLargeCellTitleFont;
++ (instancetype)VLClibraryLargeCellSubtitleFont;
++ (instancetype)VLClibrarySmallCellTitleFont;
++ (instancetype)VLClibrarySmallCellSubtitleFont;
 + (instancetype)VLClibraryCellAnnotationFont;
 + (instancetype)VLClibraryButtonFont;
 + (instancetype)VLCplaylistLabelFont;
diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m 
b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
index fddd4dede2..98692a08a5 100644
--- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
@@ -46,16 +46,26 @@ NSString *VLCMacOSXInterfaceLargeTextSettingChanged = 
@"VLCMacOSXInterfaceLargeT
 return [NSFont systemFontOfSize:11. weight:NSFontWeightBold];
 }
 
-+ (instancetype)VLClibraryCellTitleFont
++ (instancetype)VLClibraryLargeCellTitleFont
 {
 return [NSFont systemFontOfSize:17. weight:NSFontWeightMedium];
 }
 
-+ (instancetype)VLClibraryCellSubtitleFont
++ (instancetype)VLClibraryLargeCellSubtitleFont
 {
 return [NSFont systemFontOfSize:13. weight:NSFontWeightSemibold];
 }
 
++ (instancetype)VLClibrarySmallCellTitleFont
+{
+return [NSFont systemFontOfSize:13. weight:NSFontWeightMedium];
+}
+
++ (instancetype)VLClibrarySmallCellSubtitleFont
+{
+return [NSFont systemFontOfSize:10. weight:NSFontWeightSemibold];
+}
+
 + (instancetype)VLClibraryCellAnnotationFont
 {
 return [NSFont systemFontOfSize:15. weight:NSFontWeightBold];
diff --git a/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m 
b/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
index 7c475a5c83..ec216b9415 100644
--- a/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
+++ b/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
@@ -50,9 +50,9 @@ const CGFloat VLCLibraryTracksRowHeight = 50.;
 
 - (void)awakeFromNib
 {
-self.albumNameTextField.font = [NSFont VLClibraryCellTitleFont];
-self.yearTextField.font = [NSFont VLClibraryCellTitleFont];
-self.summaryTextField.font = [NSFont VLClibraryCellSubtitleFont];
+self.albumNameTextField.font = [NSFont VLClibraryLargeCellTitleFont];
+self.yearTextField.font = [NSFont VLClibraryLargeCellTitleFont];
+self.summaryTextField.font =

[vlc-commits] macosx/playlist: iterate on cell dimensions, font size and have it respect the large-text setting

2019-06-01 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Jun  1 11:24:28 
2019 +0200| [bf7c59034f2c5845717c3c9c1eacdbd272ddc136] | committer: Felix Paul 
Kühne

macosx/playlist: iterate on cell dimensions, font size and have it respect the 
large-text setting

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

 modules/gui/macosx/UI/VLCLibraryWindow.xib | 14 +--
 modules/gui/macosx/UI/VLCPlaylistTableCellView.xib | 14 +--
 .../gui/macosx/extensions/NSFont+VLCAdditions.h|  2 ++
 .../gui/macosx/extensions/NSFont+VLCAdditions.m| 11 
 modules/gui/macosx/library/VLCLibraryWindow.m  |  5 ++--
 .../gui/macosx/playlist/VLCPlaylistTableCellView.m | 29 +-
 6 files changed, 58 insertions(+), 17 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index 05a1187a45..646999ac2c 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -64,19 +64,19 @@
 
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
 
 
-
+
 
 
 
@@ -90,11 +90,11 @@
 

 

 
-
+
 

 
 

-

+

 

 


 
@@ -205,7 +205,7 @@
 
 
 
-
+
 
 
 
diff --git a/modules/gui/macosx/UI/VLCPlaylistTableCellView.xib 
b/modules/gui/macosx/UI/VLCPlaylistTableCellView.xib
index 3deb69a965..202d885689 100644
--- a/modules/gui/macosx/UI/VLCPlaylistTableCellView.xib
+++ b/modules/gui/macosx/UI/VLCPlaylistTableCellView.xib
@@ -13,7 +13,7 @@
 
 
 
-
+
 
 
 
@@ -21,7 +21,7 @@
 
 
 
-
+
 
 
 
@@ -29,17 +29,17 @@
 
 
 
-
+
 
 
 
 
 
-
+
 
 
 
-
+
 
 
 
@@ -56,7 +56,7 @@
 
 
 
-
+
 
 
 
@@ -67,7 +67,7 @@
 
 
 
-
+
 
 
 
diff --git a/modules/gui/mac

[vlc-commits] macosx/library and playlist menus: simplify creation code

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 20:07:23 
2019 +0200| [3f5ff5a4abbdd05f93cfa3a677cabe06f8b3ad36] | committer: Felix Paul 
Kühne

macosx/library and playlist menus: simplify creation code

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

 .../gui/macosx/library/VLCLibraryMenuController.m  | 25 ++
 .../macosx/playlist/VLCPlaylistMenuController.m| 13 +++
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryMenuController.m 
b/modules/gui/macosx/library/VLCLibraryMenuController.m
index e930e27bb2..355e3a8181 100644
--- a/modules/gui/macosx/library/VLCLibraryMenuController.m
+++ b/modules/gui/macosx/library/VLCLibraryMenuController.m
@@ -40,19 +40,26 @@
 {
 self = [super init];
 if (self) {
-_libraryMenu = [[NSMenu alloc] initWithTitle:@""];
-[_libraryMenu addItemWithTitle:_NS("Play") action:@selector(play:) 
keyEquivalent:@""];
-[[_libraryMenu itemAtIndex:0] setTarget:self];
-[_libraryMenu addItemWithTitle:_NS("Append to Playlist") 
action:@selector(appendToPlaylist:) keyEquivalent:@""];
-[[_libraryMenu itemAtIndex:1] setTarget:self];
-[_libraryMenu addItemWithTitle:_NS("Add Media...") 
action:@selector(addMedia:) keyEquivalent:@""];
-[[_libraryMenu itemAtIndex:2] setTarget:self];
-[_libraryMenu addItemWithTitle:_NS("Reveal in Finder") 
action:@selector(revealInFinder:) keyEquivalent:@""];
-[[_libraryMenu itemAtIndex:3] setTarget:self];
+[self createMenu];
 }
 return self;
 }
 
+- (void)createMenu
+{
+NSMenuItem *playItem = [[NSMenuItem alloc] initWithTitle:_NS("Play") 
action:@selector(play:) keyEquivalent:@""];
+playItem.target = self;
+NSMenuItem *appendItem = [[NSMenuItem alloc] initWithTitle:_NS("Append to 
Playlist") action:@selector(appendToPlaylist:) keyEquivalent:@""];
+appendItem.target = self;
+NSMenuItem *addItem = [[NSMenuItem alloc] initWithTitle:_NS("Add 
Media...") action:@selector(addMedia:) keyEquivalent:@""];
+addItem.target = self;
+NSMenuItem *revealItem = [[NSMenuItem alloc] initWithTitle:_NS("Reveal in 
Finder") action:@selector(revealInFinder:) keyEquivalent:@""];
+revealItem.target = self;
+
+_libraryMenu = [[NSMenu alloc] initWithTitle:@""];
+_libraryMenu.itemArray = @[playItem, appendItem, revealItem, [NSMenuItem 
separatorItem], addItem];
+}
+
 - (void)popupMenuWithEvent:(NSEvent *)theEvent forView:(NSView *)theView
 {
 [NSMenu popUpContextMenu:_libraryMenu withEvent:theEvent forView:theView];
diff --git a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m 
b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
index 446f04e46d..7aeed86620 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
@@ -60,34 +60,27 @@
 
 - (void)createMenu
 {
-_playlistMenu = [[NSMenu alloc] init];
-
 _playMenuItem = [[NSMenuItem alloc] initWithTitle:_NS("Play") 
action:@selector(play:) keyEquivalent:@""];
 _playMenuItem.target = self;
-[_playlistMenu addItem:_playMenuItem];
 
 _removeMenuItem = [[NSMenuItem alloc] initWithTitle:_NS("Delete") 
action:@selector(remove:) keyEquivalent:@""];
 _removeMenuItem.target = self;
-[_playlistMenu addItem:_removeMenuItem];
 
 _revealInFinderMenuItem = [[NSMenuItem alloc] initWithTitle:_NS("Reveal in 
Finder") action:@selector(revealInFinder:) keyEquivalent:@""];
 _revealInFinderMenuItem.target = self;
-[_playlistMenu addItem:_revealInFinderMenuItem];
-
-[_playlistMenu addItem:[NSMenuItem separatorItem]];
 
 _addFilesToPlaylistMenuItem = [[NSMenuItem alloc] initWithTitle:_NS("Add 
File...") action:@selector(addFilesToPlaylist:) keyEquivalent:@""];
 _addFilesToPlaylistMenuItem.target = self;
-[_playlistMenu addItem:_addFilesToPlaylistMenuItem];
 
 _clearPlaylistMenuItem = [[NSMenuItem alloc] initWithTitle:_NS("Clear the 
playlist") action:@selector(clearPlaylist:) keyEquivalent:@""];
 _clearPlaylistMenuItem.target = self;
-[_playlistMenu addItem:_clearPlaylistMenuItem];
 
 _playlistSortingMenuController = [[VLCPlaylistSortingMenuController alloc] 
init];
 _sortMenuItem = [[NSMenuItem alloc] initWithTitle:_NS("Sort") action:nil 
keyEquivalent:@""];
 [_sortMenuItem 
setSubmenu:_playlistSortingMenuController.playlistSortingMenu];
-[_playlistMenu addItem:_sortMenuItem];
+
+_playlistMenu = [[NSMenu alloc] init];
+_playlistMenu.itemArray = @[_playMenuItem, _removeMenuItem, 
_revealInFinderMenuItem, [NSMenuItem separatorItem], 
_addFilesToPlaylistMenuItem, _clearPlaylistMenuItem, _sortMenuItem];
 }
 
 - (void)play:(id)sender

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: add playlist sorting menu to main menu and playlist context menu

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 19:57:45 
2019 +0200| [414e4b1a28a90ba9ee26b3d2cc8ad79e1b08ca4c] | committer: Felix Paul 
Kühne

macosx: add playlist sorting menu to main menu and playlist context menu

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

 modules/gui/macosx/UI/MainMenu.xib  | 4 
 modules/gui/macosx/menus/VLCMainMenu.h  | 1 +
 modules/gui/macosx/menus/VLCMainMenu.m  | 5 +
 modules/gui/macosx/playlist/VLCPlaylistMenuController.m | 8 
 4 files changed, 18 insertions(+)

diff --git a/modules/gui/macosx/UI/MainMenu.xib 
b/modules/gui/macosx/UI/MainMenu.xib
index 0b1a8cd1f8..ea72fd3f1e 100644
--- a/modules/gui/macosx/UI/MainMenu.xib
+++ b/modules/gui/macosx/UI/MainMenu.xib
@@ -118,6 +118,7 @@
 
 
 
+
 
 
 
@@ -448,6 +449,9 @@
 
 
 
+
+
+
 
 
 
diff --git a/modules/gui/macosx/menus/VLCMainMenu.h 
b/modules/gui/macosx/menus/VLCMainMenu.h
index 049f610a30..c5b8c2ad8a 100644
--- a/modules/gui/macosx/menus/VLCMainMenu.h
+++ b/modules/gui/macosx/menus/VLCMainMenu.h
@@ -88,6 +88,7 @@
 @property (readwrite, weak) IBOutlet NSMenuItem *repeat;
 @property (readwrite, weak) IBOutlet NSMenuItem *loop;
 @property (readwrite, weak) IBOutlet NSMenuItem *AtoBloop;
+@property (readwrite, weak) IBOutlet NSMenuItem *sortPlaylist;
 @property (readwrite, weak) IBOutlet NSMenuItem *quitAfterPB;
 @property (readwrite, weak) IBOutlet NSMenuItem *fwd;
 @property (readwrite, weak) IBOutlet NSMenuItem *bwd;
diff --git a/modules/gui/macosx/menus/VLCMainMenu.m 
b/modules/gui/macosx/menus/VLCMainMenu.m
index 655ab9da88..b5b5c78e98 100644
--- a/modules/gui/macosx/menus/VLCMainMenu.m
+++ b/modules/gui/macosx/menus/VLCMainMenu.m
@@ -42,6 +42,7 @@
 
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
+#import "playlist/VLCPlaylistSortingMenuController.h"
 #import "preferences/VLCSimplePrefsController.h"
 
 #import "windows/VLCAboutWindowController.h"
@@ -95,6 +96,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
 VLCPlaylistController *_playlistController;
 VLCPlayerController *_playerController;
 NSTimer *_cancelRendererDiscoveryTimer;
+VLCPlaylistSortingMenuController *_playlistSortingController;
 
 NSMenu *_playlistTableColumnsContextMenu;
 
@@ -147,6 +149,8 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
 _rendererMenuController = [[VLCRendererMenuController alloc] init];
 _rendererMenuController.rendererNoneItem = _rendererNoneItem;
 _rendererMenuController.rendererMenu = _rendererMenu;
+_playlistSortingController = [[VLCPlaylistSortingMenuController alloc] 
init];
+_sortPlaylist.submenu = _playlistSortingController.playlistSortingMenu;
 
 [self mediaItemChanged:nil];
 [self updateTitleAndChapterMenus:nil];
@@ -382,6 +386,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
 [_repeat setTitle: _NS("Repeat One")];
 [_loop setTitle: _NS("Repeat All")];
 [_AtoBloop setTitle: _NS("A→B Loop")];
+[_sortPlaylist setTitle: _NS("Sort Playlist")];
 [_quitAfterPB setTitle: _NS("Quit after Playback")];
 [_fwd setTitle: _NS("Step Forward")];
 [_bwd setTitle: _NS("Step Backward")];
diff --git a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m 
b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
index 3f627a9a3f..446f04e46d 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
@@ -29,17 +29,20 @@
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlaylistModel.h"
 #import "playlist/VLCPlaylistItem.h"
+#import "playlist/VLCPlaylistSortingMenuController.h"
 #import "windows/VLCOpenWindowController.h"
 
 @interface VLCPlaylistMenuController ()
 {
 VLCPlaylistController *_playlistController;
+VLCPlaylistSortingMenuController *_playlistSortingMenuController;
 
 NSMenuItem *_playMenuItem;
 NSMenuItem *_revealInFinderMenuItem;
 NSMenuItem *_addFilesToPlaylistMenuItem;
 NSMenuItem *_removeMenuItem;
 NSMenuItem *_clearPlaylistMenuItem;
+NSMenuItem *_sortMenuItem;
 }
 @end
 
@@ -80,6 +83,11 @@
 _clearPlaylistMenuItem = [[NSMenuItem alloc] initWithTitle:_NS("Clear the 
playlist") action:@selector(clearPlaylist:) keyEquivalent:@""];
 _clearPlaylistMenuItem.target = self;
 [_playlistMenu addItem

[vlc-commits] macosx: implement playlist sorting button with a popup menu

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 19:39:55 
2019 +0200| [ef6cb8f4aec7f8fc0883aa6e8ecde0b0f6f77414] | committer: Felix Paul 
Kühne

macosx: implement playlist sorting button with a popup menu

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |   6 +
 modules/gui/macosx/Makefile.am |   2 +
 modules/gui/macosx/UI/VLCLibraryWindow.xib |   4 +-
 modules/gui/macosx/library/VLCLibraryWindow.h  |   1 +
 modules/gui/macosx/library/VLCLibraryWindow.m  |  10 ++
 .../playlist/VLCPlaylistSortingMenuController.h|  33 ++
 .../playlist/VLCPlaylistSortingMenuController.m| 131 +
 po/POTFILES.in |   2 +
 8 files changed, 187 insertions(+), 2 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index a5d6ad34d0..7afc0f126c 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -104,6 +104,7 @@
7D0F64062202047900FDB91F /* VLCLibraryCollectionViewItem.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D0F64042202047900FDB91F /* 
VLCLibraryCollectionViewItem.m */; };
7D0F640C2202163E00FDB91F /* VLCPlaylistDataSource.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D0F640B2202163E00FDB91F /* 
VLCPlaylistDataSource.m */; };
7D1BF28A22A153E20027C50F /* VLCRoundedCornerTextField.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D1BF28922A153E20027C50F /* 
VLCRoundedCornerTextField.m */; };
+   7D1BF28D22A19227C50F /* VLCPlaylistSortingMenuController.m 
in Sources */ = {isa = PBXBuildFile; fileRef = 7D1BF28C22A19227C50F /* 
VLCPlaylistSortingMenuController.m */; };
7D20081A2289835C002679DF /* VLCTrackingView.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D2008192289835C002679DF /* VLCTrackingView.m 
*/; };
7D28E6362275B4820098D30E /* NSColor+VLCAdditions.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D28E6352275B4820098D30E /* 
NSColor+VLCAdditions.m */; };
7D28E6392275B7340098D30E /* NSFont+VLCAdditions.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7D28E6382275B7340098D30E /* 
NSFont+VLCAdditions.m */; };
@@ -452,6 +453,8 @@
7D0F640B2202163E00FDB91F /* VLCPlaylistDataSource.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPlaylistDataSource.m; sourceTree = ""; };
7D1BF28822A153E20027C50F /* VLCRoundedCornerTextField.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCRoundedCornerTextField.h; sourceTree = ""; };
7D1BF28922A153E20027C50F /* VLCRoundedCornerTextField.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCRoundedCornerTextField.m; sourceTree = ""; };
+   7D1BF28B22A19227C50F /* VLCPlaylistSortingMenuController.h 
*/ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCPlaylistSortingMenuController.h; sourceTree = ""; };
+   7D1BF28C22A19227C50F /* VLCPlaylistSortingMenuController.m 
*/ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPlaylistSortingMenuController.m; sourceTree = ""; };
7D2008182289835C002679DF /* VLCTrackingView.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCTrackingView.h; 
sourceTree = ""; };
7D2008192289835C002679DF /* VLCTrackingView.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCTrackingView.m; sourceTree = ""; };
7D28E6342275B4820098D30E /* NSColor+VLCAdditions.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"NSColor+VLCAdditions.h"; sourceTree = ""; };
@@ -1048,6 +1051,8 @@
7D445D832202524D00263D34 /* VLCPlaylistItem.m 
*/,
7D445D8C2203375100263D34 /* 
VLCPlaylistMenuController.h */,
7D445D8D2203375100263D34 /* 
VLCPlaylistMenuController.m */,
+   7D1BF28B22A19227C50F /* 
VLCPlaylistSortingMenuController.h */,
+   7D1BF28C22A19227C50F /* 
VLCPlaylistSortingMenuController.m */,
7D445D852202574B00263D34 /* VLCPlaylistModel.h 
*/,
7D445D862202574B00263D34 /* VLCPlaylistModel.m 
*/,
7D0F63FD2201F63400FDB91F /* 
VLCPlaylistTableCellView.h */,
@@ -1682,6 +1687,7 @@
7D66D43C2200D6090040D04A /* 
VLCDetachedVideoWindow.m in Sources */,
 

[vlc-commits] macosx/playlist controller: expose sorting

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 18:41:00 
2019 +0200| [bb1a55aa8012f56a39718c5da3f04849327c0271] | committer: Felix Paul 
Kühne

macosx/playlist controller: expose sorting

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

 .../gui/macosx/playlist/VLCPlaylistController.h| 24 ++
 .../gui/macosx/playlist/VLCPlaylistController.m| 16 +++
 2 files changed, 40 insertions(+)

diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.h 
b/modules/gui/macosx/playlist/VLCPlaylistController.h
index eba43dd114..4d7e6c2704 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.h
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.h
@@ -143,6 +143,30 @@ extern NSString *VLCPlaylistItemsRemoved;
 - (void)clearPlaylist;
 
 /**
+ * Sort the entire playlist listen based on:
+ * @param sortKey the key used for sorting
+ * @param sortOrder sort ascending or descending..
+ * @return Returns VLC_SUCCESS on success.
+ */
+- (int)sortByKey:(enum vlc_playlist_sort_key)sortKey andOrder:(enum 
vlc_playlist_sort_order)sortOrder;
+
+/**
+ * Initially, the playlist is unsorted until the user decides to do so
+ * Until then, the unsorted state is retained.
+ */
+@property (readonly) BOOL unsorted;
+
+/**
+ * The last key used for sorting
+ */
+@property (readonly) enum vlc_playlist_sort_key lastSortKey;
+
+/**
+ * The last order used for sorting
+ */
+@property (readonly) enum vlc_playlist_sort_order lastSortOrder;
+
+/**
  * Start the playlist
  * @return Returns VLC_SUCCESS on success.
  */
diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.m 
b/modules/gui/macosx/playlist/VLCPlaylistController.m
index a65c044e83..f09570df32 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.m
@@ -210,6 +210,7 @@ static const struct vlc_playlist_callbacks 
playlist_callbacks = {
 
 /* set initial values, further updates through callbacks */
 vlc_playlist_Lock(_p_playlist);
+_unsorted = YES;
 _playbackOrder = vlc_playlist_GetPlaybackOrder(_p_playlist);
 _playbackRepeat = vlc_playlist_GetPlaybackRepeat(_p_playlist);
 _playlistListenerID = vlc_playlist_AddListener(_p_playlist,
@@ -424,6 +425,21 @@ static const struct vlc_playlist_callbacks 
playlist_callbacks = {
 vlc_playlist_Unlock(_p_playlist);
 }
 
+- (int)sortByKey:(enum vlc_playlist_sort_key)sortKey andOrder:(enum 
vlc_playlist_sort_order)sortOrder
+{
+struct vlc_playlist_sort_criterion sortCriterion = { sortKey, sortOrder };
+int returnValue = VLC_SUCCESS;
+vlc_playlist_Lock(_p_playlist);
+returnValue = vlc_playlist_Sort(_p_playlist, , 1);
+vlc_playlist_Unlock(_p_playlist);
+if (returnValue == VLC_SUCCESS) {
+_lastSortKey = sortKey;
+_lastSortOrder = sortOrder;
+_unsorted = NO;
+}
+return returnValue;
+}
+
 - (int)startPlaylist
 {
 NSInteger selectedIndex = [_playlistDataSource.tableView selectedRow];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/playlist controller: cosmetics

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 18:45:56 
2019 +0200| [c829e34b19705b3c3b1fa2f39270eaf4823a6ab6] | committer: Felix Paul 
Kühne

macosx/playlist controller: cosmetics

self is implicitly retained by the block. Mention it to indicate that this the 
intended behavior

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

 modules/gui/macosx/playlist/VLCPlaylistController.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.m 
b/modules/gui/macosx/playlist/VLCPlaylistController.m
index 1366004983..a65c044e83 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.m
@@ -403,7 +403,7 @@ static const struct vlc_playlist_callbacks 
playlist_callbacks = {
 __block vlc_playlist_item_t **items = calloc(indexes.count, 
sizeof(vlc_playlist_item_t *));
 __block NSUInteger pos = 0;
 [indexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull 
stop) {
-VLCPlaylistItem *item = [_playlistModel playlistItemAtIndex:idx];
+VLCPlaylistItem *item = [self->_playlistModel playlistItemAtIndex:idx];
 items[pos++] = item.playlistItem;
 }];
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: generate playlist menu in code instead of using a xib file

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 18:20:18 
2019 +0200| [0137809a82ae57d3ece480a5e5a76c1664b02b3f] | committer: Felix Paul 
Kühne

macosx: generate playlist menu in code instead of using a xib file

No functional changes except for removing the sorting stub

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |  2 -
 modules/gui/macosx/Makefile.am |  1 -
 modules/gui/macosx/UI/VLCPlaylistMenu.xib  | 70 --
 .../macosx/playlist/VLCPlaylistMenuController.h| 16 +
 .../macosx/playlist/VLCPlaylistMenuController.m| 59 --
 5 files changed, 42 insertions(+), 106 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index fea8965c80..a5d6ad34d0 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -486,7 +486,6 @@
7D445D8A22032B9200263D34 /* VLCPlaylistTableView.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPlaylistTableView.m; sourceTree = ""; };
7D445D8C2203375100263D34 /* VLCPlaylistMenuController.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCPlaylistMenuController.h; sourceTree = ""; };
7D445D8D2203375100263D34 /* VLCPlaylistMenuController.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPlaylistMenuController.m; sourceTree = ""; };
-   7D445D8F220339D400263D34 /* VLCPlaylistMenu.xib */ = {isa = 
PBXFileReference; lastKnownFileType = file.xib; path = VLCPlaylistMenu.xib; 
sourceTree = ""; };
7D460B0A229EB4C700097948 /* VLCDragDropView.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCDragDropView.h; 
sourceTree = ""; };
7D460B0B229EB4C700097948 /* VLCDragDropView.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCDragDropView.m; sourceTree = ""; };
7D5678EB1D5BA1DC002698F3 /* VLCApplication.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
VLCApplication.h; sourceTree = ""; };
@@ -1518,7 +1517,6 @@
6B8224091E4D2A9000833BE1 /* MainMenu.xib */,
7D713D332201BB130042BEB7 /* 
VLCLibraryWindow.xib */,
7D0F64002201F66D00FDB91F /* 
VLCPlaylistTableCellView.xib */,
-   7D445D8F220339D400263D34 /* VLCPlaylistMenu.xib 
*/,
7D0F64052202047900FDB91F /* 
VLCLibraryCollectionViewItem.xib */,
7DE2F0482282D7980040DD0A /* 
VLCLibraryTableCellView.xib */,
7DE82E7A228437AA002D341A /* 
VLCLibraryAlbumTableCellView.xib */,
diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am
index 9be4e91373..d8f313a29d 100644
--- a/modules/gui/macosx/Makefile.am
+++ b/modules/gui/macosx/Makefile.am
@@ -266,7 +266,6 @@ libmacosx_plugin_la_XIB_SOURCES = \
gui/macosx/UI/VLCLibraryAlbumTableCellView.xib \
gui/macosx/UI/VLCLibraryWindow.xib \
gui/macosx/UI/VLCLibraryTableCellView.xib \
-   gui/macosx/UI/VLCPlaylistMenu.xib \
gui/macosx/UI/VLCPlaylistTableCellView.xib \
gui/macosx/UI/VLCLibraryCollectionViewItem.xib \
gui/macosx/UI/VLCMediaSourceCollectionViewItem.xib \
diff --git a/modules/gui/macosx/UI/VLCPlaylistMenu.xib 
b/modules/gui/macosx/UI/VLCPlaylistMenu.xib
deleted file mode 100644
index abeb2628f9..00
--

[vlc-commits] macosx: cosmetics

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 17:20:25 
2019 +0200| [e36458aad90e218744d668ad4247968d3830e920] | committer: Felix Paul 
Kühne

macosx: cosmetics

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

 modules/gui/macosx/extensions/NSString+Helpers.m | 29 +---
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/modules/gui/macosx/extensions/NSString+Helpers.m 
b/modules/gui/macosx/extensions/NSString+Helpers.m
index adfa855568..44e142d39c 100644
--- a/modules/gui/macosx/extensions/NSString+Helpers.m
+++ b/modules/gui/macosx/extensions/NSString+Helpers.m
@@ -309,33 +309,36 @@ NSString * getVolumeTypeFromMountPath(NSString *mountPath)
 
 io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, 
matchingDict);
 if (IO_OBJECT_NULL != service) {
-if (IOObjectConformsTo(service, kIOCDMediaClass))
+if (IOObjectConformsTo(service, kIOCDMediaClass)) {
 returnValue = kVLCMediaAudioCD;
-else if (IOObjectConformsTo(service, kIODVDMediaClass))
+} else if (IOObjectConformsTo(service, kIODVDMediaClass)) {
 returnValue = kVLCMediaDVD;
-else if (IOObjectConformsTo(service, kIOBDMediaClass))
+} else if (IOObjectConformsTo(service, kIOBDMediaClass)) {
 returnValue = kVLCMediaBD;
+}
 IOObjectRelease(service);
 
-if (returnValue)
+if (returnValue) {
 return returnValue;
+}
 }
 
-if ([mountPath rangeOfString:@"VIDEO_TS" options:NSCaseInsensitiveSearch | 
NSBackwardsSearch].location != NSNotFound)
+if ([mountPath rangeOfString:@"VIDEO_TS" options:NSCaseInsensitiveSearch | 
NSBackwardsSearch].location != NSNotFound) {
 returnValue = kVLCMediaVideoTSFolder;
-else if ([mountPath rangeOfString:@"BDMV" options:NSCaseInsensitiveSearch 
| NSBackwardsSearch].location != NSNotFound)
+} else if ([mountPath rangeOfString:@"BDMV" 
options:NSCaseInsensitiveSearch | NSBackwardsSearch].location != NSNotFound) {
 returnValue = kVLCMediaBDMVFolder;
-else {
+} else {
 // NSFileManager is not thread-safe, don't use defaultManager outside 
of the main thread
-NSFileManager * fm = [[NSFileManager alloc] init];
+NSFileManager *fileManager = [[NSFileManager alloc] init];
 
-NSArray *dirContents = [fm contentsOfDirectoryAtPath:mountPath 
error:nil];
-for (int i = 0; i < [dirContents count]; i++) {
-NSString *currentFile = [dirContents objectAtIndex:i];
+NSArray *directoryContents = [fileManager 
contentsOfDirectoryAtPath:mountPath error:nil];
+NSUInteger directoryContentCount = [directoryContents count];
+for (NSUInteger i = 0; i < directoryContentCount; i++) {
+NSString *currentFile = directoryContents[i];
 NSString *fullPath = [mountPath 
stringByAppendingPathComponent:currentFile];
 
-BOOL isDir;
-if ([fm fileExistsAtPath:fullPath isDirectory:] && isDir)
+BOOL isDirectory;
+if ([fileManager fileExistsAtPath:fullPath 
isDirectory:] && isDirectory)
 {
 if ([currentFile caseInsensitiveCompare:@"SVCD"] == 
NSOrderedSame) {
 returnValue = kVLCMediaSVCD;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: fix playback of block based media

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 17:15:32 
2019 +0200| [c7062b8a2b18ede29526e78feb826e1bd1ec7e55] | committer: Felix Paul 
Kühne

macosx: fix playback of block based media

This solves a regression introduced in 535112f6

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

 modules/gui/macosx/extensions/NSString+Helpers.m | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/extensions/NSString+Helpers.m 
b/modules/gui/macosx/extensions/NSString+Helpers.m
index 82289303bd..adfa855568 100644
--- a/modules/gui/macosx/extensions/NSString+Helpers.m
+++ b/modules/gui/macosx/extensions/NSString+Helpers.m
@@ -300,10 +300,14 @@ NSString * getVolumeTypeFromMountPath(NSString *mountPath)
 return @"";
 }
 
-CFMutableDictionaryRef matchingDict = 
IOBSDNameMatching(kIOMasterPortDefault, 0, stf.f_mntfromname);
-io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, 
matchingDict);
+/* the matching dictionary wants the BSD name without its path, so strip 
it */
+NSString *bsdMount = [NSString stringWithUTF8String:stf.f_mntfromname];
+NSString *bsdName = [bsdMount lastPathComponent];
+
+CFMutableDictionaryRef matchingDict = 
IOBSDNameMatching(kIOMasterPortDefault, 0, [bsdName UTF8String]);
 NSString *returnValue;
 
+io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, 
matchingDict);
 if (IO_OBJECT_NULL != service) {
 if (IOObjectConformsTo(service, kIOCDMediaClass))
 returnValue = kVLCMediaAudioCD;
@@ -317,7 +321,6 @@ NSString * getVolumeTypeFromMountPath(NSString *mountPath)
 return returnValue;
 }
 
-out:
 if ([mountPath rangeOfString:@"VIDEO_TS" options:NSCaseInsensitiveSearch | 
NSBackwardsSearch].location != NSNotFound)
 returnValue = kVLCMediaVideoTSFolder;
 else if ([mountPath rangeOfString:@"BDMV" options:NSCaseInsensitiveSearch 
| NSBackwardsSearch].location != NSNotFound)
@@ -367,8 +370,12 @@ NSString * getBSDNodeFromMountPath(NSString *mountPath)
 if (ret != 0) {
 return @"";
 }
+/* the provided BSD mount path doesn't include the r prefix we need */
+NSString *bsdMount = [NSString stringWithUTF8String:stf.f_mntfromname];
+NSString *bsdName = [bsdMount lastPathComponent];
+NSString *fixedBsdName = [NSString stringWithFormat:@"/dev/r%@", bsdName];
 
-return [NSString stringWithFormat:@"r%s", stf.f_mntfromname];
+return fixedBsdName;
 }
 
 NSString * OSXStringKeyToString(NSString *theString)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/playlist: add indicator for the number of items

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 15:05:20 
2019 +0200| [5715f6df2300700571e1c31e8fa719391e32] | committer: Felix Paul 
Kühne

macosx/playlist: add indicator for the number of items

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

 modules/gui/macosx/UI/VLCLibraryWindow.xib | 13 +++-
 .../macosx/library/VLCLibraryCollectionViewItem.m  |  4 ++--
 modules/gui/macosx/library/VLCLibraryWindow.h  |  2 ++
 modules/gui/macosx/library/VLCLibraryWindow.m  |  6 ++
 .../gui/macosx/playlist/VLCPlaylistDataSource.h|  1 +
 .../gui/macosx/playlist/VLCPlaylistDataSource.m|  6 +-
 .../gui/macosx/views/VLCRoundedCornerTextField.h   |  2 ++
 .../gui/macosx/views/VLCRoundedCornerTextField.m   | 24 +-
 8 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index 4c2f970b25..86049f80a8 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -23,7 +23,7 @@
 
 
 
-
+
 
 
 
@@ -52,6 +52,14 @@
 
 
 
+
+
+
+
+
+
+
+
 
 
 
@@ -212,9 +220,11 @@
 
 
 
+
 
 
 
+
 
 
 
@@ -512,6 +522,7 @@
 
 
 
+
 
 
 
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index a4b1aa2523..7c40d68e66 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -184,10 +184,10 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 - (void)showVideoSizeIfNeededForWidth:(CGFloat)width andHeight:(CGFloat)height
 {
 if (width >= VLCMediaLibrary4KWidth || height >= VLCMediaLibrary4KHeight) {
-_annotationTextField.stringValue = @" 4K ";
+_annotationTextField.stringValue = _NS("4K");
 _annotationTextField.hidden = NO;
 } else if (width >= VLCMediaLibrary720pWidth || height >= 
VLCMediaLibrary720pHeight) {
-_annotationTextField.stringValue = @" HD ";
+_annotationTextField.stringValue = _NS("HD");
 _annotationTextField.hidden = NO;
 }
 }
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.h 
b/modules/gui/macosx/library/VLCLibraryWindow.h
index 8611d7e238..01ca4893ff 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.h
+++ b/modules/gui/macosx/library/VLCLibraryWindow.h
@@ -25,6 +25,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @class VLCDragDropView;
+@class VLCRoundedCornerTextField;
 
 @interface VLCLibraryWindowController : NSWindowController
 
@@ -56,6 +57,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readwrite, weak) IBOutlet NSBox *clearPlaylistSeparator;
 @property (readwrite, weak) IBOutlet NSButton *repeatPlaylistButton;
 @property (readwrite, weak) IBOutlet NSButton *shufflePlaylistButton;
+@property (readwrite, weak) IBOutlet VLCRoundedCornerTextField 
*playlistCounterTextField;
 @property (readwrite, weak) IBOutlet NSView *alternativeAudioView;
 @property (readwrite, weak) IBOutlet NSCollectionView 
*alternativeAudioCollectionView;
 @property (readwrite, weak) IBOutlet NSSegmentedControl 
*alternativeAudioSegmentedControl;
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index 6747da672b..f9bf5fa646 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -42,6 +42,7 @@
 #import "media-source/VLCMediaSourceDataSource.h"
 
 #import "views/VLCDragDropView.h"
+#import "views/VLCRoundedCornerTextField.h"
 
 #import "

[vlc-commits] macosx: introduce a textfield with rounded background corners and use it in the library view

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 14:35:36 
2019 +0200| [a4dac2767da0a41777e8427088f058dfc585faec] | committer: Felix Paul 
Kühne

macosx: introduce a textfield with rounded background corners and use it in the 
library view

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |  6 +++
 modules/gui/macosx/Makefile.am |  2 +
 .../gui/macosx/UI/VLCLibraryCollectionViewItem.xib | 12 ++---
 .../gui/macosx/views/VLCRoundedCornerTextField.h   | 31 
 .../gui/macosx/views/VLCRoundedCornerTextField.m   | 59 ++
 po/POTFILES.in |  2 +
 6 files changed, 106 insertions(+), 6 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 5701bc5974..fea8965c80 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -103,6 +103,7 @@
7D0F63FF2201F63400FDB91F /* VLCPlaylistTableCellView.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D0F63FE2201F63400FDB91F /* 
VLCPlaylistTableCellView.m */; };
7D0F64062202047900FDB91F /* VLCLibraryCollectionViewItem.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D0F64042202047900FDB91F /* 
VLCLibraryCollectionViewItem.m */; };
7D0F640C2202163E00FDB91F /* VLCPlaylistDataSource.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D0F640B2202163E00FDB91F /* 
VLCPlaylistDataSource.m */; };
+   7D1BF28A22A153E20027C50F /* VLCRoundedCornerTextField.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D1BF28922A153E20027C50F /* 
VLCRoundedCornerTextField.m */; };
7D20081A2289835C002679DF /* VLCTrackingView.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D2008192289835C002679DF /* VLCTrackingView.m 
*/; };
7D28E6362275B4820098D30E /* NSColor+VLCAdditions.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D28E6352275B4820098D30E /* 
NSColor+VLCAdditions.m */; };
7D28E6392275B7340098D30E /* NSFont+VLCAdditions.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7D28E6382275B7340098D30E /* 
NSFont+VLCAdditions.m */; };
@@ -449,6 +450,8 @@
7D0F64052202047900FDB91F /* VLCLibraryCollectionViewItem.xib */ 
= {isa = PBXFileReference; lastKnownFileType = file.xib; path = 
VLCLibraryCollectionViewItem.xib; sourceTree = ""; };
7D0F640A2202163E00FDB91F /* VLCPlaylistDataSource.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCPlaylistDataSource.h; sourceTree = ""; };
7D0F640B2202163E00FDB91F /* VLCPlaylistDataSource.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPlaylistDataSource.m; sourceTree = ""; };
+   7D1BF28822A153E20027C50F /* VLCRoundedCornerTextField.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCRoundedCornerTextField.h; sourceTree = ""; };
+   7D1BF28922A153E20027C50F /* VLCRoundedCornerTextField.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCRoundedCornerTextField.m; sourceTree = ""; };
7D2008182289835C002679DF /* VLCTrackingView.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCTrackingView.h; 
sourceTree = ""; };
7D2008192289835C002679DF /* VLCTrackingView.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCTrackingView.m; sourceTree = ""; };
7D28E6342275B4820098D30E /* NSColor+VLCAdditions.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"NSColor+VLCAdditions.h"; sourceTree = ""; };
@@ -851,6 +854,8 @@
7D2008192289835C002679DF /* VLCTrackingView.m 
*/,
7D460B0A229EB4C700097948 /* VLCDragDropView.h 
*/,
7D460B0B229EB4C700097948 /* VLCDragDropView.m 
*/,
+   7D1BF28822A153E20027C50F /* 
VLCRoundedCornerTextField.h */,
+   7D1BF28922A153E20027C50F /* 
VLCRoundedCornerTextField.m */,
);
path = views;
sourceTree = "";
@@ -1752,6 +1757,7 @@
1C3113DD1E508C6900D4DD76 /* 
VLCTrackSynchronizationWindowController.m in Sources */,
7D0F5A9B2264EB410009C48A /* 
VLCHotkeysController.m in Sources */,
6B6FFF701EF9EC350001CEB1 /* 
CompatibilityFixes.m in Sources */,
+   7D1BF28A22A153E20027C50F /* 
VLCRoundedCornerTextField.m in So

[vlc-commits] macosx/library window: make the playlist collapsable and add widgets to describe the future look

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 14:07:05 
2019 +0200| [f72131c6f85af1d6dbe8fbefd29aea93defb202d] | committer: Felix Paul 
Kühne

macosx/library window: make the playlist collapsable and add widgets to 
describe the future look

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

 modules/gui/macosx/UI/VLCLibraryWindow.xib| 216 ++
 modules/gui/macosx/library/VLCLibraryWindow.h |   2 +
 modules/gui/macosx/library/VLCLibraryWindow.m |  62 +++-
 3 files changed, 211 insertions(+), 69 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index d083f419f2..4c2f970b25 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -23,49 +23,46 @@
 
 
 
-
-
-
-
-
+
+
 
 
-
-
-
+
+
+
 
 
 
 
-
+
 
-
-
+
+
 
 
 
-
+
 
 
-
-
-
-
+
+
+
+
 
 
 
 
 
-
+
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
@@ -146,8 +143,8 @@
 
 
 
-
-
+
+
 
 
 
@@ -156,10 +153,10 @@
 
 
 
-
+
 
 
-
+
 
 
 
@@ -167,7 +164,7 @@
 
 
 
-
+
 
 
 
@@ -184,24 +181

[vlc-commits] macosx/library window: make the playlist collapsable and add widgets to describe the future look

2019-05-31 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 31 14:07:05 
2019 +0200| [1046bceba3b8cd60f8b36e11add110aeb16391a0] | committer: Felix Paul 
Kühne

macosx/library window: make the playlist collapsable and add widgets to 
describe the future look

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

 modules/gui/macosx/UI/VLCLibraryWindow.xib| 215 ++
 modules/gui/macosx/library/VLCLibraryWindow.h |   2 +
 modules/gui/macosx/library/VLCLibraryWindow.m |  68 +++-
 3 files changed, 216 insertions(+), 69 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index d083f419f2..bd44d26559 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -23,49 +23,46 @@
 
 
 
-
-
-
-
-
+
+
 
 
-
-
-
+
+
+
 
 
 
 
-
+
 
-
-
+
+
 
 
 
-
+
 
 
-
-
-
-
+
+
+
+
 
 
 
 
 
-
+
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
@@ -146,8 +143,8 @@
 
 
 
-
-
+
+
 
 
 
@@ -156,10 +153,10 @@
 
 
 
-
+
 
 
-
+
 
 
 
@@ -167,7 +164,7 @@
 
 
 
-
+
 
 
 
@@ -184,24 +181

[vlc-commits] macosx/sprefs: cleanup hotkeys UI a bit

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 23:16:16 
2019 +0200| [c9bdd19e66cef8f369541888a12b61f28602ee87] | committer: Felix Paul 
Kühne

macosx/sprefs: cleanup hotkeys UI a bit

This moves the 'Clear' button to the changer panel and removes the 'Change' 
button in favor of double clicking items in the list.

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

 modules/gui/macosx/UI/SimplePreferences.xib| 52 --
 .../macosx/preferences/VLCSimplePrefsController.h  |  3 +-
 .../macosx/preferences/VLCSimplePrefsController.m  | 15 ---
 3 files changed, 28 insertions(+), 42 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index 76506505f4..4d8e4457f9 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -31,14 +31,13 @@
 
 
 
-
 
 
+
 
 
 
 
-
 
 
 
@@ -1846,13 +1845,13 @@ Gw
 
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
@@ -1908,29 +1907,9 @@ Gw
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
-
-
+
+
 
 
 
@@ -1960,19 +1939,14 @@ Gw
 
 
 
-
+
 
 
-
 
-
 
 
-
 
 
-
-
 
 
 
@@ -2032,10 +2006,21 @@ Gw
 
 
 
+
+
+
+
+
+
+
+
+
+
 
 
 
 
+
 
 
 
@@ -2043,6 +2028,7 @@ Gw
 
 
 
+
 
 
 
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.h 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
index aefad7c187..4e2a549b31 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.h
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
@@ -74,13 +74,12 @@
 @property (readwrite, strong) IBOutlet NSView *hotkeysView;
 
 @property (readwrite, strong) IBOutlet NSWindow *hotkeys_change_win;
-@property (readwrite, weak) IBOutlet NSButton *hotkeys_changeButton;
 @property (readwrite, weak) IBOutlet NSTextField *hotkeys_changeLabel;
 @property (readwrite, weak) IBOutlet NSTextField *hotkeys_change_keysLabel;
 @property (readwrite, weak) IBOutlet NSTextField *hotkeys_change_takenLabel;
 @property (readwrite, weak) IBOutlet NSButton *hotkeys_change_cancelButton;
 @property (readwrite, weak) IBOutlet NSButton *hotkeys_change_okButton;
-@property (readwrite, weak) IBOutlet NSButton *hotkeys_clearButton;
+@property (readwrite, weak) IBOutlet NSButton *hotkeys_change_clearButton;
 @property (readwrite, weak) IBOutlet NSTextField *hotkeysLabel;
 @property (readwrite, weak) IBOutlet NSTableView *hotkeys_listbox;
 @property (readwrite, weak) IBOutlet NSButton *hotkeys_mediakeysCheckbox;
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.m 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
index 08ae70479a..52f82e25cf 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/preferen

[vlc-commits] macosx/sprefs: remove UI for 'postproc-q' as the option is gone

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 22:32:24 
2019 +0200| [d47c9fb28e2680502173f683c42def08c387eb9e] | committer: Felix Paul 
Kühne

macosx/sprefs: remove UI for 'postproc-q' as the option is gone

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

 modules/gui/macosx/UI/SimplePreferences.xib| 88 ++
 .../macosx/preferences/VLCSimplePrefsController.h  |  2 -
 .../macosx/preferences/VLCSimplePrefsController.m  |  7 +-
 3 files changed, 23 insertions(+), 74 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index 3e438814d5..c1c19f7101 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -52,8 +52,6 @@
 
 
 
-
-
 
 
 
@@ -175,7 +173,7 @@
 
 
 
-
+
 
 
 
@@ -1221,10 +1219,10 @@ Gw
 
 
 
-
+
 
 
-
+
 
 
 
@@ -1268,7 +1266,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1295,7 +1293,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1352,21 +1350,13 @@ Gw
 
 
 
-
+
 
-
+
 
 
-
-
-
-
-
-
-
-
 
-
+
 
 
 
@@ -1374,7 +1364,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1382,7 +1372,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1391,35 +1381,8 @@ Gw
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
-
+
 
 
 
@@ -1436,7 +1399,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1452,8 +1415,8 @@

[vlc-commits] macosx/sprefs: add 'large text in list views' option to the interface section

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 22:43:52 
2019 +0200| [319e7dc291ee9270d4749df47ef26a640010c5b4] | committer: Felix Paul 
Kühne

macosx/sprefs: add 'large text in list views' option to the interface section

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

 modules/gui/macosx/UI/SimplePreferences.xib| 34 +++---
 .../macosx/preferences/VLCSimplePrefsController.h  |  4 +--
 .../macosx/preferences/VLCSimplePrefsController.m  |  3 ++
 3 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index 73b824a7df..b4502e8e3a 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -65,8 +65,10 @@
 
 
 
+
 
 
+
 
 
 
@@ -286,13 +288,13 @@ Gw
 
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
@@ -300,7 +302,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -314,7 +316,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -323,21 +325,33 @@ Gw
 
 
 
+
+
+
+
+
+
+
+
+
+
 
 
 
 
+
 
-
 
+
 
 
+
 
 
 
 
 
-
+
 
 
 
@@ -373,7 +387,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -424,7 +438,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -473,7 +487,7 @@ Gw
 
 
 
-
+
 
 
 
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.h 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
index 92ae37e6d2..46a119c5a4 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.h
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
@@ -112,10 +112,8 @@
 @property (readwrite, weak) IBOutlet NSBox *intf_generalSettingsBox;
 @property (readwrite, weak) IBOutlet NSPopUpButton *intf_languagePopup;
 @property (readwrite, weak) IBOutlet NSTextField *intf_languageLabel;
-@property (readwrite, weak) IBOutlet NSTextField *intf_styleLabel;
-@property (readwrite, weak) IBOutlet NSButtonCell *intf_style_darkButtonCell;
-@property (readwrite, weak) IBOutlet NSButtonCell *intf_style_brightButtonCell;
 @property (readwrite, weak) IBOutlet NSButton *intf_statusIconCheckbox;
+@property (readwrite, weak) IBOutlet NSButton *intf_largeFontInListsCheckbox;
 
 // intf pane - control box
 @property (readwrite, weak) IBOutlet NSBox *intf_playbackControlBox;
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.m 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
index bc6a34f40a..aea737eb15 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/preferen

[vlc-commits] macosx/sprefs: reorder items in the codec/input category

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 22:36:53 
2019 +0200| [f3aeacb592fd3347a47fe329f8608d662d9b30bb] | committer: Felix Paul 
Kühne

macosx/sprefs: reorder items in the codec/input category

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

 modules/gui/macosx/UI/SimplePreferences.xib | 210 ++--
 1 file changed, 105 insertions(+), 105 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index c1c19f7101..73b824a7df 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -1221,8 +1221,108 @@ Gw
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-
+
 
 
 
@@ -1266,7 +1366,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1293,7 +1393,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1349,111 +1449,9 @@

[vlc-commits] macosx/sprefs: add input-fast-seek

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 23:07:56 
2019 +0200| [4a2109c728d4ca6f84bf2f027a9fa1ac3e33e5db] | committer: Felix Paul 
Kühne

macosx/sprefs: add input-fast-seek

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

 modules/gui/macosx/UI/SimplePreferences.xib | 17 ++---
 .../gui/macosx/preferences/VLCSimplePrefsController.h   |  1 +
 .../gui/macosx/preferences/VLCSimplePrefsController.m   |  3 +++
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index b4502e8e3a..76506505f4 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -49,6 +49,7 @@
 
 
 
+
 
 
 
@@ -1267,6 +1268,16 @@ Gw
 
 
 
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -1313,6 +1324,7 @@ Gw
 
 
 
+
 
 
 
@@ -1325,15 +1337,14 @@ Gw
 
 
 
+
 
 
 
 
+
 
 
-
-
-
 
 
 
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.h 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
index 46a119c5a4..aefad7c187 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.h
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
@@ -105,6 +105,7 @@
 @property (readwrite, weak) IBOutlet NSPopUpButton *input_skipLoopPopup;
 @property (readwrite, weak) IBOutlet NSButton *input_urlhandlerButton;
 @property (readwrite, weak) IBOutlet NSButton *input_skipFramesCheckbox;
+@property (readwrite, weak) IBOutlet NSButton *input_fastSeekCheckbox;
 
 // intf pane - general box
 @property (readwrite, strong) IBOutlet NSView *intfView;
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.m 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
index aea737eb15..08ae70479a 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
@@ -359,6 +359,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, 
NSString *desc, NSStrin
 [_input_skipLoopLabel setStringValue: _NS("Skip the loop filter for H.264 
decoding")];
 [_input_urlhandlerButton setTitle: _NS("Edit default application settings 
for network protocols")];
 [_input_skipFramesCheckbox setTitle: _NS("Skip frames")];
+[_input_fastSeekCheckbox setTitle: _NS("Fast seek")];
 
 /* url handler */
 [_urlhandler_titleLabel setStringValue: _NS("Open network streams using 
the following protocols")];
@@ -736,6 +737,7 @@ static inline const char * __config_GetLabel(vlc_object_t 
*p_this, const char *p
 
 [self setupButton:_input_hardwareAccelerationCheckbox forBoolValue: 
"videotoolbox"];
 [self setupButton:_input_skipFramesCheckbox forBoolValue: "skip-frames"];
+[self setupButton:_input_fastSeekCheckbox forBoolValue: "input-fast-seek"];
 [self setupButton:_input_aviPopup forIntList: "avi-index"];
 [self setupButton:_input_skipLoopPopup forIntList: 
"avcodec-skiploopfilter"];
 
@@ -1044,6 +1046,7 @@ static inline void save_string_list(intf_thread_t * 
p_intf, id object, const cha
 
 config_PutInt("videotoolbox", [_input_hardwareAccelerationCheckbox 
state]);
 config_PutInt("skip-frames", [_input_skipFramesCheckbox state]);
+config_PutInt("input-fast-seek", [_input_fastSeekCheckbox state]);
 
 SaveIntList(_input_aviPopup, "avi-index");
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/sprefs: add option to dim the keyboard backlight in fullscreen and make it the default

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 21:37:22 
2019 +0200| [e354e7536bd5a660b1743b2f6e42099b73907101] | committer: Felix Paul 
Kühne

macosx/sprefs: add option to dim the keyboard backlight in fullscreen and make 
it the default

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

 modules/gui/macosx/UI/SimplePreferences.xib| 29 --
 modules/gui/macosx/main/macosx.m   |  2 +-
 .../macosx/preferences/VLCSimplePrefsController.h  |  1 +
 .../macosx/preferences/VLCSimplePrefsController.m  |  3 +++
 4 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index 02b191d594..52262bd68d 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -39,6 +39,7 @@
 
 
 
+
 
 
 
@@ -1848,10 +1849,10 @@ Gw
 
 
 
-
+
 
 
-
+
 
 
 
@@ -1914,7 +1915,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1924,7 +1925,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1934,7 +1935,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1942,7 +1943,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1951,15 +1952,27 @@ Gw
 
 
 
+
+
+
+
+
+
+
+
+
+
 
 
 
+
 
+
 
 
 
 
-
+
 
 
 
@@ -1968,7 +1981,7 @@ Gw
 
 
 
-
+
 
 
 
diff --git a/modules/gui/macosx/main/macosx.m b/modules/gui/macosx/main/macosx.m
index 7fc40b2318..924920b356 100644
--- a/modules/gui/macosx/main/macosx.m
+++ b/modules/gui/macosx/main/macosx.m
@@ -153,7 +153,7 @@ vlc_module_begin()
 add_bool("macosx-video-autoresize", true, KEEPSIZE_TEXT, 
KEEPSIZE_LONGTEXT, false)
 add_bool("macosx-pause-minimized", false, PAUSE_MINIMIZED_TEXT, 
PAUSE_MINIMIZED_LONGTEXT, false)
 add_bool("macosx-lock-aspect-ratio", true, LOCK_ASPECT_RATIO_TEXT, 
LOCK_ASPECT_RATIO_TEXT, true)
-add_bool("macosx-dim-keyboard", false, DIM_KEYBOARD_PLAYBACK_TEXT, 
DIM_KEYBOARD_PLAYBACK_LONGTEXT, false)
+add_bool("macosx-dim-keyboard", true, DIM_KEYBOARD_PLAYBACK_TEXT, 
DIM_KEYBOARD_PLAYBACK_LONGTEXT, false)
 add_integer("macosx-control-itunes", 1, ITUNES_TEXT, ITUNES_LONGTEXT, 
false)
 change_integer_list(itunes_list, itunes_list_text)
 add_integer("macosx-continue-playback", 0, CONTINUE_PLAYBACK_TEXT, 
CONTINUE_PLAYBACK_LONGTEXT, false)
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.h 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
index 319d2e72d7..f27e62f039 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.h
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
@@ -84,6 +84,7 @@
 @property (readwrite, weak) IBOutlet NSTextField *hotkeysLabel;
 @property (readwrite, weak) IBOutlet NSTableView *hotkeys_listbox;
 @property (readwrite, weak) IBOutlet NSButton *hotkeys_mediakeysCheckbox;
+@property (readwrite, weak) IBOutlet NSButton *hotkeys_dimKeyboardCheckbox;
 
 // input pane
 @property (readwrite, strong) IBOutlet NSView *inputView;
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.m 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
index 378378ec53..56ea056a87 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
@@ -343,6 +343,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, 
NSString *desc, NSStrin

[vlc-commits] macosx/sprefs: remove Apple Remote settings since the devices are not dominant enough anymore to sustify such prominent settings

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 21:20:06 
2019 +0200| [4f9a1cfdecacdfd241773a1b28400f03fafda1a3] | committer: Felix Paul 
Kühne

macosx/sprefs: remove Apple Remote settings since the devices are not dominant 
enough anymore to sustify such prominent settings

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

 modules/gui/macosx/UI/SimplePreferences.xib| 61 ++
 .../gui/macosx/os-integration/VLCClickerManager.h  |  1 -
 .../gui/macosx/os-integration/VLCClickerManager.m  | 15 --
 .../macosx/preferences/VLCSimplePrefsController.h  |  2 -
 .../macosx/preferences/VLCSimplePrefsController.m  |  7 ---
 5 files changed, 16 insertions(+), 70 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index 37608c6262..c129800982 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -60,8 +60,6 @@
 
 
 
-
-
 
 
 
@@ -339,23 +337,13 @@ Gw
 
 
 
-
+
 
-
+
 
 
-
-
-
-
-
-
-
-
-
-
 
-
+
 
 
 
@@ -365,7 +353,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -373,7 +361,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -383,38 +371,22 @@ Gw
 
 
 
-
-
-
-
-
-
-
-
-
-
 
 
-
-
-
-
 
 
 
-
+
+
 
 
-
-
-
+
 
-
 
 
 
 
-
+
 
 
 
@@ -465,9 +437,9 @@ Gw
 
 
 
-
+
 
-
+
 
 
 
@@ -481,7 +453,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -514,13 +486,13 @@ Gw
 
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
@@ -540,7 +512,7 @@

[vlc-commits] macosx/sprefs: add the option to disable video resizing to the native size to the video section

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 21:47:14 
2019 +0200| [a80b810bddfee8fbdcbd82ce30bbdf831b97b33f] | committer: Felix Paul 
Kühne

macosx/sprefs: add the option to disable video resizing to the native size to 
the video section

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

 modules/gui/macosx/UI/SimplePreferences.xib| 29 --
 .../macosx/preferences/VLCSimplePrefsController.h  |  1 +
 .../macosx/preferences/VLCSimplePrefsController.m  |  3 +++
 3 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index 52262bd68d..3e438814d5 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -145,6 +145,7 @@
 
 
 
+
 
 
 
@@ -820,10 +821,10 @@ Gw
 
 
 
-
+
 
 
-
+
 
 
 
@@ -833,13 +834,13 @@ Gw
 
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
@@ -859,7 +860,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -868,6 +869,16 @@ Gw
 
 
 
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -880,8 +891,10 @@ Gw
 
 
 
+
 
 
+
 
 
 
@@ -891,7 +904,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1172,7 +1185,7 @@ Gw
 
 
 
-
+
 
 
 
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.h 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
index f27e62f039..27224e6648 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.h
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.h
@@ -179,6 +179,7 @@
 @property (readwrite, weak) IBOutlet NSButton 
*video_pauseWhenMinimizedCheckbox;
 @property (readwrite, weak) IBOutlet NSButton *video_onTopCheckbox;
 @property (readwrite, weak) IBOutlet NSButton *video_videodecoCheckbox;
+@property (readwrite, weak) IBOutlet NSButton 
*video_resizeToNativeSizeCheckbox;
 
 // video pane - fullscreen box
 @property (readwrite, weak) IBOutlet NSBox *video_fullscreenBox;
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.m 
b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
index 56ea056a87..756e0a5312 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
@@ -409,6 +409,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, 
NSString *desc, NSStrin
 [_video_displayBox setTitle: _NS("Display")];
 [_video_embeddedCheckbox setTitle: _NS("Show video within the main 
window")];
 [_video_pauseWhenMinimizedCheckbox setTitle:_NS("Pause the video playback 
when minimized")];
+[_video_resizeToNativeSizeCheckbox setTitle:_NS("Resize interface to the 
native video size")];
 [_video_onTopCheckbox setTitle: _NS("Float on Top")];
 [_video_videodecoCheckbox setTitle: _NS("Window decorations")];
 
@@ -699,6 +700,7 @@ static inline cons

[vlc-commits] macosx/sprefs: move the mediakeys option from interface to the hotkeys section

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 21:28:10 
2019 +0200| [af8b79cda207317a7b9333e1be21e0affce8e30f] | committer: Felix Paul 
Kühne

macosx/sprefs: move the mediakeys option from interface to the hotkeys section

From an end-user perspective, those are functional global hotkeys and it is 
irrelevant that the implementation for their support is in the UI and not the 
hotkeys module.

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

 modules/gui/macosx/UI/SimplePreferences.xib| 62 +++---
 .../macosx/preferences/VLCSimplePrefsController.h  |  2 +-
 .../macosx/preferences/VLCSimplePrefsController.m  |  7 +--
 3 files changed, 36 insertions(+), 35 deletions(-)

diff --git a/modules/gui/macosx/UI/SimplePreferences.xib 
b/modules/gui/macosx/UI/SimplePreferences.xib
index c129800982..02b191d594 100644
--- a/modules/gui/macosx/UI/SimplePreferences.xib
+++ b/modules/gui/macosx/UI/SimplePreferences.xib
@@ -40,6 +40,7 @@
 
 
 
+
 
 
 
@@ -71,7 +72,6 @@
 
 
 
-
 
 
 
@@ -337,23 +337,13 @@ Gw
 
 
 
-
+
 
-
+
 
 
-
-
-
-
-
-
-
-
-
-
 
-
+
 
 
 
@@ -361,7 +351,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -373,20 +363,17 @@ Gw
 
 
 
+
 
 
 
-
-
 
 
-
-
 
 
 
 
-
+
 
 
 
@@ -437,7 +424,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -486,7 +473,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1861,16 +1848,16 @@ Gw
 
 
 
-
+
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
@@ -1927,7 +1914,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1937,7 +1924,7 @@ Gw
 
 
 
-
+
 
 
 
@@ -1947,28 +1934,41 @@

[vlc-commits] macosx: merge library folder management window to simple preferences

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 21:04:59 
2019 +0200| [9ee4545085776b2505361887a21eed9abb94eb93] | committer: Felix Paul 
Kühne

macosx: merge library folder management window to simple preferences

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |   8 -
 modules/gui/macosx/Makefile.am |   3 -
 modules/gui/macosx/UI/MainMenu.xib |   7 -
 modules/gui/macosx/UI/SimplePreferences.xib| 140 +-
 .../macosx/UI/VLCLibraryFolderManagementWindow.xib | 168 -
 .../library/VLCLibraryFolderManagementWindow.h |  48 -
 .../library/VLCLibraryFolderManagementWindow.m | 157 
 modules/gui/macosx/menus/VLCMainMenu.h |   3 -
 modules/gui/macosx/menus/VLCMainMenu.m |  11 --
 .../macosx/preferences/VLCSimplePrefsController.h  |  52 --
 .../macosx/preferences/VLCSimplePrefsController.m  | 206 ++---
 po/POTFILES.in |   2 -
 12 files changed, 352 insertions(+), 453 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index a1fadb9f6c..5701bc5974 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -132,7 +132,6 @@
7D903EAF224392B400917358 /* timespec_get.c in Sources */ = {isa 
= PBXBuildFile; fileRef = 7D903EAE224392B400917358 /* timespec_get.c */; };
7D903EB6224394BE00917358 /* specific.c in Sources */ = {isa = 
PBXBuildFile; fileRef = 7D903EB5224394BE00917358 /* specific.c */; };
7D903EB92243952100917358 /* threads.c in Sources */ = {isa = 
PBXBuildFile; fileRef = 7D903EB82243952100917358 /* threads.c */; };
-   7D94E28D2274D2140008057F /* VLCLibraryFolderManagementWindow.m 
in Sources */ = {isa = PBXBuildFile; fileRef = 7D94E28B2274D2140008057F /* 
VLCLibraryFolderManagementWindow.m */; };
7DB40D2A20CBCEB500F63173 /* VLCMainMenu.m in Sources */ = {isa 
= PBXBuildFile; fileRef = 7DB40D2920CBCEB500F63173 /* VLCMainMenu.m */; };
7DB40D2D20CBCEC200F63173 /* VLCStatusBarIcon.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7DB40D2B20CBCEC200F63173 /* VLCStatusBarIcon.m 
*/; };
7DB7F1EC20CC036D00C2CAED /* AudioUnit.framework in Frameworks 
*/ = {isa = PBXBuildFile; fileRef = 7DB7F1EB20CC036D00C2CAED /* 
AudioUnit.framework */; };
@@ -512,9 +511,6 @@
7D903EAE224392B400917358 /* timespec_get.c */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.c; name = timespec_get.c; 
path = ../../../../compat/timespec_get.c; sourceTree = ""; };
7D903EB5224394BE00917358 /* specific.c */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = 
specific.c; path = ../../../src/darwin/specific.c; sourceTree = ""; };
7D903EB82243952100917358 /* threads.c */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = 
threads.c; path = ../../../../src/misc/threads.c; sourceTree = ""; };
-   7D94E28A2274D2140008057F /* VLCLibraryFolderManagementWindow.h 
*/ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryFolderManagementWindow.h; sourceTree = ""; };
-   7D94E28B2274D2140008057F /* VLCLibraryFolderManagementWindow.m 
*/ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryFolderManagementWindow.m; sourceTree = ""; };
-   7D94E28C2274D2140008057F /* 
VLCLibraryFolderManagementWindow.xib */ = {isa = PBXFileReference; 
lastKnownFileType = file.xib; path = VLCLibraryFolderManagementWindow.xib; 
sourceTree = ""; };
7DB40D2820CBCEB500F63173 /* VLCMainMenu.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCMainMenu.h; 
sourceTree = ""; };
7DB40D2920CBCEB500F63173 /* VLCMainMenu.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCMainMenu.m; 
sourceTree = ""; };
7DB40D2B20CBCEC200F63173 /* VLCStatusBarIcon.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCStatusBarIcon.m; sourceTree = ""; };
@@ -1027,8 +1023,6 @@
7DE2F0432282C84A0040DD0A /* 
VLCLibraryAudioDataSource.m */,
7DFBDCAF226A518400B700A5 /* 
VLCLibraryMenuController.h */,
7DFBDCB0226A518400B700A5 /* 
VLCLibraryMenuController.m */,
-   7D94E28A2274D2140008057F /* 
VLCLibraryFolderManagementWindow.h */,
-   7D94E28B2274D2140008057F /* 
VL

[vlc-commits] macosx/library collection view item: refactor for increased readibility

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 20:25:50 
2019 +0200| [5337f1bc805d97ab299578cfc6e56edb9678f611] | committer: Felix Paul 
Kühne

macosx/library collection view item: refactor for increased readibility

No functional changes

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

 .../macosx/library/VLCLibraryCollectionViewItem.m  | 39 +-
 modules/gui/macosx/library/VLCLibraryDataTypes.h   |  1 +
 modules/gui/macosx/library/VLCLibraryDataTypes.m   |  1 +
 3 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index d06c0728b2..a4b1aa2523 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -142,12 +142,31 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 - (void)updateRepresentation
 {
 if (_representedMediaItem == nil) {
+NSAssert(1, @"no media item assigned for collection view item", nil);
 return;
 }
 
 _mediaTitleTextField.stringValue = _representedMediaItem.title;
-_durationTextField.stringValue = [NSString 
stringWithTime:_representedMediaItem.duration / 1000];
+_durationTextField.stringValue = [NSString 
stringWithTime:_representedMediaItem.duration / 
VLCMediaLibraryMediaItemDurationDenominator];
 
+_mediaImageView.image = [self imageForMedia];
+
+VLCMediaLibraryTrack *videoTrack = _representedMediaItem.firstVideoTrack;
+[self showVideoSizeIfNeededForWidth:videoTrack.videoWidth 
andHeight:videoTrack.videoHeight];
+
+CGFloat position = _representedMediaItem.lastPlaybackPosition;
+if (position > VLCLibraryCollectionViewItemMinimalDisplayedProgress && 
position < VLCLibraryCollectionViewItemMaximumDisplayedProgress) {
+_progressIndicator.progress = position;
+_progressIndicator.hidden = NO;
+}
+
+if (_representedMediaItem.playCount == 0) {
+_unplayedIndicatorTextField.hidden = NO;
+}
+}
+
+- (NSImage *)imageForMedia
+{
 NSImage *image;
 if (_representedMediaItem.artworkGenerated) {
 image = [[NSImage alloc] initWithContentsOfURL:[NSURL 
URLWithString:_representedMediaItem.artworkMRL]];
@@ -159,11 +178,11 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 if (!image) {
 image = [NSImage imageNamed: @"noart.png"];
 }
-_mediaImageView.image = image;
+return image;
+}
 
-VLCMediaLibraryTrack *videoTrack = _representedMediaItem.firstVideoTrack;
-CGFloat width = videoTrack.videoWidth;
-CGFloat height = videoTrack.videoHeight;
+- (void)showVideoSizeIfNeededForWidth:(CGFloat)width andHeight:(CGFloat)height
+{
 if (width >= VLCMediaLibrary4KWidth || height >= VLCMediaLibrary4KHeight) {
 _annotationTextField.stringValue = @" 4K ";
 _annotationTextField.hidden = NO;
@@ -171,16 +190,6 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 _annotationTextField.stringValue = @" HD ";
 _annotationTextField.hidden = NO;
 }
-
-CGFloat position = _representedMediaItem.lastPlaybackPosition;
-if (position > VLCLibraryCollectionViewItemMinimalDisplayedProgress && 
position < VLCLibraryCollectionViewItemMaximumDisplayedProgress) {
-_progressIndicator.progress = position;
-_progressIndicator.hidden = NO;
-}
-
-if (_representedMediaItem.playCount == 0) {
-_unplayedIndicatorTextField.hidden = NO;
-}
 }
 
 #pragma mark - actions
diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.h 
b/modules/gui/macosx/library/VLCLibraryDataTypes.h
index 8fb75bc8a8..5d50c69e5b 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.h
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.h
@@ -31,6 +31,7 @@ extern const CGFloat VLCMediaLibrary4KWidth;
 extern const CGFloat VLCMediaLibrary4KHeight;
 extern const CGFloat VLCMediaLibrary720pWidth;
 extern const CGFloat VLCMediaLibrary720pHeight;
+extern const long long int VLCMediaLibraryMediaItemDurationDenominator;
 
 @interface VLCMediaLibraryFile : NSObject
 
diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.m 
b/modules/gui/macosx/library/VLCLibraryDataTypes.m
index af99634fd2..76ec78fd4e 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.m
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.m
@@ -31,6 +31,7 @@ const CGFloat VLCMediaLibrary4KWidth = 3840.;
 const CGFloat VLCMediaLibrary4KHeight = 2160.;
 const CGFloat VLCMediaLibrary720pWidth = 1280.;
 const CGFloat VLCMediaLibrary720pHeight = 720.;
+const long long int VLCMediaLibraryMediaItemDurationDenominator = 1000;
 
 @implementation VLCMediaLibraryFile
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library collection view supplementary element view: don't show a border

2019-05-30 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 30 20:27:04 
2019 +0200| [4d2c5cbefcef6cc145e5643591a2dc26c08db17a] | committer: Felix Paul 
Kühne

macosx/library collection view supplementary element view: don't show a border

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

 .../macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m
index d651cf2f08..e9de52bdf5 100644
--- 
a/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m
+++ 
b/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m
@@ -42,6 +42,7 @@ NSString *VLCLibrarySupplementaryElementViewIdentifier = 
@"VLCLibrarySupplementa
 self.textColor = self.shouldShowDarkAppearance ? [NSColor 
VLClibraryDarkTitleColor] : [NSColor VLClibraryLightTitleColor];
 self.editable = NO;
 self.selectable = NO;
+self.bordered = NO;
 }
 return self;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: introduce constants for volume default and maximum internal to the module

2019-05-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 29 19:07:52 
2019 +0200| [5738d7a0b65bc692185a63c3caa1bcd9542c4f45] | committer: Felix Paul 
Kühne

macosx: introduce constants for volume default and maximum internal to the 
module

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

 modules/gui/macosx/playlist/VLCPlayerController.h| 3 +++
 modules/gui/macosx/playlist/VLCPlayerController.m| 3 +++
 modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m | 3 ---
 modules/gui/macosx/windows/video/VLCFSPanelController.m  | 6 ++
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/playlist/VLCPlayerController.h 
b/modules/gui/macosx/playlist/VLCPlayerController.h
index 7a83bba9ce..1909beac13 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.h
+++ b/modules/gui/macosx/playlist/VLCPlayerController.h
@@ -227,6 +227,9 @@ extern NSString *VLCPlayerVolumeChanged;
  */
 extern NSString *VLCPlayerMuteChanged;
 
+extern const CGFloat VLCVolumeMaximum;
+extern const CGFloat VLCVolumeDefault;
+
 @interface VLCPlayerController : NSObject
 
 - (instancetype)initWithPlayer:(vlc_player_t *)player;
diff --git a/modules/gui/macosx/playlist/VLCPlayerController.m 
b/modules/gui/macosx/playlist/VLCPlayerController.m
index fc97049fd3..268eecf250 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.m
+++ b/modules/gui/macosx/playlist/VLCPlayerController.m
@@ -71,6 +71,9 @@ NSString *VLCPlayerListOfVideoOutputThreadsChanged = 
@"VLCPlayerListOfVideoOutpu
 NSString *VLCPlayerVolumeChanged = @"VLCPlayerVolumeChanged";
 NSString *VLCPlayerMuteChanged = @"VLCPlayerMuteChanged";
 
+const CGFloat VLCVolumeMaximum = 2.;
+const CGFloat VLCVolumeDefault = 1.;
+
 @interface VLCPlayerController ()
 {
 vlc_player_t *_p_player;
diff --git a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m 
b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
index e7a113e729..f66d1ca27b 100644
--- a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
+++ b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
@@ -29,9 +29,6 @@
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
 
-CGFloat VLCVolumeMaximum = 2.;
-CGFloat VLCVolumeDefault = 1.;
-
 /*
  * VLCMainWindowControlsBar
  *
diff --git a/modules/gui/macosx/windows/video/VLCFSPanelController.m 
b/modules/gui/macosx/windows/video/VLCFSPanelController.m
index fb4eb160a9..9e4e7e038f 100644
--- a/modules/gui/macosx/windows/video/VLCFSPanelController.m
+++ b/modules/gui/macosx/windows/video/VLCFSPanelController.m
@@ -25,8 +25,6 @@
 
 #import "VLCFSPanelController.h"
 
-#import 
-
 #import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "playlist/VLCPlaylistController.h"
@@ -150,9 +148,9 @@ static NSString *kAssociatedFullscreenRect = 
@"VLCFullscreenAssociatedWindowRect
 _NS("Adjust the current playback position"));
 
 /* Setup other controls */
-[_volumeSlider setMaxValue:2.0];
+[_volumeSlider setMaxValue:VLCVolumeMaximum];
 [_volumeSlider setFloatValue:_playerController.volume];
-[_volumeSlider setDefaultValue:1.0];
+[_volumeSlider setDefaultValue:VLCVolumeDefault];
 
 /* Identifier to store the state of the remaining or total time label,
  * this is the same identifier as used for the window playback cotrols

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: iterate on playlist cell view

2019-05-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 29 19:36:32 
2019 +0200| [7d9948f3a86fd2cd9e6f5fdff9213109d84d7142] | committer: Felix Paul 
Kühne

macosx: iterate on playlist cell view

This introduces an indicator for media where we can be sure it is audio and 
privatices the cell content setting

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |   4 +++
 modules/gui/macosx/Makefile.am |   2 ++
 .../gui/macosx/Resources/librarywindow/note.png| Bin 0 -> 267 bytes
 .../gui/macosx/Resources/librarywindow/n...@2x.png | Bin 0 -> 400 bytes
 modules/gui/macosx/UI/VLCPlaylistTableCellView.xib |  34 -
 modules/gui/macosx/library/VLCLibraryWindow.m  |   2 +-
 .../gui/macosx/playlist/VLCPlaylistDataSource.m|  19 +---
 .../gui/macosx/playlist/VLCPlaylistTableCellView.h |   5 +++
 .../gui/macosx/playlist/VLCPlaylistTableCellView.m |  30 ++
 9 files changed, 70 insertions(+), 26 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 21f1f6eab0..a1fadb9f6c 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -500,6 +500,8 @@
7D713D302201AE350042BEB7 /* VLCLibraryWindow.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryWindow.h; sourceTree = ""; };
7D713D312201AE350042BEB7 /* VLCLibraryWindow.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryWindow.m; sourceTree = ""; };
7D713D332201BB130042BEB7 /* VLCLibraryWindow.xib */ = {isa = 
PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryWindow.xib; 
sourceTree = ""; };
+   7D71B88C229EF61200D919E7 /* note.png */ = {isa = 
PBXFileReference; lastKnownFileType = image.png; name = note.png; path = 
librarywindow/note.png; sourceTree = ""; };
+   7D71B88D229EF61300D919E7 /* n...@2x.png */ = {isa = 
PBXFileReference; lastKnownFileType = image.png; name = "n...@2x.png"; path = 
"librarywindow/n...@2x.png"; sourceTree = ""; };
7D871D371B5E6844000B56C0 /* VLCMain+OldPrefs.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"VLCMain+OldPrefs.h"; sourceTree = ""; };
7D871D381B5E6844000B56C0 /* VLCMain+OldPrefs.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
"VLCMain+OldPrefs.m"; sourceTree = ""; };
7D8BB0B318302AC000FAE9B7 /* VLCLogWindowController.h */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLogWindowController.h; sourceTree = ""; };
@@ -1353,6 +1355,8 @@
7D28E63E2275C8660098D30E /* ellip...@2x.png */,
7D28E6402275C9C70098D30E /* libraryPlay.png */,
7D28E63F2275C9C70098D30E /* libraryp...@2x.png 
*/,
+   7D71B88C229EF61200D919E7 /* note.png */,
+   7D71B88D229EF61300D919E7 /* n...@2x.png */,
7D28E6462275F2850098D30E /* repeatOff.png */,
7D28E6442275F2840098D30E /* repeat...@2x.png */,
7D28E6482275F2850098D30E /* repeatOne.png */,
diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am
index 83c986b778..d9f2aa1c58 100644
--- a/modules/gui/macosx/Makefile.am
+++ b/modules/gui/macosx/Makefile.am
@@ -319,6 +319,8 @@ libmacosx_plugin_la_RES = \
gui/macosx/Resources/File-Icons/wmv.icns \
gui/macosx/Resources/librarywindow/ellipsis.png \
gui/macosx/Resources/librarywindow/ellip...@2x.png \
+   gui/macosx/Resources/librarywindow/note.png \
+   gui/macosx/Resources/librarywindow/n...@2x.png \
gui/macosx/Resources/librarywindow/libraryPlay.png \
gui/macosx/Resources/librarywindow/libraryp...@2x.png \
gui/macosx/Resources/librarywindow/repeatAll.png \
diff --git a/modules/gui/macosx/Resources/librarywindow/note.png 
b/modules/gui/macosx/Resources/librarywindow/note.png
new file mode 100644
index 00..7714f2ba4b
Binary files /dev/null and 
b/modules/gui/macosx/Resources/librarywindow/note.png differ
diff --git a/modules/gui/macosx/Resources/librarywindow/n...@2x.png 
b/modules/gui/macosx/Resources/librarywindow/n...@2x.png
new file mode 100644
index 00..4a14dabb3e
Binary files /dev/null and 
b/modules/gui/macosx/Resources/librarywindow/n...@2x.png differ
diff --git a/modules/gui/macosx/UI/VLCPlaylistTableCellView.xib 
b/modules/gui/macosx/UI/VLCPlaylistTableCellView.xib
index d35ecfa235..3deb69a965 

[vlc-commits] macosx: re-add volume slider and stop button to main window

2019-05-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 29 18:31:55 
2019 +0200| [5d8def777ffac73aa1886169087428a96eb446ef] | committer: Felix Paul 
Kühne

macosx: re-add volume slider and stop button to main window

This commit removes a lot of legacy code for control bar customization which is 
no longer desired in v4.

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

 modules/gui/macosx/UI/MainMenu.xib |  21 --
 .../gui/macosx/UI/VLCLibraryCollectionViewItem.xib |   4 +-
 modules/gui/macosx/UI/VLCLibraryWindow.xib |  75 -
 modules/gui/macosx/main/macosx.m   |  15 +-
 modules/gui/macosx/menus/VLCMainMenu.h |   5 -
 modules/gui/macosx/menus/VLCMainMenu.m |  38 +--
 modules/gui/macosx/playlist/VLCPlayerController.m  |   4 +-
 .../windows/mainwindow/VLCControlsBarCommon.h  |   1 -
 .../windows/mainwindow/VLCControlsBarCommon.m  |  54 +---
 .../windows/mainwindow/VLCMainWindowControlsBar.h  |  29 +-
 .../windows/mainwindow/VLCMainWindowControlsBar.m  | 337 ++---
 11 files changed, 125 insertions(+), 458 deletions(-)

diff --git a/modules/gui/macosx/UI/MainMenu.xib 
b/modules/gui/macosx/UI/MainMenu.xib
index ee8d623a61..e543134225 100644
--- a/modules/gui/macosx/UI/MainMenu.xib
+++ b/modules/gui/macosx/UI/MainMenu.xib
@@ -145,9 +145,6 @@
 
 
 
-
-
-
 
 
 
@@ -369,24 +366,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 
diff --git a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib 
b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
index bf6fb3d446..7914071e39 100644
--- a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
+++ b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
@@ -28,9 +28,9 @@
 
 
 
-
+
 
-
+
 
 
 
diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index c24ca5c6b9..d083f419f2 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -272,7 +272,7 @@
 
 
 
-
+
 
 
 
@@ -284,7 +284,7 @@
 
 
 
-
+
 
 
 
@@ -309,17 +309

[vlc-commits] macosx/linear progress indicator: rewrite to show a bar instead of a triangle

2019-05-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 29 17:38:41 
2019 +0200| [3fbd27c8db71a62d3df01adf4c6df5d446e2a358] | committer: Felix Paul 
Kühne

macosx/linear progress indicator: rewrite to show a bar instead of a triangle

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

 .../gui/macosx/extensions/NSColor+VLCAdditions.h   |  2 +
 .../gui/macosx/extensions/NSColor+VLCAdditions.m   | 10 
 .../gui/macosx/views/VLCLinearProgressIndicator.m  | 67 ++
 3 files changed, 55 insertions(+), 24 deletions(-)

diff --git a/modules/gui/macosx/extensions/NSColor+VLCAdditions.h 
b/modules/gui/macosx/extensions/NSColor+VLCAdditions.h
index 122f44e4e9..a5bfb7105d 100644
--- a/modules/gui/macosx/extensions/NSColor+VLCAdditions.h
+++ b/modules/gui/macosx/extensions/NSColor+VLCAdditions.h
@@ -34,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
 + (instancetype)VLClibraryAnnotationBackgroundColor;
 + (instancetype)VLClibrarySeparatorLightColor;
 + (instancetype)VLClibrarySeparatorDarkColor;
++ (instancetype)VLClibraryProgressIndicatorBackgroundColor;
++ (instancetype)VLClibraryProgressIndicatorForegroundColor;
 
 @end
 
diff --git a/modules/gui/macosx/extensions/NSColor+VLCAdditions.m 
b/modules/gui/macosx/extensions/NSColor+VLCAdditions.m
index 5f9db425d6..3e17ac64a9 100644
--- a/modules/gui/macosx/extensions/NSColor+VLCAdditions.m
+++ b/modules/gui/macosx/extensions/NSColor+VLCAdditions.m
@@ -64,4 +64,14 @@
 return [NSColor colorWithRed:0.11 green:0.09 blue:0.07 alpha:1.];
 }
 
++ (instancetype)VLClibraryProgressIndicatorBackgroundColor
+{
+return [NSColor colorWithRed:37./255. green:41./255. blue:44./255. 
alpha:.8];
+}
+
++ (instancetype)VLClibraryProgressIndicatorForegroundColor
+{
+return [NSColor colorWithRed:246./255. green:127./255. blue:0. alpha:1.];
+}
+
 @end
diff --git a/modules/gui/macosx/views/VLCLinearProgressIndicator.m 
b/modules/gui/macosx/views/VLCLinearProgressIndicator.m
index faaa022df7..fa4892b788 100644
--- a/modules/gui/macosx/views/VLCLinearProgressIndicator.m
+++ b/modules/gui/macosx/views/VLCLinearProgressIndicator.m
@@ -23,39 +23,58 @@
 #import "VLCLinearProgressIndicator.h"
 #import "extensions/NSColor+VLCAdditions.h"
 
-@implementation VLCLinearProgressIndicator
-
-- (void)drawRect:(NSRect)dirtyRect
+@interface VLCLinearProgressIndicator()
 {
-[super drawRect:dirtyRect];
-
-CGRect rect = NSRectToCGRect(dirtyRect);
-
-CGContextClearRect([NSGraphicsContext currentContext].CGContext, rect);
+NSView *_foregroundView;
+}
+@end
 
-NSColor *drawingColor = [NSColor VLClibraryHighlightColor];
+@implementation VLCLinearProgressIndicator
 
-NSBezierPath* bezierPath = [NSBezierPath bezierPath];
+- (instancetype)initWithFrame:(NSRect)frameRect
+{
+self = [super initWithFrame:frameRect];
+if (self) {
+[self setupSubviews];
+}
+return self;
+}
 
-float progress_width = self.progress * rect.size.width;
+- (instancetype)initWithCoder:(NSCoder *)decoder
+{
+self = [super initWithCoder:decoder];
+if (self) {
+[self setupSubviews];
+}
+return self;
+}
 
-// Create our triangle
-[bezierPath moveToPoint:CGPointMake(progress_width - rect.size.height + 
3., 2.)];
-[bezierPath lineToPoint:CGPointMake(progress_width - (rect.size.height/2), 
rect.size.height - 5.)];
-[bezierPath lineToPoint:CGPointMake(progress_width - 3., 2.)];
-[bezierPath closePath];
+- (void)setupSubviews
+{
+self.wantsLayer = YES;
+self.layer.backgroundColor = [NSColor 
VLClibraryProgressIndicatorBackgroundColor].CGColor;
 
-// Set the display for the path, and stroke it
-bezierPath.lineWidth = 6.;
-[drawingColor setStroke];
-[bezierPath stroke];
-[drawingColor setFill];
-[bezierPath fill];
+CGRect frame = self.frame;
+frame.size.width = 0.;
+_foregroundView = [[NSView alloc] initWithFrame:frame];
+_foregroundView.wantsLayer = YES;
+_foregroundView.layer.backgroundColor = [NSColor 
VLClibraryProgressIndicatorForegroundColor].CGColor;
+_foregroundView.autoresizingMask = NSViewWidthSizable;
+_foregroundView.translatesAutoresizingMaskIntoConstraints = NO;
+[self addSubview:_foregroundView];
 }
 
-- (BOOL)isFlipped
+- (void)setProgress:(CGFloat)progress
 {
-return YES;
+if (progress > 1.) {
+progress = 1.;
+}
+
+CGRect rect = self.frame;
+rect.size.width = rect.size.width * progress;
+_foregroundView.frame = rect;
+
+_progress = progress;
 }
 
 @end

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library window: add drop zone

2019-05-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 29 15:37:54 
2019 +0200| [c8663d458ce0f864773a8ff46119ff0c7e2e208e] | committer: Felix Paul 
Kühne

macosx/library window: add drop zone

This reimplements the drop zone known from v3 to encourage media drops on the 
playlist for playback

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

 modules/gui/macosx/UI/VLCLibraryWindow.xib | 36 +
 modules/gui/macosx/library/VLCLibraryWindow.h  |  5 +++
 modules/gui/macosx/library/VLCLibraryWindow.m  | 47 +-
 .../gui/macosx/playlist/VLCPlaylistDataSource.h|  2 +
 .../gui/macosx/playlist/VLCPlaylistDataSource.m|  3 ++
 5 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index ce75a54a5b..c24ca5c6b9 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -155,6 +155,35 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -163,8 +192,10 @@
 
 
 
+
 
 
+
 
 
 
@@ -174,6 +205,8 @@
 
 
 
+
+
 
 
 
@@ -326,6 +359,8 @@
 
 
 
+
+
 
 
 
@@ -706,6 +741,7 @@
 
 
 
+
 
 
 
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.h 
b/modules/gui/macosx/library/VLCLibraryWindow.h
index 29b7f14505..b42394ab9b 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.h
+++ b/modules/gui/macosx/library/VLCLibraryWindow.h
@@ -24,6 +24,8 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+@class VLCDragDropView;
+
 @interface VLCLibraryWindowController : NSWindowController
 
 - (instancetype)initWithLibraryWindow;
@@ -46,6 +48,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readwrite, weak) IBOutlet NSView *libraryTargetView;
 @property (readwrite, weak) IBOutlet NSTableView *playlistTableView;
 @property (readwrite, weak) IBOutlet NSTextField *upNextLabel;
+@property (readwrite, weak) IBOutlet VLCDragDropView *playlistDragDropView;
+@property (readwrite, weak) IBOutlet NSButton *openMediaButton;
 @property (readwrite, weak) IBOutlet NSBox *upNextSeparator;
 @property (readwrite, weak) IBOutlet NSButton *clearPlaylistButton;
 @property (readwrite, weak) IBOutlet NSBox *clearPlaylistSeparator;
@@ -66,6 +70,7 @@ NS_ASSUME_NONNULL_BEGIN
 - (IBAction)shuffleAction:(id)sender;
 - (IBAction)repeatAction:(id)sender;
 - (IBAction)clearPlaylist:(id)sender;
+- (IBAction)openMedia:(id)sender;
 
 @end
 
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index e0d9020783..681e024bd9 100644
--- a/modules/gui/mac

[vlc-commits] macosx/playlist controller: fix comment and declaration for class used to add items

2019-05-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 29 15:36:37 
2019 +0200| [18541524ce3885f0a4f985464b5dae92f9976d87] | committer: Felix Paul 
Kühne

macosx/playlist controller: fix comment and declaration for class used to add 
items

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

 modules/gui/macosx/playlist/VLCPlaylistController.h | 9 +
 modules/gui/macosx/playlist/VLCPlaylistController.m | 4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.h 
b/modules/gui/macosx/playlist/VLCPlaylistController.h
index 908aaafa5a..7276a69ec5 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.h
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.h
@@ -29,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
 @class VLCPlaylistDataSource;
 @class VLCPlayerController;
 @class VLCPlaylistExportModuleDescription;
+@class VLCOpenInputMetadata;
 
 extern NSString *VLCPlaybackOrderChanged;
 extern NSString *VLCPlaybackRepeatChanged;
@@ -105,17 +106,17 @@ extern NSString *VLCPlaylistItemsRemoved;
 
 /**
  * Simplified version to add new items to the end of the current playlist
- * @param array array of items. Each item is a Dictionary with meta info.
+ * @param array array of items. Each item is an instance of 
VLCOpenInputMetadata.
  */
-- (void)addPlaylistItems:(NSArray*)array;
+- (void)addPlaylistItems:(NSArray  *)array;
 
 /**
  * Add new items to the playlist, at specified index.
- * @param itemArray array of items. Each item is a Dictionary with meta info.
+ * @param itemArray array of items. Each item is an instance of 
VLCOpenInputMetadata.
  * @param insertionIndex index for new items, -1 for appending at end
  * @param startPlayback starts playback of first item if true
  */
-- (void)addPlaylistItems:(NSArray*)itemArray
+- (void)addPlaylistItems:(NSArray  *)itemArray
   atPosition:(size_t)insertionIndex
startPlayback:(BOOL)startPlayback;
 
diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.m 
b/modules/gui/macosx/playlist/VLCPlaylistController.m
index 33d5f2cd40..1597b8ec00 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.m
@@ -311,13 +311,13 @@ static const struct vlc_playlist_callbacks 
playlist_callbacks = {
 
 #pragma mark - controller functions for use within the UI
 
-- (void)addPlaylistItems:(NSArray*)array
+- (void)addPlaylistItems:(NSArray  *)array
 {
 BOOL b_autoplay = var_InheritBool(getIntf(), "macosx-autoplay");
 [self addPlaylistItems:array atPosition:-1 startPlayback:b_autoplay];
 }
 
-- (void)addPlaylistItems:(NSArray*)itemArray
+- (void)addPlaylistItems:(NSArray  *)itemArray
   atPosition:(size_t)insertionIndex
startPlayback:(BOOL)startPlayback;
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: split drag & drop view from misc

2019-05-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 29 14:50:19 
2019 +0200| [540f3a007378302b8eca03da2848d378313e59ce] | committer: Felix Paul 
Kühne

macosx: split drag & drop view from misc

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |   6 +
 modules/gui/macosx/Makefile.am |   2 +
 modules/gui/macosx/extensions/misc.h   |  25 
 modules/gui/macosx/extensions/misc.m   | 128 +--
 modules/gui/macosx/views/VLCDragDropView.h |  46 +++
 modules/gui/macosx/views/VLCDragDropView.m | 135 +
 .../VLCConvertAndSaveWindowController.m|   2 +-
 .../windows/mainwindow/VLCControlsBarCommon.h  |   8 +-
 .../windows/mainwindow/VLCControlsBarCommon.m  |   5 +
 .../macosx/windows/video/VLCVideoWindowCommon.m|   1 +
 po/POTFILES.in |   2 +
 11 files changed, 203 insertions(+), 157 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 1f6a9b0930..21f1f6eab0 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -115,6 +115,7 @@
7D445D872202574B00263D34 /* VLCPlaylistModel.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D445D862202574B00263D34 /* VLCPlaylistModel.m 
*/; };
7D445D8B22032B9200263D34 /* VLCPlaylistTableView.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D445D8A22032B9200263D34 /* 
VLCPlaylistTableView.m */; };
7D445D8E2203375100263D34 /* VLCPlaylistMenuController.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D445D8D2203375100263D34 /* 
VLCPlaylistMenuController.m */; };
+   7D460B0C229EB4C700097948 /* VLCDragDropView.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D460B0B229EB4C700097948 /* VLCDragDropView.m 
*/; };
7D66D4362200BC340040D04A /* VLCClickerManager.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D66D4352200BC340040D04A /* VLCClickerManager.m 
*/; };
7D66D4392200C5B80040D04A /* VLCVideoFilterHelper.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D66D4382200C5B80040D04A /* 
VLCVideoFilterHelper.m */; };
7D66D43C2200D6090040D04A /* VLCDetachedVideoWindow.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D66D43B2200D6090040D04A /* 
VLCDetachedVideoWindow.m */; };
@@ -484,6 +485,8 @@
7D445D8C2203375100263D34 /* VLCPlaylistMenuController.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCPlaylistMenuController.h; sourceTree = ""; };
7D445D8D2203375100263D34 /* VLCPlaylistMenuController.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPlaylistMenuController.m; sourceTree = ""; };
7D445D8F220339D400263D34 /* VLCPlaylistMenu.xib */ = {isa = 
PBXFileReference; lastKnownFileType = file.xib; path = VLCPlaylistMenu.xib; 
sourceTree = ""; };
+   7D460B0A229EB4C700097948 /* VLCDragDropView.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCDragDropView.h; 
sourceTree = ""; };
+   7D460B0B229EB4C700097948 /* VLCDragDropView.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCDragDropView.m; sourceTree = ""; };
7D5678EB1D5BA1DC002698F3 /* VLCApplication.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
VLCApplication.h; sourceTree = ""; };
7D5678EC1D5BA1DC002698F3 /* VLCApplication.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= VLCApplication.m; sourceTree = ""; };
7D5678EE1D5BA397002698F3 /* VLCMainWindowControlsBar.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = VLCMainWindowControlsBar.h; sourceTree = ""; };
@@ -848,6 +851,8 @@
7D2FFA3F227B8A5B0085D649 /* 
VLCLinearProgressIndicator.m */,
7D2008182289835C002679DF /* VLCTrackingView.h 
*/,
7D2008192289835C002679DF /* VLCTrackingView.m 
*/,
+   7D460B0A229EB4C700097948 /* VLCDragDropView.h 
*/,
+   7D460B0B229EB4C700097948 /* VLCDragDropView.m 
*/,
);
path = views;
sourceTree = "";
@@ -1703,6 +1708,7 @@
1C3113A71E508C6900D4DD76 /* 
VLCLogWindowController.m in Sources */,
1C3113A91E508C6900D4DD76 /* 
VLCDocumentController.m in Sources */,

[vlc-commits] macosx/image view: improve border appearance

2019-05-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 29 14:14:11 
2019 +0200| [519ed8454479bf4a90bbf2c4fb5aa8326f5a6905] | committer: Felix Paul 
Kühne

macosx/image view: improve border appearance

This introduces a 1pt border to avoid bleeding and a 5° corner radius to 
smoothen the appearance

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

 modules/gui/macosx/views/VLCImageView.m | 16 
 1 file changed, 16 insertions(+)

diff --git a/modules/gui/macosx/views/VLCImageView.m 
b/modules/gui/macosx/views/VLCImageView.m
index e3bd78698a..c0015df9d5 100644
--- a/modules/gui/macosx/views/VLCImageView.m
+++ b/modules/gui/macosx/views/VLCImageView.m
@@ -21,6 +21,8 @@
  */
 
 #import "VLCImageView.h"
+#import "extensions/NSColor+VLCAdditions.h"
+#import "extensions/NSView+VLCAdditions.h"
 
 @implementation VLCImageView
 
@@ -47,6 +49,15 @@
 self.layer = [[CALayer alloc] init];
 self.contentGravity = VLCImageViewContentGravityResizeAspectFill;
 self.wantsLayer = YES;
+self.layer.cornerRadius = 5.;
+self.layer.masksToBounds = YES;
+self.layer.borderWidth = 1.;
+[self setupBorderColor];
+}
+
+- (void)setupBorderColor
+{
+self.layer.borderColor = self.shouldShowDarkAppearance ? [NSColor 
VLClibrarySeparatorDarkColor].CGColor : [NSColor 
VLClibrarySeparatorLightColor].CGColor;
 }
 
 - (void)setImage:(NSImage *)image
@@ -105,4 +116,9 @@
 }
 }
 
+- (void)viewDidChangeEffectiveAppearance
+{
+[self setupBorderColor];
+}
+
 @end

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/drag & drop view: modernize code

2019-05-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 29 15:17:55 
2019 +0200| [6609dce76e9c4d1cd4dd7da5f344e2611ffa8251] | committer: Felix Paul 
Kühne

macosx/drag & drop view: modernize code

Use CALayer instead of drawRect to show the focus ring and use an explicit 
instead of an implicit protocol for the handler

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

 modules/gui/macosx/views/VLCDragDropView.h |  7 ++-
 modules/gui/macosx/views/VLCDragDropView.m | 60 ++
 .../VLCConvertAndSaveWindowController.m|  7 ++-
 3 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/modules/gui/macosx/views/VLCDragDropView.h 
b/modules/gui/macosx/views/VLCDragDropView.h
index 045979cdd6..02ff245f4f 100644
--- a/modules/gui/macosx/views/VLCDragDropView.h
+++ b/modules/gui/macosx/views/VLCDragDropView.h
@@ -34,9 +34,14 @@ NS_ASSUME_NONNULL_BEGIN
 
 @end
 
+@protocol VLCDragDropTarget
+@required
+- (BOOL)handlePasteBoardFromDragSession:(NSPasteboard *)aPasteboard;
+@end
+
 @interface VLCDragDropView : NSView
 
-@property (nonatomic, assign) id dropHandler;
+@property (nonatomic, assign) id dropTarget;
 @property (nonatomic, assign) BOOL drawBorder;
 
 - (void)enablePlaylistItems;
diff --git a/modules/gui/macosx/views/VLCDragDropView.m 
b/modules/gui/macosx/views/VLCDragDropView.m
index e73b35d322..5daa1f5e77 100644
--- a/modules/gui/macosx/views/VLCDragDropView.m
+++ b/modules/gui/macosx/views/VLCDragDropView.m
@@ -33,12 +33,6 @@
 
 @end
 
-@interface VLCDragDropView()
-{
-bool b_activeDragAndDrop;
-}
-@end
-
 @implementation VLCDragDropView
 
 - (id)initWithFrame:(NSRect)frame
@@ -48,7 +42,6 @@
 // default value
 [self setDrawBorder:YES];
 }
-
 return self;
 }
 
@@ -70,30 +63,36 @@
 - (void)awakeFromNib
 {
 [self registerForDraggedTypes:[NSArray 
arrayWithObject:NSFilenamesPboardType]];
+self.wantsLayer = YES;
+self.layer.cornerRadius = 5.;
+[self updateBorderColor];
+}
+
+- (void)updateBorderColor
+{
+self.layer.borderColor = [NSColor selectedControlColor].CGColor;
 }
 
 - (NSDragOperation)draggingEntered:(id )sender
 {
 if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) == 
NSDragOperationGeneric) {
-b_activeDragAndDrop = YES;
-[self setNeedsDisplay:YES];
-
+if (self.drawBorder) {
+self.layer.borderWidth = 5.;
+}
 return NSDragOperationCopy;
 }
 
 return NSDragOperationNone;
 }
 
-- (void)draggingEnded:(id < NSDraggingInfo >)sender
+- (void)draggingEnded:(id )sender
 {
-b_activeDragAndDrop = NO;
-[self setNeedsDisplay:YES];
+self.layer.borderWidth = 0.;
 }
 
-- (void)draggingExited:(id < NSDraggingInfo >)sender
+- (void)draggingExited:(id )sender
 {
-b_activeDragAndDrop = NO;
-[self setNeedsDisplay:YES];
+self.layer.borderWidth = 0.;
 }
 
 - (BOOL)prepareForDragOperation:(id )sender
@@ -103,33 +102,28 @@
 
 - (BOOL)performDragOperation:(id )sender
 {
-BOOL b_returned = NO;
+BOOL returnValue = NO;
+NSPasteboard *pasteBoard = [sender draggingPasteboard];
+if (!pasteBoard) {
+return NO;
+}
 
-if (_dropHandler && [_dropHandler 
respondsToSelector:@selector(performDragOperation:)])
-b_returned = [_dropHandler performDragOperation:sender];
-// default
-// FIXME: implement drag and drop _on_ new playlist
-//b_returned = [[[VLCMain sharedInstance] playlist] 
performDragOperation:sender];
+if (_dropTarget) {
+returnValue = [_dropTarget handlePasteBoardFromDragSession:pasteBoard];
+}
 
 [self setNeedsDisplay:YES];
-return b_returned;
+return returnValue;
 }
 
 - (void)concludeDragOperation:(id )sender
 {
-[self setNeedsDisplay:YES];
+self.layer.borderWidth = 0.;
 }
 
-- (void)drawRect:(NSRect)dirtyRect
+- (void)viewDidChangeEffectiveAppearance
 {
-if ([self drawBorder] && b_activeDragAndDrop) {
-NSRect frameRect = [self bounds];
-
-[[NSColor selectedControlColor] set];
-NSFrameRectWithWidthUsingOperation(frameRect, 2., 
NSCompositeSourceOver);
-}
-
-[super drawRect:dirtyRect];
+[self updateBorderColor];
 }
 
 @end
diff --git 
a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m 
b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
index 8d2ddcbc85..1cf8bf93f1 100644
--- 
a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
+++ 
b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
@@ -51,7 +51,7 @@
 #define ASF 12
 /* 13-15 are present, but not set */
 
-@interface VLCConvertAndSaveWindowController()
+@interface VLCConvertAndSaveWindowController() 
 {
 NSArray *_videoCodecs;
 NSArray *_audioCodecs;
@@ -255,7 +255,7 @@
 
 // setup drop view
 [_dropBox enablePlaylistItem

[vlc-commits] macosx/player: Explicitely initalize cb_device_changed

2019-05-24 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Fri May 24 19:30:21 
2019 +0200| [d463b561b7e19eb7d52d3772e7fe9f74e6156eef] | committer: Felix Paul 
Kühne

macosx/player: Explicitely initalize cb_device_changed

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

 modules/gui/macosx/playlist/VLCPlayerController.m | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/gui/macosx/playlist/VLCPlayerController.m 
b/modules/gui/macosx/playlist/VLCPlayerController.m
index 463bee5946..50dd9f5339 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.m
+++ b/modules/gui/macosx/playlist/VLCPlayerController.m
@@ -523,6 +523,7 @@ static void cb_player_aout_mute_changed(vlc_player_t 
*p_player, bool muted, void
 static const struct vlc_player_aout_cbs player_aout_callbacks = {
 cb_player_aout_volume_changed,
 cb_player_aout_mute_changed,
+NULL,
 };
 
 #pragma mark - controller initialization

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library collection view item: implement prepareForReuse

2019-05-16 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May 16 16:29:54 
2019 +0200| [fe552c29411838bded88836155405cf1b8cca736] | committer: Felix Paul 
Kühne

macosx/library collection view item: implement prepareForReuse

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

 .../macosx/library/VLCLibraryCollectionViewItem.m  | 29 ++
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index d2457114a9..d06c0728b2 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -52,7 +52,9 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 {
 self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
 if (self) {
-[[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(mediaItemUpdated:) name:VLCLibraryModelMediaItemUpdated 
object:nil];
+[[NSNotificationCenter defaultCenter] addObserver:self
+ 
selector:@selector(mediaItemUpdated:)
+ 
name:VLCLibraryModelMediaItemUpdated object:nil];
 }
 return self;
 }
@@ -67,7 +69,6 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 
 - (void)awakeFromNib
 {
-self.playInstantlyButton.hidden = YES;
 [(VLCTrackingView *)self.view setViewToHide:self.playInstantlyButton];
 self.mediaTitleTextField.font = [NSFont VLClibraryCellTitleFont];
 self.durationTextField.font = [NSFont VLClibraryCellSubtitleFont];
@@ -87,6 +88,7 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 }
 
 [self updateColoredAppearance];
+[self prepareForReuse];
 }
 
 - (void)observeValueForKeyPath:(NSString *)keyPath
@@ -104,6 +106,18 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 
 #pragma mark - view representation
 
+- (void)prepareForReuse
+{
+[super prepareForReuse];
+_playInstantlyButton.hidden = YES;
+_mediaTitleTextField.stringValue = @"";
+_durationTextField.stringValue = [NSString stringWithTime:0];
+_mediaImageView.image = nil;
+_annotationTextField.hidden = YES;
+_progressIndicator.hidden = YES;
+_unplayedIndicatorTextField.hidden = YES;
+}
+
 - (void)setRepresentedMediaItem:(VLCMediaLibraryMediaItem 
*)representedMediaItem
 {
 if (!_libraryController) {
@@ -128,9 +142,6 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 - (void)updateRepresentation
 {
 if (_representedMediaItem == nil) {
-_mediaTitleTextField.stringValue = @"";
-_durationTextField.stringValue = [NSString stringWithTime:0];
-_mediaImageView.image = [NSImage imageNamed: @"noart.png"];
 return;
 }
 
@@ -159,19 +170,17 @@ const CGFloat 
VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 } else if (width >= VLCMediaLibrary720pWidth || height >= 
VLCMediaLibrary720pHeight) {
 _annotationTextField.stringValue = @" HD ";
 _annotationTextField.hidden = NO;
-} else {
-_annotationTextField.hidden = YES;
 }
 
 CGFloat position = _representedMediaItem.lastPlaybackPosition;
 if (position > VLCLibraryCollectionViewItemMinimalDisplayedProgress && 
position < VLCLibraryCollectionViewItemMaximumDisplayedProgress) {
 _progressIndicator.progress = position;
 _progressIndicator.hidden = NO;
-} else {
-_progressIndicator.hidden = YES;
 }
 
-_unplayedIndicatorTextField.hidden = _representedMediaItem.playCount > 0 ? 
YES : NO;
+if (_representedMediaItem.playCount == 0) {
+_unplayedIndicatorTextField.hidden = NO;
+}
 }
 
 #pragma mark - actions

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: simplify library model code

2019-05-15 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 15 20:07:33 
2019 +0200| [1fc2ab02f8f0a3f94b6a8165941da494225fb880] | committer: Felix Paul 
Kühne

macosx: simplify library model code

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

 modules/gui/macosx/library/VLCLibraryModel.h   |  7 --
 modules/gui/macosx/library/VLCLibraryModel.m   | 19 +++---
 .../gui/macosx/library/VLCLibraryVideoDataSource.m | 29 ++
 modules/gui/macosx/library/VLCLibraryWindow.m  |  3 ---
 4 files changed, 5 insertions(+), 53 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryModel.h 
b/modules/gui/macosx/library/VLCLibraryModel.h
index aa58e17fd9..80e04dd06c 100644
--- a/modules/gui/macosx/library/VLCLibraryModel.h
+++ b/modules/gui/macosx/library/VLCLibraryModel.h
@@ -26,11 +26,6 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-typedef NS_ENUM(NSInteger, VLCLibraryMode) {
-VLCLibraryModeAudio,
-VLCLibraryModeVideo,
-};
-
 @class VLCMediaLibraryMediaItem;
 @class VLCMediaLibraryArtist;
 @class VLCMediaLibraryAlbum;
@@ -50,8 +45,6 @@ extern NSString *VLCLibraryModelMediaItemUpdated;
 
 - (instancetype)initWithLibrary:(vlc_medialibrary_t *)library;
 
-@property (readwrite) VLCLibraryMode libraryMode;
-
 @property (readonly) size_t numberOfAudioMedia;
 @property (readonly) NSArray  *listOfAudioMedia;
 
diff --git a/modules/gui/macosx/library/VLCLibraryModel.m 
b/modules/gui/macosx/library/VLCLibraryModel.m
index 2417ef8576..09ae2c3532 100644
--- a/modules/gui/macosx/library/VLCLibraryModel.m
+++ b/modules/gui/macosx/library/VLCLibraryModel.m
@@ -63,22 +63,9 @@ static void libraryCallback(void *p_data, const 
vlc_ml_event_t *p_event)
 case VLC_ML_EVENT_MEDIA_DELETED:
 dispatch_async(dispatch_get_main_queue(), ^{
 VLCLibraryModel *libraryModel = (__bridge VLCLibraryModel 
*)p_data;
-switch (libraryModel.libraryMode) {
-case VLCLibraryModeAudio:
-[libraryModel updateCachedListOfRecentMedia];
-[libraryModel updateCachedListOfAudioMedia];
-break;
-
-case VLCLibraryModeVideo:
-[libraryModel updateCachedListOfRecentMedia];
-[libraryModel updateCachedListOfVideoMedia];
-break;
-
-default:
-[libraryModel updateCachedListOfRecentMedia];
-break;
-}
-
+[libraryModel updateCachedListOfRecentMedia];
+[libraryModel updateCachedListOfAudioMedia];
+[libraryModel updateCachedListOfVideoMedia];
 });
 break;
 case VLC_ML_EVENT_MEDIA_THUMBNAIL_GENERATED:
diff --git a/modules/gui/macosx/library/VLCLibraryVideoDataSource.m 
b/modules/gui/macosx/library/VLCLibraryVideoDataSource.m
index 68dfa78e3b..f99d37ffd9 100644
--- a/modules/gui/macosx/library/VLCLibraryVideoDataSource.m
+++ b/modules/gui/macosx/library/VLCLibraryVideoDataSource.m
@@ -38,19 +38,7 @@
 return [_libraryModel numberOfRecentMedia];
 }
 
-switch (_libraryModel.libraryMode) {
-case VLCLibraryModeAudio:
-return [_libraryModel numberOfAudioMedia];
-break;
-
-case VLCLibraryModeVideo:
-return [_libraryModel numberOfVideoMedia];
-break;
-
-default:
-return 0;
-break;
-}
+return [_libraryModel numberOfVideoMedia];
 }
 
 - (NSInteger)numberOfSectionsInCollectionView:(NSCollectionView 
*)collectionView
@@ -67,20 +55,7 @@
 if (collectionView == self.recentMediaCollectionView) {
 mediaArray = [_libraryModel listOfRecentMedia];
 } else {
-switch (_libraryModel.libraryMode) {
-case VLCLibraryModeAudio:
-mediaArray = [_libraryModel listOfAudioMedia];
-break;
-
-case VLCLibraryModeVideo:
-mediaArray = [_libraryModel listOfVideoMedia];
-break;
-
-default:
-NSAssert(1, @"no representation for selected library mode");
-mediaArray = @[];
-break;
-}
+mediaArray = [_libraryModel listOfVideoMedia];
 }
 
 viewItem.representedMediaItem = mediaArray[indexPath.item];
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index 5eabfbad89..e0d9020783 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -288,7 +288,6 @@ const CGFloat VLCLibraryWindowLargeRowHeight = 50.;
 {
 switch (_segmentedTitleControl.selectedSegment) {
 case 0:
-_libraryVideoDataSource.libraryModel.libraryMode = 
VLCLibraryModeVideo;
 if (_mediaSourceScrollView.sup

[vlc-commits] macosx: add alternative audio library representation based on a collection view

2019-05-15 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 15 20:00:31 
2019 +0200| [4c47033e0d0329cc18f3fd5c64284e8141f52cbe] | committer: Felix Paul 
Kühne

macosx: add alternative audio library representation based on a collection view

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |   6 +
 modules/gui/macosx/Makefile.am |   2 +
 modules/gui/macosx/UI/VLCLibraryWindow.xib |  56 +++
 .../VLCLibraryAlternativeAudioViewController.h |  40 +
 .../VLCLibraryAlternativeAudioViewController.m | 170 +
 .../gui/macosx/library/VLCLibraryAudioDataSource.m |   2 +-
 modules/gui/macosx/library/VLCLibraryModel.h   |   2 +
 modules/gui/macosx/library/VLCLibraryModel.m   |   6 +
 modules/gui/macosx/library/VLCLibraryWindow.h  |   3 +
 modules/gui/macosx/library/VLCLibraryWindow.m  |  45 +-
 po/POTFILES.in |   2 +
 11 files changed, 330 insertions(+), 4 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 79e27dcbaf..1f6a9b0930 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -156,6 +156,7 @@
7DD2F5C52081B73B007EE187 /* VLCRemoteControlService.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DD2F5C42081B73B007EE187 /* 
VLCRemoteControlService.m */; };
7DE2F0442282C84A0040DD0A /* VLCLibraryAudioDataSource.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DE2F0432282C84A0040DD0A /* 
VLCLibraryAudioDataSource.m */; };
7DE2F0472282D5D10040DD0A /* VLCLibraryTableCellView.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DE2F0462282D5D10040DD0A /* 
VLCLibraryTableCellView.m */; };
+   7DE7E72F228C795B00D6EA38 /* 
VLCLibraryAlternativeAudioViewController.m in Sources */ = {isa = PBXBuildFile; 
fileRef = 7DE7E72E228C795B00D6EA38 /* 
VLCLibraryAlternativeAudioViewController.m */; };
7DE82E7922843781002D341A /* VLCLibraryAlbumTableCellView.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DE82E7822843781002D341A /* 
VLCLibraryAlbumTableCellView.m */; };
7DE9C7DD220728420089108F /* VLCPlayerController.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7DE9C7DC220728420089108F /* 
VLCPlayerController.m */; };
7DF14FBD2270CB1C0008ABE4 /* VLCMediaSourceCollectionViewItem.m 
in Sources */ = {isa = PBXBuildFile; fileRef = 7DF14FBB2270CB1C0008ABE4 /* 
VLCMediaSourceCollectionViewItem.m */; };
@@ -544,6 +545,8 @@
7DE2F0452282D5D10040DD0A /* VLCLibraryTableCellView.h */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryTableCellView.h; sourceTree = ""; };
7DE2F0462282D5D10040DD0A /* VLCLibraryTableCellView.m */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryTableCellView.m; sourceTree = ""; };
7DE2F0482282D7980040DD0A /* VLCLibraryTableCellView.xib */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = 
VLCLibraryTableCellView.xib; sourceTree = ""; };
+   7DE7E72D228C795B00D6EA38 /* 
VLCLibraryAlternativeAudioViewController.h */ = {isa = PBXFileReference; 
lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryAlternativeAudioViewController.h; sourceTree = ""; };
+   7DE7E72E228C795B00D6EA38 /* 
VLCLibraryAlternativeAudioViewController.m */ = {isa = PBXFileReference; 
lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryAlternativeAudioViewController.m; sourceTree = ""; };
7DE82E7722843781002D341A /* VLCLibraryAlbumTableCellView.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryAlbumTableCellView.h; sourceTree = ""; };
7DE82E7822843781002D341A /* VLCLibraryAlbumTableCellView.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryAlbumTableCellView.m; sourceTree = ""; };
7DE82E7A228437AA002D341A /* VLCLibraryAlbumTableCellView.xib */ 
= {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path 
= VLCLibraryAlbumTableCellView.xib; sourceTree = ""; };
@@ -1003,6 +1006,8 @@
7DBB7638227F3FBC002649E1 /* 
VLCLibraryCollectionViewSupplementaryElementView.m */,
7D713D302201AE350042BEB7 /* VLCLibraryWindow.h 
*/,
7D713D312201AE350042BEB7 /* VLCLibraryWindow.m 
*/,
+   7DE7E72D228C795B00D6EA38 /* 
VLCLibraryAlternativeAudioViewController.h */,
+   7DE7E72E228C795B00D6EA38 /* 
VLCLibraryAlternativeAudioViewController.m */,

[vlc-commits] macosx: coding style improvements

2019-05-15 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May 15 18:17:59 
2019 +0200| [9339899f467383f34a5d4def91d740b89b27ff87] | committer: Felix Paul 
Kühne

macosx: coding style improvements

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

 modules/gui/macosx/extensions/NSFont+VLCAdditions.h  |  2 ++
 modules/gui/macosx/extensions/NSFont+VLCAdditions.m  | 10 ++
 .../macosx/library/VLCLibraryAlbumTableCellView.m|  9 ++---
 .../macosx/library/VLCLibraryCollectionViewItem.m|  8 +---
 modules/gui/macosx/library/VLCLibraryDataTypes.h |  5 +
 modules/gui/macosx/library/VLCLibraryDataTypes.m |  5 +
 modules/gui/macosx/library/VLCLibraryWindow.m| 20 ++--
 .../gui/macosx/playlist/VLCPlaylistTableCellView.m   | 10 ++
 .../macosx/windows/video/VLCDetachedVideoWindow.m|  2 +-
 .../macosx/windows/video/VLCVideoOutputProvider.m|  2 +-
 .../gui/macosx/windows/video/VLCVideoWindowCommon.h  |  2 +-
 .../gui/macosx/windows/video/VLCVideoWindowCommon.m  |  5 +++--
 12 files changed, 51 insertions(+), 29 deletions(-)

diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h 
b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
index df7058a7c1..0d74b79c7c 100644
--- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h
@@ -34,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
 + (instancetype)VLClibraryCellSubtitleFont;
 + (instancetype)VLClibraryCellAnnotationFont;
 + (instancetype)VLClibraryButtonFont;
++ (instancetype)VLCplaylistLabelFont;
++ (instancetype)VLCplaylistSelectedItemLabelFont;
 
 @end
 
diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m 
b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
index 74c227c075..2a61bd649d 100644
--- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
+++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m
@@ -64,4 +64,14 @@
 return [NSFont systemFontOfSize:15. weight:NSFontWeightBold];
 }
 
++ (instancetype)VLCplaylistLabelFont
+{
+return [NSFont systemFontOfSize:13. weight:NSFontWeightRegular];
+}
+
++ (instancetype)VLCplaylistSelectedItemLabelFont
+{
+return [NSFont systemFontOfSize:13. weight:NSFontWeightBold];
+}
+
 @end
diff --git a/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m 
b/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
index a126e63b5b..7c475a5c83 100644
--- a/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
+++ b/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
@@ -30,7 +30,8 @@
 #import "library/VLCLibraryDataTypes.h"
 #import "library/VLCLibraryTableCellView.h"
 
-static NSString *VLCAudioLibraryCellIdentifier = 
@"VLCAudioLibraryCellIdentifier";
+NSString *VLCAudioLibraryCellIdentifier = @"VLCAudioLibraryCellIdentifier";
+const CGFloat VLCLibraryTracksRowHeight = 50.;
 
 @interface VLCLibraryTracksDataSource : NSObject 
 
@@ -87,7 +88,9 @@ static NSString *VLCAudioLibraryCellIdentifier = 
@"VLCAudioLibraryCellIdentifier
 {
 _representedAlbum = representedAlbum;
 self.albumNameTextField.stringValue = _representedAlbum.title;
-self.yearTextField.intValue = _representedAlbum.year;
+if (_representedAlbum.year > 0) {
+self.yearTextField.intValue = _representedAlbum.year;
+}
 self.summaryTextField.stringValue = _representedAlbum.summary;
 
 NSImage *image;
@@ -99,7 +102,7 @@ static NSString *VLCAudioLibraryCellIdentifier = 
@"VLCAudioLibraryCellIdentifier
 }
 self.representedImageView.image = image;
 
-self.tracksTableView.rowHeight = 50.;
+self.tracksTableView.rowHeight = VLCLibraryTracksRowHeight;
 _tracksDataSource = [[VLCLibraryTracksDataSource alloc] init];
 _tracksDataSource.representedAlbum = _representedAlbum;
 self.tracksTableView.dataSource = _tracksDataSource;
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index ce07f70edd..d2457114a9 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -36,6 +36,8 @@
 #import "extensions/NSView+VLCAdditions.h"
 
 NSString *VLCLibraryCellIdentifier = @"VLCLibraryCellIdentifier";
+const CGFloat VLCLibraryCollectionViewItemMinimalDisplayedProgress = 0.05;
+const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 
 @interface VLCLibraryCollectionViewItem()
 {
@@ -151,10 +153,10 @@ NSString *VLCLibraryCellIdentifier = 
@"VLCLibraryCellIdentifier";
 VLCMediaLibraryTrack *videoTrack = _representedMediaItem.firstVideoTrack;
 CGFloat width = videoTrack.videoWidth;
 CGFloat height = videoTrack.videoHeight;
-if (width >= 3840. || height >= 2160.) {
+if (width >= VLCMediaLibrary4KWidth || height >= VLCMediaLibrary4KH

[vlc-commits] macosx/library: add audio specific library interface

2019-05-13 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May  9 14:14:12 
2019 +0200| [4510eb8ea914d319334ebeab9e50390faea7a4d0] | committer: Felix Paul 
Kühne

macosx/library: add audio specific library interface

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |  28 ++
 modules/gui/macosx/Makefile.am |  14 +-
 .../gui/macosx/UI/VLCLibraryAlbumTableCellView.xib | 160 +++
 .../gui/macosx/UI/VLCLibraryCollectionViewItem.xib |   2 +-
 modules/gui/macosx/UI/VLCLibraryTableCellView.xib  | 106 
 modules/gui/macosx/UI/VLCLibraryWindow.xib | 199 +-
 .../macosx/library/VLCLibraryAlbumTableCellView.h  |  47 
 .../macosx/library/VLCLibraryAlbumTableCellView.m  | 178 
 .../gui/macosx/library/VLCLibraryAudioDataSource.h |  47 
 .../gui/macosx/library/VLCLibraryAudioDataSource.m | 298 +
 .../macosx/library/VLCLibraryCollectionViewItem.h  |   6 -
 .../macosx/library/VLCLibraryCollectionViewItem.m  |  38 +--
 modules/gui/macosx/library/VLCLibraryDataTypes.h   |   4 +
 modules/gui/macosx/library/VLCLibraryDataTypes.m   |  24 ++
 modules/gui/macosx/library/VLCLibraryModel.h   |  16 ++
 modules/gui/macosx/library/VLCLibraryModel.m   | 121 -
 .../gui/macosx/library/VLCLibraryTableCellView.h   |  45 
 .../gui/macosx/library/VLCLibraryTableCellView.m   |  72 +
 modules/gui/macosx/library/VLCLibraryWindow.h  |   4 +
 modules/gui/macosx/library/VLCLibraryWindow.m  |  48 +++-
 modules/gui/macosx/views/VLCTrackingView.h |  33 +++
 modules/gui/macosx/views/VLCTrackingView.m |  58 
 po/POTFILES.in |  12 +-
 23 files changed, 1491 insertions(+), 69 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc.git/?a=commitdiff;h=4510eb8ea914d319334ebeab9e50390faea7a4d0
___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library: add abstractions for albums, artists and genres

2019-05-13 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May  8 12:10:33 
2019 +0200| [cf70f1370260eb4847f27dda1477c5b6cda95251] | committer: Felix Paul 
Kühne

macosx/library: add abstractions for albums, artists and genres

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

 modules/gui/macosx/library/VLCLibraryDataTypes.h | 40 +
 modules/gui/macosx/library/VLCLibraryDataTypes.m | 55 
 2 files changed, 95 insertions(+)

diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.h 
b/modules/gui/macosx/library/VLCLibraryDataTypes.h
index 67a8fac729..eb7bdba8a8 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.h
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.h
@@ -79,6 +79,36 @@ NS_ASSUME_NONNULL_BEGIN
 
 @end
 
+@interface VLCMediaLibraryArtist : NSObject
+
+- (instancetype)initWithArtist:(struct vlc_ml_artist_t *)p_artist;
+
+@property (readonly) int64_t artistID;
+@property (readonly) NSString *name;
+@property (readonly) NSString *shortBiography;
+@property (readonly) NSString *artworkMRL;
+@property (readonly) NSString *musicBrainzID;
+@property (readonly) unsigned int numberOfAlbums;
+@property (readonly) unsigned int numberOfTracks;
+
+@end
+
+@interface VLCMediaLibraryAlbum : NSObject
+
+- (instancetype)initWithAlbum:(struct vlc_ml_album_t *)p_album;
+
+@property (readonly) int64_t albumID;
+@property (readonly) NSString *title;
+@property (readonly) NSString *summary;
+@property (readonly) NSString *artworkMRL;
+@property (readonly) NSString *artistName;
+@property (readonly) int64_t artistID;
+@property (readonly) size_t numberOfTracks;
+@property (readonly) unsigned int duration;
+@property (readonly) unsigned int year;
+
+@end
+
 @interface VLCMediaLibraryAlbumTrack : NSObject
 
 - (instancetype)initWithAlbumTrack:(struct vlc_ml_album_track_t *)p_albumTrack;
@@ -92,6 +122,16 @@ NS_ASSUME_NONNULL_BEGIN
 
 @end
 
+@interface VLCMediaLibraryGenre : NSObject
+
+- (instancetype)initWithGenre:(struct vlc_ml_genre_t *)p_genre;
+
+@property (readonly) int64_t genreID;
+@property (readonly) NSString *name;
+@property (readonly) size_t numberOfTracks;
+
+@end
+
 @interface VLCMediaLibraryMediaItem : NSObject
 
 + (nullable instancetype)mediaItemForLibraryID:(int64_t)libraryID;
diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.m 
b/modules/gui/macosx/library/VLCLibraryDataTypes.m
index 228b99076a..e3211672a6 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.m
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.m
@@ -111,6 +111,46 @@
 
 @end
 
+@implementation VLCMediaLibraryArtist
+
+- (instancetype)initWithArtist:(struct vlc_ml_artist_t *)p_artist;
+{
+self = [super init];
+if (self && p_artist != NULL) {
+_artistID = p_artist->i_id;
+_name = toNSStr(p_artist->psz_name);
+_shortBiography = toNSStr(p_artist->psz_shortbio);
+_artworkMRL = toNSStr(p_artist->psz_artwork_mrl);
+_musicBrainzID = toNSStr(p_artist->psz_mb_id);
+_numberOfAlbums = p_artist->i_nb_album;
+_numberOfTracks = p_artist->i_nb_tracks;
+}
+return self;
+}
+
+@end
+
+@implementation VLCMediaLibraryAlbum
+
+- (instancetype)initWithAlbum:(struct vlc_ml_album_t *)p_album
+{
+self = [super init];
+if (self && p_album != NULL) {
+_albumID = p_album->i_id;
+_title = toNSStr(p_album->psz_title);
+_summary = toNSStr(p_album->psz_summary);
+_artworkMRL = toNSStr(p_album->psz_artwork_mrl);
+_artistName = toNSStr(p_album->psz_artist);
+_artistID = p_album->i_artist_id;
+_numberOfTracks = p_album->i_nb_tracks;
+_duration = p_album->i_duration;
+_year = p_album->i_year;
+}
+return self;
+}
+
+@end
+
 @implementation VLCMediaLibraryAlbumTrack
 
 - (instancetype)initWithAlbumTrack:(struct vlc_ml_album_track_t *)p_albumTrack
@@ -129,6 +169,21 @@
 
 @end
 
+@implementation VLCMediaLibraryGenre
+
+- (instancetype)initWithGenre:(struct vlc_ml_genre_t *)p_genre
+{
+self = [super init];
+if (self && p_genre != NULL) {
+_genreID = p_genre->i_id;
+_name = toNSStr(p_genre->psz_name);
+_numberOfTracks = p_genre->i_nb_tracks;
+}
+return self;
+}
+
+@end
+
 @interface VLCMediaLibraryMediaItem ()
 
 @property (readwrite, assign) vlc_medialibrary_t *p_mediaLibrary;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library: rename data source

2019-05-13 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed May  8 10:17:12 
2019 +0200| [88dd577b77313b601f572ba84814db021e3632f8] | committer: Felix Paul 
Kühne

macosx/library: rename data source

There will be designated classes for audio and video

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   | 12 +--
 modules/gui/macosx/Makefile.am |  4 ++--
 ...aryDataSource.h => VLCLibraryVideoDataSource.h} |  4 ++--
 ...aryDataSource.m => VLCLibraryVideoDataSource.m} |  6 +++---
 modules/gui/macosx/library/VLCLibraryWindow.m  | 24 +++---
 po/POTFILES.in |  4 ++--
 6 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 202e68201c..bd50b2e3bc 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -157,7 +157,7 @@
7DF14FBD2270CB1C0008ABE4 /* VLCMediaSourceCollectionViewItem.m 
in Sources */ = {isa = PBXBuildFile; fileRef = 7DF14FBB2270CB1C0008ABE4 /* 
VLCMediaSourceCollectionViewItem.m */; };
7DFBDCA82269E77500B700A5 /* VLCLibraryController.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7DFBDCA72269E77500B700A5 /* 
VLCLibraryController.m */; };
7DFBDCAB2269E77F00B700A5 /* VLCLibraryModel.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7DFBDCAA2269E77F00B700A5 /* VLCLibraryModel.m 
*/; };
-   7DFBDCAE2269ED0C00B700A5 /* VLCLibraryDataSource.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7DFBDCAD2269ED0C00B700A5 /* 
VLCLibraryDataSource.m */; };
+   7DFBDCAE2269ED0C00B700A5 /* VLCLibraryVideoDataSource.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCAD2269ED0C00B700A5 /* 
VLCLibraryVideoDataSource.m */; };
7DFBDCB1226A518400B700A5 /* VLCLibraryMenuController.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCB0226A518400B700A5 /* 
VLCLibraryMenuController.m */; };
7DFBDCB4226CD00900B700A5 /* VLCLibraryDataTypes.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7DFBDCB3226CD00900B700A5 /* 
VLCLibraryDataTypes.m */; };
7DFBDCB7226CDFD600B700A5 /* VLCImageView.m in Sources */ = {isa 
= PBXBuildFile; fileRef = 7DFBDCB6226CDFD600B700A5 /* VLCImageView.m */; };
@@ -548,8 +548,8 @@
7DFBDCA72269E77500B700A5 /* VLCLibraryController.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryController.m; sourceTree = ""; };
7DFBDCA92269E77F00B700A5 /* VLCLibraryModel.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryModel.h; 
sourceTree = ""; };
7DFBDCAA2269E77F00B700A5 /* VLCLibraryModel.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryModel.m; sourceTree = ""; };
-   7DFBDCAC2269ED0C00B700A5 /* VLCLibraryDataSource.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryDataSource.h; sourceTree = ""; };
-   7DFBDCAD2269ED0C00B700A5 /* VLCLibraryDataSource.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryDataSource.m; sourceTree = ""; };
+   7DFBDCAC2269ED0C00B700A5 /* VLCLibraryVideoDataSource.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryVideoDataSource.h; sourceTree = ""; };
+   7DFBDCAD2269ED0C00B700A5 /* VLCLibraryVideoDataSource.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryVideoDataSource.m; sourceTree = ""; };
7DFBDCAF226A518400B700A5 /* VLCLibraryMenuController.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryMenuController.h; sourceTree = ""; };
7DFBDCB0226A518400B700A5 /* VLCLibraryMenuController.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryMenuController.m; sourceTree = ""; };
7DFBDCB2226CD00900B700A5 /* VLCLibraryDataTypes.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryDataTypes.h; sourceTree = ""; };
@@ -989,8 +989,8 @@
7DFBDCAA2269E77F00B700A5 /* VLCLibraryModel.m 
*/,
7DFBDCB2226CD00900B700A5 /* 
VLCLibraryDataTypes.h */,
7DFBDCB3226CD00900B700A5 /* 
VLCLibraryDataTypes.m */,
-   7DFBDCAC2269ED0C00B700A5 /* 
VLCLibraryDataSource.h */,
-   7DFBDCAD2269ED0C00B700A5 /* 
VLCLib

[vlc-commits] macosx: add helper for the Mojave dark mode

2019-05-07 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue May  7 12:55:56 
2019 +0200| [62186521264a021bfda172db9b679bfb6d14872e] | committer: Felix Paul 
Kühne

macosx: add helper for the Mojave dark mode

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

 modules/gui/macosx/extensions/NSView+VLCAdditions.h  |  2 ++
 modules/gui/macosx/extensions/NSView+VLCAdditions.m  | 13 +
 .../gui/macosx/library/VLCLibraryCollectionViewItem.m| 12 ++--
 .../VLCLibraryCollectionViewSupplementaryElementView.m   | 12 +++-
 modules/gui/macosx/library/VLCLibraryWindow.m| 16 +---
 modules/gui/macosx/main/CompatibilityFixes.h |  6 ++
 modules/gui/macosx/views/VLCBottomBarView.m  | 12 +++-
 modules/gui/macosx/views/VLCSlider.m | 11 +--
 modules/gui/macosx/views/VLCVolumeSlider.m   | 12 +---
 9 files changed, 44 insertions(+), 52 deletions(-)

diff --git a/modules/gui/macosx/extensions/NSView+VLCAdditions.h 
b/modules/gui/macosx/extensions/NSView+VLCAdditions.h
index a97ad3c76f..2478345d72 100644
--- a/modules/gui/macosx/extensions/NSView+VLCAdditions.h
+++ b/modules/gui/macosx/extensions/NSView+VLCAdditions.h
@@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface NSView (VLCAdditions)
 
+@property (readonly) BOOL shouldShowDarkAppearance;
+
 - (void)enableSubviews:(BOOL)enabled;
 
 @end
diff --git a/modules/gui/macosx/extensions/NSView+VLCAdditions.m 
b/modules/gui/macosx/extensions/NSView+VLCAdditions.m
index 2609f0bd4f..702016e154 100644
--- a/modules/gui/macosx/extensions/NSView+VLCAdditions.m
+++ b/modules/gui/macosx/extensions/NSView+VLCAdditions.m
@@ -23,8 +23,21 @@
 
 #import "NSView+VLCAdditions.h"
 
+#import "main/CompatibilityFixes.h"
+
 @implementation NSView (VLCAdditions)
 
+- (BOOL)shouldShowDarkAppearance
+{
+if (@available(macOS 10_14, *)) {
+if ([self.effectiveAppearance.name 
isEqualToString:NSAppearanceNameDarkAqua]) {
+return YES;
+}
+}
+
+return NO;
+}
+
 - (void)enableSubviews:(BOOL)enabled
 {
 for (NSView *view in [self subviews]) {
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index a11560555f..58cf601b96 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -23,7 +23,6 @@
 #import "VLCLibraryCollectionViewItem.h"
 
 #import "main/VLCMain.h"
-#import "main/CompatibilityFixes.h"
 #import "library/VLCLibraryController.h"
 #import "library/VLCLibraryDataTypes.h"
 #import "library/VLCLibraryModel.h"
@@ -33,6 +32,7 @@
 #import "extensions/NSString+Helpers.h"
 #import "extensions/NSFont+VLCAdditions.h"
 #import "extensions/NSColor+VLCAdditions.h"
+#import "extensions/NSView+VLCAdditions.h"
 
 NSString *VLCLibraryCellIdentifier = @"VLCLibraryCellIdentifier";
 
@@ -96,15 +96,7 @@ NSString *VLCLibraryCellIdentifier = 
@"VLCLibraryCellIdentifier";
 
 - (void)updateColoredAppearance
 {
-if (@available(macOS 10_14, *)) {
-if ([self.view.effectiveAppearance.name 
isEqualToString:NSAppearanceNameDarkAqua]) {
-self.mediaTitleTextField.textColor = [NSColor 
VLClibraryDarkTitleColor];
-} else {
-self.mediaTitleTextField.textColor = [NSColor 
VLClibraryLightTitleColor];
-}
-} else {
-self.mediaTitleTextField.textColor = [NSColor 
VLClibraryLightTitleColor];
-}
+self.mediaTitleTextField.textColor = self.view.shouldShowDarkAppearance ? 
[NSColor VLClibraryDarkTitleColor] : [NSColor VLClibraryLightTitleColor];
 }
 
 #pragma mark - view representation
diff --git 
a/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m
index 9ce0a78e78..d651cf2f08 100644
--- 
a/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m
+++ 
b/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m
@@ -23,7 +23,7 @@
 #import "VLCLibraryCollectionViewSupplementaryElementView.h"
 #import "extensions/NSFont+VLCAdditions.h"
 #import "extensions/NSColor+VLCAdditions.h"
-#import "main/CompatibilityFixes.h"
+#import "extensions/NSView+VLCAdditions.h"
 
 NSString *VLCLibrarySupplementaryElementViewIdentifier = 
@"VLCLibrarySupplementaryElementViewIdentifier";
 
@@ -39,11 +39,7 @@ NSString *VLCLibrarySupplementaryElementViewIdentifier = 
@"VLCLibrarySupplementa
 self = [super initWithFrame:frameRect];
 if (self) {
 self.font = [NSFont VLClibrarySectionHeaderFont];
-if (@available(macOS 1

[vlc-commits] macosx/main: trim public interface and remove pseudo-global includes

2019-05-07 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue May  7 12:37:18 
2019 +0200| [a5e053f12777086ac64843f435d4c350b1cb097c] | committer: Felix Paul 
Kühne

macosx/main: trim public interface and remove pseudo-global includes

This reduces the amount of unexpected magic behavior throughout the interface.

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

 .../macosx/coreinteraction/VLCHotkeysController.m  |  1 +
 modules/gui/macosx/library/VLCLibraryWindow.m  |  1 +
 modules/gui/macosx/main/VLCMain.h  | 78 ++---
 modules/gui/macosx/main/VLCMain.m  | 99 ++
 modules/gui/macosx/menus/VLCMainMenu.m |  5 +-
 .../gui/macosx/os-integration/VLCClickerManager.h  |  3 +
 .../gui/macosx/os-integration/VLCClickerManager.m  |  3 +
 .../panels/VLCAudioEffectsWindowController.m   |  1 +
 .../macosx/panels/VLCBookmarksWindowController.m   |  7 +-
 .../macosx/panels/VLCInformationWindowController.m |  2 +
 .../VLCTrackSynchronizationWindowController.m  |  2 +
 .../panels/VLCVideoEffectsWindowController.m   |  6 +-
 .../macosx/panels/dialogs/VLCCoreDialogProvider.m  |  1 +
 .../panels/dialogs/VLCResumeDialogController.m |  2 +-
 .../playlist/VLCPlaybackContinuityController.m |  1 +
 modules/gui/macosx/playlist/VLCPlayerController.m  |  1 +
 .../gui/macosx/playlist/VLCPlaylistController.m|  1 +
 .../macosx/playlist/VLCPlaylistMenuController.m|  1 +
 .../macosx/preferences/VLCSimplePrefsController.m  |  4 +-
 modules/gui/macosx/preferences/prefs.m | 13 +--
 .../gui/macosx/windows/VLCAboutWindowController.m  |  1 +
 .../gui/macosx/windows/VLCErrorWindowController.m  |  1 -
 .../gui/macosx/windows/VLCHelpWindowController.m   |  1 +
 .../gui/macosx/windows/VLCOpenWindowController.m   |  3 +-
 .../windows/addons/VLCAddonsWindowController.m |  1 +
 .../VLCConvertAndSaveWindowController.m|  2 +
 .../gui/macosx/windows/convertandsave/VLCOutput.m  |  1 +
 .../extensions/VLCExtensionsDialogProvider.m   |  1 +
 .../windows/extensions/VLCExtensionsManager.m  |  2 +-
 .../windows/logging/VLCLogWindowController.m   |  1 +
 .../windows/mainwindow/VLCMainWindowControlsBar.m  |  1 +
 .../macosx/windows/video/VLCFSPanelController.m|  1 +
 .../macosx/windows/video/VLCVideoOutputProvider.m  |  6 +-
 .../macosx/windows/video/VLCVideoWindowCommon.m|  4 +-
 modules/gui/macosx/windows/video/VLCVoutView.m |  2 +-
 35 files changed, 127 insertions(+), 133 deletions(-)

diff --git a/modules/gui/macosx/coreinteraction/VLCHotkeysController.m 
b/modules/gui/macosx/coreinteraction/VLCHotkeysController.m
index 9914954752..43a7e6080f 100644
--- a/modules/gui/macosx/coreinteraction/VLCHotkeysController.m
+++ b/modules/gui/macosx/coreinteraction/VLCHotkeysController.m
@@ -25,6 +25,7 @@
 #import "VLCHotkeysController.h"
 
 #import "main/VLCMain.h"
+#import "extensions/NSString+Helpers.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
 
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index c3ba1d461b..baf282b4d5 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -43,6 +43,7 @@
 #import "windows/mainwindow/VLCControlsBarCommon.h"
 #import "windows/video/VLCFSPanelController.h"
 #import "windows/video/VLCVoutView.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 static const float f_min_window_width = 604.;
 static const float f_min_window_height = 307.;
diff --git a/modules/gui/macosx/main/VLCMain.h 
b/modules/gui/macosx/main/VLCMain.h
index 7aa74ca1f8..77dbc82054 100644
--- a/modules/gui/macosx/main/VLCMain.h
+++ b/modules/gui/macosx/main/VLCMain.h
@@ -31,16 +31,6 @@
 
 #import 
 #import 
-#import 
-#import 
-#import 
-#import 
-#import 
-
-#import "extensions/misc.h"
-#import "extensions/NSString+Helpers.h"
-#import "menus/VLCStatusBarIcon.h"
-#import "windows/video/VLCVideoOutputProvider.h"
 
 /*
  * Local prototypes.
@@ -48,15 +38,12 @@
 
 intf_thread_t *getIntf(void);
 
-static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
-static NSString * VLCConfigurationChangedNotification = 
@"VLCConfigurationChangedNotification";
-static NSString * VLCMediaKeySupportSettingChangedNotification = 
@"VLCMediaKeySupportSettingChangedNotification";
-static NSString * VLCAppleRemoteSettingChangedNotification = 
@"VLCAppleRemoteSettingChangedNotification";
+extern NSString *VLCConfigurationChangedNotification;
 
 /*
  * VLCMain interface
  

[vlc-commits] macosx/NSView category: split to a file of its own

2019-05-07 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue May  7 11:44:27 
2019 +0200| [4a9a7e4bd85248c44f405e13b058e8f98b8d019e] | committer: Felix Paul 
Kühne

macosx/NSView category: split to a file of its own

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |  6 +++
 modules/gui/macosx/Makefile.am |  2 +
 .../gui/macosx/extensions/NSView+VLCAdditions.h| 34 +++
 .../gui/macosx/extensions/NSView+VLCAdditions.m| 49 ++
 modules/gui/macosx/extensions/misc.h   |  8 
 modules/gui/macosx/extensions/misc.m   | 25 ---
 .../panels/VLCAudioEffectsWindowController.m   |  1 +
 .../VLCConvertAndSaveWindowController.m|  2 +-
 po/POTFILES.in |  2 +
 9 files changed, 95 insertions(+), 34 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 74fa01979c..202e68201c 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -108,6 +108,7 @@
7D2E0EDB20CD204D0033A221 /* VLCWindow.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 7D2E0ED920CD204D0033A221 /* VLCWindow.m */; };
7D2E0EDE20CD206F0033A221 /* VLCVideoWindowCommon.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D2E0EDD20CD206F0033A221 /* 
VLCVideoWindowCommon.m */; };
7D2FFA40227B8A5B0085D649 /* VLCLinearProgressIndicator.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D2FFA3F227B8A5B0085D649 /* 
VLCLinearProgressIndicator.m */; };
+   7D404ABF2281892C00B28EF4 /* NSView+VLCAdditions.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7D404ABE2281892C00B28EF4 /* 
NSView+VLCAdditions.m */; };
7D445D812202524000263D34 /* VLCPlaylistController.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D445D802202524000263D34 /* 
VLCPlaylistController.m */; };
7D445D842202524D00263D34 /* VLCPlaylistItem.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D445D832202524D00263D34 /* VLCPlaylistItem.m 
*/; };
7D445D872202574B00263D34 /* VLCPlaylistModel.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D445D862202574B00263D34 /* VLCPlaylistModel.m 
*/; };
@@ -463,6 +464,8 @@
7D2E0EDD20CD206F0033A221 /* VLCVideoWindowCommon.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= VLCVideoWindowCommon.m; sourceTree = ""; };
7D2FFA3E227B8A5B0085D649 /* VLCLinearProgressIndicator.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLinearProgressIndicator.h; sourceTree = ""; };
7D2FFA3F227B8A5B0085D649 /* VLCLinearProgressIndicator.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLinearProgressIndicator.m; sourceTree = ""; };
+   7D404ABD2281892C00B28EF4 /* NSView+VLCAdditions.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"NSView+VLCAdditions.h"; sourceTree = ""; };
+   7D404ABE2281892C00B28EF4 /* NSView+VLCAdditions.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
"NSView+VLCAdditions.m"; sourceTree = ""; };
7D445D7F2202524000263D34 /* VLCPlaylistController.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCPlaylistController.h; sourceTree = ""; };
7D445D802202524000263D34 /* VLCPlaylistController.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPlaylistController.m; sourceTree = ""; };
7D445D822202524D00263D34 /* VLCPlaylistItem.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCPlaylistItem.h; 
sourceTree = ""; };
@@ -956,6 +959,8 @@
7D28E6352275B4820098D30E /* 
NSColor+VLCAdditions.m */,
7D28E6372275B7340098D30E /* 
NSFont+VLCAdditions.h */,
7D28E6382275B7340098D30E /* 
NSFont+VLCAdditions.m */,
+   7D404ABD2281892C00B28EF4 /* 
NSView+VLCAdditions.h */,
+   7D404ABE2281892C00B28EF4 /* 
NSView+VLCAdditions.m */,
);
path = extensions;
sourceTree = "";
@@ -1645,6 +1650,7 @@
1C3113901E508C6900D4DD76 /* 
VLCHelpWindowController.m in Sources */,
1C3113921E508C6900D4DD76 /* VLCAddonListItem.m 
in Sources */,
7DFBDCB7226CDFD600B700A5 /* VLCImageVie

[vlc-commits] macosx/library window: generate vout view i code instead of IB

2019-05-07 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Tue May  7 11:32:04 
2019 +0200| [76657bad0a129320e4edb28b2e06319e83a875a2] | committer: Felix Paul 
Kühne

macosx/library window: generate vout view i code instead of IB

This way, the UI elements are a lot more accessible when working with the 
visual editor.

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

 modules/gui/macosx/UI/VLCLibraryWindow.xib | 35 +-
 modules/gui/macosx/library/VLCLibraryWindow.h  |  1 +
 modules/gui/macosx/library/VLCLibraryWindow.m  |  9 ++
 .../macosx/windows/video/VLCVideoWindowCommon.h|  2 +-
 4 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index 947e6b96c1..76965f6c1c 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -17,13 +17,13 @@
 
 
 
-
+
 
 
 
 
 
-
+
 
 
 
@@ -37,18 +37,18 @@
 
 
 
-
+
 
 
-
+
 
 
 
-
+
 
 
 
-
+
 
 
 
@@ -56,16 +56,16 @@
 
 
 
-
+
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
@@ -158,7 +158,7 @@
 
 
 
-
+
 
 
 
@@ -298,22 +298,14 @@
 
 
 
-
-
-
 
 
 
-
-
 
 
 
-
-
 
 
-
 
 
 
@@ -322,7 +314,9 @@
 
 
 
+
 
+
 
 
 
@@ -334,7 +328,6 @@
 
 
 
-
 
 
 
@@ -435,7 +428,7 @@
 
 
 
-
+
 
 
 
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.h 
b/modules/gui/macosx/library/VLCLibraryWindow.h
index 0ff1edea0f..480e84e182 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.h
+++ b/modules/gui/macosx/library/VLCLibraryWindow.h
@@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
 @interface VLCLibraryWindow : VLCVideoWindowCommon
 
 @property (readwrite, weak) IBOutlet NSSegmentedControl *segmentedTitleControl;
+@property (readwrite, weak) IBOutlet NSSplitView *mainSplitView;
 @property (readwrite, weak) IBOutlet NSStackView *videoLibraryStackView;
 @property (readwrite, weak) IBOutlet NSCollectionView 
*videoLibraryCollectionView;
 @property (readwrite, weak) IBOutlet NSCollectionV

[vlc-commits] macosx/library: clean view display and object interaction

2019-05-06 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon May  6 12:12:21 
2019 +0200| [fdd3c157a21ba65d014f75819c4de1c95bf29ff1] | committer: Felix Paul 
Kühne

macosx/library: clean view display and object interaction

Data views are now removed from/added to the superview instead of 
hidden/unhidden

Additionally, the media lookup was cleaned and generalized beyond video.

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

 modules/gui/macosx/UI/VLCLibraryWindow.xib | 251 ++---
 .../macosx/library/VLCLibraryCollectionViewItem.m  |  34 ++-
 modules/gui/macosx/library/VLCLibraryController.h  |   4 +-
 modules/gui/macosx/library/VLCLibraryController.m  |   6 +-
 .../gui/macosx/library/VLCLibraryMenuController.h  |   4 +-
 .../gui/macosx/library/VLCLibraryMenuController.m  |  10 +-
 modules/gui/macosx/library/VLCLibraryModel.h   |   2 -
 modules/gui/macosx/library/VLCLibraryModel.m   |  13 --
 modules/gui/macosx/library/VLCLibraryWindow.h  |   6 +-
 modules/gui/macosx/library/VLCLibraryWindow.m  |  70 +++---
 10 files changed, 193 insertions(+), 207 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index af383765c6..e7ff43b58c 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -18,12 +18,12 @@
 
 
 
-
-
+
+
 
 
 
-
+
 
 
 
@@ -37,134 +37

[vlc-commits] macosx/library: move recent media to its on collection view

2019-05-06 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon May  6 11:02:21 
2019 +0200| [30fc2fd4be67f70f0e7a892504fd64b3776f] | committer: Felix Paul 
Kühne

macosx/library: move recent media to its on collection view

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

 .../gui/macosx/UI/VLCLibraryCollectionViewItem.xib |   4 +-
 modules/gui/macosx/UI/VLCLibraryWindow.xib | 158 ++---
 modules/gui/macosx/library/VLCLibraryDataSource.h  |   2 +
 modules/gui/macosx/library/VLCLibraryDataSource.m  |   8 +-
 modules/gui/macosx/library/VLCLibraryModel.m   |   5 +-
 modules/gui/macosx/library/VLCLibraryWindow.h  |   4 +-
 modules/gui/macosx/library/VLCLibraryWindow.m  |  30 ++--
 7 files changed, 140 insertions(+), 71 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib 
b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
index 4639a95f6f..7747707f6a 100644
--- a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
+++ b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
@@ -55,7 +55,6 @@
 
 
 
-
 
 
 
@@ -101,13 +100,14 @@
 
 
 
+
 
 
+
 
 
 
 
-
 
 
 
diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index f516b40197..af383765c6 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -18,12 +18,12 @@
 
 
 
-
-
-
+
+
+
 
 
-
+
 
 
 
@@ -37,47 +37

[vlc-commits] macosx/library: fix display of audio media

2019-05-06 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon May  6 10:26:24 
2019 +0200| [6b88208f23a44e612fa44365bdd76260954756e9] | committer: Felix Paul 
Kühne

macosx/library: fix display of audio media

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

 modules/gui/macosx/library/VLCLibraryCollectionViewItem.m | 4 +++-
 modules/gui/macosx/library/VLCLibraryModel.m  | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index 508fdd96c8..89fbb30959 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -144,7 +144,9 @@ NSString *VLCLibraryCellIdentifier = 
@"VLCLibraryCellIdentifier";
 if (_representedMediaItem.artworkGenerated) {
 image = [[NSImage alloc] initWithContentsOfURL:[NSURL 
URLWithString:_representedMediaItem.artworkMRL]];
 } else {
-[_libraryController 
attemptToGenerateThumbnailForMediaItem:_representedMediaItem];
+if (_representedMediaItem.mediaType != VLC_ML_MEDIA_TYPE_AUDIO) {
+[_libraryController 
attemptToGenerateThumbnailForMediaItem:_representedMediaItem];
+}
 }
 if (!image) {
 image = [NSImage imageNamed: @"noart.png"];
diff --git a/modules/gui/macosx/library/VLCLibraryModel.m 
b/modules/gui/macosx/library/VLCLibraryModel.m
index cd68a0b1e1..e8bac59ba4 100644
--- a/modules/gui/macosx/library/VLCLibraryModel.m
+++ b/modules/gui/macosx/library/VLCLibraryModel.m
@@ -125,7 +125,7 @@ static void libraryCallback(void *p_data, const 
vlc_ml_event_t *p_event)
 
 - (size_t)numberOfAudioMedia
 {
-if (_cachedAudioMedia) {
+if (!_cachedAudioMedia) {
 dispatch_async(dispatch_get_main_queue(), ^{
 [self updateCachedListOfAudioMedia];
 });

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: fix compilation with legacy SDK versions

2019-05-06 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon May  6 09:41:02 
2019 +0200| [6879ee14e930fa84b4deaffed64ab369a25a7231] | committer: Felix Paul 
Kühne

macosx: fix compilation with legacy SDK versions

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

 .../library/VLCLibraryCollectionViewSupplementaryElementView.m   | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m
index 1eda8d31d5..9ce0a78e78 100644
--- 
a/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m
+++ 
b/modules/gui/macosx/library/VLCLibraryCollectionViewSupplementaryElementView.m
@@ -23,6 +23,7 @@
 #import "VLCLibraryCollectionViewSupplementaryElementView.h"
 #import "extensions/NSFont+VLCAdditions.h"
 #import "extensions/NSColor+VLCAdditions.h"
+#import "main/CompatibilityFixes.h"
 
 NSString *VLCLibrarySupplementaryElementViewIdentifier = 
@"VLCLibrarySupplementaryElementViewIdentifier";
 
@@ -51,7 +52,9 @@ NSString *VLCLibrarySupplementaryElementViewIdentifier = 
@"VLCLibrarySupplementa
 
 - (void)viewDidChangeEffectiveAppearance
 {
-self.textColor = [self.effectiveAppearance.name 
isEqualToString:NSAppearanceNameDarkAqua] ? [NSColor VLClibraryDarkTitleColor] 
: [NSColor VLClibraryLightTitleColor];
+if (@available(macOS 10_14, *)) {
+self.textColor = [self.effectiveAppearance.name 
isEqualToString:NSAppearanceNameDarkAqua] ? [NSColor VLClibraryDarkTitleColor] 
: [NSColor VLClibraryLightTitleColor];
+}
 }
 
 @end

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library: show recently played media and introduce section headers

2019-05-06 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon May  6 08:23:46 
2019 +0200| [510805b252b5185413056e07314b14ccfb32a8a0] | committer: Felix Paul 
Kühne

macosx/library: show recently played media and introduce section headers

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |  6 ++
 modules/gui/macosx/Makefile.am |  2 +
 ...LibraryCollectionViewSupplementaryElementView.h | 35 
 ...LibraryCollectionViewSupplementaryElementView.m | 57 +++
 modules/gui/macosx/library/VLCLibraryDataSource.m  | 55 +++
 modules/gui/macosx/library/VLCLibraryModel.h   |  4 ++
 modules/gui/macosx/library/VLCLibraryModel.m   | 64 --
 modules/gui/macosx/library/VLCLibraryWindow.m  |  9 +++
 modules/gui/macosx/main/CompatibilityFixes.m   |  6 ++
 po/POTFILES.in |  2 +
 10 files changed, 225 insertions(+), 15 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 6e7538ffa8..74fa01979c 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -149,6 +149,7 @@
7DB7F20720CC07E600C2CAED /* SystemConfiguration.framework in 
Frameworks */ = {isa = PBXBuildFile; fileRef = 7DB7F20620CC07E600C2CAED /* 
SystemConfiguration.framework */; };
7DB7F20920CC07FD00C2CAED /* WebKit.framework in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 7DB7F20820CC07FD00C2CAED /* WebKit.framework */; 
};
7DB7F20B20CC082800C2CAED /* QuartzCore.framework in Frameworks 
*/ = {isa = PBXBuildFile; fileRef = 7DB7F20A20CC082800C2CAED /* 
QuartzCore.framework */; };
+   7DBB7639227F3FBC002649E1 /* 
VLCLibraryCollectionViewSupplementaryElementView.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 7DBB7638227F3FBC002649E1 /* 
VLCLibraryCollectionViewSupplementaryElementView.m */; };
7DC21A7422049A6600F98A02 /* VLCOpenInputMetadata.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7DC21A7322049A6600F98A02 /* 
VLCOpenInputMetadata.m */; };
7DD2F5C52081B73B007EE187 /* VLCRemoteControlService.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7DD2F5C42081B73B007EE187 /* 
VLCRemoteControlService.m */; };
7DE9C7DD220728420089108F /* VLCPlayerController.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7DE9C7DC220728420089108F /* 
VLCPlayerController.m */; };
@@ -523,6 +524,8 @@
7DB7F20820CC07FD00C2CAED /* WebKit.framework */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.framework; name = 
WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree 
= SDKROOT; };
7DB7F20A20CC082800C2CAED /* QuartzCore.framework */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.framework; name = 
QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; 
sourceTree = SDKROOT; };
7DBB06631CC2314D004C74D2 /* caopengllayer.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name 
= caopengllayer.m; path = ../../../modules/video_output/caopengllayer.m; 
sourceTree = ""; };
+   7DBB7637227F3FBC002649E1 /* 
VLCLibraryCollectionViewSupplementaryElementView.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLibraryCollectionViewSupplementaryElementView.h; sourceTree = ""; };
+   7DBB7638227F3FBC002649E1 /* 
VLCLibraryCollectionViewSupplementaryElementView.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLibraryCollectionViewSupplementaryElementView.m; sourceTree = ""; };
7DC21A7222049A6600F98A02 /* VLCOpenInputMetadata.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCOpenInputMetadata.h; sourceTree = ""; };
7DC21A7322049A6600F98A02 /* VLCOpenInputMetadata.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCOpenInputMetadata.m; sourceTree = ""; };
7DD2F5C32081B73B007EE187 /* VLCRemoteControlService.h */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCRemoteControlService.h; sourceTree = ""; };
@@ -971,6 +974,8 @@
children = (
7D0F64032202047900FDB91F /* 
VLCLibraryCollectionViewItem.h */,
7D0F64042202047900FDB91F /* 
VLCLibraryCollectionViewItem.m */,
+   7DBB7637227F3FBC002649E1 /* 
VLCLibraryCollectionViewSupplementaryElementView.h */,
+   7DBB7638227F3FBC002649E1 /* 
VLCLibraryCollectionViewSupplementaryElementView.m */,
   

[vlc-commits] macosx/playlist: fix playback broken in 50c0fa5d

2019-05-06 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon May  6 08:22:29 
2019 +0200| [316f60130cbe83777b45bc0b07b15cd33f8b8ab1] | committer: Felix Paul 
Kühne

macosx/playlist: fix playback broken in 50c0fa5d

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

 modules/gui/macosx/playlist/VLCPlayerController.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/playlist/VLCPlayerController.m 
b/modules/gui/macosx/playlist/VLCPlayerController.m
index 01b997faed..7b4cff2e45 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.m
+++ b/modules/gui/macosx/playlist/VLCPlayerController.m
@@ -175,9 +175,9 @@ static void cb_player_rate_changed(vlc_player_t *p_player, 
float newRateValue, v
 });
 }
 
-static void cb_player_capabilities_changed(vlc_player_t *p_player, int 
newCapabilities, void *p_data)
+static void cb_player_capabilities_changed(vlc_player_t *p_player, int 
oldCapabilities, int newCapabilities, void *p_data)
 {
-VLC_UNUSED(p_player);
+VLC_UNUSED(p_player); VLC_UNUSED(oldCapabilities);
 dispatch_async(dispatch_get_main_queue(), ^{
 VLCPlayerController *playerController = (__bridge VLCPlayerController 
*)p_data;
 [playerController capabilitiesChanged:newCapabilities];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: load media sources on request only

2019-05-05 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun May  5 16:55:45 
2019 +0200| [8a7fead4cbeeaf700405ac5b1970e3de04bec096] | committer: Felix Paul 
Kühne

macosx: load media sources on request only

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

 modules/gui/macosx/library/VLCLibraryWindow.m  | 2 ++
 modules/gui/macosx/media-source/VLCMediaSourceDataSource.h | 3 +++
 modules/gui/macosx/media-source/VLCMediaSourceDataSource.m | 7 +++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index ec7ffa5eef..e56e21d21a 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -128,6 +128,7 @@ static const float f_playlist_row_height = 72.;
 [_libraryCollectionView registerClass:[VLCLibraryCollectionViewItem class] 
forItemWithIdentifier:VLCLibraryCellIdentifier];
 
 _mediaSourceDataSource = [[VLCMediaSourceDataSource alloc] init];
+_mediaSourceDataSource.collectionView = _mediaSourceCollectionView;
 _mediaSourceCollectionView.dataSource = _mediaSourceDataSource;
 _mediaSourceCollectionView.delegate = _mediaSourceDataSource;
 [_mediaSourceCollectionView 
registerClass:[VLCMediaSourceCollectionViewItem class] 
forItemWithIdentifier:VLCMediaSourceCellIdentifier];
@@ -256,6 +257,7 @@ static const float f_playlist_row_height = 72.;
 default:
 _mediaSourceScrollView.hidden = NO;
 _libraryCollectionView.hidden = YES;
+[_mediaSourceDataSource loadMediaSources];
 [_mediaSourceCollectionView reloadData];
 break;
 }
diff --git a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h 
b/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h
index 97bf803182..897231ed68 100644
--- a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h
+++ b/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h
@@ -32,6 +32,9 @@ NS_ASSUME_NONNULL_BEGIN
 @interface VLCMediaSourceDataSource : NSObject 
 
 @property (readwrite) VLCMediaSourceMode mediaSourceMode;
+@property (readwrite) NSCollectionView *collectionView;
+
+- (void)loadMediaSources;
 
 @end
 
diff --git a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m 
b/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m
index e5b14c22f3..c07245761b 100644
--- a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m
+++ b/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m
@@ -42,14 +42,12 @@
 {
 self = [super init];
 if (self) {
-dispatch_async(dispatch_get_main_queue(), ^{
-[self lazyLoadMediaSources];
-});
+_mediaDiscovery = @[];
 }
 return self;
 }
 
-- (void)lazyLoadMediaSources
+- (void)loadMediaSources
 {
 NSArray *mediaDiscoveryForLAN = [VLCMediaSourceProvider 
listOfMediaSourcesForCategory:SD_CAT_LAN];
 NSUInteger count = mediaDiscoveryForLAN.count;
@@ -61,6 +59,7 @@
 }
 }
 _mediaDiscovery = mediaDiscoveryForLAN;
+[self.collectionView reloadData];
 }
 
 - (NSInteger)collectionView:(NSCollectionView *)collectionView

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library: add 'NEW' indicator for media that was never played before

2019-05-05 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sun May  5 17:16:10 
2019 +0200| [25b7531b75fe4b1d2db222bd3e860a0754b1733d] | committer: Felix Paul 
Kühne

macosx/library: add 'NEW' indicator for media that was never played before

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

 .../gui/macosx/UI/VLCLibraryCollectionViewItem.xib  | 21 -
 .../macosx/library/VLCLibraryCollectionViewItem.h   |  1 +
 .../macosx/library/VLCLibraryCollectionViewItem.m   |  5 +
 modules/gui/macosx/library/VLCLibraryController.m   |  3 +++
 4 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib 
b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
index 021f5b4cb8..4639a95f6f 100644
--- a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
+++ b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
@@ -14,6 +14,7 @@
 
 
 
+
 
 
 
@@ -68,10 +69,10 @@
 
 
 
-
-
-
-
+
+
+
+
 
 
 
@@ -90,12 +91,22 @@
 
 
 
+
+
+
+
+
+
+
+
 
 
-
 
 
+
+
 
+
 
 
 
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
index 2880a0a5a8..d482b64fa1 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
@@ -34,6 +34,7 @@ extern NSString *VLCLibraryCellIdentifier;
 
 @property (readwrite, assign) IBOutlet NSTextField *mediaTitleTextField;
 @property (readwrite, assign) IBOutlet NSTextField *annotationTextField;
+@property (readwrite, assign) IBOutlet NSTextField *unplayedIndicatorTextField;
 @property (readwrite, assign) IBOutlet NSTextField *durationTextField;
 @property (readwrite, assign) IBOutlet VLCImageView *mediaImageView;
 @property (readwrite, assign) IBOutlet NSButton *playInstantlyButton;
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index ddf1b654b8..508fdd96c8 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -70,6 +70,9 @@ NSString *VLCLibraryCellIdentifier = 
@"VLCLibraryCellIdentifier";
 self.annotationTextField.font = [NSFont VLClibraryCellAnnotationFont];
 self.annotationTextField.textColor = [NSColor VLClibraryAnnotationColor];
 self.annotationTextField.backgroundColor = [NSColor 
VLClibraryAnnotationBackgroundColor];
+self.unplayedIndicatorTextField.stringValue = _NS("NEW");
+self.unplayedIndicatorTextField.font = [NSFont 
VLClibraryHighlightCellHighlightLabelFont];
+self.unplayedIndicatorTextField.textColor = [NSColor 
VLClibraryHighlightColor];
 
 if (@available(macOS 10_14, *)) {
 [[NSApplication sharedApplication] addObserver:self
@@ -168,6 +171,8 @@ NSString *VLCLibraryCellIdentifier = 
@"VLCLibraryCellIdentifier";
 } else {
 _progressIndicator.hidden = YES;
 }
+
+_unplayedIndicatorTextField.hidden = _representedMediaItem.playCount > 0 ? 
YES : NO;
 }
 
 #pragma mark - actions
diff --git a/modules/gui/macosx/library/VLCLibraryController.m 
b/modules/gui/macosx/library/VLCLibraryController.m
index 225bd72d10..d8e7851507 100644
--- a/modules/gui/macosx/library/VLCLibraryController.m
+++ b/modules/gui/macosx/library/VLCLibraryController.m
@@ -102,6 +102,9 @@
 input_item_t *p_inputItem = vlc_ml_get_input_item(_p_libraryInstance, 
mediaItem.libraryID);
 int ret = [[[VLCMain sharedInstance] playlistController] 
addInputItem:p_inputItem atPosition:-1 startPlayback:playImmediately];
 input_item_Release(p_inputItem);
+if (ret == VLC_SUCCESS) {
+[mediaItem increasePlayCount];
+}
 return ret;
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library: display playback progress

2019-05-02 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May  2 22:55:49 
2019 +0200| [9489908e343d77f9e2093e8f65007b6ef74162fd] | committer: Felix Paul 
Kühne

macosx/library: display playback progress

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

 modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib| 10 ++
 modules/gui/macosx/library/VLCLibraryCollectionViewItem.h |  2 ++
 modules/gui/macosx/library/VLCLibraryCollectionViewItem.m |  9 +
 3 files changed, 21 insertions(+)

diff --git a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib 
b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
index ae7468c34e..021f5b4cb8 100644
--- a/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
+++ b/modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
@@ -13,6 +13,7 @@
 
 
 
+
 
 
 
@@ -25,6 +26,12 @@
 
 
 
+
+
+
+
+
+
 
 
 
@@ -45,9 +52,12 @@
 
 
 
+
 
 
 
+
+
 
 
 
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
index b35d009f02..2880a0a5a8 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
@@ -27,6 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
 extern NSString *VLCLibraryCellIdentifier;
 
 @class VLCImageView;
+@class VLCLinearProgressIndicator;
 @class VLCMediaLibraryMediaItem;
 
 @interface VLCLibraryCollectionViewItem : NSCollectionViewItem
@@ -37,6 +38,7 @@ extern NSString *VLCLibraryCellIdentifier;
 @property (readwrite, assign) IBOutlet VLCImageView *mediaImageView;
 @property (readwrite, assign) IBOutlet NSButton *playInstantlyButton;
 @property (readwrite, assign) IBOutlet NSButton *addToPlaylistButton;
+@property (readwrite, assign) IBOutlet VLCLinearProgressIndicator 
*progressIndicator;
 
 @property (readwrite, assign, nonatomic) VLCMediaLibraryMediaItem 
*representedMediaItem;
 
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index 3a2b5dc9c3..ddf1b654b8 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -28,6 +28,7 @@
 #import "library/VLCLibraryModel.h"
 #import "library/VLCLibraryDataTypes.h"
 #import "views/VLCImageView.h"
+#import "views/VLCLinearProgressIndicator.h"
 #import "extensions/NSString+Helpers.h"
 #import "extensions/NSFont+VLCAdditions.h"
 #import "extensions/NSColor+VLCAdditions.h"
@@ -159,6 +160,14 @@ NSString *VLCLibraryCellIdentifier = 
@"VLCLibraryCellIdentifier";
 } else {
 _annotationTextField.hidden = YES;
 }
+
+CGFloat position = _representedMediaItem.lastPlaybackPosition;
+if (position > .05 && position < .95) {
+_progressIndicator.progress = position;
+_progressIndicator.hidden = NO;
+} else {
+_progressIndicator.hidden = YES;
+}
 }
 
 #pragma mark - actions

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library: re-order tabs to start with Video instead of Audio

2019-05-02 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May  2 21:09:40 
2019 +0200| [2b416e23271da8fbd7f4f31b5b16cc67a6556d0a] | committer: Felix Paul 
Kühne

macosx/library: re-order tabs to start with Video instead of Audio

This also fixes the indent on top and bottom for the collection view.

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

 modules/gui/macosx/UI/VLCLibraryWindow.xib| 2 +-
 modules/gui/macosx/library/VLCLibraryWindow.m | 9 +
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib 
b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index a1d180f1be..f516b40197 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -54,7 +54,7 @@
 
 
 
-
+
 
 
 
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index ebbd8e8007..ec7ffa5eef 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -104,11 +104,12 @@ static const float f_playlist_row_height = 72.;
 _segmentedTitleControl.segmentCount = 4;
 [_segmentedTitleControl setTarget:self];
 [_segmentedTitleControl setAction:@selector(segmentedControlAction:)];
-[_segmentedTitleControl setLabel:_NS("Music") forSegment:0];
-[_segmentedTitleControl setLabel:_NS("Video") forSegment:1];
+[_segmentedTitleControl setLabel:_NS("Video") forSegment:0];
+[_segmentedTitleControl setLabel:_NS("Music") forSegment:1];
 [_segmentedTitleControl setLabel:_NS("Local Network") forSegment:2];
 [_segmentedTitleControl setLabel:_NS("Internet") forSegment:3];
 [_segmentedTitleControl sizeToFit];
+[_segmentedTitleControl setSelectedSegment:0];
 
 _playlistDataSource = [[VLCPlaylistDataSource alloc] init];
 _playlistDataSource.playlistController = _playlistController;
@@ -239,14 +240,14 @@ static const float f_playlist_row_height = 72.;
 {
 switch (_segmentedTitleControl.selectedSegment) {
 case 0:
-_libraryDataSource.libraryModel.libraryMode = VLCLibraryModeAudio;
+_libraryDataSource.libraryModel.libraryMode = VLCLibraryModeVideo;
 _mediaSourceScrollView.hidden = YES;
 _libraryCollectionView.hidden = NO;
 [_libraryCollectionView reloadData];
 break;
 
 case 1:
-_libraryDataSource.libraryModel.libraryMode = VLCLibraryModeVideo;
+_libraryDataSource.libraryModel.libraryMode = VLCLibraryModeAudio;
 _mediaSourceScrollView.hidden = YES;
 _libraryCollectionView.hidden = NO;
 [_libraryCollectionView reloadData];

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx/library: expose preference API and history clearance

2019-05-02 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May  2 22:23:53 
2019 +0200| [21119ffe33af5532e9be4753157678f269166a06] | committer: Felix Paul 
Kühne

macosx/library: expose preference API and history clearance

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

 modules/gui/macosx/library/VLCLibraryController.h |   2 +
 modules/gui/macosx/library/VLCLibraryController.m |   5 +
 modules/gui/macosx/library/VLCLibraryDataTypes.h  |  22 ++
 modules/gui/macosx/library/VLCLibraryDataTypes.m  | 270 ++
 4 files changed, 299 insertions(+)

diff --git a/modules/gui/macosx/library/VLCLibraryController.h 
b/modules/gui/macosx/library/VLCLibraryController.h
index 06c0b2cf86..46635f84de 100644
--- a/modules/gui/macosx/library/VLCLibraryController.h
+++ b/modules/gui/macosx/library/VLCLibraryController.h
@@ -40,6 +40,8 @@ NS_ASSUME_NONNULL_BEGIN
 - (int)unbanFolderWithFileURL:(NSURL *)fileURL;
 - (int)removeFolderWithFileURL:(NSURL *)fileURL;
 
+- (int)clearHistory;
+
 @end
 
 NS_ASSUME_NONNULL_END
diff --git a/modules/gui/macosx/library/VLCLibraryController.m 
b/modules/gui/macosx/library/VLCLibraryController.m
index fb81ede9e8..225bd72d10 100644
--- a/modules/gui/macosx/library/VLCLibraryController.m
+++ b/modules/gui/macosx/library/VLCLibraryController.m
@@ -148,4 +148,9 @@
 return vlc_ml_remove_folder(_p_libraryInstance, [[fileURL absoluteString] 
UTF8String]);
 }
 
+- (int)clearHistory
+{
+return vlc_ml_clear_history(_p_libraryInstance);
+}
+
 @end
diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.h 
b/modules/gui/macosx/library/VLCLibraryDataTypes.h
index c5789b4767..67a8fac729 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.h
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.h
@@ -94,6 +94,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface VLCMediaLibraryMediaItem : NSObject
 
++ (nullable instancetype)mediaItemForLibraryID:(int64_t)libraryID;
 - (instancetype)initWithMediaItem:(struct vlc_ml_media_t *)mediaItem;
 
 @property (readonly) int64_t libraryID;
@@ -119,6 +120,27 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readonly, nullable) VLCMediaLibraryMovie *movie;
 @property (readonly, nullable) VLCMediaLibraryAlbumTrack *albumTrack;
 
+@property (readwrite) int rating;
+@property (readwrite) float lastPlaybackPosition;
+@property (readwrite) float lastPlaybackRate;
+@property (readwrite) int lastTitle;
+@property (readwrite) int lastChapter;
+@property (readwrite) int lastProgram;
+@property (readwrite) BOOL seen;
+@property (readwrite) int lastVideoTrack;
+@property (readwrite) NSString *lastAspectRatio;
+@property (readwrite) NSString *lastZoom;
+@property (readwrite) NSString *lastCrop;
+@property (readwrite) NSString *lastDeinterlaceFilter;
+@property (readwrite) NSString *lastVideoFilters;
+@property (readwrite) int lastAudioTrack;
+@property (readwrite) float lastGain;
+@property (readwrite) int lastAudioDelay;
+@property (readwrite) int lastSubtitleTrack;
+@property (readwrite) int lastSubtitleDelay;
+
+- (int)increasePlayCount;
+
 @end
 
 @interface VLCMediaLibraryEntryPoint : NSObject
diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.m 
b/modules/gui/macosx/library/VLCLibraryDataTypes.m
index 9ea940b9b0..228b99076a 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.m
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.m
@@ -22,6 +22,7 @@
 
 #import "VLCLibraryDataTypes.h"
 
+#import "main/VLCMain.h"
 #import "extensions/NSString+Helpers.h"
 
 #import 
@@ -128,12 +129,38 @@
 
 @end
 
+@interface VLCMediaLibraryMediaItem ()
+
+@property (readwrite, assign) vlc_medialibrary_t *p_mediaLibrary;
+
+@end
+
 @implementation VLCMediaLibraryMediaItem
 
+#pragma mark - initialization
+
++ (nullable instancetype)mediaItemForLibraryID:(int64_t)libraryID
+{
+vlc_medialibrary_t *p_mediaLibrary = vlc_ml_instance_get(getIntf());
+vlc_ml_media_t *p_mediaItem = vlc_ml_get(p_mediaLibrary, VLC_ML_GET_MEDIA, 
libraryID);
+VLCMediaLibraryMediaItem *returnValue = nil;
+if (p_mediaItem) {
+returnValue = [[VLCMediaLibraryMediaItem alloc] 
initWithMediaItem:p_mediaItem library:p_mediaLibrary];
+}
+return returnValue;
+}
+
 - (instancetype)initWithMediaItem:(struct vlc_ml_media_t *)p_mediaItem
 {
+vlc_medialibrary_t *p_mediaLibrary = vlc_ml_instance_get(getIntf());
+return [self initWithMediaItem:p_mediaItem library:p_mediaLibrary];
+}
+
+- (instancetype)initWithMediaItem:(struct vlc_ml_media_t *)p_mediaItem 
library:(vlc_medialibrary_t *)p_mediaLibrary
+{
 self = [super init];
 if (self) {
+_p_mediaLibrary = p_mediaLibrary;
 _libraryID = p_mediaItem->i_id;
 _mediaType = p_mediaItem->i_type;
 _mediaSubType = p_mediaItem->i_subtype;
@@ -191,6 +218,249 @@
 NSStringFromClass([self class]), _title, _libraryID, _mediaType, 
_artworkMRL];
 }
 
+#pragma mark - preference setters / getters
+
+- (

[vlc-commits] macosx: add custom linear progress indicator view

2019-05-02 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu May  2 22:53:53 
2019 +0200| [eb7de2a917df2680a0023151a9c1e0a49599d00e] | committer: Felix Paul 
Kühne

macosx: add custom linear progress indicator view

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   |  6 +++
 modules/gui/macosx/Makefile.am |  2 +
 .../gui/macosx/views/VLCLinearProgressIndicator.h  | 33 
 .../gui/macosx/views/VLCLinearProgressIndicator.m  | 61 ++
 po/POTFILES.in |  2 +
 5 files changed, 104 insertions(+)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj 
b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index 0dec0a06b3..6e7538ffa8 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -107,6 +107,7 @@
7D28E6392275B7340098D30E /* NSFont+VLCAdditions.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 7D28E6382275B7340098D30E /* 
NSFont+VLCAdditions.m */; };
7D2E0EDB20CD204D0033A221 /* VLCWindow.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 7D2E0ED920CD204D0033A221 /* VLCWindow.m */; };
7D2E0EDE20CD206F0033A221 /* VLCVideoWindowCommon.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D2E0EDD20CD206F0033A221 /* 
VLCVideoWindowCommon.m */; };
+   7D2FFA40227B8A5B0085D649 /* VLCLinearProgressIndicator.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 7D2FFA3F227B8A5B0085D649 /* 
VLCLinearProgressIndicator.m */; };
7D445D812202524000263D34 /* VLCPlaylistController.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 7D445D802202524000263D34 /* 
VLCPlaylistController.m */; };
7D445D842202524D00263D34 /* VLCPlaylistItem.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D445D832202524D00263D34 /* VLCPlaylistItem.m 
*/; };
7D445D872202574B00263D34 /* VLCPlaylistModel.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 7D445D862202574B00263D34 /* VLCPlaylistModel.m 
*/; };
@@ -459,6 +460,8 @@
7D2E0EDA20CD204D0033A221 /* VLCWindow.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
VLCWindow.h; sourceTree = ""; };
7D2E0EDC20CD206F0033A221 /* VLCVideoWindowCommon.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
VLCVideoWindowCommon.h; sourceTree = ""; };
7D2E0EDD20CD206F0033A221 /* VLCVideoWindowCommon.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= VLCVideoWindowCommon.m; sourceTree = ""; };
+   7D2FFA3E227B8A5B0085D649 /* VLCLinearProgressIndicator.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCLinearProgressIndicator.h; sourceTree = ""; };
+   7D2FFA3F227B8A5B0085D649 /* VLCLinearProgressIndicator.m */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCLinearProgressIndicator.m; sourceTree = ""; };
7D445D7F2202524000263D34 /* VLCPlaylistController.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
VLCPlaylistController.h; sourceTree = ""; };
7D445D802202524000263D34 /* VLCPlaylistController.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
VLCPlaylistController.m; sourceTree = ""; };
7D445D822202524D00263D34 /* VLCPlaylistItem.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCPlaylistItem.h; 
sourceTree = ""; };
@@ -818,6 +821,8 @@
1C1C62001F8260A90052DD4F /* 
VLCWrappableTextField.m */,
7DFBDCB5226CDFD600B700A5 /* VLCImageView.h */,
7DFBDCB6226CDFD600B700A5 /* VLCImageView.m */,
+   7D2FFA3E227B8A5B0085D649 /* 
VLCLinearProgressIndicator.h */,
+   7D2FFA3F227B8A5B0085D649 /* 
VLCLinearProgressIndicator.m */,
);
path = views;
sourceTree = "";
@@ -1685,6 +1690,7 @@
7D0F63FF2201F63400FDB91F /* 
VLCPlaylistTableCellView.m in Sources */,
1C3113D11E508C6900D4DD76 /* prefs.m in Sources 
*/,
1C3113D31E508C6900D4DD76 /* 
VLCResumeDialogController.m in Sources */,
+   7D2FFA40227B8A5B0085D649 /* 
VLCLinearProgressIndicator.m in Sources */,
7DFBDCB1226A518400B700A5 /* 
VLCLibraryMenuController.m in Sources */,
1C3113D51E508C6900D4DD76 /* 
VLCTextfieldPanelController.m in So

[vlc-commits] macosx: use https instead of http for links opened from within the application

2019-05-01 Thread Felix Paul Kühne
vlc/vlc-3.0 | branch: master | Felix Paul Kühne  | Fri Apr 19 
13:04:32 2019 +0200| [dade7d84b65ea85196bd4a65de62726e65be7bdf] | committer: 
David Fuhrmann

macosx: use https instead of http for links opened from within the application

(cherry picked from commit 9da6cedb6e69b77b617515f9bdcae6967bd825cf)
Signed-off-by: David Fuhrmann 

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

 modules/gui/macosx/VLCHelpWindowController.m | 2 +-
 modules/gui/macosx/VLCMainMenu.m | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/VLCHelpWindowController.m 
b/modules/gui/macosx/VLCHelpWindowController.m
index ed973de85e..9520e5aead 100644
--- a/modules/gui/macosx/VLCHelpWindowController.m
+++ b/modules/gui/macosx/VLCHelpWindowController.m
@@ -63,7 +63,7 @@
((OSX_YOSEMITE_AND_HIGHER) ? @"Helvetica Neue" 
: @"Lucida Grande"), _NS(I_LONGHELP)];
 
 [[helpWebView mainFrame] loadHTMLString:htmlWithStyle
-baseURL:[NSURL 
URLWithString:@"http://videolan.org;]];
+baseURL:[NSURL 
URLWithString:@"https://videolan.org;]];
 }
 
 - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
diff --git a/modules/gui/macosx/VLCMainMenu.m b/modules/gui/macosx/VLCMainMenu.m
index 0be5de87a0..736dd27b49 100644
--- a/modules/gui/macosx/VLCMainMenu.m
+++ b/modules/gui/macosx/VLCMainMenu.m
@@ -1301,28 +1301,28 @@
 
 - (IBAction)openDocumentation:(id)sender
 {
-NSURL *url = [NSURL URLWithString: @"http://www.videolan.org/doc/;];
+NSURL *url = [NSURL URLWithString: @"https://www.videolan.org/doc/;];
 
 [[NSWorkspace sharedWorkspace] openURL: url];
 }
 
 - (IBAction)openWebsite:(id)sender
 {
-NSURL *url = [NSURL URLWithString: @"http://www.videolan.org/;];
+NSURL *url = [NSURL URLWithString: @"https://www.videolan.org/;];
 
 [[NSWorkspace sharedWorkspace] openURL: url];
 }
 
 - (IBAction)openForum:(id)sender
 {
-NSURL *url = [NSURL URLWithString: @"http://forum.videolan.org/;];
+NSURL *url = [NSURL URLWithString: @"https://forum.videolan.org/;];
 
 [[NSWorkspace sharedWorkspace] openURL: url];
 }
 
 - (IBAction)openDonate:(id)sender
 {
-NSURL *url = [NSURL URLWithString: 
@"http://www.videolan.org/contribute.html#paypal;];
+NSURL *url = [NSURL URLWithString: 
@"https://www.videolan.org/contribute.html#paypal;];
 
 [[NSWorkspace sharedWorkspace] openURL: url];
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: fix compilation with legacy SDK versions

2019-04-29 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Mon Apr 29 19:38:22 
2019 +0200| [a30f1f9a409dcc9d0f1c039018d3be61d7d89a6b] | committer: Felix Paul 
Kühne

macosx: fix compilation with legacy SDK versions

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

 modules/gui/macosx/library/VLCLibraryCollectionViewItem.m | 1 +
 modules/gui/macosx/library/VLCLibraryWindow.m | 1 +
 2 files changed, 2 insertions(+)

diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m 
b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index 2e6275ccca..3a2b5dc9c3 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -23,6 +23,7 @@
 #import "VLCLibraryCollectionViewItem.h"
 
 #import "main/VLCMain.h"
+#import "main/CompatibilityFixes.h"
 #import "library/VLCLibraryController.h"
 #import "library/VLCLibraryModel.h"
 #import "library/VLCLibraryDataTypes.h"
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m 
b/modules/gui/macosx/library/VLCLibraryWindow.m
index 033189d9cc..ebbd8e8007 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -25,6 +25,7 @@
 #import "extensions/NSFont+VLCAdditions.h"
 #import "extensions/NSColor+VLCAdditions.h"
 #import "main/VLCMain.h"
+#import "main/CompatibilityFixes.h"
 
 #import "playlist/VLCPlaylistTableCellView.h"
 #import "playlist/VLCPlaylistController.h"

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


<    1   2   3   4   5   6   7   8   9   10   >