author | mickeyl <mickeyl> | 2004-03-01 19:19:37 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-03-01 19:19:37 (UTC) |
commit | ddc3d749af5f7afebf69488b79641771fe246b5b (patch) (unidiff) | |
tree | 8ea8614906c568e4677493ef09040724d60dd2d4 /core/applets/vmemo | |
parent | fb0981f47e529f9d1dd77fa005ffa3c3ecedff67 (diff) | |
download | opie-ddc3d749af5f7afebf69488b79641771fe246b5b.zip opie-ddc3d749af5f7afebf69488b79641771fe246b5b.tar.gz opie-ddc3d749af5f7afebf69488b79641771fe246b5b.tar.bz2 |
remove duplicated boiler plate code in favour of the OTaskbarApplet template
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 12 | ||||
-rw-r--r-- | core/applets/vmemo/vmemo.h | 1 | ||||
-rw-r--r-- | core/applets/vmemo/vmemo.pro | 4 | ||||
-rw-r--r-- | core/applets/vmemo/vmemoimpl.cpp | 61 | ||||
-rw-r--r-- | core/applets/vmemo/vmemoimpl.h | 40 |
5 files changed, 15 insertions, 103 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index fe8ebfd..563d110 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -16,96 +16,97 @@ extern "C" { | |||
16 | #include "adpcm.h" | 16 | #include "adpcm.h" |
17 | } | 17 | } |
18 | 18 | ||
19 | #include <unistd.h> | 19 | #include <unistd.h> |
20 | #include <stdio.h> | 20 | #include <stdio.h> |
21 | #include <fcntl.h> | 21 | #include <fcntl.h> |
22 | #include <sys/ioctl.h> | 22 | #include <sys/ioctl.h> |
23 | #include <linux/soundcard.h> | 23 | #include <linux/soundcard.h> |
24 | 24 | ||
25 | #include <errno.h> | 25 | #include <errno.h> |
26 | 26 | ||
27 | typedef struct _waveheader { | 27 | typedef struct _waveheader { |
28 | u_long main_chunk; /* 'RIFF' */ | 28 | u_long main_chunk; /* 'RIFF' */ |
29 | u_long length; /* filelen */ | 29 | u_long length; /* filelen */ |
30 | u_long chunk_type; /* 'WAVE' */ | 30 | u_long chunk_type; /* 'WAVE' */ |
31 | u_long sub_chunk; /* 'fmt ' */ | 31 | u_long sub_chunk; /* 'fmt ' */ |
32 | u_long sc_len; /* length of sub_chunk, =16 | 32 | u_long sc_len; /* length of sub_chunk, =16 |
33 | (chunckSize) format len */ | 33 | (chunckSize) format len */ |
34 | u_short format; /* should be 1 for PCM-code (formatTag) */ | 34 | u_short format; /* should be 1 for PCM-code (formatTag) */ |
35 | 35 | ||
36 | u_short modus; /* 1 Mono, 2 Stereo (channels) */ | 36 | u_short modus; /* 1 Mono, 2 Stereo (channels) */ |
37 | u_long sample_fq; /* samples per second (samplesPerSecond) */ | 37 | u_long sample_fq; /* samples per second (samplesPerSecond) */ |
38 | u_long byte_p_sec; /* avg bytes per second (avgBytePerSecond) */ | 38 | u_long byte_p_sec; /* avg bytes per second (avgBytePerSecond) */ |
39 | u_short byte_p_spl; /* samplesize; 1 or 2 bytes (blockAlign) */ | 39 | u_short byte_p_spl; /* samplesize; 1 or 2 bytes (blockAlign) */ |
40 | u_short bit_p_spl; /* 8, 12 or 16 bit (bitsPerSample) */ | 40 | u_short bit_p_spl; /* 8, 12 or 16 bit (bitsPerSample) */ |
41 | 41 | ||
42 | u_long data_chunk; /* 'data' */ | 42 | u_long data_chunk; /* 'data' */ |
43 | 43 | ||
44 | u_long data_length;/* samplecount */ | 44 | u_long data_length;/* samplecount */ |
45 | } WaveHeader; | 45 | } WaveHeader; |
46 | 46 | ||
47 | #define RIFF 0x46464952 | 47 | #define RIFF 0x46464952 |
48 | #define WAVE 0x45564157 | 48 | #define WAVE 0x45564157 |
49 | #define FMT 0x20746D66 | 49 | #define FMT 0x20746D66 |
50 | #define DATA 0x61746164 | 50 | #define DATA 0x61746164 |
51 | #define PCM_CODE 1 | 51 | #define PCM_CODE 1 |
52 | #define WAVE_MONO 1 | 52 | #define WAVE_MONO 1 |
53 | #define WAVE_STEREO 2 | 53 | #define WAVE_STEREO 2 |
54 | 54 | ||
55 | struct adpcm_state encoder_state; | 55 | struct adpcm_state encoder_state; |
56 | //struct adpcm_state decoder_state; | 56 | //struct adpcm_state decoder_state; |
57 | 57 | ||
58 | #define WAVE_FORMAT_DVI_ADPCM (0x0011) | 58 | #define WAVE_FORMAT_DVI_ADPCM (0x0011) |
59 | #define WAVE_FORMAT_PCM (0x0001) | 59 | #define WAVE_FORMAT_PCM (0x0001) |
60 | 60 | ||
61 | 61 | ||
62 | #include "vmemo.h" | 62 | #include "vmemo.h" |
63 | 63 | ||
64 | #include <opie2/otaskbarapplet.h> | ||
64 | #include <qpe/qpeapplication.h> | 65 | #include <qpe/qpeapplication.h> |
65 | #include <qpe/config.h> | 66 | #include <qpe/config.h> |
66 | 67 | ||
67 | #include <qpainter.h> | 68 | #include <qpainter.h> |
68 | #include <qmessagebox.h> | 69 | #include <qmessagebox.h> |
69 | 70 | ||
70 | int seq = 0; | 71 | int seq = 0; |
71 | 72 | ||
72 | /* XPM */ | 73 | /* XPM */ |
73 | static char * vmemo_xpm[] = { | 74 | static char * vmemo_xpm[] = { |
74 | "16 16 102 2", | 75 | "16 16 102 2", |
75 | " c None", | 76 | " c None", |
76 | ". c #60636A", | 77 | ". c #60636A", |
77 | "+ c #6E6E72", | 78 | "+ c #6E6E72", |
78 | "@ c #68696E", | 79 | "@ c #68696E", |
79 | "# c #4D525C", | 80 | "# c #4D525C", |
80 | "$ c #6B6C70", | 81 | "$ c #6B6C70", |
81 | "% c #E3E3E8", | 82 | "% c #E3E3E8", |
82 | "& c #EEEEF2", | 83 | "& c #EEEEF2", |
83 | "* c #EAEAEF", | 84 | "* c #EAEAEF", |
84 | "= c #CACAD0", | 85 | "= c #CACAD0", |
85 | "- c #474A51", | 86 | "- c #474A51", |
86 | "; c #171819", | 87 | "; c #171819", |
87 | "> c #9B9B9F", | 88 | "> c #9B9B9F", |
88 | ", c #EBEBF0", | 89 | ", c #EBEBF0", |
89 | "' c #F4F4F7", | 90 | "' c #F4F4F7", |
90 | ") c #F1F1F5", | 91 | ") c #F1F1F5", |
91 | "! c #DEDEE4", | 92 | "! c #DEDEE4", |
92 | "~ c #57575C", | 93 | "~ c #57575C", |
93 | "{ c #010101", | 94 | "{ c #010101", |
94 | "] c #A2A2A6", | 95 | "] c #A2A2A6", |
95 | "^ c #747477", | 96 | "^ c #747477", |
96 | "/ c #B5B5B8", | 97 | "/ c #B5B5B8", |
97 | "( c #AEAEB2", | 98 | "( c #AEAEB2", |
98 | "_ c #69696D", | 99 | "_ c #69696D", |
99 | ": c #525256", | 100 | ": c #525256", |
100 | "< c #181C24", | 101 | "< c #181C24", |
101 | "[ c #97979B", | 102 | "[ c #97979B", |
102 | "} c #A7A7AC", | 103 | "} c #A7A7AC", |
103 | "| c #B0B0B4", | 104 | "| c #B0B0B4", |
104 | "1 c #C8C8D1", | 105 | "1 c #C8C8D1", |
105 | "2 c #75757B", | 106 | "2 c #75757B", |
106 | "3 c #46464A", | 107 | "3 c #46464A", |
107 | "4 c #494A4F", | 108 | "4 c #494A4F", |
108 | "5 c #323234", | 109 | "5 c #323234", |
109 | "6 c #909095", | 110 | "6 c #909095", |
110 | "7 c #39393B", | 111 | "7 c #39393B", |
111 | "8 c #757578", | 112 | "8 c #757578", |
@@ -192,96 +193,101 @@ static char * vmemo_xpm[] = { | |||
192 | " n n n n n n n n n "}; | 193 | " n n n n n n n n n "}; |
193 | 194 | ||
194 | 195 | ||
195 | VMemo::VMemo( QWidget *parent, const char *_name ) | 196 | VMemo::VMemo( QWidget *parent, const char *_name ) |
196 | : QWidget( parent, _name ) { | 197 | : QWidget( parent, _name ) { |
197 | setFixedHeight( 18 ); | 198 | setFixedHeight( 18 ); |
198 | setFixedWidth( 14 ); | 199 | setFixedWidth( 14 ); |
199 | 200 | ||
200 | t_timer = new QTimer( this ); | 201 | t_timer = new QTimer( this ); |
201 | connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); | 202 | connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); |
202 | 203 | ||
203 | Config vmCfg("Vmemo"); | 204 | Config vmCfg("Vmemo"); |
204 | vmCfg.setGroup("Defaults"); | 205 | vmCfg.setGroup("Defaults"); |
205 | int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); | 206 | int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); |
206 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); | 207 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); |
207 | 208 | ||
208 | qDebug("toggleKey %d", toggleKey); | 209 | qDebug("toggleKey %d", toggleKey); |
209 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | 210 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) |
210 | systemZaurus=TRUE; | 211 | systemZaurus=TRUE; |
211 | else | 212 | else |
212 | systemZaurus=FALSE; | 213 | systemZaurus=FALSE; |
213 | 214 | ||
214 | myChannel = new QCopChannel( "QPE/VMemo", this ); | 215 | myChannel = new QCopChannel( "QPE/VMemo", this ); |
215 | connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), | 216 | connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), |
216 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 217 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
217 | 218 | ||
218 | if( toggleKey != -1 ) { | 219 | if( toggleKey != -1 ) { |
219 | // keyRegister(key, channel, message) | 220 | // keyRegister(key, channel, message) |
220 | QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); | 221 | QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); |
221 | // e << 4096; // Key_Escape | 222 | // e << 4096; // Key_Escape |
222 | // e << Key_F5; //4148 | 223 | // e << Key_F5; //4148 |
223 | e << toggleKey; | 224 | e << toggleKey; |
224 | e << QString("QPE/VMemo"); | 225 | e << QString("QPE/VMemo"); |
225 | e << QString("toggleRecord()"); | 226 | e << QString("toggleRecord()"); |
226 | } | 227 | } |
227 | if(toggleKey == 1) | 228 | if(toggleKey == 1) |
228 | usingIcon=TRUE; | 229 | usingIcon=TRUE; |
229 | else | 230 | else |
230 | usingIcon=FALSE; | 231 | usingIcon=FALSE; |
231 | if( vmCfg.readNumEntry("hideIcon",0) == 1) | 232 | if( vmCfg.readNumEntry("hideIcon",0) == 1) |
232 | hide(); | 233 | hide(); |
233 | recording = FALSE; | 234 | recording = FALSE; |
234 | // } | 235 | // } |
235 | } | 236 | } |
236 | 237 | ||
237 | VMemo::~VMemo() { | 238 | VMemo::~VMemo() { |
238 | } | 239 | } |
239 | 240 | ||
241 | int VMemo::position() | ||
242 | { | ||
243 | return 6; | ||
244 | } | ||
245 | |||
240 | void VMemo::receive( const QCString &msg, const QByteArray &data ) { | 246 | void VMemo::receive( const QCString &msg, const QByteArray &data ) { |
241 | qDebug("receive"); | 247 | qDebug("receive"); |
242 | QDataStream stream( data, IO_ReadOnly ); | 248 | QDataStream stream( data, IO_ReadOnly ); |
243 | 249 | ||
244 | if (msg == "toggleRecord()") { | 250 | if (msg == "toggleRecord()") { |
245 | if (recording) { | 251 | if (recording) { |
246 | fromToggle = TRUE; | 252 | fromToggle = TRUE; |
247 | stopRecording(); | 253 | stopRecording(); |
248 | } else { | 254 | } else { |
249 | fromToggle = TRUE; | 255 | fromToggle = TRUE; |
250 | startRecording(); | 256 | startRecording(); |
251 | } | 257 | } |
252 | } | 258 | } |
253 | } | 259 | } |
254 | 260 | ||
255 | void VMemo::paintEvent( QPaintEvent* ) { | 261 | void VMemo::paintEvent( QPaintEvent* ) { |
256 | QPainter p(this); | 262 | QPainter p(this); |
257 | p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); | 263 | p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); |
258 | } | 264 | } |
259 | 265 | ||
260 | void VMemo::mousePressEvent( QMouseEvent * me) { | 266 | void VMemo::mousePressEvent( QMouseEvent * me) { |
261 | /* 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 |
262 | mousePressEvent and mouseReleaseEvent with a NULL parameter. */ | 268 | mousePressEvent and mouseReleaseEvent with a NULL parameter. */ |
263 | 269 | ||
264 | // if (!systemZaurus && me != NULL) | 270 | // if (!systemZaurus && me != NULL) |
265 | // return; | 271 | // return; |
266 | // } | 272 | // } |
267 | 273 | ||
268 | if(!recording) | 274 | if(!recording) |
269 | startRecording(); | 275 | startRecording(); |
270 | else | 276 | else |
271 | stopRecording(); | 277 | stopRecording(); |
272 | } | 278 | } |
273 | 279 | ||
274 | void VMemo::mouseReleaseEvent( QMouseEvent * ) { | 280 | void VMemo::mouseReleaseEvent( QMouseEvent * ) { |
275 | } | 281 | } |
276 | 282 | ||
277 | bool VMemo::startRecording() { | 283 | bool VMemo::startRecording() { |
278 | Config config( "Vmemo" ); | 284 | Config config( "Vmemo" ); |
279 | config.setGroup( "System" ); | 285 | config.setGroup( "System" ); |
280 | 286 | ||
281 | useAlerts = config.readBoolEntry("Alert",1); | 287 | useAlerts = config.readBoolEntry("Alert",1); |
282 | if(useAlerts) { | 288 | if(useAlerts) { |
283 | 289 | ||
284 | msgLabel = new QLabel( 0, "alertLabel" ); | 290 | msgLabel = new QLabel( 0, "alertLabel" ); |
285 | msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); | 291 | msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); |
286 | msgLabel->show(); | 292 | msgLabel->show(); |
287 | } | 293 | } |
@@ -586,48 +592,54 @@ bool VMemo::record() { | |||
586 | cfg.setGroup("Volume"); | 592 | cfg.setGroup("Volume"); |
587 | QString foo = cfg.readEntry("Mute","TRUE"); | 593 | QString foo = cfg.readEntry("Mute","TRUE"); |
588 | if(foo.find("TRUE",0,TRUE) != -1) | 594 | if(foo.find("TRUE",0,TRUE) != -1) |
589 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute | 595 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute |
590 | return TRUE; | 596 | return TRUE; |
591 | } | 597 | } |
592 | 598 | ||
593 | int VMemo::setToggleButton(int tog) { | 599 | int VMemo::setToggleButton(int tog) { |
594 | 600 | ||
595 | for( int i=0; i < 10;i++) { | 601 | for( int i=0; i < 10;i++) { |
596 | switch (tog) { | 602 | switch (tog) { |
597 | case 0: | 603 | case 0: |
598 | return -1; | 604 | return -1; |
599 | break; | 605 | break; |
600 | case 1: | 606 | case 1: |
601 | return 0; | 607 | return 0; |
602 | break; | 608 | break; |
603 | case 2: | 609 | case 2: |
604 | return Key_F24; //was Escape | 610 | return Key_F24; //was Escape |
605 | break; | 611 | break; |
606 | case 3: | 612 | case 3: |
607 | return Key_Space; | 613 | return Key_Space; |
608 | break; | 614 | break; |
609 | case 4: | 615 | case 4: |
610 | return Key_F12; | 616 | return Key_F12; |
611 | break; | 617 | break; |
612 | case 5: | 618 | case 5: |
613 | return Key_F9; | 619 | return Key_F9; |
614 | break; | 620 | break; |
615 | case 6: | 621 | case 6: |
616 | return Key_F10; | 622 | return Key_F10; |
617 | break; | 623 | break; |
618 | case 7: | 624 | case 7: |
619 | return Key_F11; | 625 | return Key_F11; |
620 | break; | 626 | break; |
621 | case 8: | 627 | case 8: |
622 | return Key_F13; | 628 | return Key_F13; |
623 | break; | 629 | break; |
624 | }; | 630 | }; |
625 | } | 631 | } |
626 | return -1; | 632 | return -1; |
627 | } | 633 | } |
628 | 634 | ||
629 | void VMemo::timerBreak() { | 635 | void VMemo::timerBreak() { |
630 | //stop | 636 | //stop |
631 | stopRecording(); | 637 | stopRecording(); |
632 | QMessageBox::message("Vmemo","Vmemo recording has ended"); | 638 | QMessageBox::message("Vmemo","Vmemo recording has ended"); |
633 | } | 639 | } |
640 | |||
641 | Q_EXPORT_INTERFACE() | ||
642 | { | ||
643 | Q_CREATE_INSTANCE( OTaskbarAppletWrapper<VMemo> ); | ||
644 | } | ||
645 | |||
diff --git a/core/applets/vmemo/vmemo.h b/core/applets/vmemo/vmemo.h index 31d0a25..1bd735f 100644 --- a/core/applets/vmemo/vmemo.h +++ b/core/applets/vmemo/vmemo.h | |||
@@ -1,64 +1,65 @@ | |||
1 | /**************************************************************************************94x78** | 1 | /**************************************************************************************94x78** |
2 | ** | 2 | ** |
3 | ** This file may be distributed and/or modified under the terms of the | 3 | ** This file may be distributed and/or modified under the terms of the |
4 | ** GNU General Public License version 2 as published by the Free Software | 4 | ** GNU General Public License version 2 as published by the Free Software |
5 | ** Foundation and appearing in the file LICENSE.GPL included in the | 5 | ** Foundation and appearing in the file LICENSE.GPL included in the |
6 | ** packaging of this file. | 6 | ** packaging of this file. |
7 | ** | 7 | ** |
8 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 8 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
10 | ** | 10 | ** |
11 | *********************************************************************************************/ | 11 | *********************************************************************************************/ |
12 | 12 | ||
13 | /* | 13 | /* |
14 | * $Id$ | 14 | * $Id$ |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifndef __VMEMO_H__ | 17 | #ifndef __VMEMO_H__ |
18 | #define __VMEMO_H__ | 18 | #define __VMEMO_H__ |
19 | 19 | ||
20 | 20 | ||
21 | #include <qwidget.h> | 21 | #include <qwidget.h> |
22 | #include <qpixmap.h> | 22 | #include <qpixmap.h> |
23 | #include <qpe/applnk.h> | 23 | #include <qpe/applnk.h> |
24 | #include <qfile.h> | 24 | #include <qfile.h> |
25 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qtimer.h> | 27 | #include <qtimer.h> |
28 | 28 | ||
29 | class VMemo : public QWidget | 29 | class VMemo : public QWidget |
30 | { | 30 | { |
31 | Q_OBJECT | 31 | Q_OBJECT |
32 | public: | 32 | public: |
33 | VMemo( QWidget *parent, const char *name = NULL); | 33 | VMemo( QWidget *parent, const char *name = NULL); |
34 | ~VMemo(); | 34 | ~VMemo(); |
35 | static int position(); | ||
35 | QFile track; | 36 | QFile track; |
36 | int length; | 37 | int length; |
37 | QString fileName, errorMsg, date; | 38 | QString fileName, errorMsg, date; |
38 | QLabel* msgLabel; | 39 | QLabel* msgLabel; |
39 | QTimer *t_timer; | 40 | QTimer *t_timer; |
40 | bool usingIcon, useADPCM; | 41 | bool usingIcon, useADPCM; |
41 | public slots: | 42 | public slots: |
42 | bool record(); | 43 | bool record(); |
43 | void mousePressEvent( QMouseEvent * ); | 44 | void mousePressEvent( QMouseEvent * ); |
44 | void mouseReleaseEvent( QMouseEvent * ); | 45 | void mouseReleaseEvent( QMouseEvent * ); |
45 | void receive( const QCString &msg, const QByteArray &data ); | 46 | void receive( const QCString &msg, const QByteArray &data ); |
46 | bool startRecording(); | 47 | bool startRecording(); |
47 | void stopRecording(); | 48 | void stopRecording(); |
48 | void timerBreak(); | 49 | void timerBreak(); |
49 | private: | 50 | private: |
50 | bool useAlerts; | 51 | bool useAlerts; |
51 | void paintEvent( QPaintEvent* ); | 52 | void paintEvent( QPaintEvent* ); |
52 | int setToggleButton(int); | 53 | int setToggleButton(int); |
53 | int openDSP(); | 54 | int openDSP(); |
54 | int openWAV(const char *filename); | 55 | int openWAV(const char *filename); |
55 | bool fromToggle; | 56 | bool fromToggle; |
56 | QPixmap vmemoPixmap; | 57 | QPixmap vmemoPixmap; |
57 | QCopChannel *myChannel; | 58 | QCopChannel *myChannel; |
58 | bool systemZaurus; | 59 | bool systemZaurus; |
59 | int dsp, wav, rate, speed, channels, format, resolution; | 60 | int dsp, wav, rate, speed, channels, format, resolution; |
60 | bool recording; | 61 | bool recording; |
61 | }; | 62 | }; |
62 | 63 | ||
63 | #endif // __VMEMO_H__ | 64 | #endif // __VMEMO_H__ |
64 | 65 | ||
diff --git a/core/applets/vmemo/vmemo.pro b/core/applets/vmemo/vmemo.pro index f83a53f..2deedfd 100644 --- a/core/applets/vmemo/vmemo.pro +++ b/core/applets/vmemo/vmemo.pro | |||
@@ -1,13 +1,13 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt plugin warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = vmemo.h vmemoimpl.h adpcm.h | 3 | HEADERS = vmemo.h adpcm.h |
4 | SOURCES = vmemo.cpp vmemoimpl.cpp adpcm.c | 4 | SOURCES = vmemo.cpp adpcm.c |
5 | TARGET = vmemoapplet | 5 | TARGET = vmemoapplet |
6 | DESTDIR =$(OPIEDIR)/plugins/applets | 6 | DESTDIR =$(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
11 | 11 | ||
12 | include ( $(OPIEDIR)/include.pro ) | 12 | include ( $(OPIEDIR)/include.pro ) |
13 | target.path = $$prefix/plugins/applets | 13 | target.path = $$prefix/plugins/applets |
diff --git a/core/applets/vmemo/vmemoimpl.cpp b/core/applets/vmemo/vmemoimpl.cpp deleted file mode 100644 index 7779b83..0000000 --- a/core/applets/vmemo/vmemoimpl.cpp +++ b/dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /**************************************************************************************94x78** | ||
2 | ** | ||
3 | ** This file may be distributed and/or modified under the terms of the | ||
4 | ** GNU General Public License version 2 as published by the Free Software | ||
5 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
6 | ** packaging of this file. | ||
7 | ** | ||
8 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
10 | ** | ||
11 | *********************************************************************************************/ | ||
12 | |||
13 | /* | ||
14 | * $Id$ | ||
15 | */ | ||
16 | |||
17 | #include "vmemo.h" | ||
18 | #include "vmemoimpl.h" | ||
19 | |||
20 | |||
21 | VMemoAppletImpl::VMemoAppletImpl() | ||
22 | : vmemo(0) | ||
23 | { | ||
24 | } | ||
25 | |||
26 | VMemoAppletImpl::~VMemoAppletImpl() | ||
27 | { | ||
28 | delete vmemo; | ||
29 | } | ||
30 | |||
31 | QWidget *VMemoAppletImpl::applet( QWidget *parent ) | ||
32 | { | ||
33 | if ( !vmemo ) | ||
34 | vmemo = new VMemo( parent ); | ||
35 | return vmemo; | ||
36 | } | ||
37 | |||
38 | int VMemoAppletImpl::position() const | ||
39 | { | ||
40 | return 6; | ||
41 | } | ||
42 | |||
43 | QRESULT VMemoAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | ||
44 | { | ||
45 | *iface = 0; | ||
46 | if ( uuid == IID_QUnknown ) | ||
47 | *iface = this; | ||
48 | else if ( uuid == IID_TaskbarApplet ) | ||
49 | *iface = this; | ||
50 | else | ||
51 | return QS_FALSE; | ||
52 | |||
53 | if ( *iface ) | ||
54 | (*iface)->addRef(); | ||
55 | return QS_OK; | ||
56 | } | ||
57 | |||
58 | Q_EXPORT_INTERFACE() | ||
59 | { | ||
60 | Q_CREATE_INSTANCE( VMemoAppletImpl ) | ||
61 | } | ||
diff --git a/core/applets/vmemo/vmemoimpl.h b/core/applets/vmemo/vmemoimpl.h deleted file mode 100644 index 985138b..0000000 --- a/core/applets/vmemo/vmemoimpl.h +++ b/dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /**************************************************************************************94x78** | ||
2 | ** | ||
3 | ** This file may be distributed and/or modified under the terms of the | ||
4 | ** GNU General Public License version 2 as published by the Free Software | ||
5 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
6 | ** packaging of this file. | ||
7 | ** | ||
8 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
10 | ** | ||
11 | *********************************************************************************************/ | ||
12 | |||
13 | /* | ||
14 | * $Id$ | ||
15 | */ | ||
16 | |||
17 | #ifndef __VMEMOIMPLAPPLETIMPL_H__ | ||
18 | #define __VMEMOIMPLAPPLETIMPL_H__ | ||
19 | |||
20 | #include <qpe/taskbarappletinterface.h> | ||
21 | |||
22 | class VMemo; | ||
23 | |||
24 | class VMemoAppletImpl : public TaskbarAppletInterface | ||
25 | { | ||
26 | public: | ||
27 | VMemoAppletImpl(); | ||
28 | virtual ~VMemoAppletImpl(); | ||
29 | |||
30 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | ||
31 | Q_REFCOUNT | ||
32 | |||
33 | virtual QWidget *applet( QWidget *parent ); | ||
34 | virtual int position() const; | ||
35 | |||
36 | private: | ||
37 | VMemo *vmemo; | ||
38 | }; | ||
39 | |||
40 | #endif | ||