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

« back to all changes in this revision

Viewing changes to kmix/mixdevicewidget.h

  • 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
//-*-C++-*-
 
2
/*
 
3
 * KMix -- KDE's full featured mini mixer
 
4
 *
 
5
 *
 
6
 * Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de>
 
7
 *               1996-2000 Christian Esken <esken@kde.org>
 
8
 *                         Sven Fischer <herpes@kawo2.rwth-aachen.de>
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or
 
11
 * modify it under the terms of the GNU Library General Public
 
12
 * License as published by the Free Software Foundation; either
 
13
 * version 2 of the License, or (at your option) any later version.
 
14
 *
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
18
 * Library General Public License for more details.
 
19
 *
 
20
 * You should have received a copy of the GNU Library General Public
 
21
 * License along with this program; if not, write to the Free
 
22
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
23
 */
 
24
 
 
25
#ifndef MIXDEVICEWIDGET_H
 
26
#define MIXDEVICEWIDGET_H
 
27
 
 
28
#include <kpanelapplet.h>
 
29
 
 
30
#include <qwidget.h>
 
31
#include <volume.h>
 
32
#include <qlist.h>
 
33
#include <qpixmap.h>
 
34
#include <qrangecontrol.h>
 
35
 
 
36
class KLed;
 
37
class QLabel;
 
38
class QPopupMenu;
 
39
class KLedButton;
 
40
class MixDevice;
 
41
class KActionCollection;
 
42
class Mixer;
 
43
class QTimer;
 
44
class KSmallSlider;
 
45
class QSlider;
 
46
class KGlobalAccel;
 
47
 
 
48
class MixDeviceWidget
 
49
 : public QWidget
 
50
{
 
51
      Q_OBJECT
 
52
 
 
53
   public:
 
54
      MixDeviceWidget( Mixer *mixer, MixDevice* md,
 
55
                       bool showMuteLED, bool showRecordLED,
 
56
                       bool small, KPanelApplet::Direction dir,
 
57
                       QWidget* parent = 0, const char* name = 0);
 
58
      ~MixDeviceWidget();
 
59
 
 
60
      bool isDisabled();
 
61
      bool isMuted();
 
62
      bool isRecsrc();
 
63
      bool isStereoLinked() { return m_linked; };
 
64
      bool isLabeled();
 
65
 
 
66
      void setStereoLinked( bool value );
 
67
      void setLabeled( bool value );
 
68
      void setTicks( bool ticks );
 
69
      void setIcons( bool value );
 
70
      void setColors( QColor high, QColor low, QColor back );
 
71
      void setMutedColors( QColor high, QColor low, QColor back );
 
72
 
 
73
      KGlobalAccel *keys(void);
 
74
 
 
75
   public slots:
 
76
      void toggleRecsrc();
 
77
      void toggleMuted();
 
78
      void toggleStereoLinked();
 
79
 
 
80
      void setDisabled() { setDisabled( true ); };
 
81
      void setDisabled( bool value );
 
82
 
 
83
      void defineKeys();
 
84
   signals:
 
85
      void newVolume( int num, Volume volume );
 
86
      void newRecsrc( int num, bool on );
 
87
      void updateLayout();
 
88
      void rightMouseClick();
 
89
 
 
90
   private slots:
 
91
      void setRecsrc( bool value );
 
92
      void setMuted( bool value );
 
93
      void setUnmuted( bool value) { setMuted( !value ); };
 
94
      void setVolume( int channel, int volume );
 
95
      void setVolume( Volume volume );
 
96
      void contextMenu();
 
97
      void update();
 
98
      void volumeChange( int );
 
99
 
 
100
      void increaseVolume();
 
101
      void decreaseVolume();
 
102
   private:
 
103
      QPixmap getIcon( int icon );
 
104
      void setIcon( int icontype );
 
105
 
 
106
      void mousePressEvent( QMouseEvent *e );
 
107
      bool eventFilter( QObject*, QEvent* );
 
108
 
 
109
      void createWidgets( bool showMuteLED, bool showRecordLED );
 
110
 
 
111
      Mixer *m_mixer;
 
112
      MixDevice *m_mixdevice;
 
113
      QTimer *m_updateTimer;
 
114
      QList<QWidget> m_sliders;
 
115
      KActionCollection *m_actions;
 
116
      KGlobalAccel *m_keys;
 
117
 
 
118
      bool m_linked;
 
119
      bool m_disabled;
 
120
      KPanelApplet::Direction m_direction;
 
121
      bool m_small;
 
122
 
 
123
      QLabel *m_iconLabel;
 
124
      KLedButton *m_muteLED;
 
125
      KLedButton *m_recordLED;
 
126
      QLabel *m_label;
 
127
 
 
128
};
 
129
 
 
130
#endif