www.pudn.com > wav_mp3_recorder.rar > mediarecorder.h
/********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef MEDIARECORDER_H #define MEDIARECORDER_H #include#include #include #include #include #include #include #include #include #include #include #include #include class MediaRecorderBase; class Waveform; class PlayListBase; struct QualitySetting { int frequency; int channels; }; class MediaRecorder : public QMainWindow { Q_OBJECT public: MediaRecorder( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); ~MediaRecorder(); private: void initializeContents(); void get_sample_data(); private slots: void startSave(); void startRecording(); void stopRecording(); void recordClicked(); void ShowWaveData(); void mp3_encode(); void Exit(); void changebid(int index); void loadplay(); void replayclicked(); void startplay(); void stopplay(); void play_mp3_wav(const QString& fileName); void PlayExit(); protected: // void closeEvent( QCloseEvent *e ); void tellmp(const QString & command); private: MediaRecorderBase *contents; QWidgetStack *stack; short *sampleBuffer; //PlayListBase *playbase; QualitySetting qualities; long samplesPlayed; bool recording; bool playing; QTimer *sample_Timer; QProcess *process; pid_t pidtomp3; int read_data; int wave_mp3_id; int recordTime; int tenTimes; int loopTimes; QString lastSaved; }; #endif