summaryrefslogtreecommitdiffstats
path: root/kttsd/libkttsd/testplayer.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit00bb99ac80741fc50ef8a289719373032f2391eb (patch)
tree3a5a9bf72f942784b38bf77dd66c534662fab5f2 /kttsd/libkttsd/testplayer.h
downloadtdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.tar.gz
tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kttsd/libkttsd/testplayer.h')
-rw-r--r--kttsd/libkttsd/testplayer.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/kttsd/libkttsd/testplayer.h b/kttsd/libkttsd/testplayer.h
new file mode 100644
index 0000000..2e7339c
--- /dev/null
+++ b/kttsd/libkttsd/testplayer.h
@@ -0,0 +1,121 @@
+/***************************************************** vim:set ts=4 sw=4 sts=4:
+ Player Object for playing synthesized audio files. Plays them
+ synchronously.
+ -------------------
+ Copyright:
+ (C) 2004 by Gary Cramblitt <garycramblitt@comcast.net>
+ -------------------
+ Original author: Gary Cramblitt <garycramblitt@comcast.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ ******************************************************************************/
+
+#ifndef _TESTPLAYER_H_
+#define _TESTPLAYER_H_
+
+#include <kdemacros.h>
+#include "kdeexportfix.h"
+
+class Player;
+class Stretcher;
+
+// TODO: Make this work asynchronously.
+
+class KDE_EXPORT TestPlayer : public QObject{
+ public:
+ /**
+ * Constructor.
+ * @param playerOption
+ * @param audioStretchFactor
+ */
+ TestPlayer(QObject *parent = 0, const char *name = 0,
+ const int playerOption = 0, const float audioStretchFactor = 1.0,
+ const QString &sinkName = QString::null);
+
+ /**
+ * Destructor.
+ */
+ ~TestPlayer();
+
+ /**
+ * Sets which audio player to use.
+ * 0 = aRts
+ * 1 = gstreamer
+ */
+ void setPlayerOption(const int playerOption);
+
+ /**
+ * Sets the audio stretch factor (Speed adjustment).
+ * 1.0 = normal
+ * 0.5 = twice as fast
+ * 2.0 = twice as slow
+ */
+ void setAudioStretchFactor(const float audioStretchFactor);
+
+ /**
+ * Plays the specifified audio file and waits for completion.
+ * The audio file speed is adjusted according to the stretch factor.
+ * @param waveFile Name of the audio file to play.
+ */
+ void play(const QString &waveFile);
+
+ /**
+ * Sets the GStreamer Sink Name. Examples: "alsasink", "osssink", "nassink".
+ */
+ void setSinkName(const QString &sinkName);
+
+ /**
+ * Creates and returns a player object based on user option.
+ */
+ Player* createPlayerObject(int playerOption);
+
+ private:
+
+ /**
+ * Constructs a temporary filename for plugins to use as a suggested filename
+ * for synthesis to write to.
+ * @return Full pathname of suggested file.
+ */
+ QString makeSuggestedFilename();
+
+ /**
+ * Which audio player to use.
+ * 0 = aRts
+ * 1 = gstreamer
+ */
+ int m_playerOption;
+
+ /**
+ * Audio stretch factor (Speed).
+ */
+ float m_audioStretchFactor;
+
+ /**
+ * GStreamer sink name.
+ */
+ QString m_sinkName;
+
+ /**
+ * Stretcher object.
+ */
+ Stretcher* m_stretcher;
+
+ /**
+ * Player object.
+ */
+ Player* m_player;
+};
+
+#endif // _TESTPLAYER_H_