Major developments to love.audio/love.sound. Music and Sound are gone. There are only Sources now, which is much cleaner.

The audio module was not really stable in 0.6.0, it takes very little messing around to cause OpenAL to do horrible things. It should now be much more stable,
and you *should* be able to play/stop/pause/resume/rewind/loop like a madman without disasters. Seek and tell, however, are still not tested and verified for
all decoders, but that's less important. Also, all objects now have object:type() and object:typeOf(), which returns the type name of the object,
and checks whether an object is of a certain type, respectively.
This commit is contained in:
rude
2010-01-31 11:52:54 +01:00
parent 8e74574544
commit 5b30c7fcfe
51 changed files with 894 additions and 1693 deletions
+27 -9
View File
@@ -23,7 +23,7 @@
// LOVE
#include <common/Object.h>
#include "Audible.h"
#include <common/StringMap.h>
namespace love
{
@@ -31,14 +31,23 @@ namespace audio
{
class Source : public Object
{
protected:
Audible * audible;
bool looping;
public:
Source();
enum Type
{
TYPE_STATIC = 1,
TYPE_STREAM,
TYPE_MAX_ENUM
}; // Type
protected:
Type type;
public:
Source(Type type);
virtual ~Source();
void setAudible(Audible * audible);
Audible * getAudible() const;
virtual Source * copy() = 0;
virtual void play() = 0;
virtual void stop() = 0;
@@ -46,6 +55,7 @@ namespace audio
virtual void resume() = 0;
virtual void rewind() = 0;
virtual bool isStopped() const = 0;
virtual bool isFinished() const = 0;
virtual void update() = 0;
virtual void setPitch(float pitch) = 0;
@@ -62,8 +72,16 @@ namespace audio
virtual void setDirection(float * v) = 0;
virtual void getDirection(float * v) const = 0;
void setLooping(bool looping);
bool isLooping() const;
virtual void setLooping(bool looping) = 0;
virtual bool isLooping() const = 0;
static bool getConstant(const char * in, Type & out);
static bool getConstant(Type in, const char *& out);
private:
static StringMap<Type, TYPE_MAX_ENUM>::Entry typeEntries[];
static StringMap<Type, TYPE_MAX_ENUM> types;
}; // Source