Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c66a493e22
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (55 sloc) 2.709 kb
//
// SMFAssetPreviewController.m
// SMFramework
//
// Created by Thomas Cool on 2/8/11.
// Copyright 2011 tomcool.org. All rights reserved.
//
#import "SMFAssetPreviewController.h"
static NSString * const kSMFMovieTitle = @"title";
static NSString * const kSMFMovieSubtitle = @"substitle";
static NSString * const kSMFMovieSummary = @"summary";
static NSString * const kSMFMoviePoster = @"poster";
static NSString * const kSMFMovieHeaders = @"headers";
static NSString * const kSMFMovieColumns = @"columns";
static NSString * const kSMFMovieRating = @"rating";
@implementation SMFAssetPreviewController
@synthesize asset;
-(NSMutableDictionary *)getInformation
{
NSMutableDictionary *d = [[NSMutableDictionary alloc]initWithObjectsAndKeys:
@"",kSMFMovieTitle,
@"",kSMFMovieSubtitle,
@"(no summary)",kSMFMovieSummary,
[NSArray array],kSMFMovieHeaders,
[NSArray array],kSMFMovieColumns,
[BRImage imageWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"colorAppleTVNameImage" ofType:@"png"]],kSMFMoviePoster,
@"pg",kSMFMovieRating,
nil];
if ([asset isKindOfClass:[BRBaseMediaAsset class]]) {
NSString *t = [self.asset title];
if (t!=nil) {[d setObject:t forKey:kSMFMovieTitle];}
t = [self.asset publisher];
if (t!=nil) {[d setObject:t forKey:kSMFMovieSubtitle];}
t = [self.asset mediaSummary];
if (t!=nil) {[d setObject:t forKey:kSMFMovieSummary];}
if ([asset respondsToSelector:@selector(coverArt)]) {
BRImage *i = [(BRPhotoMediaAsset *)self.asset coverArt];
if (i==nil) [d setObject:i forKey:kSMFMoviePoster];
}
NSArray *a = [NSArray arrayWithObjects:@"Details",@"Actors",@"Director",@"Producers",nil];
[d setObject:a forKey:kSMFMovieHeaders];
NSArray *cast = [self.asset cast];
if (cast==nil) cast=[NSArray array];
NSArray *directors = [self.asset directors];
if (directors==nil) directors=[NSArray array];
NSArray *producers = [self.asset producers];
if (producers==nil) producers=[NSArray array];
a=[NSArray arrayWithObjects:[NSArray array],cast,directors,producers,nil];
[d setObject:a forKey:kSMFMovieColumns];
t = [self.asset rating];
if (t!=nil) {[d setObject:t forKey:kSMFMovieRating];}
}
return [d autorelease];
}
@end
Jump to Line
Something went wrong with that request. Please try again.