cog/Plugins/CueSheet/CueSheetTrack.m

97 lines
2.1 KiB
Matlab
Raw Normal View History

2007-10-09 02:25:40 +00:00
//
// CueSheetTrack.m
// CueSheet
//
// Created by Zaphod Beeblebrox on 10/8/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import "CueSheetTrack.h"
@implementation CueSheetTrack
+ (id)trackWithURL:(NSURL *)u track:(NSString *)t time:(double)s timeInSamples:(BOOL)tis artist:(NSString *)a album:(NSString *)b title:(NSString *)l genre:(NSString *)g year:(NSString *)y albumGain:(float)albumGain albumPeak:(float)albumPeak trackGain:(float)trackGain trackPeak:(float)trackPeak {
return [[CueSheetTrack alloc] initWithURL:u track:t time:s timeInSamples:tis artist:a album:b title:l genre:g year:y albumGain:albumGain albumPeak:albumPeak trackGain:trackGain trackPeak:trackPeak];
}
- (id)initWithURL:(NSURL *)u track:(NSString *)t time:(double)s timeInSamples:(BOOL)tis artist:(NSString *)a album:(NSString *)b title:(NSString *)l genre:(NSString *)g year:(NSString *)y albumGain:(float)albumGain albumPeak:(float)albumPeak trackGain:(float)trackGain trackPeak:(float)trackPeak {
2007-10-09 02:25:40 +00:00
self = [super init];
if(self) {
2007-10-09 02:25:40 +00:00
track = [t copy];
url = [u copy];
2007-10-13 01:07:19 +00:00
artist = [a copy];
album = [b copy];
title = [l copy];
genre = [g copy];
year = [y copy];
time = s;
timeInSamples = tis;
self->albumGain = albumGain;
self->albumPeak = albumPeak;
self->trackGain = trackGain;
self->trackPeak = trackPeak;
2007-10-09 02:25:40 +00:00
}
2007-10-09 02:25:40 +00:00
return self;
}
- (NSString *)track {
2007-10-09 02:25:40 +00:00
return track;
}
- (NSURL *)url {
return url;
2007-10-09 02:25:40 +00:00
}
- (double)time {
return time;
2007-10-09 02:25:40 +00:00
}
- (BOOL)timeInSamples {
return timeInSamples;
}
- (NSString *)artist {
2007-10-13 01:07:19 +00:00
return artist;
}
- (NSString *)album {
2007-10-13 01:07:19 +00:00
return album;
}
- (NSString *)title {
2007-10-13 01:07:19 +00:00
return title;
}
- (NSString *)genre {
2007-10-13 01:07:19 +00:00
return genre;
}
- (NSString *)year {
2007-10-13 01:07:19 +00:00
return year;
}
- (float)albumGain {
return albumGain;
}
- (float)albumPeak {
return albumPeak;
}
- (float)trackGain {
return trackGain;
}
- (float)trackPeak {
return trackPeak;
}
- (NSString *)description {
return [NSString stringWithFormat:@"CueSheetTrack{track: %@, url: %@, artist: %@, album: %@, title: %@, genre: %@, year: %@}", track, [url absoluteURL], artist, album, title, genre, year];
2013-10-11 13:20:08 +00:00
}
2007-10-13 01:07:19 +00:00
2007-10-09 02:25:40 +00:00
@end