zengine/include/ZE_ZAudioBase.h

66 lines
1.7 KiB
C
Raw Normal View History

2004-01-02 10:37:18 +00:00
/*******************************************************************************
This file is Part of the ZEngine Library for 2D game development.
Copyright (C) 2002-2004 James Turk
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
*******************************************************************************/
2004-01-13 23:52:01 +00:00
#ifndef __ze_zaudiobase_h__
#define __ze_zaudiobase_h__
2004-01-02 10:37:18 +00:00
#include "ZE_ZEngine.h"
2004-01-13 23:52:01 +00:00
#if SND_BACKEND == ZE_AUDIERE
2004-01-02 10:37:18 +00:00
namespace ZE
{
2004-01-13 23:52:01 +00:00
class ZAudioBase
2004-01-02 10:37:18 +00:00
{
protected:
2004-01-13 23:52:01 +00:00
ZEngine* rEngine;
2004-01-02 10:37:18 +00:00
audiere::AudioDevicePtr rDevice;
audiere::OutputStreamPtr rStream;
2004-01-13 23:52:01 +00:00
int rPausePos;
2004-01-02 10:37:18 +00:00
public:
2004-01-13 23:52:01 +00:00
ZAudioBase();
virtual ~ZAudioBase();
2004-01-02 10:37:18 +00:00
virtual void Open(std::string filename)=0;
2004-01-13 23:52:01 +00:00
virtual void OpenFromZip(std::string zipname, std::string filename)=0;
virtual void OpenFromZRF(std::string resourceId)=0;
//void Release();
2004-01-02 10:37:18 +00:00
void Play(bool loop=false);
2004-01-13 23:52:01 +00:00
void Pause();
void Unpause();
void Rewind();
2004-01-02 10:37:18 +00:00
void Stop();
2004-01-13 23:52:01 +00:00
void SetVolume(int volume);
2004-01-02 10:37:18 +00:00
void SetPan(float pan);
void SetPitch(float pitch);
void SetPosition(int position);
void SetPosition(float posPercent);
bool IsLoaded() const;
bool IsPlaying() const;
2004-01-13 23:52:01 +00:00
bool IsPaused() const;
2004-01-02 10:37:18 +00:00
bool IsSeekable() const;
2004-01-13 23:52:01 +00:00
int GetVolume() const;
2004-01-02 10:37:18 +00:00
float GetPan() const;
float GetPitch() const;
int GetPosition() const;
int GetLength() const;
};
}
2004-01-13 23:52:01 +00:00
#endif //ZE_AUDIERE
2004-01-02 10:37:18 +00:00
2004-01-13 23:52:01 +00:00
#endif //__ze_zaudiobase_h__