ScummVM API documentation
musicplugin.h
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 modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (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, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef AUDIO_MUSICPLUGIN_H
23#define AUDIO_MUSICPLUGIN_H
24
25#include "base/plugins.h"
26#include "audio/mididrv.h"
27#include "common/list.h"
28
29namespace Common {
30class Error;
31}
32
34
49public:
50 MusicDevice(MusicPluginObject const *musicPlugin, Common::String name, MusicType mt);
51
52 const Common::String &getName() const { return _name; }
53 const Common::String &getMusicDriverName() const { return _musicDriverName; }
54 const Common::String &getMusicDriverId() const { return _musicDriverId; }
55 MusicType getMusicType() const { return _type; }
56
62
68
69 MidiDriver::DeviceHandle getHandle();
70
71private:
72 Common::String _name;
73 Common::String _musicDriverName;
74 Common::String _musicDriverId;
75 MusicType _type;
76};
77
80
86public:
87 virtual ~MusicPluginObject() {}
88
93 virtual const char *getId() const = 0;
94
98 virtual MusicDevices getDevices() const = 0;
99
111 virtual bool checkDevice(MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const { return (checkFlags & MDCK_AUTO) == 0; }
112
126};
127
131class MusicManager : public Common::Singleton<MusicManager> {
132private:
134
135public:
136 const PluginList &getPlugins() const;
137};
138
140#define MusicMan MusicManager::instance()
142#endif
Definition: error.h:81
Definition: list.h:44
Definition: singleton.h:42
Definition: str.h:59
Definition: mididrv.h:313
uint32 DeviceHandle
Definition: mididrv.h:322
Definition: musicplugin.h:48
Common::String getCompleteId()
Common::String getCompleteName()
Definition: musicplugin.h:131
Definition: musicplugin.h:85
virtual bool checkDevice(MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const
Definition: musicplugin.h:111
virtual Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle=0) const =0
virtual MusicDevices getDevices() const =0
virtual const char * getId() const =0
Definition: plugins.h:143
MusicType
Definition: mididrv.h:44
Common::List< MusicDevice > MusicDevices
Definition: musicplugin.h:79
Definition: algorithm.h:29