-rw-r--r-- | noncore/multimedia/opierec/qtrec.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/multimedia/opierec/qtrec.h b/noncore/multimedia/opierec/qtrec.h index 5d6ed62..ada3270 100644 --- a/noncore/multimedia/opierec/qtrec.h +++ b/noncore/multimedia/opierec/qtrec.h | |||
@@ -1,186 +1,185 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Created: Thu Jan 17 11:19:45 2002 | 2 | ** Created: Thu Jan 17 11:19:45 2002 |
3 | copyright 2002 by L.J. Potter ljp@llornkcor.com | 3 | copyright 2002 by L.J. Potter ljp@llornkcor.com |
4 | ****************************************************************************/ | 4 | ****************************************************************************/ |
5 | #ifndef QTREC_H | 5 | #ifndef QTREC_H |
6 | #define QTREC_H | 6 | #define QTREC_H |
7 | #define VERSION 1.0 | 7 | #define VERSION 1.0 |
8 | 8 | ||
9 | #include <qpe/ir.h> | 9 | #include <qpe/ir.h> |
10 | 10 | ||
11 | #include <iostream.h> | ||
12 | #include <qfile.h> | 11 | #include <qfile.h> |
13 | #include <qimage.h> | 12 | #include <qimage.h> |
14 | #include <qlineedit.h> | 13 | #include <qlineedit.h> |
15 | #include <qpixmap.h> | 14 | #include <qpixmap.h> |
16 | #include <qvariant.h> | 15 | #include <qvariant.h> |
17 | #include <qwidget.h> | 16 | #include <qwidget.h> |
18 | #include <stdio.h> | 17 | #include <stdio.h> |
19 | #include <stdlib.h> | 18 | #include <stdlib.h> |
20 | 19 | ||
21 | #include "device.h" | 20 | #include "device.h" |
22 | #include "wavFile.h" | 21 | #include "wavFile.h" |
23 | 22 | ||
24 | class QButtonGroup; | 23 | class QButtonGroup; |
25 | class QCheckBox; | 24 | class QCheckBox; |
26 | class QComboBox; | 25 | class QComboBox; |
27 | class QGridLayout; | 26 | class QGridLayout; |
28 | class QGroupBox; | 27 | class QGroupBox; |
29 | class QHBoxLayout; | 28 | class QHBoxLayout; |
30 | class QIconView; | 29 | class QIconView; |
31 | class QIconViewItem; | 30 | class QIconViewItem; |
32 | class QLabel; | 31 | class QLabel; |
33 | class QLabel; | 32 | class QLabel; |
34 | class QListView; | 33 | class QListView; |
35 | class QListViewItem; | 34 | class QListViewItem; |
36 | class QPushButton; | 35 | class QPushButton; |
37 | class QSlider; | 36 | class QSlider; |
38 | class QTabWidget; | 37 | class QTabWidget; |
39 | class QTimer; | 38 | class QTimer; |
40 | class QVBoxLayout; | 39 | class QVBoxLayout; |
41 | class QLineEdit; | 40 | class QLineEdit; |
42 | 41 | ||
43 | #define MAX_TRACKS 2 | 42 | #define MAX_TRACKS 2 |
44 | //#define BUFSIZE 4096 | 43 | //#define BUFSIZE 4096 |
45 | // #define BUFSIZE 8182 //Z default buffer size | 44 | // #define BUFSIZE 8182 //Z default buffer size |
46 | #define BUFSIZE 1024 | 45 | #define BUFSIZE 1024 |
47 | //#define BUFSIZE 2048 | 46 | //#define BUFSIZE 2048 |
48 | #define FRAGSIZE 0x7fff000A; | 47 | #define FRAGSIZE 0x7fff000A; |
49 | 48 | ||
50 | #define WAVE_FORMAT_DVI_ADPCM (0x0011) | 49 | #define WAVE_FORMAT_DVI_ADPCM (0x0011) |
51 | #define WAVE_FORMAT_PCM (0x0001) | 50 | #define WAVE_FORMAT_PCM (0x0001) |
52 | //AFMT_IMA_ADPCM | 51 | //AFMT_IMA_ADPCM |
53 | 52 | ||
54 | class QtRec : public QWidget | 53 | class QtRec : public QWidget |
55 | { | 54 | { |
56 | Q_OBJECT | 55 | Q_OBJECT |
57 | 56 | ||
58 | public: | 57 | public: |
59 | static QString appName() { return QString::fromLatin1("opierec"); } | 58 | static QString appName() { return QString::fromLatin1("opierec"); } |
60 | QtRec( QWidget* parent=0, const char* name=0, WFlags fl=0 ); | 59 | QtRec( QWidget* parent=0, const char* name=0, WFlags fl=0 ); |
61 | ~QtRec(); | 60 | ~QtRec(); |
62 | QSlider *OutputSlider,*InputSlider; | 61 | QSlider *OutputSlider,*InputSlider; |
63 | 62 | ||
64 | public slots: | 63 | public slots: |
65 | private: | 64 | private: |
66 | // int fragment; | 65 | // int fragment; |
67 | int fd1; | 66 | int fd1; |
68 | int secCount; | 67 | int secCount; |
69 | QString timeString; | 68 | QString timeString; |
70 | 69 | ||
71 | QLineEdit *renameBox; | 70 | QLineEdit *renameBox; |
72 | QGroupBox* GroupBox1; | 71 | QGroupBox* GroupBox1; |
73 | QString currentFile; | 72 | QString currentFile; |
74 | QString date, currentFileName, tmpFileName; | 73 | QString date, currentFileName, tmpFileName; |
75 | QTimer *t_timer; | 74 | QTimer *t_timer; |
76 | bool needsStereoOut, paused, playing; | 75 | bool needsStereoOut, paused, playing; |
77 | bool useTmpFile, autoMute; | 76 | bool useTmpFile, autoMute; |
78 | 77 | ||
79 | bool eventFilter( QObject * , QEvent * ); | 78 | bool eventFilter( QObject * , QEvent * ); |
80 | void okRename(); | 79 | void okRename(); |
81 | void cancelRename(); | 80 | void cancelRename(); |
82 | QString getStorage(const QString &); | 81 | QString getStorage(const QString &); |
83 | bool rec(); | 82 | bool rec(); |
84 | int getCurrentSizeLimit(); | 83 | int getCurrentSizeLimit(); |
85 | long checkDiskSpace(const QString &); | 84 | long checkDiskSpace(const QString &); |
86 | void doMute(bool); | 85 | void doMute(bool); |
87 | void errorStop(); | 86 | void errorStop(); |
88 | void fillDirectoryCombo(); | 87 | void fillDirectoryCombo(); |
89 | void getInVol(); | 88 | void getInVol(); |
90 | void getOutVol(); | 89 | void getOutVol(); |
91 | void init(); | 90 | void init(); |
92 | void initConfig(); | 91 | void initConfig(); |
93 | void initConnections(); | 92 | void initConnections(); |
94 | void selectItemByName(const QString &); | 93 | void selectItemByName(const QString &); |
95 | void setRecordButton(bool); | 94 | void setRecordButton(bool); |
96 | void start(); | 95 | void start(); |
97 | void stop(); | 96 | void stop(); |
98 | void timerEvent( QTimerEvent *e ); | 97 | void timerEvent( QTimerEvent *e ); |
99 | 98 | ||
100 | private slots: | 99 | private slots: |
101 | 100 | ||
102 | 101 | ||
103 | void FastforwardPressed(); | 102 | void FastforwardPressed(); |
104 | void FastforwardReleased(); | 103 | void FastforwardReleased(); |
105 | void changeDirCombo(int); | 104 | void changeDirCombo(int); |
106 | void changeSizeLimitCombo(int); | 105 | void changeSizeLimitCombo(int); |
107 | void changeTimeSlider(int); | 106 | void changeTimeSlider(int); |
108 | void changebitrateCombo(int); | 107 | void changebitrateCombo(int); |
109 | void changedInVolume(); | 108 | void changedInVolume(); |
110 | void changedOutVolume(); | 109 | void changedOutVolume(); |
111 | void changesamplerateCombo(int); | 110 | void changesamplerateCombo(int); |
112 | void cleanUp(); | 111 | void cleanUp(); |
113 | void compressionSelected(bool); | 112 | void compressionSelected(bool); |
114 | void deleteSound(); | 113 | void deleteSound(); |
115 | void doBeam(); | 114 | void doBeam(); |
116 | void doMenuPlay(); | 115 | void doMenuPlay(); |
117 | void doMicMuting(bool); | 116 | void doMicMuting(bool); |
118 | void doPlayBtn(); | 117 | void doPlayBtn(); |
119 | void doRename(); | 118 | void doRename(); |
120 | void doVolMuting(bool); | 119 | void doVolMuting(bool); |
121 | void forwardTimerTimeout(); | 120 | void forwardTimerTimeout(); |
122 | void itClick(QListViewItem *item); | 121 | void itClick(QListViewItem *item); |
123 | void listPressed(int, QListViewItem *, const QPoint&, int); | 122 | void listPressed(int, QListViewItem *, const QPoint&, int); |
124 | void newSound(); | 123 | void newSound(); |
125 | void rewindPressed(); | 124 | void rewindPressed(); |
126 | void rewindReleased(); | 125 | void rewindReleased(); |
127 | void rewindTimerTimeout(); | 126 | void rewindTimerTimeout(); |
128 | void slotAutoMute(bool); | 127 | void slotAutoMute(bool); |
129 | void thisTab(QWidget*); | 128 | void thisTab(QWidget*); |
130 | void timeSliderPressed(); | 129 | void timeSliderPressed(); |
131 | void timeSliderReleased(); | 130 | void timeSliderReleased(); |
132 | void timerBreak(); | 131 | void timerBreak(); |
133 | /* void changedOutVolume(int); */ | 132 | /* void changedOutVolume(int); */ |
134 | /* void changedInVolume(int); */ | 133 | /* void changedInVolume(int); */ |
135 | 134 | ||
136 | protected: | 135 | protected: |
137 | 136 | ||
138 | Device *soundDevice; | 137 | Device *soundDevice; |
139 | WavFile *wavFile; | 138 | WavFile *wavFile; |
140 | 139 | ||
141 | QButtonGroup *ButtonGroup1; | 140 | QButtonGroup *ButtonGroup1; |
142 | QCheckBox *outMuteCheckBox, *inMuteCheckBox, *compressionCheckBox, *autoMuteCheckBox; | 141 | QCheckBox *outMuteCheckBox, *inMuteCheckBox, *compressionCheckBox, *autoMuteCheckBox; |
143 | QComboBox* sampleRateComboBox, * bitRateComboBox, *directoryComboBox, *sizeLimitCombo; | 142 | QComboBox* sampleRateComboBox, * bitRateComboBox, *directoryComboBox, *sizeLimitCombo; |
144 | QHBoxLayout* Layout12; | 143 | QHBoxLayout* Layout12; |
145 | QHBoxLayout* Layout13; | 144 | QHBoxLayout* Layout13; |
146 | QHBoxLayout* Layout14; | 145 | QHBoxLayout* Layout14; |
147 | QHBoxLayout* Layout16; | 146 | QHBoxLayout* Layout16; |
148 | QHBoxLayout* Layout17; | 147 | QHBoxLayout* Layout17; |
149 | QHBoxLayout* Layout19; | 148 | QHBoxLayout* Layout19; |
150 | QIconView *IconView1; | 149 | QIconView *IconView1; |
151 | QLabel *NewSoundLabel,*playLabel2; | 150 | QLabel *NewSoundLabel,*playLabel2; |
152 | QLabel *TextLabel3, *TextLabel1, *TextLabel2; | 151 | QLabel *TextLabel3, *TextLabel1, *TextLabel2; |
153 | QListView *ListView1; | 152 | QListView *ListView1; |
154 | QPushButton *Stop_PushButton, *Play_PushButton, *Rec_PushButton, *NewSoundButton, *deleteSoundButton, *toBeginningButton, *toEndButton; | 153 | QPushButton *Stop_PushButton, *Play_PushButton, *Rec_PushButton, *NewSoundButton, *deleteSoundButton, *toBeginningButton, *toEndButton; |
155 | QString recDir; | 154 | QString recDir; |
156 | QTabWidget *TabWidget; | 155 | QTabWidget *TabWidget; |
157 | QTimer *t, *rewindTimer, *forwardTimer; | 156 | QTimer *t, *rewindTimer, *forwardTimer; |
158 | QVBoxLayout* Layout15; | 157 | QVBoxLayout* Layout15; |
159 | QVBoxLayout* Layout15b; | 158 | QVBoxLayout* Layout15b; |
160 | QVBoxLayout* Layout18; | 159 | QVBoxLayout* Layout18; |
161 | QWidget *tab, *tab_2, *tab_3, *tab_4, *tab_5; | 160 | QWidget *tab, *tab_2, *tab_3, *tab_4, *tab_5; |
162 | int sliderPos, total; | 161 | int sliderPos, total; |
163 | // short inbuffer[BUFSIZE], outbuffer[BUFSIZE]; | 162 | // short inbuffer[BUFSIZE], outbuffer[BUFSIZE]; |
164 | // unsigned short unsigned_inbuffer[BUFSIZE], unsigned_outbuffer[BUFSIZE]; | 163 | // unsigned short unsigned_inbuffer[BUFSIZE], unsigned_outbuffer[BUFSIZE]; |
165 | QGroupBox *sampleGroup, *bitGroup, *dirGroup, *sizeGroup; | 164 | QGroupBox *sampleGroup, *bitGroup, *dirGroup, *sizeGroup; |
166 | /* short inbuffer[65536], outbuffer[65536]; */ | 165 | /* short inbuffer[65536], outbuffer[65536]; */ |
167 | /* unsigned short unsigned_inbuffer[65536], unsigned_outbuffer[65536]; */ | 166 | /* unsigned short unsigned_inbuffer[65536], unsigned_outbuffer[65536]; */ |
168 | 167 | ||
169 | 168 | ||
170 | bool doPlay(); | 169 | bool doPlay(); |
171 | bool openPlayFile(); | 170 | bool openPlayFile(); |
172 | bool setUpFile(); | 171 | bool setUpFile(); |
173 | bool setupAudio( bool b); | 172 | bool setupAudio( bool b); |
174 | void endPlaying(); | 173 | void endPlaying(); |
175 | void endRecording(); | 174 | void endRecording(); |
176 | void fileBeamFinished( Ir *ir); | 175 | void fileBeamFinished( Ir *ir); |
177 | void initIconView(); | 176 | void initIconView(); |
178 | void keyPressEvent( QKeyEvent *e); | 177 | void keyPressEvent( QKeyEvent *e); |
179 | void keyReleaseEvent( QKeyEvent *e); | 178 | void keyReleaseEvent( QKeyEvent *e); |
180 | void receive( const QCString &, const QByteArray & ); | 179 | void receive( const QCString &, const QByteArray & ); |
181 | void showListMenu(QListViewItem * ); | 180 | void showListMenu(QListViewItem * ); |
182 | // void quickRec(); | 181 | // void quickRec(); |
183 | 182 | ||
184 | }; | 183 | }; |
185 | 184 | ||
186 | #endif // QTREC_H | 185 | #endif // QTREC_H |