~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to noatun/noatun/modules/winskin/waStereo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  standard Button for winamp Skin
 
3
  Copyright (C) 1999  Martin Vogt
 
4
 
 
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.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
#include <waStereo.h>
 
15
 
 
16
 
 
17
WaStereo::WaStereo(WaSkinModell* waSkinModell,QWidget* parent,char* name):
 
18
QWidget(parent,name){
 
19
  this->waSkinModell=waSkinModell;
 
20
  connect(waSkinModell,SIGNAL(event_WA_SKIN_MONOSTER_STEREO_FALSE()),
 
21
          this,SLOT(pixmapChange()));
 
22
  stereoPixmap=new QPixmap();
 
23
  noStereoPixmap=new QPixmap();
 
24
  lStereo=false;
 
25
  QSize size=sizeHint();
 
26
  stereoPixmap->resize(size.width(),size.height());
 
27
  noStereoPixmap->resize(size.width(),size.height());
 
28
 
 
29
  WaSkinDesc* waSkinDesc=
 
30
    waSkinModell->getWaSkinMapDesc(_WA_MAPPING_MONOSTER_STEREO);
 
31
  setGeometry((*waSkinDesc->getGeometry()));
 
32
  pixmapChange();
 
33
}
 
34
 
 
35
WaStereo::~WaStereo() {
 
36
  delete noStereoPixmap;
 
37
  delete stereoPixmap;
 
38
}
 
39
 
 
40
 
 
41
 
 
42
 
 
43
QSize WaStereo::sizeHint() const {
 
44
  WaSkinDesc* waSkinDesc=
 
45
    waSkinModell->getWaSkinMapDesc(_WA_MAPPING_MONOSTER_STEREO);
 
46
  return QSize(waSkinDesc->getWidgetWidth(),waSkinDesc->getWidgetHeight());
 
47
}
 
48
 
 
49
 
 
50
void WaStereo::paintEvent ( QPaintEvent * paintEvent ) {
 
51
 
 
52
  QPainter paint;
 
53
 
 
54
  int stereo=getStereo();
 
55
  if (stereo) {
 
56
    paint.begin( this );
 
57
    paint.drawPixmap(0,0,*stereoPixmap);
 
58
    paint.end();  
 
59
  } else {
 
60
    paint.begin( this );
 
61
    paint.drawPixmap(0,0,*noStereoPixmap);
 
62
    paint.end();  
 
63
  }
 
64
 
 
65
}
 
66
 
 
67
 
 
68
void WaStereo::setStereo(int lStereo) {
 
69
  this->lStereo=lStereo;
 
70
  pixmapChange();
 
71
}
 
72
 
 
73
int WaStereo::getStereo() {
 
74
  return lStereo;
 
75
}
 
76
 
 
77
 
 
78
void WaStereo::pixmapChange() {
 
79
 
 
80
  stereoPixmap=waSkinModell->get(_WA_SKIN_MONOSTER_STEREO_TRUE);
 
81
  noStereoPixmap=waSkinModell->get(_WA_SKIN_MONOSTER_STEREO_FALSE);
 
82
 
 
83
  repaint(false);
 
84
}
 
85
     
 
86
#include "waStereo.moc"