4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * Copyright 2009-2011 Jörg Hermann Müller
8 * This file is part of AudaSpace.
10 * Audaspace is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * AudaSpace 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 Audaspace; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file audaspace/SDL/AUD_SDLDevice.h
35 #include "AUD_SoftwareDevice.h"
40 * This device plays back through SDL, the simple direct media layer.
42 class AUD_SDLDevice : public AUD_SoftwareDevice
46 * Mixes the next bytes into the buffer.
47 * \param data The SDL device.
48 * \param buffer The target buffer.
49 * \param length The length in bytes to be filled.
51 static void SDL_mix(void *data, Uint8* buffer, int length);
53 // hide copy constructor and operator=
54 AUD_SDLDevice(const AUD_SDLDevice&);
55 AUD_SDLDevice& operator=(const AUD_SDLDevice&);
58 virtual void playing(bool playing);
62 * Opens the SDL audio device for playback.
63 * \param specs The wanted audio specification.
64 * \param buffersize The size of the internal buffer.
65 * \note The specification really used for opening the device may differ.
66 * \exception AUD_Exception Thrown if the audio device cannot be opened.
68 AUD_SDLDevice(AUD_DeviceSpecs specs,
69 int buffersize = AUD_DEFAULT_BUFFER_SIZE);
72 * Closes the SDL audio device.
74 virtual ~AUD_SDLDevice();
77 #endif //AUD_SDLDEVICE