#ifndef _MUSICSOUND_H_
#define _MUSICSOUND_H_

#include "allegro.h"
#include <alogg/alogg.h>
#include <string>
using namespace std;

//stop/fade out songs when they finish
//accept commands to fade music/start new music

class MusicSound {
 public:
  MusicSound ();

  int initAudio ();

  void playMusic (string *); //starts playing the given song.
  void fadeMusic (); //fade the current music (note: audiostream -> voice returns the int voice of it, so you can do stuff to it., like void voice_set_volume (voice, volume)
  void playSfx (SAMPLE *, int pan, int freq);
  void updateMusic ();
  void stopMusic ();
  void pauseMusic ();
  void restartMusic ();

  ~MusicSound ();

  int getVolumeGlobal ();
  int getVolumeMusic ();
  int getVolumeSfx ();

  void setVolumeGlobal (int);
  void setVolumeMusic (int);
  void setVolumeSfx (int);

 protected:
  bool soundInit;

  int volGlobal;
  int volMusic;
  int volSfx;

  int musicFreq;

  alogg_stream * musicPlaying;
  alogg_stream * musicQueued;

  bool beginFading;
  bool doneFading;

  string * musicPlayingFilename;
};

#endif
