1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00
Matej Jan b212fc7d44 Completed Accelerometer support.
MediaPlayer stop corrected.

git-svn-id: http://xni.googlecode.com/svn/XNI@61 ac433895-eea3-a490-d80a-17149a75e588
2011-02-18 13:53:30 +00:00

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