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