4 * ***** BEGIN LGPL LICENSE BLOCK *****
6 * Copyright 2009 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 Lesser General Public License as published by
12 * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
23 * ***** END LGPL LICENSE BLOCK *****
26 #ifndef AUD_JACKDEVICE
27 #define AUD_JACKDEVICE
31 #include "AUD_SoftwareDevice.h"
37 * This device plays back through Jack.
39 class AUD_JackDevice : public AUD_SoftwareDevice
43 * The output ports of jack.
45 jack_port_t** m_ports;
50 jack_client_t* m_client;
58 * Whether the device is valid.
63 * Invalidates the jack device.
64 * \param data The jack device that gets invalidet by jack.
66 static void jack_shutdown(void *data);
69 * Mixes the next bytes into the buffer.
70 * \param length The length in samples to be filled.
71 * \param data A pointer to the jack device.
72 * \return 0 what shows success.
74 static int jack_mix(jack_nframes_t length, void *data);
77 virtual void playing(bool playing);
81 * Creates a Jack client for audio output.
82 * \param specs The wanted audio specification, where only the channel count is important.
83 * \exception AUD_Exception Thrown if the audio device cannot be opened.
85 AUD_JackDevice(AUD_Specs specs);
88 * Closes the Jack client.
90 virtual ~AUD_JackDevice();
95 #endif //AUD_JACKDEVICE