Chris@476
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@476
|
2
|
Chris@476
|
3 /*
|
Chris@476
|
4 Sonic Visualiser
|
Chris@476
|
5 An audio file viewer and annotation editor.
|
Chris@476
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@476
|
7
|
Chris@476
|
8 This program is free software; you can redistribute it and/or
|
Chris@476
|
9 modify it under the terms of the GNU General Public License as
|
Chris@476
|
10 published by the Free Software Foundation; either version 2 of the
|
Chris@476
|
11 License, or (at your option) any later version. See the file
|
Chris@476
|
12 COPYING included with this distribution for more information.
|
Chris@476
|
13 */
|
Chris@476
|
14
|
Chris@476
|
15 #ifndef AUDIO_RECORD_TARGET_H
|
Chris@476
|
16 #define AUDIO_RECORD_TARGET_H
|
Chris@476
|
17
|
Chris@476
|
18 #include <bqaudioio/ApplicationRecordTarget.h>
|
Chris@476
|
19
|
Chris@476
|
20 #include <string>
|
Chris@476
|
21
|
Chris@476
|
22 #include <QObject>
|
Chris@476
|
23 #include <QMutex>
|
Chris@476
|
24
|
Chris@476
|
25 #include "base/BaseTypes.h"
|
Chris@476
|
26
|
Chris@476
|
27 class ViewManagerBase;
|
Chris@477
|
28 class WritableWaveFileModel;
|
Chris@476
|
29
|
Chris@476
|
30 class AudioRecordTarget : public QObject,
|
Chris@476
|
31 public breakfastquay::ApplicationRecordTarget
|
Chris@476
|
32 {
|
Chris@476
|
33 Q_OBJECT
|
Chris@476
|
34
|
Chris@476
|
35 public:
|
Chris@476
|
36 AudioRecordTarget(ViewManagerBase *, QString clientName);
|
Chris@476
|
37 virtual ~AudioRecordTarget();
|
Chris@476
|
38
|
Chris@476
|
39 virtual std::string getClientName() const { return m_clientName; }
|
Chris@476
|
40
|
Chris@476
|
41 virtual int getApplicationSampleRate() const { return 0; } // don't care
|
Chris@476
|
42 virtual int getApplicationChannelCount() const { return 2; }
|
Chris@476
|
43
|
Chris@476
|
44 virtual void setSystemRecordBlockSize(int);
|
Chris@476
|
45 virtual void setSystemRecordSampleRate(int);
|
Chris@476
|
46 virtual void setSystemRecordLatency(int);
|
Chris@476
|
47
|
Chris@476
|
48 virtual void putSamples(int nframes, float **samples);
|
Chris@476
|
49
|
Chris@476
|
50 virtual void setInputLevels(float peakLeft, float peakRight);
|
Chris@476
|
51
|
Chris@476
|
52 virtual void audioProcessingOverload() { }
|
Chris@476
|
53
|
Chris@508
|
54 QString getRecordContainerFolder();
|
Chris@483
|
55 QString getRecordFolder();
|
Chris@483
|
56
|
Chris@477
|
57 bool isRecording() const { return m_recording; }
|
Chris@477
|
58 WritableWaveFileModel *startRecording(); // caller takes ownership
|
Chris@476
|
59 void stopRecording();
|
Chris@477
|
60
|
Chris@477
|
61 signals:
|
Chris@477
|
62 void recordStatusChanged(bool recording);
|
Chris@485
|
63 void recordDurationChanged(sv_frame_t, sv_samplerate_t); // emitted occasionally
|
Chris@497
|
64 void recordCompleted();
|
Chris@477
|
65
|
Chris@477
|
66 protected slots:
|
Chris@477
|
67 void modelAboutToBeDeleted();
|
Chris@476
|
68
|
Chris@476
|
69 private:
|
Chris@476
|
70 ViewManagerBase *m_viewManager;
|
Chris@476
|
71 std::string m_clientName;
|
Chris@476
|
72 bool m_recording;
|
Chris@476
|
73 sv_samplerate_t m_recordSampleRate;
|
Chris@485
|
74 sv_frame_t m_frameCount;
|
Chris@476
|
75 QString m_audioFileName;
|
Chris@477
|
76 WritableWaveFileModel *m_model;
|
Chris@476
|
77 QMutex m_mutex;
|
Chris@476
|
78 };
|
Chris@476
|
79
|
Chris@476
|
80 #endif
|