Final polisihing for KDE4:
[kdemultimedia.git] / kmix / mixdevicewidget.h
blob5cc6b3ab9bed5910a51250e724b3cb623ae596a6
1 //-*-C++-*-
2 /*
3 * KMix -- KDE's full featured mini mixer
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>
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 #ifndef MIXDEVICEWIDGET_H
26 #define MIXDEVICEWIDGET_H
28 #include <QWidget>
29 #include "volume.h"
30 #include <qpixmap.h>
33 class KLed;
34 class KAction;
35 class KActionCollection;
37 class MixDevice;
38 class Mixer;
39 class ViewBase;
41 class MixDeviceWidget
42 : public QWidget
44 Q_OBJECT
46 public:
47 MixDeviceWidget( MixDevice* md,
48 bool small, Qt::Orientation orientation,
49 QWidget* parent = 0, ViewBase* mw = 0 );
50 ~MixDeviceWidget();
52 void addActionToPopup( KAction *action );
54 virtual bool isDisabled() const;
55 MixDevice* mixDevice() { return m_mixdevice; }
57 virtual void setColors( QColor high, QColor low, QColor back );
58 virtual void setIcons( bool value );
59 virtual void setMutedColors( QColor high, QColor low, QColor back );
61 virtual bool isStereoLinked() const { return false; }
62 virtual void setStereoLinked( bool ) {}
63 virtual void setLabeled( bool );
64 virtual void setTicks( bool ) {}
67 public slots:
68 virtual void setDisabled( bool value );
69 virtual void defineKeys();
70 virtual void update();
71 virtual void showContextMenu();
73 protected slots:
74 void volumeChange( int );
75 virtual void setVolume( int channel, int volume );
76 virtual void setVolume( Volume volume );
78 protected:
79 MixDevice* m_mixdevice;
80 KActionCollection* _mdwActions;
81 KActionCollection* _mdwPopupActions;
82 ViewBase* m_view;
83 bool m_disabled;
84 Qt::Orientation _orientation;
85 bool m_small;
87 private:
88 void mousePressEvent( QMouseEvent *e );
91 #endif