3
Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA.
21
#include "audioframe.h"
22
#include "auto_sink.h"
28
extern "C" { AutoSinkPlugin auto_sink; }
30
struct AutoSink::private_data
32
private_data() : sink(0) {};
33
SinkPluginHandler plugin_handler;
36
bool tryOpen(const string plugin) {
37
if (plugin_handler.load(plugin)) {
38
sink = plugin_handler.openSink();
45
plugin_handler.unload();
47
std::cout << "auto_sink: Could not load " << plugin << std::endl;
54
m_data = new private_data;
65
if (m_data->tryOpen("polyp")) return true;
67
if (m_data->tryOpen("jack")) return true;
69
if (m_data->tryOpen("alsa")) return true;
71
if (m_data->tryOpen("oss")) return true;
76
int AutoSink::setAudioConfiguration(const AudioConfiguration* config)
81
return m_data->sink->setAudioConfiguration(config);
84
const AudioConfiguration* AutoSink::audioConfiguration() const
89
return m_data->sink->audioConfiguration();
92
bool AutoSink::writeFrame(AudioFrame* frame)
97
return m_data->sink->writeFrame(frame);