//
//  Wumbo-BGM.h
//  Wumbo
//
//  Created by Wade McGillis on 12/13/13.
//  Copyright (c) 2013 Wade McGillis. All rights reserved.
//

#ifndef __Wumbo__Wumbo_BGM__
#define __Wumbo__Wumbo_BGM__

#include "Wumbo-Header.h"
#include <string>
#include <vector>

#if PLATFORM_PC
#include <SFML/Audio.hpp>
#endif

#if PLATFORM_IOS
#include <UIKit/UIKit.h>
#include <AVFoundation/AVAudioPlayer.h>
//#import "Finch.h"
#endif

#if PLATFORM_IOS || PLATFORM_OSX
#include <Foundation/Foundation.h>
#endif

namespace Wumbo
{
	class BGM
	{
	private:
		int volume;
#if PLATFORM_WINDOWS || PLATFORM_OSX
		sf::SoundBuffer buffer;
		sf::Sound sound;
#elif PLATFORM_IOS
		AVAudioPlayer *sound;
#endif
	public:
		BGM();
		~BGM();
#if PLATFORM_OSX || PLATFORM_IOS
		void load(NSString *name);
#else
		void load(std::string name);
#endif
		void play();
		void loop();
		void stop();
		void pause();
		int length();
		void setVolume(int vol);
		bool isPlaying();
#if PLATFORM_IOS
		AVAudioPlayer *getSound();
#endif
	};
};

#endif /* defined(__Wumbo__Wumbo_BGM__) */
