1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef SCUMM_PLAYERS_PLAYER_V2A_H
24 #define SCUMM_PLAYERS_PLAYER_V2A_H
25 
26 #include "common/scummsys.h"
27 #include "scumm/music.h"
28 #include "scumm/players/player_mod.h"
29 
30 class Mixer;
31 
32 namespace Scumm {
33 
34 class ScummEngine;
35 class V2A_Sound;
36 
37 /**
38  * Scumm V2 Amiga sound/music driver.
39  */
40 class Player_V2A : public MusicEngine {
41 public:
42 	Player_V2A(ScummEngine *scumm, Audio::Mixer *mixer);
43 	~Player_V2A() override;
44 
45 	void setMusicVolume(int vol) override;
46 	void startSound(int sound) override;
47 	void stopSound(int sound) override;
48 	void stopAllSounds() override;
49 	int  getMusicTimer() override;
50 	int  getSoundStatus(int sound) const override;
51 
52 private:
53 	enum {
54 		V2A_MAXSLOTS = 8
55 	};
56 
57 	struct soundSlot {
58 		int id;
59 		V2A_Sound *sound;
60 	};
61 
62 	ScummEngine *_vm;
63 	Player_MOD *_mod;
64 	soundSlot _slot[V2A_MAXSLOTS];
65 
66 	int getSoundSlot(int id = 0) const;
67 	static void update_proc(void *param);
68 	void updateSound();
69 };
70 
71 } // End of namespace Scumm
72 
73 #endif
74