Commit 33f57d38 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Further unify coding style

parent 07f19af6
......@@ -90,7 +90,7 @@
#endif
NSArray *foundFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:directoryPath error:nil];
NSMutableArray *filePaths = [NSMutableArray arrayWithCapacity:[foundFiles count]];
for (NSString * fileName in foundFiles) {
for (NSString *fileName in foundFiles) {
if ([fileName rangeOfString:@"\\.(3gp|3gp|3gp2|3gpp|amv|asf|avi|divx|dv|flv|f4v|gvi|gxf|m1v|m2p|m2t|m2ts|m2v|m4v|mkv|moov|mov|mp2v|mp4|mpeg|mpeg1|mpeg2|mpeg4|mpg|mpv|mt2s|mts|mxf|oga|ogm|ogv|ogx|spx|ps|qt|rm|rmvb|ts|tts|vob|webm|wm|wmv)$" options:NSRegularExpressionSearch|NSCaseInsensitiveSearch].length != 0) {
[filePaths addObject:[directoryPath stringByAppendingPathComponent:fileName]];
}
......
......@@ -12,7 +12,7 @@
{
VLCMediaPlayer *_mediaPlayer;
UIView *_movieView;
UIBarButtonItem * _backButton;
UIBarButtonItem *_backButton;
UISlider *_positionSlider;
UIBarButtonItem *_timeDisplay;
UIButton *_playPauseButton;
......@@ -29,17 +29,17 @@
UIActionSheet *_audiotrackActionSheet;
}
@property (nonatomic, retain) IBOutlet UIView * movieView;
@property (nonatomic, retain) IBOutlet UIBarButtonItem * backButton;
@property (nonatomic, retain) IBOutlet UISlider * positionSlider;
@property (nonatomic, retain) IBOutlet UIBarButtonItem * timeDisplay;
@property (nonatomic, retain) IBOutlet UIButton * playPauseButton;
@property (nonatomic, retain) IBOutlet UIButton * bwdButton;
@property (nonatomic, retain) IBOutlet UIButton * fwdButton;
@property (nonatomic, retain) IBOutlet UIButton * subtitleSwitcherButton;
@property (nonatomic, retain) IBOutlet UIButton * audioSwitcherButton;
@property (nonatomic, retain) IBOutlet UIToolbar * toolbar;
@property (nonatomic, retain) IBOutlet UIView * controllerPanel;
@property (nonatomic, retain) IBOutlet UIView *movieView;
@property (nonatomic, retain) IBOutlet UIBarButtonItem *backButton;
@property (nonatomic, retain) IBOutlet UISlider *positionSlider;
@property (nonatomic, retain) IBOutlet UIBarButtonItem *timeDisplay;
@property (nonatomic, retain) IBOutlet UIButton *playPauseButton;
@property (nonatomic, retain) IBOutlet UIButton *bwdButton;
@property (nonatomic, retain) IBOutlet UIButton *fwdButton;
@property (nonatomic, retain) IBOutlet UIButton *subtitleSwitcherButton;
@property (nonatomic, retain) IBOutlet UIButton *audioSwitcherButton;
@property (nonatomic, retain) IBOutlet UIToolbar *toolbar;
@property (nonatomic, retain) IBOutlet UIView *controllerPanel;
@property (strong, nonatomic) MLFile *mediaItem;
......
......@@ -87,14 +87,15 @@
[self.navigationController setNavigationBarHidden:YES animated:YES];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackTranslucent;
if (self.mediaItem) {
self.title = [self.mediaItem title];
if (!self.mediaItem)
return;
[_mediaPlayer setMedia:[VLCMedia mediaWithURL:[NSURL URLWithString:self.mediaItem.url]]];
[_mediaPlayer play];
if (self.mediaItem.lastPosition && [self.mediaItem.lastPosition floatValue] < 0.99)
[_mediaPlayer setPosition:[self.mediaItem.lastPosition floatValue]];
}
self.title = [self.mediaItem title];
[_mediaPlayer setMedia:[VLCMedia mediaWithURL:[NSURL URLWithString:self.mediaItem.url]]];
[_mediaPlayer play];
if (self.mediaItem.lastPosition && [self.mediaItem.lastPosition floatValue] < 0.99)
[_mediaPlayer setPosition:[self.mediaItem.lastPosition floatValue]];
}
- (void)viewWillDisappear:(BOOL)animated
......@@ -202,7 +203,7 @@
- (IBAction)switchAudioTrack:(id)sender
{
_audiotrackActionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Choose Audio Track", @"audio track selector") delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles: nil];
NSArray * audioTracks = [_mediaPlayer audioTrackNames];
NSArray *audioTracks = [_mediaPlayer audioTrackNames];
NSUInteger count = [audioTracks count];
for (NSUInteger i = 0; i < count; i++)
[_audiotrackActionSheet addButtonWithTitle:[audioTracks objectAtIndex:i]];
......@@ -213,7 +214,7 @@
- (IBAction)switchSubtitleTrack:(id)sender
{
NSArray * spuTracks = [_mediaPlayer videoSubTitlesNames];
NSArray *spuTracks = [_mediaPlayer videoSubTitlesNames];
NSUInteger count = [spuTracks count];
if (count <= 1)
return;
......@@ -227,8 +228,8 @@
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
NSUInteger arrayIndex = 0;
NSArray * indexArray;
NSArray * namesArray;
NSArray *indexArray;
NSArray *namesArray;
if (actionSheet == _subtitleActionSheet) {
namesArray = _mediaPlayer.videoSubTitlesNames;
arrayIndex = [namesArray indexOfObject:[actionSheet buttonTitleAtIndex:buttonIndex]];
......
......@@ -10,8 +10,8 @@
@interface VLCPlaylistTableViewCell : UITableViewCell
{
UILabel * _titleLabel;
UILabel * _subtitleLabel;
UILabel *_titleLabel;
UILabel *_subtitleLabel;
UIImageView *_thumbnailView;
}
@property (nonatomic, retain) IBOutlet UILabel *titleLabel;
......
......@@ -16,7 +16,7 @@
NSArray *nibContentArray = [[NSBundle mainBundle] loadNibNamed:@"VLCPlaylistTableViewCell" owner:nil options:nil];
NSAssert([nibContentArray count] == 1, @"meh");
NSAssert([[nibContentArray lastObject] isKindOfClass:[VLCPlaylistTableViewCell class]], @"meh meh");
VLCPlaylistTableViewCell * cell = (VLCPlaylistTableViewCell *)[nibContentArray lastObject];
VLCPlaylistTableViewCell *cell = (VLCPlaylistTableViewCell *)[nibContentArray lastObject];
CGRect frame = [cell frame];
UIView *background = [[UIView alloc] initWithFrame:frame];
background.backgroundColor = [UIColor colorWithWhite:.05 alpha:1.];
......
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