kttsd Library API Documentation

stretcher.h

00001 /***************************************************** vim:set ts=4 sw=4 sts=4:
00002   Description: 
00003      Speeds up or slows down an audio file by stretching the audio stream.
00004      Uses the sox program to do the stretching.
00005 
00006   Copyright:
00007   (C) 2004 by Gary Cramblitt <garycramblitt@comcast.net>
00008   -------------------
00009   Original author: Gary Cramblitt <garycramblitt@comcast.net
00010  ******************************************************************************/
00011 
00012 /******************************************************************************
00013  *                                                                            *
00014  *    This program is free software; you can redistribute it and/or modify    *
00015  *    it under the terms of the GNU General Public License as published by    *
00016  *    the Free Software Foundation; either version 2 of the License.          *
00017  *                                                                            *
00018  ******************************************************************************/
00019 
00020 #ifndef _STRETCHER_H_
00021 #define _STRETCHER_H_
00022 
00023 class KProcess;
00024 
00025 class Stretcher : public QObject{
00026     Q_OBJECT
00027 
00028     public:
00032         Stretcher(QObject *parent = 0, const char *name = 0);
00033 
00037         ~Stretcher();
00038 
00039         enum StretcherState {
00040             ssIdle = 0,             // Not doing anything.  Ready to stretch.
00041             ssStretching = 1,       // Stretching.
00042             ssFinished = 2          // Stretching finished.
00043         };
00044 
00051         bool stretch(const QString &inFilename, const QString &outFilename, const float stretchFactor);
00052 
00056         int getState();
00057 
00061         QString getOutFilename();
00062 
00066         void ackFinished();
00067 
00068     signals:
00072         void stretchFinished();
00073 
00074     private slots:
00075         void slotProcessExited(KProcess* proc);
00076 
00077     private:
00078         // Stretcher state.
00079         int m_state;
00080 
00081         // Sox process.
00082         KProcess* m_stretchProc;
00083 
00084         // Output file name.
00085         QString m_outFilename;
00086 };
00087 
00088 #endif      // _STRETCHER_H_
KDE Logo
This file is part of the documentation for kttsd Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Dec 12 14:37:18 2004 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003