1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2 Player Object for playing synthesized audio files. Plays them
6 (C) 2004 by Gary Cramblitt <garycramblitt@comcast.net>
8 Original author: Gary Cramblitt <garycramblitt@comcast.net>
10 This program 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 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
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ******************************************************************************/
32 #include <kdemacros.h>
37 // TODO: Make this work asynchronously.
39 class KDE_EXPORT TestPlayer
: public QObject
{
44 * @param audioStretchFactor
46 explicit TestPlayer(QObject
*parent
= 0, const char *name
= 0,
47 const int playerOption
= 0, const float audioStretchFactor
= 1.0,
48 const QString
&sinkName
= QString());
56 * Sets which audio player to use.
60 void setPlayerOption(const int playerOption
);
63 * Sets the audio stretch factor (Speed adjustment).
68 void setAudioStretchFactor(const float audioStretchFactor
);
71 * Plays the specifified audio file and waits for completion.
72 * The audio file speed is adjusted according to the stretch factor.
73 * @param waveFile Name of the audio file to play.
75 void play(const QString
&waveFile
);
78 * Sets the GStreamer Sink Name. Examples: "alsasink", "osssink", "nassink".
80 void setSinkName(const QString
&sinkName
);
83 * Creates and returns a player object based on user option.
85 Player
* createPlayerObject(int playerOption
);
90 * Constructs a temporary filename for plugins to use as a suggested filename
91 * for synthesis to write to.
92 * @return Full pathname of suggested file.
94 QString
makeSuggestedFilename();
97 * Which audio player to use.
104 * Audio stretch factor (Speed).
106 float m_audioStretchFactor
;
109 * GStreamer sink name.
116 Stretcher
* m_stretcher
;
124 #endif // TESTPLAYER_H