Commit dcfa0ee6 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Implement a basic media library and playback on iPad

parent 582efa4e
......@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
7D33D41617182615008AF0E0 /* VLCMovieViewController~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D33D41517182615008AF0E0 /* VLCMovieViewController~ipad.xib */; };
7D6B07BC1716C9B8003280C4 /* AQGridView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07A61716C9B8003280C4 /* AQGridView.m */; };
7D6B07BD1716C9B8003280C4 /* AQGridViewAnimatorItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07AA1716C9B8003280C4 /* AQGridViewAnimatorItem.m */; };
7D6B07BE1716C9B8003280C4 /* AQGridViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07AC1716C9B8003280C4 /* AQGridViewCell.m */; };
......@@ -17,6 +18,7 @@
7D6B07C31716C9B8003280C4 /* NSIndexSet+AQIndexesOutsideSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07B71716C9B8003280C4 /* NSIndexSet+AQIndexesOutsideSet.m */; };
7D6B07C41716C9B8003280C4 /* NSIndexSet+AQIsSetContiguous.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07B91716C9B8003280C4 /* NSIndexSet+AQIsSetContiguous.m */; };
7D6B07C51716C9B8003280C4 /* UIColor+AQGridView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07BB1716C9B8003280C4 /* UIColor+AQGridView.m */; };
7D6B07F71716D45C003280C4 /* VLCPlaylistGridViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07F61716D45B003280C4 /* VLCPlaylistGridViewCell.m */; };
7D94FCDF16DE7D1000F2623B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D94FCDE16DE7D1000F2623B /* UIKit.framework */; };
7D94FCE116DE7D1000F2623B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D94FCE016DE7D1000F2623B /* Foundation.framework */; };
7D94FCE316DE7D1000F2623B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D94FCE216DE7D1000F2623B /* CoreGraphics.framework */; };
......@@ -38,10 +40,9 @@
A79246A7170F0ED20036AAF2 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A7924698170F0ED20036AAF2 /* Default-568h@2x.png */; };
A79246A8170F0ED20036AAF2 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = A7924699170F0ED20036AAF2 /* Default.png */; };
A79246A9170F0ED20036AAF2 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A792469A170F0ED20036AAF2 /* Default@2x.png */; };
A79246C1170F114E0036AAF2 /* VLCMovieViewController~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = A79246BC170F114E0036AAF2 /* VLCMovieViewController~ipad.xib */; };
A79246C1170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = A79246BC170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib */; };
A79246C2170F114E0036AAF2 /* VLCMovieViewController~iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = A79246BD170F114E0036AAF2 /* VLCMovieViewController~iphone.xib */; };
A79246C3170F114E0036AAF2 /* VLCPlaylistTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A79246BE170F114E0036AAF2 /* VLCPlaylistTableViewCell.xib */; };
A79246C4170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = A79246BF170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib */; };
A79246C5170F114E0036AAF2 /* VLCPlaylistViewController~iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = A79246C0170F114E0036AAF2 /* VLCPlaylistViewController~iphone.xib */; };
A79246C8170F11DF0036AAF2 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A79246C6170F11DF0036AAF2 /* Localizable.strings */; };
A7CB0DB11716F72600050CF3 /* PlayingExternally@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = A7CB0DAD1716F72600050CF3 /* PlayingExternally@2x~iphone.png */; };
......@@ -64,6 +65,7 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
7D33D41517182615008AF0E0 /* VLCMovieViewController~ipad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "VLCMovieViewController~ipad.xib"; path = "Resources/VLCMovieViewController~ipad.xib"; sourceTree = SOURCE_ROOT; };
7D6B07A51716C9B8003280C4 /* AQGridView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AQGridView.h; path = ImportedSources/AQGridView/Classes/AQGridView.h; sourceTree = SOURCE_ROOT; };
7D6B07A61716C9B8003280C4 /* AQGridView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AQGridView.m; path = ImportedSources/AQGridView/Classes/AQGridView.m; sourceTree = SOURCE_ROOT; };
7D6B07A71716C9B8003280C4 /* AQGridView+CellLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AQGridView+CellLayout.h"; path = "ImportedSources/AQGridView/Classes/AQGridView+CellLayout.h"; sourceTree = SOURCE_ROOT; };
......@@ -87,6 +89,8 @@
7D6B07B91716C9B8003280C4 /* NSIndexSet+AQIsSetContiguous.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSIndexSet+AQIsSetContiguous.m"; path = "ImportedSources/AQGridView/Classes/NSIndexSet+AQIsSetContiguous.m"; sourceTree = SOURCE_ROOT; };
7D6B07BA1716C9B8003280C4 /* UIColor+AQGridView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIColor+AQGridView.h"; path = "ImportedSources/AQGridView/Classes/UIColor+AQGridView.h"; sourceTree = SOURCE_ROOT; };
7D6B07BB1716C9B8003280C4 /* UIColor+AQGridView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIColor+AQGridView.m"; path = "ImportedSources/AQGridView/Classes/UIColor+AQGridView.m"; sourceTree = SOURCE_ROOT; };
7D6B07F51716D45B003280C4 /* VLCPlaylistGridViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCPlaylistGridViewCell.h; sourceTree = "<group>"; };
7D6B07F61716D45B003280C4 /* VLCPlaylistGridViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCPlaylistGridViewCell.m; sourceTree = "<group>"; };
7D94FCDB16DE7D1000F2623B /* AspenProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AspenProject.app; sourceTree = BUILT_PRODUCTS_DIR; };
7D94FCDE16DE7D1000F2623B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
7D94FCE016DE7D1000F2623B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
......@@ -117,10 +121,9 @@
A7924698170F0ED20036AAF2 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
A7924699170F0ED20036AAF2 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
A792469A170F0ED20036AAF2 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
A79246BC170F114E0036AAF2 /* VLCMovieViewController~ipad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "VLCMovieViewController~ipad.xib"; path = "Resources/VLCMovieViewController~ipad.xib"; sourceTree = SOURCE_ROOT; };
A79246BC170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "VLCPlaylistViewController~ipad.xib"; path = "Resources/VLCPlaylistViewController~ipad.xib"; sourceTree = SOURCE_ROOT; };
A79246BD170F114E0036AAF2 /* VLCMovieViewController~iphone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "VLCMovieViewController~iphone.xib"; path = "Resources/VLCMovieViewController~iphone.xib"; sourceTree = SOURCE_ROOT; };
A79246BE170F114E0036AAF2 /* VLCPlaylistTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = VLCPlaylistTableViewCell.xib; path = Resources/VLCPlaylistTableViewCell.xib; sourceTree = SOURCE_ROOT; };
A79246BF170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "VLCPlaylistViewController~ipad.xib"; path = "Resources/VLCPlaylistViewController~ipad.xib"; sourceTree = SOURCE_ROOT; };
A79246C0170F114E0036AAF2 /* VLCPlaylistViewController~iphone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "VLCPlaylistViewController~iphone.xib"; path = "Resources/VLCPlaylistViewController~iphone.xib"; sourceTree = SOURCE_ROOT; };
A79246C7170F11DF0036AAF2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
A79246C9170F11E40036AAF2 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
......@@ -260,6 +263,8 @@
7D94FCFA16DE7D1100F2623B /* VLCMovieViewController.m */,
7DA62099170A0CE500643D11 /* VLCPlaylistTableViewCell.h */,
7DA6209A170A0CE500643D11 /* VLCPlaylistTableViewCell.m */,
7D6B07F51716D45B003280C4 /* VLCPlaylistGridViewCell.h */,
7D6B07F61716D45B003280C4 /* VLCPlaylistGridViewCell.m */,
A7DA16CF171083DF00D6FED9 /* VLCExternalDisplayController.h */,
A7DA16D0171083DF00D6FED9 /* VLCExternalDisplayController.m */,
7DADC5601704FACC001DAC63 /* Imported */,
......@@ -284,11 +289,11 @@
isa = PBXGroup;
children = (
7DBC3B431711FC6C00DCF688 /* VLCAboutViewController~iphone.xib */,
A79246BC170F114E0036AAF2 /* VLCMovieViewController~ipad.xib */,
A79246BD170F114E0036AAF2 /* VLCMovieViewController~iphone.xib */,
A79246BE170F114E0036AAF2 /* VLCPlaylistTableViewCell.xib */,
A79246BF170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib */,
A79246C0170F114E0036AAF2 /* VLCPlaylistViewController~iphone.xib */,
7D33D41517182615008AF0E0 /* VLCMovieViewController~ipad.xib */,
A79246BC170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib */,
);
name = XIBs;
sourceTree = "<group>";
......@@ -398,10 +403,9 @@
A79246A7170F0ED20036AAF2 /* Default-568h@2x.png in Resources */,
A79246A8170F0ED20036AAF2 /* Default.png in Resources */,
A79246A9170F0ED20036AAF2 /* Default@2x.png in Resources */,
A79246C1170F114E0036AAF2 /* VLCMovieViewController~ipad.xib in Resources */,
A79246C1170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib in Resources */,
A79246C2170F114E0036AAF2 /* VLCMovieViewController~iphone.xib in Resources */,
A79246C3170F114E0036AAF2 /* VLCPlaylistTableViewCell.xib in Resources */,
A79246C4170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib in Resources */,
A79246C5170F114E0036AAF2 /* VLCPlaylistViewController~iphone.xib in Resources */,
A79246C8170F11DF0036AAF2 /* Localizable.strings in Resources */,
7DBC3B311711DB1E00DCF688 /* Aspen.png in Resources */,
......@@ -415,6 +419,7 @@
A7CB0DB21716F72600050CF3 /* PlayingExternally~iphone.png in Resources */,
A7CB0DB31716F72600050CF3 /* PlayingExternally~ipad.png in Resources */,
A7CB0DB41716F72600050CF3 /* PlayingExternally@2x~ipad.png in Resources */,
7D33D41617182615008AF0E0 /* VLCMovieViewController~ipad.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -443,6 +448,7 @@
7D6B07C31716C9B8003280C4 /* NSIndexSet+AQIndexesOutsideSet.m in Sources */,
7D6B07C41716C9B8003280C4 /* NSIndexSet+AQIsSetContiguous.m in Sources */,
7D6B07C51716C9B8003280C4 /* UIColor+AQGridView.m in Sources */,
7D6B07F71716D45C003280C4 /* VLCPlaylistGridViewCell.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -26,27 +26,11 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
_playlistViewController = [[VLCPlaylistViewController alloc] initWithNibName:@"VLCPlaylistViewController" bundle:nil];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:_playlistViewController] autorelease];
self.window.rootViewController = self.navigationController;
} else {
_playlistViewController = [[VLCPlaylistViewController alloc] initWithNibName:@"VLCPlaylistViewController" bundle:nil];
UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:_playlistViewController] autorelease];
VLCMovieViewController *movieViewController = [[[VLCMovieViewController alloc] initWithNibName:@"VLCMovieViewController" bundle:nil] autorelease];
UINavigationController *movieNavigationController = [[[UINavigationController alloc] initWithRootViewController:movieViewController] autorelease];
_playlistViewController.movieViewController = movieViewController;
self.splitViewController = [[[UISplitViewController alloc] init] autorelease];
self.splitViewController.delegate = movieViewController;
self.splitViewController.viewControllers = @[masterNavigationController, movieNavigationController];
_playlistViewController = [[VLCPlaylistViewController alloc] initWithNibName:@"VLCPlaylistViewController" bundle:nil];
self.window.rootViewController = self.splitViewController;
}
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:_playlistViewController] autorelease];
self.window.rootViewController = self.navigationController;
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
[self.window makeKeyAndVisible];
......
//
// VLCGridViewCell.h
// AspenProject
//
// Created by Felix Paul Kühne on 11.04.13.
// Copyright (c) 2013 VideoLAN. All rights reserved.
//
#import "AQGridViewCell.h"
@interface VLCPlaylistGridViewCell : AQGridViewCell
{
UILabel *_titleLabel;
UILabel *_subtitleLabel;
UIImageView *_thumbnailView;
}
@property (nonatomic, copy) UIImage *thumbnail;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *subtitle;
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier;
@end
//
// VLCGridViewCell.m
// AspenProject
//
// Created by Felix Paul Kühne on 11.04.13.
// Copyright (c) 2013 VideoLAN. All rights reserved.
//
#import "VLCPlaylistGridViewCell.h"
@interface VLCPlaylistGridViewCell (Hack)
@property (nonatomic, retain) NSString * reuseIdentifier;
@end
@implementation VLCPlaylistGridViewCell
- (void)dealloc
{
[_thumbnailView release];
[_titleLabel release];
[_subtitleLabel release];
[super dealloc];
}
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier];
if (self == nil)
return nil;
_thumbnailView = [[UIImageView alloc] initWithFrame:CGRectZero];
_titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_titleLabel.highlightedTextColor = [UIColor whiteColor];
_titleLabel.textColor = [UIColor colorWithWhite:.95 alpha:1.];
_titleLabel.font = [UIFont boldSystemFontOfSize:12.];
_titleLabel.adjustsFontSizeToFitWidth = YES;
_titleLabel.minimumFontSize = 10.;
_subtitleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_subtitleLabel.highlightedTextColor = [UIColor whiteColor];
_subtitleLabel.textColor = [UIColor colorWithWhite:.95 alpha:1.];
_subtitleLabel.font = [UIFont systemFontOfSize:9.];
_subtitleLabel.adjustsFontSizeToFitWidth = YES;
_subtitleLabel.minimumFontSize = 8.;
self.backgroundColor = [UIColor colorWithWhite:.5 alpha:1.];
self.contentView.backgroundColor = self.backgroundColor;
_thumbnailView.backgroundColor = self.backgroundColor;
_titleLabel.backgroundColor = self.backgroundColor;
_subtitleLabel.backgroundColor = self.backgroundColor;
[self.contentView addSubview:_thumbnailView];
[self.contentView addSubview:_titleLabel];
[self.contentView addSubview:_subtitleLabel];
return self;
}
- (UIImage *)thumbnail
{
return _thumbnailView.image;
}
- (void)setThumbnail:(UIImage *)newThumb
{
_thumbnailView.image = newThumb;
[self setNeedsLayout];
}
- (NSString *)title
{
return _titleLabel.text;
}
- (void)setTitle:(NSString *)newTitle
{
_titleLabel.text = newTitle;
[self setNeedsLayout];
}
- (NSString *)subtitle
{
return @"";
}
- (void)setSubtitle:(NSString *)newSubtitle
{
_subtitleLabel.text = newSubtitle;
[self setNeedsLayout];
}
- (void)layoutSubviews
{
[super layoutSubviews];
CGSize imageSize = _thumbnailView.image.size;
CGRect bounds = CGRectInset(self.contentView.bounds, 10., 10.);
[_titleLabel sizeToFit];
CGRect frame = _titleLabel.frame;
frame.size.width = MIN(frame.size.width, bounds.size.width);
frame.origin.y = CGRectGetMaxY(bounds) - frame.size.height - 15.;
frame.origin.x = floorf((bounds.size.width - frame.size.width) * 0.5);
_titleLabel.frame = frame;
[_subtitleLabel sizeToFit];
frame = _subtitleLabel.frame;
frame.size.width = MIN(frame.size.width, bounds.size.width);
frame.origin.y = CGRectGetMaxY(bounds) - frame.size.height;
frame.origin.x = floorf((bounds.size.width - frame.size.width) * 0.5);
_subtitleLabel.frame = frame;
bounds.size.height = frame.origin.y - bounds.origin.y;
if ((imageSize.width <= bounds.size.width) && (imageSize.height <= bounds.size.height))
return;
CGFloat hRatio = bounds.size.width / imageSize.width;
CGFloat vRatio = bounds.size.height / imageSize.height;
CGFloat ratio = MIN(hRatio, vRatio);
[_thumbnailView sizeToFit];
frame = _thumbnailView.frame;
frame.size.width = floorf(imageSize.width * ratio);
frame.size.height = floorf(imageSize.height * ratio);
frame.origin.x = floorf((bounds.size.width - frame.size.width) * 0.5);
frame.origin.y = floorf((bounds.size.height - frame.size.height) * 0.5);
_thumbnailView.frame = frame;
}
@end
......@@ -7,15 +7,26 @@
//
#import <UIKit/UIKit.h>
#import "AQGridView.h"
@class VLCMovieViewController;
@class VLCAboutViewController;
@interface VLCPlaylistViewController : UITableViewController
@interface VLCPlaylistViewController : UIViewController <AQGridViewDataSource, AQGridViewDelegate, UITableViewDataSource, UITableViewDelegate>
{
UITableView *_tableView;
AQGridView *_gridview;
}
@property (strong, nonatomic) VLCMovieViewController *movieViewController;
@property (strong, nonatomic) VLCAboutViewController *aboutViewController;
@property (nonatomic, retain) IBOutlet UITableView *tableView;
@property (nonatomic, retain) IBOutlet UIBarButtonItem *ipadAboutButton;
@property (nonatomic, retain) IBOutlet AQGridView *gridView;
@property (nonatomic, retain) IBOutlet UIToolbar *ipadToolBar;
- (void)updateViewContents;
@end
......@@ -9,6 +9,7 @@
#import "VLCPlaylistViewController.h"
#import "VLCMovieViewController.h"
#import "VLCPlaylistTableViewCell.h"
#import "VLCPlaylistGridViewCell.h"
#import "VLCAboutViewController.h"
@interface VLCPlaylistViewController () {
......@@ -17,22 +18,23 @@
@end
@implementation VLCPlaylistViewController
@synthesize ipadAboutButton=_ipadAboutButton, gridView=_gridview, ipadToolBar=_ipadToolBar;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = @"Aspen";
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
self.clearsSelectionOnViewWillAppear = NO;
self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0);
}
}
return self;
}
- (void)dealloc
{
[_tableView release];
[_ipadAboutButton release];
[_ipadToolBar release];
[_gridview release];
[_aboutViewController release];
[_movieViewController release];
[_foundMedia release];
......@@ -71,7 +73,10 @@
_foundMedia = [[NSMutableArray arrayWithArray:[MLFile allFiles]] retain];
[self.tableView reloadData];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
[self.tableView reloadData];
else
[self.gridView reloadData];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
......@@ -109,39 +114,60 @@
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
[_foundMedia removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
}
}
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
MLFile *mediaObject = _foundMedia[indexPath.row];
if (!self.movieViewController) {
self.movieViewController = [[[VLCMovieViewController alloc] initWithNibName:@"VLCMovieViewController" bundle:nil] autorelease];
}
self.movieViewController.mediaItem = mediaObject;
[self.navigationController pushViewController:self.movieViewController animated:YES];
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
#pragma mark - AQGridView
- (NSUInteger)numberOfItemsInGridView:(AQGridView *)gridView
{
// Return NO if you do not want the item to be re-orderable.
return YES;
return _foundMedia.count;
}
*/
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- (AQGridViewCell *)gridView:(AQGridView *)gridView cellForItemAtIndex:(NSUInteger)index
{
MLFile *mediaObject = _foundMedia[indexPath.row];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
if (!self.movieViewController) {
self.movieViewController = [[[VLCMovieViewController alloc] initWithNibName:@"VLCMovieViewController" bundle:nil] autorelease];
}
self.movieViewController.mediaItem = mediaObject;
[self.navigationController pushViewController:self.movieViewController animated:YES];
} else
self.movieViewController.mediaItem = mediaObject;
static NSString *AQCellIdentifier = @"AQCell";
VLCPlaylistGridViewCell *cell = (VLCPlaylistGridViewCell *)[gridView dequeueReusableCellWithIdentifier:AQCellIdentifier];
if (cell == nil) {
cell = [[VLCPlaylistGridViewCell alloc] initWithFrame:CGRectMake(0.0, 0.0, 384.,216.) reuseIdentifier:AQCellIdentifier];
cell.selectionStyle = AQGridViewCellSelectionStyleBlueGray;
}
MLFile *object = _foundMedia[index];
cell.title = object.title;
cell.subtitle = [NSString stringWithFormat:@"%@ — %.2f MB", [VLCTime timeWithNumber:[object duration]], [object fileSizeInBytes] / 2e6];
cell.thumbnail = object.computedThumbnail;
return cell;
}
- (CGSize)portraitGridCellSizeForGridView:(AQGridView *)gridView
{
static CGSize cellSize = { 384., 216. };
return cellSize;
}
- (void)gridView:(AQGridView *)gridView didSelectItemAtIndex:(NSUInteger)index
{
MLFile *mediaObject = _foundMedia[index];
if (!self.movieViewController) {
self.movieViewController = [[[VLCMovieViewController alloc] initWithNibName:@"VLCMovieViewController" bundle:nil] autorelease];
}
self.movieViewController.mediaItem = mediaObject;
[self.navigationController pushViewController:self.movieViewController animated:YES];
}
#pragma mark - UI implementation
......
......@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1552</int>
<string key="IBDocument.SystemVersion">12C3104</string>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">2083</string>
......@@ -44,7 +44,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 49}, {120, 120}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="347055423"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
......@@ -59,7 +58,6 @@
<int key="NSvFlags">289</int>
<string key="NSFrame">{{160, 64}, {140, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
......@@ -90,7 +88,6 @@
<int key="NSvFlags">289</int>
<string key="NSFrame">{{160, 87}, {140, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="564366035"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
......@@ -118,7 +115,6 @@
<int key="NSvFlags">289</int>
<string key="NSFrame">{{160, 116}, {140, 32}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="856471446"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
......@@ -141,7 +137,6 @@
<int key="NSvFlags">274</int>
<string key="NSFrame">{{0, 233}, {320, 315}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
......@@ -181,7 +176,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 177}, {280, 48}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="832811267"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
......@@ -207,7 +201,6 @@ IEvDvGhuZSBhbmQgR2xlYiBQaW5pZ2luDURlc2lnbiBieSBEYW1pZW4gRXJhbWJlcnQ</string>
<array class="NSMutableArray" key="NSSubviews"/>
<string key="NSFrameSize">{320, 44}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
......@@ -231,7 +224,6 @@ IEvDvGhuZSBhbmQgR2xlYiBQaW5pZ2luDURlc2lnbiBieSBEYW1pZW4gRXJhbWJlcnQ</string>
</array>
<string key="NSFrame">{{0, 20}, {320, 548}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="690699265"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUIScreenMetrics" key="IBUISimulatedDestinationMetrics">
......@@ -417,53 +409,7 @@ IEvDvGhuZSBhbmQgR2xlYiBQaW5pZ2luDURlc2lnbiBieSBEYW1pZW4gRXJhbWJlcnQ</string>
<nil key="sourceID"/>
<int key="maxID">112</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">VLCAboutViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">dismiss:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">dismiss:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">dismiss:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="aspenVersion">UILabel</string>
<string key="dismissButton">UIBarButtonItem</string>
<string key="textContents">UITextView</string>
<string key="vlckitVersion">UILabel</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="aspenVersion">
<string key="name">aspenVersion</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="dismissButton">
<string key="name">dismissButton</string>
<string key="candidateClassName">UIBarButtonItem</string>
</object>
<object class="IBToOneOutletInfo" key="textContents">
<string key="name">textContents</string>
<string key="candidateClassName">UITextView</string>
</object>
<object class="IBToOneOutletInfo" key="vlckitVersion">
<string key="name">vlckitVersion</string>
<string key="candidateClassName">UILabel</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/VLCAboutViewController.h</string>
</object>
</object>
</array>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
......
......@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1552</int>
<string key="IBDocument.SystemVersion">12C3104</string>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">2083</string>
......@@ -47,7 +47,7 @@
<string key="NSFrameSize">{768, 1004}</string>
<reference key="NSSuperview" ref="647120888"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="753155309"/>
<reference key="NSNextKeyView" ref="189908447"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor" id="503819652">
<int key="NSColorSpace">3</int>
......@@ -117,7 +117,7 @@
<string key="NSFrame">{{51, 303}, {298, 53}}</string>
<reference key="NSSuperview" ref="753155309"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="189908447"/>
<reference key="NSNextKeyView" ref="734589612"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<reference key="IBUIBackgroundColor" ref="8046438"/>
<bool key="IBUIOpaque">NO</bool>
......@@ -169,7 +169,7 @@
<string key="NSFrame">{{67, 11}, {628, 23}}</string>
<reference key="NSSuperview" ref="189908447"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="734589612"/>
<reference key="NSNextKeyView" ref="753155309"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSHuggingPriority">{250, 250}</string>
<bool key="IBUIOpaque">NO</bool>
......@@ -182,7 +182,7 @@
<float key="IBUIValue">0.5</float>
</object>
</array>
<string key="NSFrameSize">{768, 44}</string>
<string key="NSFrame">{{0, 20}, {768, 44}}</string>
<reference key="NSSuperview" ref="647120888"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1012531257"/>
......@@ -499,6 +499,68 @@
</object>
<int key="connectionID">133</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">closePlayback:</string>
<reference key="source" ref="270679370"/>
<reference key="destination" ref="841351856"/>
</object>
<int key="connectionID">134</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">positionSliderAction:</string>
<reference key="source" ref="1012531257"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">13</int>
</object>
<int key="connectionID">135</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">forward:</string>
<reference key="source" ref="1020021014"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">139</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">backward:</string>
<reference key="source" ref="627610352"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">137</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">play:</string>
<reference key="source" ref="606697150"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">138</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">switchAudioTrack:</string>
<reference key="source" ref="121962198"/>