src/music/music_driver.hpp
author translators
Sun, 30 Nov 2008 18:46:32 +0000
changeset 10395 6fe57f7c5d8d
parent 9111 48ce04029fe4
permissions -rw-r--r--
(svn r14646) -Update: WebTranslator2 update to 2008-11-30 18:46:24
esperanto - 4 fixed by Athaba (4)
finnish - 1 changed by SuomiPoika (1)
indonesian - 16 fixed, 4 changed by fanioz (20)
korean - 1 fixed by dlunch (1)
lithuanian - 57 fixed, 20 changed by Enternald (77)
macedonian - 140 fixed, 1 changed by simonkoco (34), zharko (107)
persian - 21 fixed by ali sattari (21)
serbian - 5 fixed by dejac (5)
/* $Id$ */

/** @file music_driver.hpp Base for all music playback. */

#ifndef MUSIC_MUSIC_DRIVER_HPP
#define MUSIC_MUSIC_DRIVER_HPP

#include "../driver.h"

class MusicDriver: public Driver {
public:
	virtual void PlaySong(const char *filename) = 0;

	virtual void StopSong() = 0;

	virtual bool IsSongPlaying() = 0;

	virtual void SetVolume(byte vol) = 0;
};

class MusicDriverFactoryBase: public DriverFactoryBase {
};

template <class T>
class MusicDriverFactory: public MusicDriverFactoryBase {
public:
	MusicDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_MUSIC, ((T *)this)->priority); }

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

extern MusicDriver *_music_driver;
extern char _ini_musicdriver[32];

#endif /* MUSIC_MUSIC_DRIVER_HPP */