Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef RECORDER_H
- #define RECORDER_H
- #include <QObject>
- #include <QProcess>
- #include <QDesktopServices>
- #include <QTimer>
- #include <QApplication>
- #include <QTime>
- #include <QDebug>
- struct VideoDevice
- {// I'll keep other options in this struct too.
- QString deviceName;
- QString resolution;
- };
- struct AudioDevice
- {// I'll keep other options in this struct too.
- QString deviceName;
- };
- class Recorder : public QObject
- {
- Q_OBJECT
- public:
- enum RecordingMode { AudioOnly = 0, VideoOnly, AudioVideo };
- enum RecorderState { Recording = 0, Paused, Stopped };
- explicit Recorder(QObject *parent = 0);
- virtual ~Recorder();
- void setDevices( const AudioDevice &audioDevice, const VideoDevice &videoDevice );
- void setAudioDevice( const AudioDevice &audioDevice );
- const AudioDevice &audioDevice() const;
- void setVideoDevice( const VideoDevice &videoDevice );
- const VideoDevice &videoDevice() const;
- void setOutputFile( const QString &fileName );
- const QString &fileName() const;
- Q_SIGNALS:
- void stateChanged( const RecorderState &state );
- public Q_SLOTS:
- void start( RecordingMode mode );
- void stop();
- void pause();
- private Q_SLOTS:
- void onFFMPEGstateChanged( QProcess::ProcessState state );
- void onTest();
- private:
- QProcess *m_ffmpeg;
- RecordingMode m_mode;
- VideoDevice m_videoDevice;
- QString m_output;
- AudioDevice m_audioDevice;
- };
- #endif // RECORDER_H
Add Comment
Please, Sign In to add comment