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

« back to all changes in this revision

Viewing changes to noatun/noatun/modules/winskin/waVolumeSlider.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
  jumpslider for winamp skins
 
3
  Copyright (C) 1998  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 <waVolumeSlider.h>
 
15
 
 
16
 
 
17
WaVolumeSlider::WaVolumeSlider(WaSkinModell* waSkinModell,
 
18
                               QWidget *parent, const char *name) :
 
19
  QWidget(parent,name) {
 
20
 
 
21
  this->waSkinModell=waSkinModell;
 
22
 WaSkinDesc* waSkinDesc=waSkinModell->getWaSkinMapDesc(_WA_MAPPING_VOLUME_BAR);
 
23
  setGeometry((*waSkinDesc->getGeometry()));
 
24
}
 
25
 
 
26
 
 
27
WaVolumeSlider::~WaVolumeSlider() {
 
28
}
 
29
 
 
30
 
 
31
void WaVolumeSlider::buildGui() {
 
32
  ws = new WaSlider(waSkinModell,_WA_MAPPING_VOLUME_BAR,
 
33
                    _WA_MAPPING_VOLUME_SLIDER,
 
34
                    parentWidget());
 
35
  ws->setPixmapSliderButtonUp(SIGNAL(event_WA_SKIN_VOLUME_SLIDER_NORM()),
 
36
                              _WA_SKIN_VOLUME_SLIDER_NORM);
 
37
  ws->setPixmapSliderButtonDown(SIGNAL(event_WA_SKIN_VOLUME_SLIDER_PRES()),
 
38
                                _WA_SKIN_VOLUME_SLIDER_PRES);
 
39
  ws->setPixmapSliderBar(SIGNAL(event_WA_SKIN_VOLUME_BAR()),
 
40
                         _WA_SKIN_VOLUME_BAR);
 
41
 
 
42
  sizeHint();
 
43
 
 
44
  connect(ws,SIGNAL(valueChanged(int)),this,SIGNAL(volumeSetValue(int)));
 
45
}
 
46
 
 
47
QSize WaVolumeSlider::sizeHint() const {
 
48
  return ws->sizeHint();
 
49
}
 
50
 
 
51
void WaVolumeSlider::paintEvent ( QPaintEvent * paintEvent ) {
 
52
  // nothing
 
53
}
 
54
 
 
55
  
 
56
void WaVolumeSlider::setVolumeValue(int val) {
 
57
  int currVal=ws->value();
 
58
  if (currVal != val) {
 
59
    ws->setValue(val);
 
60
  }
 
61
}
 
62
 
 
63
 
 
64
#include "waVolumeSlider.moc"