mirror of
https://github.com/thes3m/XNI
synced 2024-12-26 13:26:06 +01:00
MediaPlayer stop corrected. git-svn-id: http://xni.googlecode.com/svn/XNI@61 ac433895-eea3-a490-d80a-17149a75e588
39 lines
548 B
Objective-C
39 lines
548 B
Objective-C
//
|
|
// Song.m
|
|
// XNI
|
|
//
|
|
// Created by Matej Jan on 18.1.11.
|
|
// Copyright 2011 Retronator. All rights reserved.
|
|
//
|
|
|
|
#import "Song.h"
|
|
#import "Song+Internal.h"
|
|
|
|
@implementation Song
|
|
|
|
- (id) initWithUrl:(NSURL*)url
|
|
{
|
|
self = [super init];
|
|
if (self != nil) {
|
|
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (NSTimeInterval) duration {
|
|
return audioPlayer.duration;
|
|
}
|
|
|
|
- (AVAudioPlayer *) audioPlayer {
|
|
return audioPlayer;
|
|
}
|
|
|
|
- (void) dealloc
|
|
{
|
|
[audioPlayer release];
|
|
[super dealloc];
|
|
}
|
|
|
|
|
|
@end
|