author | terom@frrb.lan |
Fri, 19 Dec 2008 01:38:09 +0200 | |
changeset 10439 | 50f056aa3024 |
parent 10380 | f4adb9648a93 |
permissions | -rw-r--r-- |
7170
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
1 |
/* $Id$ */ |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
2 |
|
9111
48ce04029fe4
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents:
8275
diff
changeset
|
3 |
/** @file sound_driver.hpp Base for all sound drivers. */ |
48ce04029fe4
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents:
8275
diff
changeset
|
4 |
|
7170
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
5 |
#ifndef SOUND_SOUND_DRIVER_HPP |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
6 |
#define SOUND_SOUND_DRIVER_HPP |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
7 |
|
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
8 |
#include "../driver.h" |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
9 |
|
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
10 |
class SoundDriver: public Driver { |
10380
f4adb9648a93
(svn r14631) -Add: support for Allegro as sound backend.
rubidium
parents:
9111
diff
changeset
|
11 |
public: |
f4adb9648a93
(svn r14631) -Add: support for Allegro as sound backend.
rubidium
parents:
9111
diff
changeset
|
12 |
/* Called once every tick */ |
f4adb9648a93
(svn r14631) -Add: support for Allegro as sound backend.
rubidium
parents:
9111
diff
changeset
|
13 |
virtual void MainLoop() {} |
7170
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
14 |
}; |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
15 |
|
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
16 |
class SoundDriverFactoryBase: public DriverFactoryBase { |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
17 |
}; |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
18 |
|
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
19 |
template <class T> |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
20 |
class SoundDriverFactory: public SoundDriverFactoryBase { |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
21 |
public: |
7193
d46cbf314baf
(svn r10471) -Codechange: implement driver probing priority so that 'preferred' drivers are loaded first
peter1138
parents:
7170
diff
changeset
|
22 |
SoundDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_SOUND, ((T *)this)->priority); } |
7170
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
23 |
|
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
24 |
/** |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
25 |
* Get the long, human readable, name for the Driver-class. |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
26 |
*/ |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
27 |
const char *GetName(); |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
28 |
}; |
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
29 |
|
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
30 |
extern SoundDriver *_sound_driver; |
8275
f17d0c863ee3
(svn r11839) -Codechange: move some variables from variables.h to a more logical location.
rubidium
parents:
7193
diff
changeset
|
31 |
extern char _ini_sounddriver[32]; |
7170
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
32 |
|
923946ec324f
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents:
diff
changeset
|
33 |
#endif /* SOUND_SOUND_DRIVER_HPP */ |