src/sound/sound_driver.hpp
author rubidium
Fri, 05 Dec 2008 18:02:04 +0000
changeset 10405 fb6f4c4476a6
parent 10380 f4adb9648a93
permissions -rw-r--r--
(svn r14656) -Change: replace instances of x & S_IFREG with S_ISREG(x) as S_IFREG can be 0 on some platforms.
/* $Id$ */

/** @file sound_driver.hpp Base for all sound drivers. */

#ifndef SOUND_SOUND_DRIVER_HPP
#define SOUND_SOUND_DRIVER_HPP

#include "../driver.h"

class SoundDriver: public Driver {
public:
	/* Called once every tick */
	virtual void MainLoop() {}
};

class SoundDriverFactoryBase: public DriverFactoryBase {
};

template <class T>
class SoundDriverFactory: public SoundDriverFactoryBase {
public:
	SoundDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_SOUND, ((T *)this)->priority); }

	/**
	 * Get the long, human readable, name for the Driver-class.
	 */
	const char *GetName();
};

extern SoundDriver *_sound_driver;
extern char _ini_sounddriver[32];

#endif /* SOUND_SOUND_DRIVER_HPP */