4 * singleton for creating, switching and deleting audiodevices
8 * ***** BEGIN GPL LICENSE BLOCK *****
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
25 * All rights reserved.
27 * The Original Code is: all of this file.
29 * Contributor(s): none yet.
31 * ***** END GPL LICENSE BLOCK *****
34 #ifndef __SND_DEVICEMANAGER_H
35 #define __SND_DEVICEMANAGER_H
37 #include "SND_IAudioDevice.h"
39 class SND_DeviceManager
44 * a subscription is needed before instances are given away
45 * applications must call subscribe first, get an instance, and
46 * when they are finished with sound, unsubscribe
48 static void Subscribe();
49 static void Unsubscribe();
51 static SND_IAudioDevice* Instance();
52 static void SetDeviceType(int device_type);
57 * Private to enforce singleton
60 SND_DeviceManager(const SND_DeviceManager&);
63 static SND_IAudioDevice* m_instance;
66 * The type of device to be created on a call
69 static int m_device_type;
72 * Remember the number of subscriptions.
73 * if 0, delete the device
75 static int m_subscriptions;
78 #endif //__SND_DEVICEMANAGER_H