~ubuntu-branches/ubuntu/oneiric/muse/oneiric

« back to all changes in this revision

Viewing changes to mixer/volslider.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-23 17:28:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020423172823-w8yplzr81a759xa3
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=========================================================
 
2
//  MusE
 
3
//  Linux Music Editor
 
4
//  $Id: volslider.cpp,v 1.1 2002/01/30 12:08:38 muse Exp $
 
5
//
 
6
//  (C) Copyright 2000 Werner Schweer (ws@seh.de)
 
7
//=========================================================
 
8
 
 
9
#include <math.h>
 
10
#include "../audiothread.h"
 
11
#include "volslider.h"
 
12
#include "globals.h"
 
13
 
 
14
//---------------------------------------------------------
 
15
//   VolSlider
 
16
//---------------------------------------------------------
 
17
 
 
18
VolSlider::VolSlider(QWidget* parent, AudioNode* s)
 
19
   : Slider(parent, "vol", Slider::Vertical, Slider::None, Slider::BgTrough | Slider::BgSlot)
 
20
      {
 
21
      src = s;
 
22
      connect(this, SIGNAL(valueChanged(double)), SLOT(valueChanged(double)));
 
23
      }
 
24
 
 
25
//---------------------------------------------------------
 
26
//   volChanged
 
27
//---------------------------------------------------------
 
28
 
 
29
void VolSlider::valueChanged(double val)
 
30
      {
 
31
      double vol = pow(10.0, val/20.0);
 
32
      audioThread->msgSetVolume(src, vol);
 
33
      emit volChanged(val);
 
34
      }
 
35
 
 
36