[vlc-commits] macosx/library: clean info panel output

Felix Paul Kühne git at videolan.org
Sun Jan 26 15:00:02 CET 2020


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sun Jan 26 14:20:24 2020 +0100| [2601a1725db3e65f5d809023bcb1bd44197cb5bd] | committer: Felix Paul Kühne

macosx/library: clean info panel output

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

 .../gui/macosx/library/VLCLibraryInformationPanel.m   | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/modules/gui/macosx/library/VLCLibraryInformationPanel.m b/modules/gui/macosx/library/VLCLibraryInformationPanel.m
index bed9cb05af..793105f6d3 100644
--- a/modules/gui/macosx/library/VLCLibraryInformationPanel.m
+++ b/modules/gui/macosx/library/VLCLibraryInformationPanel.m
@@ -47,20 +47,16 @@
 
 - (void)updateRepresentation
 {
-    NSMutableString *textContent = [[NSMutableString alloc] initWithFormat:@"ID: %lli\n", _representedMediaItem.libraryID];
-    [textContent appendFormat:@"Title: %@\n", _representedMediaItem.title];
+    NSMutableString *textContent = [[NSMutableString alloc] initWithFormat:@"Title: '%@', ID: %lli\n", _representedMediaItem.title, _representedMediaItem.libraryID];
     if (_representedMediaItem.mediaSubType != VLC_ML_MEDIA_SUBTYPE_UNKNOWN) {
         [textContent appendFormat:@"Type: %@ — %@\n", _representedMediaItem.readableMediaType, _representedMediaItem.readableMediaSubType];
     } else {
         [textContent appendFormat:@"Type: %@\n", _representedMediaItem.readableMediaType];
     }
     [textContent appendFormat:@"Duration: %@\n", [NSString stringWithTime:_representedMediaItem.duration / VLCMediaLibraryMediaItemDurationDenominator]];
-    [textContent appendFormat:@"Play count: %u\n", _representedMediaItem.playCount];
-    [textContent appendFormat:@"Last played: %@\n", [NSDateFormatter localizedStringFromDate:[NSDate dateWithTimeIntervalSince1970:_representedMediaItem.lastPlayedDate]
-                                                                                 dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle]];
+    [textContent appendFormat:@"Play count: %u, last played: %@\n", _representedMediaItem.playCount, [NSDateFormatter localizedStringFromDate:[NSDate dateWithTimeIntervalSince1970:_representedMediaItem.lastPlayedDate] dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle]];
     [textContent appendFormat:@"Small artwork generated? %@\n", _representedMediaItem.smallArtworkGenerated == YES ? _NS("Yes") : _NS("No")];
-    [textContent appendFormat:@"Favorited? %@\n", _representedMediaItem.smallArtworkGenerated == YES ? _NS("Yes") : _NS("No")];
-    [textContent appendFormat:@"Playback progress: %2.f%%\n", _representedMediaItem.lastPlaybackPosition * 100.];
+    [textContent appendFormat:@"Favorited? %@, Playback progress: %2.f%%\n", _representedMediaItem.smallArtworkGenerated == YES ? _NS("Yes") : _NS("No"), _representedMediaItem.lastPlaybackPosition * 100.];
 
     NSArray *array = _representedMediaItem.files;
     NSUInteger count = array.count;
@@ -77,8 +73,7 @@
     for (NSUInteger x = 0; x < count; x++) {
         VLCMediaLibraryTrack *track = array[x];
         [textContent appendFormat:@"Type: %@\n", track.readableTrackType];
-        [textContent appendFormat:@"Codec: %@\n", track.codec];
-        [textContent appendFormat:@"Bitrate: %u\n", track.bitrate];
+        [textContent appendFormat:@"Codec: %@ (%@) @ %u kB/s\n", track.readableCodecName, track.codec, track.bitrate / 1024 / 8];
         if (track.language.length > 0) {
             [textContent appendFormat:@"Language: %@\n", track.language];
         }
@@ -87,11 +82,9 @@
         }
 
         if (track.trackType == VLC_ML_TRACK_TYPE_AUDIO) {
-            [textContent appendFormat:@"Number of Channels: %u\n", track.numberOfAudioChannels];
-            [textContent appendFormat:@"Sample rate: %u\n", track.audioSampleRate];
+            [textContent appendFormat:@"Number of Channels: %u, Sample rate: %u\n", track.numberOfAudioChannels, track.audioSampleRate];
         } else if (track.trackType == VLC_ML_TRACK_TYPE_VIDEO) {
-            [textContent appendFormat:@"Dimensions: %ux%u px\n", track.videoWidth, track.videoHeight];
-            [textContent appendFormat:@"Aspect-Ratio: %2.f\n", (float)track.sourceAspectRatio / track.sourceAspectRatioDenominator];
+            [textContent appendFormat:@"Dimensions: %ux%u px, Aspect-Ratio: %2.f\n", track.videoWidth, track.videoHeight, (float)track.sourceAspectRatio / track.sourceAspectRatioDenominator];
             [textContent appendFormat:@"Framerate: %2.f\n", (float)track.frameRate / track.frameRateDenominator];;
         }
         [textContent appendString:@"\n"];



More information about the vlc-commits mailing list