-rw-r--r-- | noncore/multimedia/opierec/qtrec.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp index fb2d819..e3385cd 100644 --- a/noncore/multimedia/opierec/qtrec.cpp +++ b/noncore/multimedia/opierec/qtrec.cpp | |||
@@ -28,98 +28,98 @@ using namespace Opie::Core; | |||
28 | #include <qgroupbox.h> | 28 | #include <qgroupbox.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qlayout.h> | 30 | #include <qlayout.h> |
31 | #include <qlistview.h> | 31 | #include <qlistview.h> |
32 | #include <qmessagebox.h> | 32 | #include <qmessagebox.h> |
33 | #include <qpopupmenu.h> | 33 | #include <qpopupmenu.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #include <qslider.h> | 35 | #include <qslider.h> |
36 | #include <qtabwidget.h> | 36 | #include <qtabwidget.h> |
37 | #include <qtimer.h> | 37 | #include <qtimer.h> |
38 | 38 | ||
39 | /* STD */ | 39 | /* STD */ |
40 | #include <errno.h> | 40 | #include <errno.h> |
41 | #include <fcntl.h> | 41 | #include <fcntl.h> |
42 | #include <math.h> | 42 | #include <math.h> |
43 | #include <mntent.h> | 43 | #include <mntent.h> |
44 | #include <stdio.h> | 44 | #include <stdio.h> |
45 | #include <stdlib.h> | 45 | #include <stdlib.h> |
46 | #include <sys/ioctl.h> | 46 | #include <sys/ioctl.h> |
47 | #include <sys/soundcard.h> | 47 | #include <sys/soundcard.h> |
48 | #include <sys/stat.h> | 48 | #include <sys/stat.h> |
49 | #include <sys/time.h> | 49 | #include <sys/time.h> |
50 | #include <sys/types.h> | 50 | #include <sys/types.h> |
51 | #include <sys/vfs.h> | 51 | #include <sys/vfs.h> |
52 | #include <unistd.h> | 52 | #include <unistd.h> |
53 | #include <sys/wait.h> | 53 | #include <sys/wait.h> |
54 | #include <sys/signal.h> | 54 | #include <sys/signal.h> |
55 | #include <pthread.h> | 55 | #include <pthread.h> |
56 | 56 | ||
57 | #ifdef PDAUDIO //ALSA | 57 | #ifdef PDAUDIO //ALSA |
58 | #include <alsa/asoundlib.h> | 58 | #include <alsa/asoundlib.h> |
59 | static int deviceSampleRates[8] = { 32000, 44100, 48000, 88200, 96000, 176400, 192000, -1 }; | 59 | static int deviceSampleRates[8] = { 32000, 44100, 48000, 88200, 96000, 176400, 192000, -1 }; |
60 | static int deviceBitRates[] = { 8, 16, 24, 32, -1 }; | 60 | static int deviceBitRates[] = { 8, 16, 24, 32, -1 }; |
61 | #else //OSS | 61 | #else //OSS |
62 | static int deviceSampleRates[6] = { 11025, 16000, 22050, 32000, 44100, -1 }; | 62 | static int deviceSampleRates[6] = { 11025, 16000, 22050, 32000, 44100, -1 }; |
63 | static int deviceBitRates[] = { 8, 16, -1 }; | 63 | static int deviceBitRates[] = { 8, 16, -1 }; |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #if defined(QT_QWS_SL5XXX) | 66 | #if defined(QT_QWS_SL5XXX) |
67 | ///#if defined(QT_QWS_EBX) | 67 | ///#if defined(QT_QWS_EBX) |
68 | 68 | ||
69 | #define DSPSTROUT "/dev/dsp" | 69 | #define DSPSTROUT "/dev/dsp" |
70 | #define DSPSTRIN "/dev/dsp1" | 70 | #define DSPSTRIN "/dev/dsp1" |
71 | #define DSPSTRMIXEROUT "/dev/mixer" | 71 | #define DSPSTRMIXEROUT "/dev/mixer" |
72 | #define DSPSTRMIXERIN "/dev/mixer1" | 72 | #define DSPSTRMIXERIN "/dev/mixer1" |
73 | 73 | ||
74 | #else | 74 | #else |
75 | 75 | ||
76 | #define DSPSTROUT "/dev/dsp1" | 76 | #define DSPSTROUT "/dev/dsp" |
77 | #define DSPSTRIN "/dev/dsp1" | 77 | #define DSPSTRIN "/dev/dsp" |
78 | #define DSPSTRMIXERIN "/dev/mixer" | 78 | #define DSPSTRMIXERIN "/dev/mixer" |
79 | #define DSPSTRMIXEROUT "/dev/mixer" | 79 | #define DSPSTRMIXEROUT "/dev/mixer" |
80 | 80 | ||
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | //#define ZAURUS 0 | 83 | //#define ZAURUS 0 |
84 | struct adpcm_state encoder_state; | 84 | struct adpcm_state encoder_state; |
85 | struct adpcm_state decoder_state; | 85 | struct adpcm_state decoder_state; |
86 | 86 | ||
87 | typedef struct { | 87 | typedef struct { |
88 | int sampleRate; | 88 | int sampleRate; |
89 | /* int fragSize; */ | 89 | /* int fragSize; */ |
90 | /* int blockSize; */ | 90 | /* int blockSize; */ |
91 | int resolution; //bitrate | 91 | int resolution; //bitrate |
92 | int channels; //number of channels | 92 | int channels; //number of channels |
93 | int fd; //file descriptor | 93 | int fd; //file descriptor |
94 | int sd; //sound device descriptor | 94 | int sd; //sound device descriptor |
95 | int numberSamples; //total number of samples | 95 | int numberSamples; //total number of samples |
96 | int SecondsToRecord; // number of seconds that should be recorded | 96 | int SecondsToRecord; // number of seconds that should be recorded |
97 | float numberOfRecordedSeconds; //total number of samples recorded | 97 | float numberOfRecordedSeconds; //total number of samples recorded |
98 | int samplesToRecord; //number of samples to be recorded | 98 | int samplesToRecord; //number of samples to be recorded |
99 | int inVol; //input volume | 99 | int inVol; //input volume |
100 | int outVol; //output volume | 100 | int outVol; //output volume |
101 | int format; //wavfile format PCM.. ADPCM | 101 | int format; //wavfile format PCM.. ADPCM |
102 | const char *fileName; //name of fiel to be played/recorded | 102 | const char *fileName; //name of fiel to be played/recorded |
103 | } fileParameters; | 103 | } fileParameters; |
104 | 104 | ||
105 | fileParameters filePara; | 105 | fileParameters filePara; |
106 | 106 | ||
107 | bool monitoring, recording, playing; | 107 | bool monitoring, recording, playing; |
108 | bool stopped; | 108 | bool stopped; |
109 | QLabel *timeLabel; | 109 | QLabel *timeLabel; |
110 | QSlider *timeSlider; | 110 | QSlider *timeSlider; |
111 | int sd; | 111 | int sd; |
112 | 112 | ||
113 | Waveform* waveform; | 113 | Waveform* waveform; |
114 | Device *soundDevice; | 114 | Device *soundDevice; |
115 | 115 | ||
116 | 116 | ||
117 | #ifdef THREADED | 117 | #ifdef THREADED |
118 | void quickRec() | 118 | void quickRec() |
119 | #else | 119 | #else |
120 | void QtRec::quickRec() | 120 | void QtRec::quickRec() |
121 | #endif | 121 | #endif |
122 | { | 122 | { |
123 | 123 | ||
124 | odebug << ( filePara.numberSamples/filePara.sampleRate * filePara.channels ) << oendl; | 124 | odebug << ( filePara.numberSamples/filePara.sampleRate * filePara.channels ) << oendl; |
125 | odebug << "samples " << filePara.numberSamples << ", rate " << filePara.sampleRate | 125 | odebug << "samples " << filePara.numberSamples << ", rate " << filePara.sampleRate |