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

#ifndef __Wumbo_Sound_h__
#define __Wumbo_Sound_h__

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

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

#if PLATFORM_IOS
#include <UIKit/UIKit.h>
#include <AudioToolbox/AudioServices.h>
#include <Foundation/Foundation.h>
#include "Finch/Finch-Sound.h"
#endif

#if PLATFORM_APPLE
#import <Foundation/NSString.h>
#endif

namespace Wumbo
{
	class Sound
	{
	private:
		int volume;
	#if PLATFORM_PC
		sf::SoundBuffer buffer;
		std::vector<sf::Sound> soundbuffer;
	#elif PLATFORM_IOS
		std::vector<FinchSound*> soundbuffer;
	#endif
	public:
		Sound();
		~Sound();
	#if PLATFORM_APPLE
		void load(NSString *fname, int buffercount);
	#else
		void load(std::string fname, int buffercount);
	#endif
		void play();
		void loop();
		void stopAll();
		int length();
		void setVolume(int vol);
	};
};

#endif /* defined(__Wumbo__Wumbo_Sound__) */
