/*
 *  Sound.cpp
 *  iphone-gl-app
 *
 *  Created by John Ryland on 11/06/09.
 *  Copyright 2009 InvertedLogic. All rights reserved.
 *
 */

#include "Debug.h"
#include <AudioToolbox/AudioServices.h>
#include "Sound.h"
#include "FileSystem.h"


Sound::Sound(const char *file)
{
	File f(file);
	OSStatus error = AudioServicesCreateSystemSoundID(f.toMacURL_rel(), (SystemSoundID*)&dptr);
	if (error != kAudioServicesNoError) {
		// ### Error
	}
}


Sound::~Sound()
{
    AudioServicesDisposeSystemSoundID((SystemSoundID)dptr);
}


void Sound::play()
{
    AudioServicesPlaySystemSound((SystemSoundID)dptr);
}

