-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 6867e82..7af3d8b 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -1,177 +1,171 @@ | |||
1 | /************************************************************************************ | 1 | /************************************************************************************ |
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 | // copyright 2002 Jeremy Cowgar <jc@cowgar.com> | 12 | // copyright 2002 Jeremy Cowgar <jc@cowgar.com> |
13 | /* | 13 | /* |
14 | * $Id$ | 14 | * $Id$ |
15 | */ | 15 | */ |
16 | // Sun 03-17-2002 L.J.Potter <ljp@llornkcor.com> | 16 | // Sun 03-17-2002 L.J.Potter <ljp@llornkcor.com> |
17 | extern "C" { | 17 | extern "C" { |
18 | #include "adpcm.h" | 18 | #include "adpcm.h" |
19 | } | 19 | } |
20 | 20 | ||
21 | #include <sys/utsname.h> | 21 | #include <sys/utsname.h> |
22 | #include <sys/time.h> | 22 | #include <sys/time.h> |
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
24 | #include <unistd.h> | 24 | #include <unistd.h> |
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <sys/stat.h> | 26 | #include <sys/stat.h> |
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <sys/ioctl.h> | 28 | #include <sys/ioctl.h> |
29 | #include <linux/soundcard.h> | 29 | #include <linux/soundcard.h> |
30 | 30 | ||
31 | #include <string.h> | 31 | #include <string.h> |
32 | #include <stdlib.h> | 32 | #include <stdlib.h> |
33 | #include <errno.h> | 33 | #include <errno.h> |
34 | #include <qtimer.h> | ||
35 | 34 | ||
36 | typedef struct _waveheader { | 35 | typedef struct _waveheader { |
37 | u_long main_chunk; /* 'RIFF' */ | 36 | u_long main_chunk; /* 'RIFF' */ |
38 | u_long length; /* filelen */ | 37 | u_long length; /* filelen */ |
39 | u_long chunk_type; /* 'WAVE' */ | 38 | u_long chunk_type; /* 'WAVE' */ |
40 | u_long sub_chunk; /* 'fmt ' */ | 39 | u_long sub_chunk; /* 'fmt ' */ |
41 | u_long sc_len; /* length of sub_chunk, =16 | 40 | u_long sc_len; /* length of sub_chunk, =16 |
42 | (chunckSize) format len */ | 41 | (chunckSize) format len */ |
43 | u_short format; /* should be 1 for PCM-code (formatTag) */ | 42 | u_short format; /* should be 1 for PCM-code (formatTag) */ |
44 | 43 | ||
45 | u_short modus; /* 1 Mono, 2 Stereo (channels) */ | 44 | u_short modus; /* 1 Mono, 2 Stereo (channels) */ |
46 | u_long sample_fq; /* samples per second (samplesPerSecond) */ | 45 | u_long sample_fq; /* samples per second (samplesPerSecond) */ |
47 | u_long byte_p_sec; /* avg bytes per second (avgBytePerSecond) */ | 46 | u_long byte_p_sec; /* avg bytes per second (avgBytePerSecond) */ |
48 | u_short byte_p_spl; /* samplesize; 1 or 2 bytes (blockAlign) */ | 47 | u_short byte_p_spl; /* samplesize; 1 or 2 bytes (blockAlign) */ |
49 | u_short bit_p_spl; /* 8, 12 or 16 bit (bitsPerSample) */ | 48 | u_short bit_p_spl; /* 8, 12 or 16 bit (bitsPerSample) */ |
50 | 49 | ||
51 | u_long data_chunk; /* 'data' */ | 50 | u_long data_chunk; /* 'data' */ |
52 | 51 | ||
53 | u_long data_length;/* samplecount */ | 52 | u_long data_length;/* samplecount */ |
54 | } WaveHeader; | 53 | } WaveHeader; |
55 | 54 | ||
56 | #define RIFF 0x46464952 | 55 | #define RIFF 0x46464952 |
57 | #define WAVE 0x45564157 | 56 | #define WAVE 0x45564157 |
58 | #define FMT 0x20746D66 | 57 | #define FMT 0x20746D66 |
59 | #define DATA 0x61746164 | 58 | #define DATA 0x61746164 |
60 | #define PCM_CODE 1 | 59 | #define PCM_CODE 1 |
61 | #define WAVE_MONO 1 | 60 | #define WAVE_MONO 1 |
62 | #define WAVE_STEREO 2 | 61 | #define WAVE_STEREO 2 |
63 | 62 | ||
64 | struct adpcm_state encoder_state; | 63 | struct adpcm_state encoder_state; |
65 | //struct adpcm_state decoder_state; | 64 | //struct adpcm_state decoder_state; |
66 | 65 | ||
67 | #define WAVE_FORMAT_DVI_ADPCM (0x0011) | 66 | #define WAVE_FORMAT_DVI_ADPCM (0x0011) |
68 | #define WAVE_FORMAT_PCM (0x0001) | 67 | #define WAVE_FORMAT_PCM (0x0001) |
69 | 68 | ||
70 | 69 | ||
71 | #include "vmemo.h" | 70 | #include "vmemo.h" |
72 | 71 | ||
73 | #include <qpe/qpeapplication.h> | 72 | #include <qpe/qpeapplication.h> |
74 | #include <qpe/resource.h> | ||
75 | #include <qpe/config.h> | 73 | #include <qpe/config.h> |
76 | 74 | ||
77 | #include <qpainter.h> | 75 | #include <qpainter.h> |
78 | #include <qdatetime.h> | ||
79 | #include <qregexp.h> | ||
80 | #include <qsound.h> | ||
81 | #include <qfile.h> | ||
82 | #include <qmessagebox.h> | 76 | #include <qmessagebox.h> |
83 | 77 | ||
84 | int seq = 0; | 78 | int seq = 0; |
85 | 79 | ||
86 | /* XPM */ | 80 | /* XPM */ |
87 | static char * vmemo_xpm[] = { | 81 | static char * vmemo_xpm[] = { |
88 | "16 16 102 2", | 82 | "16 16 102 2", |
89 | " c None", | 83 | " c None", |
90 | ". c #60636A", | 84 | ". c #60636A", |
91 | "+ c #6E6E72", | 85 | "+ c #6E6E72", |
92 | "@ c #68696E", | 86 | "@ c #68696E", |
93 | "# c #4D525C", | 87 | "# c #4D525C", |
94 | "$ c #6B6C70", | 88 | "$ c #6B6C70", |
95 | "% c #E3E3E8", | 89 | "% c #E3E3E8", |
96 | "& c #EEEEF2", | 90 | "& c #EEEEF2", |
97 | "* c #EAEAEF", | 91 | "* c #EAEAEF", |
98 | "= c #CACAD0", | 92 | "= c #CACAD0", |
99 | "- c #474A51", | 93 | "- c #474A51", |
100 | "; c #171819", | 94 | "; c #171819", |
101 | "> c #9B9B9F", | 95 | "> c #9B9B9F", |
102 | ", c #EBEBF0", | 96 | ", c #EBEBF0", |
103 | "' c #F4F4F7", | 97 | "' c #F4F4F7", |
104 | ") c #F1F1F5", | 98 | ") c #F1F1F5", |
105 | "! c #DEDEE4", | 99 | "! c #DEDEE4", |
106 | "~ c #57575C", | 100 | "~ c #57575C", |
107 | "{ c #010101", | 101 | "{ c #010101", |
108 | "] c #A2A2A6", | 102 | "] c #A2A2A6", |
109 | "^ c #747477", | 103 | "^ c #747477", |
110 | "/ c #B5B5B8", | 104 | "/ c #B5B5B8", |
111 | "( c #AEAEB2", | 105 | "( c #AEAEB2", |
112 | "_ c #69696D", | 106 | "_ c #69696D", |
113 | ": c #525256", | 107 | ": c #525256", |
114 | "< c #181C24", | 108 | "< c #181C24", |
115 | "[ c #97979B", | 109 | "[ c #97979B", |
116 | "} c #A7A7AC", | 110 | "} c #A7A7AC", |
117 | "| c #B0B0B4", | 111 | "| c #B0B0B4", |
118 | "1 c #C8C8D1", | 112 | "1 c #C8C8D1", |
119 | "2 c #75757B", | 113 | "2 c #75757B", |
120 | "3 c #46464A", | 114 | "3 c #46464A", |
121 | "4 c #494A4F", | 115 | "4 c #494A4F", |
122 | "5 c #323234", | 116 | "5 c #323234", |
123 | "6 c #909095", | 117 | "6 c #909095", |
124 | "7 c #39393B", | 118 | "7 c #39393B", |
125 | "8 c #757578", | 119 | "8 c #757578", |
126 | "9 c #87878E", | 120 | "9 c #87878E", |
127 | "0 c #222224", | 121 | "0 c #222224", |
128 | "a c #414144", | 122 | "a c #414144", |
129 | "b c #6A6A6E", | 123 | "b c #6A6A6E", |
130 | "c c #020C16", | 124 | "c c #020C16", |
131 | "d c #6B6B6F", | 125 | "d c #6B6B6F", |
132 | "e c #68686D", | 126 | "e c #68686D", |
133 | "f c #5B5B60", | 127 | "f c #5B5B60", |
134 | "g c #8A8A8F", | 128 | "g c #8A8A8F", |
135 | "h c #6B6B6E", | 129 | "h c #6B6B6E", |
136 | "i c #ADADB2", | 130 | "i c #ADADB2", |
137 | "j c #828289", | 131 | "j c #828289", |
138 | "k c #3E3E41", | 132 | "k c #3E3E41", |
139 | "l c #CFCFD7", | 133 | "l c #CFCFD7", |
140 | "m c #4C4C50", | 134 | "m c #4C4C50", |
141 | "n c #000000", | 135 | "n c #000000", |
142 | "o c #66666A", | 136 | "o c #66666A", |
143 | "p c #505054", | 137 | "p c #505054", |
144 | "q c #838388", | 138 | "q c #838388", |
145 | "r c #A1A1A7", | 139 | "r c #A1A1A7", |
146 | "s c #A9A9AE", | 140 | "s c #A9A9AE", |
147 | "t c #A8A8B0", | 141 | "t c #A8A8B0", |
148 | "u c #5E5E63", | 142 | "u c #5E5E63", |
149 | "v c #3A3A3E", | 143 | "v c #3A3A3E", |
150 | "w c #BDBDC6", | 144 | "w c #BDBDC6", |
151 | "x c #59595E", | 145 | "x c #59595E", |
152 | "y c #76767C", | 146 | "y c #76767C", |
153 | "z c #373738", | 147 | "z c #373738", |
154 | "A c #717174", | 148 | "A c #717174", |
155 | "B c #727278", | 149 | "B c #727278", |
156 | "C c #1C1C1E", | 150 | "C c #1C1C1E", |
157 | "D c #3C3C3F", | 151 | "D c #3C3C3F", |
158 | "E c #ADADB6", | 152 | "E c #ADADB6", |
159 | "F c #54555A", | 153 | "F c #54555A", |
160 | "G c #8B8C94", | 154 | "G c #8B8C94", |
161 | "H c #5A5A5F", | 155 | "H c #5A5A5F", |
162 | "I c #BBBBC3", | 156 | "I c #BBBBC3", |
163 | "J c #C4C4CB", | 157 | "J c #C4C4CB", |
164 | "K c #909098", | 158 | "K c #909098", |
165 | "L c #737379", | 159 | "L c #737379", |
166 | "M c #343437", | 160 | "M c #343437", |
167 | "N c #8F8F98", | 161 | "N c #8F8F98", |
168 | "O c #000407", | 162 | "O c #000407", |
169 | "P c #2D3137", | 163 | "P c #2D3137", |
170 | "Q c #B0B1BC", | 164 | "Q c #B0B1BC", |
171 | "R c #3B3C40", | 165 | "R c #3B3C40", |
172 | "S c #6E6E74", | 166 | "S c #6E6E74", |
173 | "T c #95959C", | 167 | "T c #95959C", |
174 | "U c #74747A", | 168 | "U c #74747A", |
175 | "V c #1D1D1E", | 169 | "V c #1D1D1E", |
176 | "W c #91929A", | 170 | "W c #91929A", |
177 | "X c #42444A", | 171 | "X c #42444A", |