Commit 86a3cfb9 authored by Carola Nitz's avatar Carola Nitz

renamed the PlaylistViewController to LibraryViewController since it was never...

renamed the PlaylistViewController to LibraryViewController since it was never a playlist in the first place
parent 9bf2b264
......@@ -17,14 +17,14 @@
#import "VLCMenuTableViewController.h"
#import "VLCDownloadViewController.h"
@class VLCPlaylistViewController;
@class VLCLibraryViewController;
@class VLCPlayerDisplayController;
extern NSString *const VLCDropboxSessionWasAuthorized;
@interface VLCAppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic, readonly) VLCPlaylistViewController *playlistViewController;
@property (nonatomic, readonly) VLCLibraryViewController *libraryViewController;
@property (nonatomic, readonly) VLCPlayerDisplayController *playerDisplayController;
......
......@@ -20,7 +20,7 @@
#import "VLCMediaFileDiscoverer.h"
#import "NSString+SupportedMedia.h"
#import "UIDevice+VLC.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCHTTPUploaderController.h"
#import "VLCMigrationViewController.h"
#import <BoxSDK/BoxSDK.h>
......@@ -121,9 +121,9 @@ NSString *const VLCDropboxSessionWasAuthorized = @"VLCDropboxSessionWasAuthorize
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// enable crash preventer
void (^setupBlock)() = ^{
_playlistViewController = [[VLCPlaylistViewController alloc] init];
_libraryViewController = [[VLCLibraryViewController alloc] init];
VLCSidebarController *sidebarVC = [VLCSidebarController sharedInstance];
VLCNavigationController *navCon = [[VLCNavigationController alloc] initWithRootViewController:_playlistViewController];
VLCNavigationController *navCon = [[VLCNavigationController alloc] initWithRootViewController:_libraryViewController];
sidebarVC.contentViewController = navCon;
_playerDisplayController = [[VLCPlayerDisplayController alloc] init];
......@@ -206,10 +206,10 @@ continueUserActivity:(NSUserActivity *)userActivity
if (libraryMode <= VLCLibraryModeAllSeries) {
[[VLCSidebarController sharedInstance] selectRowAtIndexPath:[NSIndexPath indexPathForRow:libraryMode inSection:0]
scrollPosition:UITableViewScrollPositionTop];
[self.playlistViewController setLibraryMode:(VLCLibraryMode)libraryMode];
[self.libraryViewController setLibraryMode:(VLCLibraryMode)libraryMode];
}
[self.playlistViewController restoreUserActivityState:userActivity];
[self.libraryViewController restoreUserActivityState:userActivity];
_isComingFromHandoff = YES;
return YES;
}
......@@ -235,7 +235,7 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
return YES;
}
if (_playlistViewController && url != nil) {
if (_libraryViewController && url != nil) {
APLog(@"%@ requested %@ to be opened", sourceApplication, url);
if (url.isFileURL) {
......@@ -334,7 +334,7 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
- (void)applicationWillResignActive:(UIApplication *)application
{
_passcodeValidated = NO;
[self.playlistViewController setEditing:NO animated:NO];
[self.libraryViewController setEditing:NO animated:NO];
[self validatePasscode];
[[MLMediaLibrary sharedMediaLibrary] applicationWillExit];
}
......@@ -369,14 +369,14 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
// TODO Should we update media db after adding new files?
[sharedLibrary updateMediaDatabase];
[_playlistViewController updateViewContents];
[_libraryViewController updateViewContents];
}
}
- (void)mediaFileDeleted:(NSString *)name
{
[[MLMediaLibrary sharedMediaLibrary] updateMediaDatabase];
[_playlistViewController updateViewContents];
[_libraryViewController updateViewContents];
}
#pragma mark - pass code validation
......@@ -384,7 +384,7 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
- (void)passcodeWasValidated:(NSNotification *)aNotifcation
{
_passcodeValidated = YES;
[self.playlistViewController updateViewContents];
[self.libraryViewController updateViewContents];
if ([VLCPlaybackController sharedInstance].isPlaying)
[_playerDisplayController pushPlaybackView];
}
......
......@@ -13,7 +13,7 @@
#import "VLCDocumentPickerController.h"
#import <MobileCoreServices/MobileCoreServices.h>
#import "VLCMediaFileDiscoverer.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
@interface VLCDocumentPickerController () <UIDocumentMenuDelegate, UIDocumentPickerDelegate>
......
......@@ -12,7 +12,7 @@
#import "VLCFolderCollectionViewFlowLayout.h"
#import <objc/runtime.h>
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
//framrate were motion appears fluent
#define LX_FRAMES_PER_SECOND 60.0
......@@ -259,7 +259,7 @@ static NSString * const kLXCollectionViewKeyPath = @"collectionView";
- (void)handleLongPressGesture:(UILongPressGestureRecognizer *)gestureRecognizer {
//keeps the controller from dragging while not in editmode
if (!((VLCPlaylistViewController *)self.delegate).isEditing) return;
if (!((VLCLibraryViewController *)self.delegate).isEditing) return;
switch(gestureRecognizer.state) {
case UIGestureRecognizerStateBegan: {
......@@ -378,7 +378,7 @@ static NSString * const kLXCollectionViewKeyPath = @"collectionView";
NSIndexPath *newIndexPath = [self.collectionView indexPathForItemAtPoint:_currentView.center];
NSIndexPath *currentIndexPath = _selectedItemIndexPath;
if (newIndexPath != nil && ![currentIndexPath isEqual:newIndexPath] && ((VLCPlaylistViewController *)self.delegate).isEditing) {
if (newIndexPath != nil && ![currentIndexPath isEqual:newIndexPath] && ((VLCLibraryViewController *)self.delegate).isEditing) {
[UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
_currentView.transform = CGAffineTransformMakeScale(0.1f, 0.1f);
_currentView.center = [self layoutAttributesForItemAtIndexPath:newIndexPath].center;
......
/*****************************************************************************
* VLCPlaylistViewController.h
* VLCLibraryViewController.h
* VLC for iOS
*****************************************************************************
* Copyright (c) 2013 VideoLAN. All rights reserved.
......@@ -19,7 +19,7 @@
@class EmptyLibraryView;
@interface VLCPlaylistViewController : UIViewController <UITabBarDelegate, UIPopoverControllerDelegate>
@interface VLCLibraryViewController : UIViewController <UITabBarDelegate, UIPopoverControllerDelegate>
- (IBAction)leftButtonAction:(id)sender;
......
/*****************************************************************************
* VLCPlaylistViewController.m
* VLCLibraryViewController.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2013-2015 VideoLAN. All rights reserved.
......@@ -14,7 +14,7 @@
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCMovieViewController.h"
#import "VLCPlaylistTableViewCell.h"
#import "VLCPlaylistCollectionViewCell.h"
......@@ -45,7 +45,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
@end
@interface VLCPlaylistViewController () <VLCFolderCollectionViewDelegateFlowLayout, LXReorderableCollectionViewDataSource, LXReorderableCollectionViewDelegateFlowLayout, UITableViewDataSource, UITableViewDelegate, MLMediaLibrary, VLCMediaListDelegate, UISearchBarDelegate, UISearchDisplayDelegate> {
@interface VLCLibraryViewController () <VLCFolderCollectionViewDelegateFlowLayout, LXReorderableCollectionViewDataSource, LXReorderableCollectionViewDelegateFlowLayout, UITableViewDataSource, UITableViewDelegate, MLMediaLibrary, VLCMediaListDelegate, UISearchBarDelegate, UISearchDisplayDelegate> {
NSMutableArray *_foundMedia;
VLCLibraryMode _libraryMode;
VLCLibraryMode _previousLibraryMode;
......@@ -74,7 +74,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
@end
@implementation VLCPlaylistViewController
@implementation VLCLibraryViewController
- (void)dealloc
{
......@@ -255,28 +255,20 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
- (void)openMediaObject:(NSManagedObject *)mediaObject
{
if ([mediaObject isKindOfClass:[MLAlbum class]]) {
if ([mediaObject isKindOfClass:[MLAlbum class]] || [mediaObject isKindOfClass:[MLShow class]]) {
BOOL isAlbum = [mediaObject isKindOfClass:[MLAlbum class]];
NSArray* array = isAlbum ? [(MLAlbum *)mediaObject sortedTracks] : [(MLShow *)mediaObject sortedEpisodes];
@synchronized(self) {
_foundMedia = [NSMutableArray arrayWithArray:[(MLAlbum *)mediaObject sortedTracks]];
_foundMedia = [NSMutableArray arrayWithArray:array];
}
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(backToAllItems:)];
if (_libraryMode == VLCLibraryModeAllFiles)
self.navigationItem.leftBarButtonItem.title = NSLocalizedString(@"BUTTON_BACK", nil);
else
[self.navigationItem.leftBarButtonItem setTitle:NSLocalizedString(@"LIBRARY_MUSIC", nil)];
[self.navigationItem.leftBarButtonItem setTitle: isAlbum ? NSLocalizedString(@"LIBRARY_MUSIC", nil) : NSLocalizedString(@"LIBRARY_SERIES", nil)];
self.title = [(MLAlbum*)mediaObject name];
[self reloadViews];
} else if ([mediaObject isKindOfClass:[MLShow class]]) {
@synchronized(self) {
_foundMedia = [NSMutableArray arrayWithArray:[(MLShow *)mediaObject sortedEpisodes]];
}
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(backToAllItems:)];
if (_libraryMode == VLCLibraryModeAllFiles)
self.navigationItem.leftBarButtonItem.title = NSLocalizedString(@"BUTTON_BACK", nil);
else
[self.navigationItem.leftBarButtonItem setTitle:NSLocalizedString(@"LIBRARY_SERIES", nil)];
self.title = [(MLShow*)mediaObject name];
[self reloadViews];
} else if ([mediaObject isKindOfClass:[MLLabel class]]) {
MLLabel *folder = (MLLabel*) mediaObject;
_inFolder = YES;
......@@ -685,7 +677,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
else
selectedObject = _foundMedia[indexPath.row];
if (_searchDisplayController.active == YES)
if (_searchDisplayController.active)
[_searchDisplayController setActive:NO animated:NO];
[self openMediaObject:selectedObject];
......
......@@ -16,7 +16,7 @@
#import "VLCPlexWebAPI.h"
#import "VLCNetworkListCell.h"
#import "VLCPlaybackController.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCDownloadViewController.h"
#import "NSString+SupportedMedia.h"
#import "VLCStatusLabel.h"
......
......@@ -13,7 +13,7 @@
#import "VLCMediaFileDiscoverer.h"
#import "NSString+SupportedMedia.h"
#import "VLCAppDelegate.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
const float MediaTimerInterval = 2.f;
......@@ -297,7 +297,7 @@ const float MediaTimerInterval = 2.f;
}
}
[[MLMediaLibrary sharedMediaLibrary] addFilePaths:filePaths];
[[(VLCAppDelegate *)[UIApplication sharedApplication].delegate playlistViewController] updateViewContents];
[[(VLCAppDelegate *)[UIApplication sharedApplication].delegate libraryViewController] updateViewContents];
}
@end
......@@ -28,7 +28,7 @@
#import "VLCOpenNetworkStreamViewController.h"
#import "VLCSettingsController.h"
#import "VLCAboutViewController.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCBugreporter.h"
#import "VLCCloudServicesTableViewController.h"
#import "VLCNavigationController.h"
......@@ -328,8 +328,8 @@
} else if (itemIndex == 1)
viewController = [[VLCAboutViewController alloc] init];
} else {
viewController = appDelegate.playlistViewController;
[(VLCPlaylistViewController *)viewController setLibraryMode:(int)itemIndex];
viewController = appDelegate.libraryViewController;
[(VLCLibraryViewController *)viewController setLibraryMode:(int)itemIndex];
}
if (!viewController)
......
......@@ -13,7 +13,7 @@
#import "VLCMiniPlaybackView.h"
#import "VLCPlaybackController.h"
#import "VLCAppDelegate.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCPlayerDisplayController.h"
#import "VLCKeychainCoordinator.h"
......
......@@ -14,7 +14,7 @@
#import "VLCOpenNetworkStreamViewController.h"
#import "VLCPlaybackController.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCMenuTableViewController.h"
#import "UIDevice+VLC.h"
......
......@@ -23,7 +23,7 @@
#import <MediaPlayer/MediaPlayer.h>
#import "VLCThumbnailsCache.h"
#import <WatchKit/WatchKit.h>
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCKeychainCoordinator.h"
NSString *const VLCPlaybackControllerPlaybackDidStart = @"VLCPlaybackControllerPlaybackDidStart";
......@@ -256,7 +256,7 @@ NSString *const VLCPlaybackControllerPlaybackDidFail = @"VLCPlaybackControllerPl
[media synchronousParse];
[media addOptions:self.mediaOptionsDictionary];
}
if (self.mediaList) {
[_listPlayer setMediaList:self.mediaList];
} else {
......
......@@ -14,7 +14,7 @@
*****************************************************************************/
#import "VLCPlaylistCollectionViewCell.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCThumbnailsCache.h"
#import "NSString+SupportedMedia.h"
......@@ -306,7 +306,7 @@
} else
self.titleLabel.text = mediaFile.title;
VLCPlaylistViewController *delegate = (VLCPlaylistViewController*)self.collectionView.delegate;
VLCLibraryViewController *delegate = (VLCLibraryViewController*)self.collectionView.delegate;
if (delegate.isEditing)
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@", [VLCTime timeWithNumber:[mediaFile duration]], [NSByteCountFormatter stringFromByteCount:[mediaFile fileSizeInBytes] countStyle:NSByteCountFormatterCountStyleFile]];
......
......@@ -13,7 +13,7 @@
*****************************************************************************/
#import "VLCSettingsController.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "IASKSettingsReader.h"
#import "IASKAppSettingsViewController.h"
#import "PAPasscodeViewController.h"
......
......@@ -14,7 +14,7 @@
#import "VLCSharedLibraryParser.h"
#import "VLCNetworkListCell.h"
#import "VLCPlaybackController.h"
#import "VLCPlaylistViewController.h"
#import "VLCLibraryViewController.h"
#import "VLCDownloadViewController.h"
#import "NSString+SupportedMedia.h"
#import "VLCStatusLabel.h"
......
......@@ -107,7 +107,7 @@
7D378492183A98BF009EE944 /* VLCExternalDisplayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D378491183A98BF009EE944 /* VLCExternalDisplayController.m */; };
7D378499183A98D1009EE944 /* VLCPlaylistCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D378494183A98D1009EE944 /* VLCPlaylistCollectionViewCell.m */; };
7D37849A183A98D1009EE944 /* VLCPlaylistTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D378496183A98D1009EE944 /* VLCPlaylistTableViewCell.m */; };
7D37849B183A98D1009EE944 /* VLCPlaylistViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D378498183A98D1009EE944 /* VLCPlaylistViewController.m */; };
7D37849B183A98D1009EE944 /* VLCLibraryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D378498183A98D1009EE944 /* VLCLibraryViewController.m */; };
7D37849E183A98DD009EE944 /* VLCThumbnailsCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D37849D183A98DD009EE944 /* VLCThumbnailsCache.m */; };
7D3784A1183A98EB009EE944 /* VLCBugreporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D3784A0183A98EB009EE944 /* VLCBugreporter.m */; };
7D3784A6183A98F5009EE944 /* VLCAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D3784A3183A98F5009EE944 /* VLCAboutViewController.m */; };
......@@ -492,8 +492,8 @@
7D378494183A98D1009EE944 /* VLCPlaylistCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCPlaylistCollectionViewCell.m; path = Sources/VLCPlaylistCollectionViewCell.m; sourceTree = SOURCE_ROOT; };
7D378495183A98D1009EE944 /* VLCPlaylistTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCPlaylistTableViewCell.h; path = Sources/VLCPlaylistTableViewCell.h; sourceTree = SOURCE_ROOT; };
7D378496183A98D1009EE944 /* VLCPlaylistTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCPlaylistTableViewCell.m; path = Sources/VLCPlaylistTableViewCell.m; sourceTree = SOURCE_ROOT; };
7D378497183A98D1009EE944 /* VLCPlaylistViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCPlaylistViewController.h; path = Sources/VLCPlaylistViewController.h; sourceTree = SOURCE_ROOT; };
7D378498183A98D1009EE944 /* VLCPlaylistViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCPlaylistViewController.m; path = Sources/VLCPlaylistViewController.m; sourceTree = SOURCE_ROOT; };
7D378497183A98D1009EE944 /* VLCLibraryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCLibraryViewController.h; path = Sources/VLCLibraryViewController.h; sourceTree = SOURCE_ROOT; };
7D378498183A98D1009EE944 /* VLCLibraryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCLibraryViewController.m; path = Sources/VLCLibraryViewController.m; sourceTree = SOURCE_ROOT; };
7D37849C183A98DD009EE944 /* VLCThumbnailsCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCThumbnailsCache.h; path = Sources/VLCThumbnailsCache.h; sourceTree = SOURCE_ROOT; };
7D37849D183A98DD009EE944 /* VLCThumbnailsCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCThumbnailsCache.m; path = Sources/VLCThumbnailsCache.m; sourceTree = SOURCE_ROOT; };
7D37849F183A98EB009EE944 /* VLCBugreporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCBugreporter.h; path = Sources/VLCBugreporter.h; sourceTree = SOURCE_ROOT; };
......@@ -1148,8 +1148,8 @@
7D378494183A98D1009EE944 /* VLCPlaylistCollectionViewCell.m */,
7D378495183A98D1009EE944 /* VLCPlaylistTableViewCell.h */,
7D378496183A98D1009EE944 /* VLCPlaylistTableViewCell.m */,
7D378497183A98D1009EE944 /* VLCPlaylistViewController.h */,
7D378498183A98D1009EE944 /* VLCPlaylistViewController.m */,
7D378497183A98D1009EE944 /* VLCLibraryViewController.h */,
7D378498183A98D1009EE944 /* VLCLibraryViewController.m */,
8F91EC77195CEC7900F5BCBA /* VLCOpenInActivity.h */,
8F91EC78195CEC7900F5BCBA /* VLCOpenInActivity.m */,
7D37849C183A98DD009EE944 /* VLCThumbnailsCache.h */,
......@@ -1996,7 +1996,7 @@
7D378499183A98D1009EE944 /* VLCPlaylistCollectionViewCell.m in Sources */,
DD8F84311B00EB3B0009138A /* VLCPlaybackController+MediaLibrary.m in Sources */,
7D37849A183A98D1009EE944 /* VLCPlaylistTableViewCell.m in Sources */,
7D37849B183A98D1009EE944 /* VLCPlaylistViewController.m in Sources */,
7D37849B183A98D1009EE944 /* VLCLibraryViewController.m in Sources */,
7DAE0C3A1B2F085F00C53996 /* VLCDiscoveryListViewController.m in Sources */,
7D37849E183A98DD009EE944 /* VLCThumbnailsCache.m in Sources */,
7D3784A1183A98EB009EE944 /* VLCBugreporter.m in Sources */,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment