From 94798c245866af6393940920fa87c8559e6ba419 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Thu, 18 Aug 2016 07:27:07 +0200 Subject: [PATCH] Autolayout in the video view. --- Base.lproj/QueueItem.xib | 8 +- Classes/PropertyView/Base.lproj/EmptyView.xib | 4 +- Classes/PropertyView/Base.lproj/VideoView.xib | 877 ++++++++++-------- Classes/PropertyView/SBVideoViewController.m | 35 +- 4 files changed, 509 insertions(+), 415 deletions(-) diff --git a/Base.lproj/QueueItem.xib b/Base.lproj/QueueItem.xib index 475e37c..d8a963e 100644 --- a/Base.lproj/QueueItem.xib +++ b/Base.lproj/QueueItem.xib @@ -1,8 +1,8 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -72,7 +72,7 @@ - + diff --git a/Classes/PropertyView/Base.lproj/EmptyView.xib b/Classes/PropertyView/Base.lproj/EmptyView.xib index 6a0df22..e637409 100755 --- a/Classes/PropertyView/Base.lproj/EmptyView.xib +++ b/Classes/PropertyView/Base.lproj/EmptyView.xib @@ -1,8 +1,8 @@ - + - + diff --git a/Classes/PropertyView/Base.lproj/VideoView.xib b/Classes/PropertyView/Base.lproj/VideoView.xib index 8629100..b7aa881 100755 --- a/Classes/PropertyView/Base.lproj/VideoView.xib +++ b/Classes/PropertyView/Base.lproj/VideoView.xib @@ -1,423 +1,522 @@ - - + + - - + - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - You should only change the video profile if you want to load the file onto one of the devices listed and have been unable to do so. However, if the video file uses advanced features of the codec, then the file may still be unplayable on the device. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + You should only change the video profile if you want to load the file onto one of the devices listed and have been unable to do so. However, if the video file uses advanced features of the codec, then the file may still be unplayable on the device. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + diff --git a/Classes/PropertyView/SBVideoViewController.m b/Classes/PropertyView/SBVideoViewController.m index bed021e..7f3d2ca 100755 --- a/Classes/PropertyView/SBVideoViewController.m +++ b/Classes/PropertyView/SBVideoViewController.m @@ -10,6 +10,16 @@ #import "SBMediaTagsController.h" #import +@interface SBVideoViewController () + +@property (nonatomic, strong) IBOutlet NSView *forcedView; +@property (nonatomic, weak) IBOutlet NSLayoutConstraint *forcedHeight; + +@property (nonatomic, strong) IBOutlet NSView *profileView; +@property (nonatomic, weak) IBOutlet NSLayoutConstraint *profileHeight; + +@end + @implementation SBVideoViewController { MP42VideoTrack *track; @@ -34,20 +44,15 @@ IBOutlet NSPopUpButton *alternateGroup; IBOutlet NSPopUpButton *videoProfile; - IBOutlet NSTextField *videoProfileLabel; - IBOutlet NSTextField *videoProfileDescription; IBOutlet NSPopUpButton *forcedSubs; - IBOutlet NSTextField *forcedSubsLabel; - IBOutlet NSPopUpButton *forced; - IBOutlet NSTextField *forcedLabel; IBOutlet NSButton *preserveAspectRatio; IBOutlet NSMenuItem *profileLevelUnchanged; - NSMutableArray *_forced; + NSMutableArray *_forced; } static NSString *getProfileName(uint8_t profile) { @@ -137,20 +142,11 @@ static NSString *getLevelName(uint8_t level) { } } } else { - [videoProfile setEnabled:NO]; - [videoProfile setHidden:YES]; - [videoProfileLabel setHidden:YES]; - [videoProfileDescription setHidden:YES]; + self.profileView.hidden = YES; + self.profileHeight.constant = 0; } if ([track isKindOfClass:[MP42SubtitleTrack class]]) { - [forcedSubs setEnabled:YES]; - [forcedSubs setHidden:NO]; - [forcedSubsLabel setHidden:NO]; - - [forced setHidden:NO]; - [forcedLabel setHidden:NO]; - MP42SubtitleTrack * subTrack = (MP42SubtitleTrack*)track; if (!subTrack.someSamplesAreForced && !subTrack.allSamplesAreForced) { @@ -186,9 +182,8 @@ static NSString *getLevelName(uint8_t level) { [forced selectItemWithTag:selectedItem]; } else { - [forcedSubs setEnabled:NO]; - [forcedSubs setHidden:YES]; - [forcedSubsLabel setHidden:YES]; + self.forcedView.hidden = YES; + self.forcedHeight.constant = 0; } }