zengine/include/ZE_ZMusic.h

73 lines
1.8 KiB
C
Raw Permalink Normal View History

2003-11-24 22:20:49 +00:00
/*******************************************************************************
This file is Part of the ZEngine Library for 2D game development.
Copyright (C) 2002-2004 James Turk
2003-11-24 22:20:49 +00:00
Licensed under a BSD-style license.
The maintainer of this library is James Turk (james@conceptofzero.net)
and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/
#ifndef __ze_zmusic_h__
#define __ze_zmusic_h__
#include "ZE_ZEngine.h"
2004-01-13 23:59:32 +00:00
#include "ZE_ZAudioBase.h"
2003-11-24 22:20:49 +00:00
namespace ZE
{
2004-01-02 10:37:18 +00:00
2004-01-13 23:59:32 +00:00
#if SND_BACKEND == ZE_MIXER
class ZMusic
2003-11-24 22:20:49 +00:00
{
2004-01-13 23:59:32 +00:00
protected:
ZEngine* rEngine;
Mix_Music *rMusic;
2003-11-24 22:20:49 +00:00
public:
2004-01-13 23:59:32 +00:00
static const int LoopInfinite;
2003-11-24 22:20:49 +00:00
ZMusic();
ZMusic(std::string filename);
2004-01-13 23:59:32 +00:00
virtual ~ZMusic();
2003-11-24 22:20:49 +00:00
void Open(std::string filename);
2004-01-13 23:59:32 +00:00
//void OpenFromZip(std::string zipname, std::string filename);
void OpenFromZRF(std::string resourceId);
void Release();
void Play(int loopNum=0, int fadeTime=0) const;
void Pause() const;
void Unpause() const;
void Rewind() const;
void Stop(int fadeTime=0) const;
void SetVolume(int volume);
void SetPosition(int position);
bool IsLoaded() const;
bool IsPlaying() const;
bool IsPaused() const;
bool IsSeekable() const;
int GetVolume() const;
2003-11-24 22:20:49 +00:00
};
2004-01-13 23:59:32 +00:00
#elif SND_BACKEND == ZE_AUDIERE
class ZMusic : public ZAudioBase
{
public:
ZMusic();
ZMusic(std::string filename);
void Open(std::string filename);
void OpenFromZip(std::string zipname, std::string filename);
void OpenFromZRF(std::string resourceId);
};
2003-11-24 22:20:49 +00:00
2004-01-13 23:59:32 +00:00
#endif //SND_BACKEND
}
2003-11-24 22:20:49 +00:00
#endif //__ze_zmusic_h__