summaryrefslogtreecommitdiff
path: root/core/applets/vmemo/vmemo.cpp
Unidiff
Diffstat (limited to 'core/applets/vmemo/vmemo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 563d110..27f6015 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -120,194 +120,194 @@ static char * vmemo_xpm[] = {
120 "f c #5B5B60", 120 "f c #5B5B60",
121 "g c #8A8A8F", 121 "g c #8A8A8F",
122 "h c #6B6B6E", 122 "h c #6B6B6E",
123 "i c #ADADB2", 123 "i c #ADADB2",
124 "j c #828289", 124 "j c #828289",
125 "k c #3E3E41", 125 "k c #3E3E41",
126 "l c #CFCFD7", 126 "l c #CFCFD7",
127 "m c #4C4C50", 127 "m c #4C4C50",
128 "n c #000000", 128 "n c #000000",
129 "o c #66666A", 129 "o c #66666A",
130 "p c #505054", 130 "p c #505054",
131 "q c #838388", 131 "q c #838388",
132 "r c #A1A1A7", 132 "r c #A1A1A7",
133 "s c #A9A9AE", 133 "s c #A9A9AE",
134 "t c #A8A8B0", 134 "t c #A8A8B0",
135 "u c #5E5E63", 135 "u c #5E5E63",
136 "v c #3A3A3E", 136 "v c #3A3A3E",
137 "w c #BDBDC6", 137 "w c #BDBDC6",
138 "x c #59595E", 138 "x c #59595E",
139 "y c #76767C", 139 "y c #76767C",
140 "z c #373738", 140 "z c #373738",
141 "A c #717174", 141 "A c #717174",
142 "B c #727278", 142 "B c #727278",
143 "C c #1C1C1E", 143 "C c #1C1C1E",
144 "D c #3C3C3F", 144 "D c #3C3C3F",
145 "E c #ADADB6", 145 "E c #ADADB6",
146 "F c #54555A", 146 "F c #54555A",
147 "G c #8B8C94", 147 "G c #8B8C94",
148 "H c #5A5A5F", 148 "H c #5A5A5F",
149 "I c #BBBBC3", 149 "I c #BBBBC3",
150 "J c #C4C4CB", 150 "J c #C4C4CB",
151 "K c #909098", 151 "K c #909098",
152 "L c #737379", 152 "L c #737379",
153 "M c #343437", 153 "M c #343437",
154 "N c #8F8F98", 154 "N c #8F8F98",
155 "O c #000407", 155 "O c #000407",
156 "P c #2D3137", 156 "P c #2D3137",
157 "Q c #B0B1BC", 157 "Q c #B0B1BC",
158 "R c #3B3C40", 158 "R c #3B3C40",
159 "S c #6E6E74", 159 "S c #6E6E74",
160 "T c #95959C", 160 "T c #95959C",
161 "U c #74747A", 161 "U c #74747A",
162 "V c #1D1D1E", 162 "V c #1D1D1E",
163 "W c #91929A", 163 "W c #91929A",
164 "X c #42444A", 164 "X c #42444A",
165 "Y c #22282E", 165 "Y c #22282E",
166 "Z c #B0B2BC", 166 "Z c #B0B2BC",
167 "` c #898A90", 167 "` c #898A90",
168 " . c #65656A", 168 " . c #65656A",
169 ".. c #999AA2", 169 ".. c #999AA2",
170 "+. c #52535A", 170 "+. c #52535A",
171 "@. c #151B21", 171 "@. c #151B21",
172 "#. c #515257", 172 "#. c #515257",
173 "$. c #B5B5BE", 173 "$. c #B5B5BE",
174 "%. c #616167", 174 "%. c #616167",
175 "&. c #1A1D22", 175 "&. c #1A1D22",
176 "*. c #000713", 176 "*. c #000713",
177 "=. c #1F1F21", 177 "=. c #1F1F21",
178 " ", 178 " ",
179 " . + @ # ", 179 " . + @ # ",
180 " $ % & * = - ", 180 " $ % & * = - ",
181 " ; > , ' ) ! ~ ", 181 " ; > , ' ) ! ~ ",
182 " { ] ^ / ( _ : ", 182 " { ] ^ / ( _ : ",
183 " < [ } | 1 2 3 ", 183 " < [ } | 1 2 3 ",
184 " 4 5 6 7 8 9 0 a b c ", 184 " 4 5 6 7 8 9 0 a b c ",
185 " d e f g h i j 3 k l m n ", 185 " d e f g h i j 3 k l m n ",
186 " o p q r s t u v w n ", 186 " o p q r s t u v w n ",
187 " o x y z A B C D E n ", 187 " o x y z A B C D E n ",
188 " F G H I J K L M N O ", 188 " F G H I J K L M N O ",
189 " P Q R S T U V W X ", 189 " P Q R S T U V W X ",
190 " Y Z ` b ...+. ", 190 " Y Z ` b ...+. ",
191 " @.#.$.%.&. ", 191 " @.#.$.%.&. ",
192 " *.B =. ", 192 " *.B =. ",
193 " n n n n n n n n n "}; 193 " n n n n n n n n n "};
194 194
195 195
196VMemo::VMemo( QWidget *parent, const char *_name ) 196VMemo::VMemo( QWidget *parent, const char *_name )
197 : QWidget( parent, _name ) { 197 : QWidget( parent, _name ) {
198 setFixedHeight( 18 ); 198 setFixedHeight( 18 );
199 setFixedWidth( 14 ); 199 setFixedWidth( 14 );
200 200
201 t_timer = new QTimer( this ); 201 t_timer = new QTimer( this );
202 connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); 202 connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) );
203 203
204 Config vmCfg("Vmemo"); 204 Config vmCfg("Vmemo");
205 vmCfg.setGroup("Defaults"); 205 vmCfg.setGroup("Defaults");
206 int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); 206 int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1));
207 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); 207 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0);
208 208
209 qDebug("toggleKey %d", toggleKey); 209 qDebug("toggleKey %d", toggleKey);
210 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) 210 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ))
211 systemZaurus=TRUE; 211 systemZaurus=TRUE;
212 else 212 else
213 systemZaurus=FALSE; 213 systemZaurus=FALSE;
214 214
215 myChannel = new QCopChannel( "QPE/VMemo", this ); 215 myChannel = new QCopChannel( "QPE/VMemo", this );
216 connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), 216 connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)),
217 this, SLOT(receive(const QCString&, const QByteArray&)) ); 217 this, SLOT(receive(const QCString&,const QByteArray&)) );
218 218
219 if( toggleKey != -1 ) { 219 if( toggleKey != -1 ) {
220 // keyRegister(key, channel, message) 220 // keyRegister(key, channel, message)
221 QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); 221 QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)");
222 // e << 4096; // Key_Escape 222 // e << 4096; // Key_Escape
223 // e << Key_F5; //4148 223 // e << Key_F5; //4148
224 e << toggleKey; 224 e << toggleKey;
225 e << QString("QPE/VMemo"); 225 e << QString("QPE/VMemo");
226 e << QString("toggleRecord()"); 226 e << QString("toggleRecord()");
227 } 227 }
228 if(toggleKey == 1) 228 if(toggleKey == 1)
229 usingIcon=TRUE; 229 usingIcon=TRUE;
230 else 230 else
231 usingIcon=FALSE; 231 usingIcon=FALSE;
232 if( vmCfg.readNumEntry("hideIcon",0) == 1) 232 if( vmCfg.readNumEntry("hideIcon",0) == 1)
233 hide(); 233 hide();
234 recording = FALSE; 234 recording = FALSE;
235 // } 235 // }
236} 236}
237 237
238VMemo::~VMemo() { 238VMemo::~VMemo() {
239} 239}
240 240
241int VMemo::position() 241int VMemo::position()
242{ 242{
243 return 6; 243 return 6;
244} 244}
245 245
246void VMemo::receive( const QCString &msg, const QByteArray &data ) { 246void VMemo::receive( const QCString &msg, const QByteArray &data ) {
247 qDebug("receive"); 247 qDebug("receive");
248 QDataStream stream( data, IO_ReadOnly ); 248 QDataStream stream( data, IO_ReadOnly );
249 249
250 if (msg == "toggleRecord()") { 250 if (msg == "toggleRecord()") {
251 if (recording) { 251 if (recording) {
252 fromToggle = TRUE; 252 fromToggle = TRUE;
253 stopRecording(); 253 stopRecording();
254 } else { 254 } else {
255 fromToggle = TRUE; 255 fromToggle = TRUE;
256 startRecording(); 256 startRecording();
257 } 257 }
258 } 258 }
259} 259}
260 260
261void VMemo::paintEvent( QPaintEvent* ) { 261void VMemo::paintEvent( QPaintEvent* ) {
262 QPainter p(this); 262 QPainter p(this);
263 p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); 263 p.drawPixmap( 0, 1,( const char** ) vmemo_xpm );
264} 264}
265 265
266void VMemo::mousePressEvent( QMouseEvent * me) { 266void VMemo::mousePressEvent( QMouseEvent * me) {
267 /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions 267 /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions
268 mousePressEvent and mouseReleaseEvent with a NULL parameter. */ 268 mousePressEvent and mouseReleaseEvent with a NULL parameter. */
269 269
270// if (!systemZaurus && me != NULL) 270// if (!systemZaurus && me != NULL)
271// return; 271// return;
272// } 272// }
273 273
274 if(!recording) 274 if(!recording)
275 startRecording(); 275 startRecording();
276 else 276 else
277 stopRecording(); 277 stopRecording();
278} 278}
279 279
280void VMemo::mouseReleaseEvent( QMouseEvent * ) { 280void VMemo::mouseReleaseEvent( QMouseEvent * ) {
281} 281}
282 282
283bool VMemo::startRecording() { 283bool VMemo::startRecording() {
284 Config config( "Vmemo" ); 284 Config config( "Vmemo" );
285 config.setGroup( "System" ); 285 config.setGroup( "System" );
286 286
287 useAlerts = config.readBoolEntry("Alert",1); 287 useAlerts = config.readBoolEntry("Alert",1);
288 if(useAlerts) { 288 if(useAlerts) {
289 289
290 msgLabel = new QLabel( 0, "alertLabel" ); 290 msgLabel = new QLabel( 0, "alertLabel" );
291 msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); 291 msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>");
292 msgLabel->show(); 292 msgLabel->show();
293 } 293 }
294 294
295 qDebug("Start recording engines"); 295 qDebug("Start recording engines");
296 recording = TRUE; 296 recording = TRUE;
297 297
298 if (openDSP() == -1) { 298 if (openDSP() == -1) {
299 recording = FALSE; 299 recording = FALSE;
300 return FALSE; 300 return FALSE;
301 } 301 }
302 302
303 config.setGroup("Defaults"); 303 config.setGroup("Defaults");
304 304
305 date = TimeString::dateString( QDateTime::currentDateTime(),false,true); 305 date = TimeString::dateString( QDateTime::currentDateTime(),false,true);
306 date.replace(QRegExp("'"),""); 306 date.replace(QRegExp("'"),"");
307 date.replace(QRegExp(" "),"_"); 307 date.replace(QRegExp(" "),"_");
308 date.replace(QRegExp(":"),"."); 308 date.replace(QRegExp(":"),".");
309 date.replace(QRegExp(","),""); 309 date.replace(QRegExp(","),"");
310 310
311 QString fName; 311 QString fName;
312 config.setGroup( "System" ); 312 config.setGroup( "System" );
313 fName = QPEApplication::documentDir() ; 313 fName = QPEApplication::documentDir() ;