Skip to content
Snippets Groups Projects
Commit 9489908e authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

macosx/library: display playback progress

parent eb7de2a9
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@
<outlet property="mediaImageView" destination="2aB-sB-hfY" id="Sv0-G1-KNm"/>
<outlet property="mediaTitleTextField" destination="OBS-Eh-1mT" id="h1n-PU-IAx"/>
<outlet property="playInstantlyButton" destination="S3I-5Z-qgS" id="JlC-bE-i5Y"/>
<outlet property="progressIndicator" destination="dFt-oZ-h9P" id="JC6-gk-Mid"/>
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
</connections>
</customObject>
......@@ -25,6 +26,12 @@
<customView translatesAutoresizingMaskIntoConstraints="NO" id="2aB-sB-hfY" customClass="VLCImageView">
<rect key="frame" x="0.0" y="46" width="256" height="168"/>
<subviews>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="dFt-oZ-h9P" customClass="VLCLinearProgressIndicator">
<rect key="frame" x="0.0" y="0.0" width="256" height="10"/>
<constraints>
<constraint firstAttribute="height" constant="10" id="lyQ-kl-gVk"/>
</constraints>
</customView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="S3I-5Z-qgS">
<rect key="frame" x="96" y="52" width="64" height="64"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="libraryPlay" imagePosition="only" alignment="center" inset="2" id="IHP-p1-d0R">
......@@ -45,9 +52,12 @@
</textField>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="dFt-oZ-h9P" secondAttribute="bottom" id="4q3-3S-7PA"/>
<constraint firstItem="S3I-5Z-qgS" firstAttribute="centerX" secondItem="2aB-sB-hfY" secondAttribute="centerX" id="Seo-tS-piW"/>
<constraint firstAttribute="height" constant="168" id="Vrp-AD-scC"/>
<constraint firstItem="S3I-5Z-qgS" firstAttribute="centerY" secondItem="2aB-sB-hfY" secondAttribute="centerY" id="ZWU-oW-OVa"/>
<constraint firstItem="dFt-oZ-h9P" firstAttribute="leading" secondItem="2aB-sB-hfY" secondAttribute="leading" id="gTe-sx-hdP"/>
<constraint firstAttribute="trailing" secondItem="dFt-oZ-h9P" secondAttribute="trailing" id="kBI-UU-vnc"/>
</constraints>
</customView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OBS-Eh-1mT">
......
......@@ -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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment