2
Modell for winamp skins
3
Copyright (C) 1999 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
16
#include <waSkinModell.h>
20
WaSkinModell::WaSkinModell() {
22
WaSkinOperation::makeEmptySkinModell(this);
27
WaSkinModell::~WaSkinModell() {
31
void WaSkinModell::load(int id,QPixmap* pixmap) {
34
lEmit=emitChangeEvent(id);
36
waSkinDesc[id].setPixmap(pixmap);
42
int WaSkinModell::emitChangeEvent(int id) {
47
emit(event_WA_SKIN_MAIN());
50
case _WA_SKIN_CBUTTONS_PREV_NORM: {
51
emit(event_WA_SKIN_CBUTTONS_PREV_NORM());
54
case _WA_SKIN_CBUTTONS_PREV_PRES: {
55
emit(event_WA_SKIN_CBUTTONS_PREV_PRES());
58
case _WA_SKIN_CBUTTONS_PLAY_NORM: {
59
emit(event_WA_SKIN_CBUTTONS_PLAY_NORM());
62
case _WA_SKIN_CBUTTONS_PLAY_PRES: {
63
emit(event_WA_SKIN_CBUTTONS_PLAY_PRES());
66
case _WA_SKIN_CBUTTONS_PAUSE_NORM: {
67
emit(event_WA_SKIN_CBUTTONS_PAUSE_NORM());
70
case _WA_SKIN_CBUTTONS_PAUSE_PRES: {
71
emit(event_WA_SKIN_CBUTTONS_PAUSE_PRES());
74
case _WA_SKIN_CBUTTONS_STOP_NORM: {
75
emit(event_WA_SKIN_CBUTTONS_STOP_NORM());
78
case _WA_SKIN_CBUTTONS_STOP_PRES: {
79
emit(event_WA_SKIN_CBUTTONS_STOP_PRES());
82
case _WA_SKIN_CBUTTONS_NEXT_NORM: {
83
emit(event_WA_SKIN_CBUTTONS_NEXT_NORM());
86
case _WA_SKIN_CBUTTONS_NEXT_PRES: {
87
emit(event_WA_SKIN_CBUTTONS_NEXT_PRES());
90
case _WA_SKIN_CBUTTONS_EJECT_NORM: {
91
emit(event_WA_SKIN_CBUTTONS_EJECT_NORM());
94
case _WA_SKIN_CBUTTONS_EJECT_PRESS: {
95
emit(event_WA_SKIN_CBUTTONS_EJECT_PRESS());
98
case _WA_SKIN_MONOSTER_STEREO_TRUE: {
99
emit(event_WA_SKIN_MONOSTER_STEREO_TRUE());
102
case _WA_SKIN_MONOSTER_STEREO_FALSE: {
103
emit(event_WA_SKIN_MONOSTER_STEREO_FALSE());
106
case _WA_SKIN_MONOSTER_MONO_TRUE: {
107
emit(event_WA_SKIN_MONOSTER_MONO_TRUE());
110
case _WA_SKIN_MONOSTER_MONO_FALSE: {
111
emit(event_WA_SKIN_MONOSTER_MONO_FALSE());
114
case _WA_SKIN_NUMBERS: {
115
emit(event_WA_SKIN_NUMBERS());
118
case _WA_SKIN_NUMBERS_MINUS: {
119
emit(event_WA_SKIN_NUMBERS_MINUS());
122
case _WA_SKIN_SHUFREP_REPEAT_NOT_SET_NORM: {
123
emit(event_WA_SKIN_SHUFREP_REPEAT_NOT_SET_NORM());
126
case _WA_SKIN_SHUFREP_REPEAT_NOT_SET_PRES: {
127
emit(event_WA_SKIN_SHUFREP_REPEAT_NOT_SET_PRES());
130
case _WA_SKIN_SHUFREP_REPEAT_SET_NORM: {
131
emit(event_WA_SKIN_SHUFREP_REPEAT_SET_NORM());
134
case _WA_SKIN_SHUFREP_REPEAT_SET_PRES: {
135
emit(event_WA_SKIN_SHUFREP_REPEAT_SET_PRES());
138
case _WA_SKIN_SHUFREP_SHUFFLE_NOT_SET_NORM: {
139
emit(event_WA_SKIN_SHUFREP_SHUFFLE_NOT_SET_NORM());
142
case _WA_SKIN_SHUFREP_SHUFFLE_NOT_SET_PRES: {
143
emit(event_WA_SKIN_SHUFREP_SHUFFLE_NOT_SET_PRES());
146
case _WA_SKIN_SHUFREP_SHUFFLE_SET_NORM: {
147
emit(event_WA_SKIN_SHUFREP_SHUFFLE_SET_NORM());
150
case _WA_SKIN_SHUFREP_SHUFFLE_SET_PRES: {
151
emit(event_WA_SKIN_SHUFREP_SHUFFLE_SET_PRES());
154
case _WA_SKIN_SHUFREP_PLAYLIST_NOT_SET_NORM: {
155
emit(event_WA_SKIN_SHUFREP_PLAYLIST_NOT_SET_NORM());
158
case _WA_SKIN_SHUFREP_PLAYLIST_NOT_SET_PRES: {
159
emit(event_WA_SKIN_SHUFREP_PLAYLIST_NOT_SET_PRES());
162
case _WA_SKIN_SHUFREP_PLAYLIST_SET_NORM: {
163
emit(event_WA_SKIN_SHUFREP_PLAYLIST_SET_NORM());
166
case _WA_SKIN_SHUFREP_PLAYLIST_SET_PRES: {
167
emit(event_WA_SKIN_SHUFREP_PLAYLIST_SET_PRES());
170
case _WA_SKIN_SHUFREP_EQ_SET_NORM: {
171
emit(event_WA_SKIN_SHUFREP_EQ_SET_NORM());
174
case _WA_SKIN_SHUFREP_EQ_SET_PRES: {
175
emit(event_WA_SKIN_SHUFREP_EQ_SET_PRES());
178
case _WA_SKIN_SHUFREP_EQ_NOT_SET_NORM: {
179
emit(event_WA_SKIN_SHUFREP_EQ_NOT_SET_NORM());
182
case _WA_SKIN_SHUFREP_EQ_NOT_SET_PRES: {
183
emit(event_WA_SKIN_SHUFREP_EQ_NOT_SET_PRES());
186
case _WA_SKIN_TEXT: {
187
emit(event_WA_SKIN_TEXT());
190
case _WA_SKIN_VOLUME_BAR: {
191
emit(event_WA_SKIN_VOLUME_BAR());
194
case _WA_SKIN_VOLUME_BAR_ALL_BARS: {
197
case _WA_SKIN_VOLUME_SLIDER_NORM: {
198
emit(event_WA_SKIN_VOLUME_SLIDER_NORM());
201
case _WA_SKIN_VOLUME_SLIDER_PRES: {
202
emit(event_WA_SKIN_VOLUME_SLIDER_PRES());
205
case _WA_SKIN_BALANCE_BAR: {
206
emit(event_WA_SKIN_BALANCE_BAR());
209
case _WA_SKIN_BALANCE_SLIDER_NORM: {
210
emit(event_WA_SKIN_BALANCE_SLIDER_NORM());
213
case _WA_SKIN_BALANCE_SLIDER_PRES: {
214
emit(event_WA_SKIN_BALANCE_SLIDER_PRES());
217
case _WA_SKIN_POS_BAR: {
218
emit(event_WA_SKIN_POS_BAR());
221
case _WA_SKIN_POS_BAR_SLIDER_NORM: {
222
emit(event_WA_SKIN_POS_BAR_SLIDER_NORM());
225
case _WA_SKIN_POS_BAR_SLIDER_PRES: {
226
emit(event_WA_SKIN_POS_BAR_SLIDER_PRES());
229
case _WA_SKIN_PLAYPAUS_PLAY: {
230
emit(event_WA_SKIN_PLAYPAUS_PLAY());
233
case _WA_SKIN_PLAYPAUS_PAUSE: {
234
emit(event_WA_SKIN_PLAYPAUS_PAUSE());
237
case _WA_SKIN_PLAYPAUS_STOP: {
238
emit(event_WA_SKIN_PLAYPAUS_STOP());
241
case _WA_SKIN_TITLE: {
242
emit(event_WA_SKIN_TITLE());
245
case _WA_SKIN_TITLE_SHADE_PRES: {
246
emit(event_WA_SKIN_TITLE_SHADE_PRES());
248
case _WA_SKIN_TITLE_SHADE_NORM: {
249
emit (event_WA_SKIN_TITLE_SHADE_NORM());
259
QPixmap* WaSkinModell::get(int id) {
261
if ((id < 0) || (id >= _WA_SKIN_ENTRIES)) {
264
back=waSkinDesc[id].getPixmap();
270
WaSkinDesc* WaSkinModell::getWaSkinDesc(int id) {
271
if ((id < 0) || (id >= _WA_SKIN_ENTRIES)) {
274
WaSkinDesc* back=&(waSkinDesc[id]);
279
WaSkinDesc* WaSkinModell::getWaSkinMapDesc(int id) {
280
if ((id < 0) || (id >= _WA_MAPPING_ENTRIES)) {
283
WaSkinDesc* back=&(waSkinMap[id]);
289
QPixmap* WaSkinModell::get(int id,int argument) {
292
case _WA_SKIN_POS_BAR : {
293
QPixmap* dest=get(_WA_SKIN_POS_BAR);
297
case _WA_SKIN_VOLUME_BAR : {
298
int percent=argument;
299
QPixmap* allBars=get(_WA_SKIN_VOLUME_BAR_ALL_BARS);
300
QPixmap* dest=get(_WA_SKIN_VOLUME_BAR);
301
int nBar=(int)((float)percent*(float)28/(float)100);
302
bitBlt(dest,0,0,allBars,0,15*nBar,68,13);
306
case _WA_SKIN_BALANCE_BAR : {
307
int percent=argument;
308
QPixmap* allBars=get(_WA_SKIN_VOLUME_BAR_ALL_BARS);
309
QPixmap* dest=get(_WA_SKIN_BALANCE_BAR);
314
int nBar=(int)((float)percent*(float)28/(float)100);
315
bitBlt(dest,0,0,allBars,0,15*nBar,68,13);
323
QPixmap* dest=get(_WA_SKIN_VOLUME_BAR);
328
void WaSkinModell::getNumber(int id,char cNumber,QPixmap* dest) {
331
case _WA_SKIN_NUMBERS : {
333
QPixmap* pix=get(_WA_SKIN_NUMBERS_MINUS);
334
dest->resize(pix->width(),pix->height());
335
bitBlt(dest,0,0,pix);
339
QPixmap* pix=get(_WA_SKIN_NUMBERS);
343
bitBlt(dest,0,0,pix,10*9,0,9,13);
347
int number=cNumber-'0';
348
if ((number < 0) || (number > 9)) {
351
bitBlt(dest,0,0,pix,number*9,0,9,13);
355
case _WA_SKIN_TEXT: {
356
getText(cNumber,dest);
369
void WaSkinModell::getText(char zeichen,QPixmap* dest) {
370
QPixmap* pix=get(_WA_SKIN_TEXT);
372
if (('A' <= zeichen) && (zeichen <= 'Z')) {
373
bitBlt(dest,0,0,pix,(zeichen-'A')*5,0,5,6);
376
if (('a' <= zeichen) && (zeichen <= 'z')) {
377
bitBlt(dest,0,0,pix,(zeichen-'a')*5,0,5,6);
380
if (('0' <= zeichen) && (zeichen <= '9')) {
381
bitBlt(dest,0,0,pix,(zeichen-'0')*5,6,5,6);
384
if ('"' == zeichen) {
385
bitBlt(dest,0,0,pix,27*5,0,5,6);
388
if ('@' == zeichen) {
389
bitBlt(dest,0,0,pix,28*5,0,5,6);
394
if ('.' == zeichen) {
395
bitBlt(dest,0,0,pix,11*5,6,5,6);
398
if (':' == zeichen) {
399
bitBlt(dest,0,0,pix,12*5,6,5,6);
402
if ('(' == zeichen) {
403
bitBlt(dest,0,0,pix,13*5,6,5,6);
406
if (')' == zeichen) {
407
bitBlt(dest,0,0,pix,14*5,6,5,6);
410
if ('-' == zeichen) {
411
bitBlt(dest,0,0,pix,15*5,6,5,6);
414
if ('`' == zeichen) {
415
bitBlt(dest,0,0,pix,16*5,6,5,6);
418
if ('!' == zeichen) {
419
bitBlt(dest,0,0,pix,17*5,6,5,6);
422
if ('_' == zeichen) {
423
bitBlt(dest,0,0,pix,18*5,6,5,6);
426
if ('+' == zeichen) {
427
bitBlt(dest,0,0,pix,19*5,6,5,6);
430
if ('\\' == zeichen) {
431
bitBlt(dest,0,0,pix,20*5,6,5,6);
434
if ('/' == zeichen) {
435
bitBlt(dest,0,0,pix,21*5,6,5,6);
438
if ('[' == zeichen) {
439
bitBlt(dest,0,0,pix,22*5,6,5,6);
442
if (']' == zeichen) {
443
bitBlt(dest,0,0,pix,23*5,6,5,6);
446
if ('^' == zeichen) {
447
bitBlt(dest,0,0,pix,24*5,6,5,6);
450
if ('&' == zeichen) {
451
bitBlt(dest,0,0,pix,25*5,6,5,6);
454
if ('%' == zeichen) {
455
bitBlt(dest,0,0,pix,26*5,6,5,6);
458
if (',' == zeichen) {
459
bitBlt(dest,0,0,pix,27*5,6,5,6);
462
if ('=' == zeichen) {
463
bitBlt(dest,0,0,pix,28*5,6,5,6);
466
if ('$' == zeichen) {
467
bitBlt(dest,0,0,pix,29*5,6,5,6);
470
if ('#' == zeichen) {
471
bitBlt(dest,0,0,pix,30*5,6,5,6);
474
if (('�' == zeichen) || ('�' == zeichen)) {
475
bitBlt(dest,0,0,pix,0*5,12,5,6);
478
if (('�' == zeichen) || ('�' == zeichen)) {
479
bitBlt(dest,0,0,pix,1*5,12,5,6);
482
if (('�' == zeichen) || ('�' == zeichen)) {
483
bitBlt(dest,0,0,pix,2*5,12,5,6);
486
if ('?' == zeichen) {
487
bitBlt(dest,0,0,pix,3*5,12,5,6);
490
if ('*' == zeichen) {
491
bitBlt(dest,0,0,pix,4*5,12,5,6);
494
// default back is space char
495
bitBlt(dest,0,0,pix,(10*5),12,5,6);
501
void WaSkinModell::setSkinDirectory(QString dir) {
506
QString WaSkinModell::getSkinDirectory() {
511
#include "waSkinModell.moc"