summaryrefslogtreecommitdiffstats
path: root/kmix/kmixerwidget.h
blob: e07808b65b43955b4a4fe0bba72d00c0338d652f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
 * KMix -- KDE's full featured mini mixer
 *
 *
 * Copyright (C) 2000 Stefan Schimanski <[email protected]>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this program; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef KMIXERWIDGET_H
#define KMIXERWIDGET_H

#include <vector>

#include <tqwidget.h>
#include <tqptrlist.h>
class TQString;
class TQGridLayout;

#include <kpanelapplet.h>
class TDEPopupMenu;

#include "mixer.h"
#include "mixdevicewidget.h"

// QT
class TQSlider;


// KDE
class TDEActionCollection;
class TDEActionMenu;
class TDEConfig;
class KTabWidget;

// KMix
class Mixer;
#include "viewbase.h"
class ViewInput;
class ViewOutput;
class ViewSwitches;
// KMix experimental
class ViewGrid;
class ViewSurround;


class KMixerWidget : public TQWidget  
{
   Q_OBJECT
  

  public:
   KMixerWidget( int _id, Mixer *mixer, const TQString &mixerName,
                 MixDevice::DeviceCategory categoryMask = MixDevice::ALL ,
                 TQWidget *parent=0, const char *name=0, ViewBase::ViewFlags vflags=0 );
   ~KMixerWidget();
	
   enum KMixerWidgetIO { OUTPUT=0, INPUT };

   const Mixer *mixer() const { return _mixer; };

  int id() const { return m_id; };

   TDEActionCollection* getActionCollection() const { return 0; /* m_actions; */ }
	
  signals:
   void masterMuted( bool );
   void newMasterVolume(Volume vol);
   void toggleMenuBar();

  public slots:
   void setTicks( bool on );
   void setLabels( bool on );
   void setIcons( bool on );
   void setValueStyle( int vs );
   void toggleMenuBarSlot();

   void saveConfig( TDEConfig *config, const TQString &grp );
   void loadConfig( TDEConfig *config, const TQString &grp );

  private slots:
      //void updateBalance();
      void balanceChanged(int balance);

  private:
   Mixer *_mixer;
   TQSlider *m_balanceSlider;
   TQVBoxLayout *m_topLayout; // contains the Card selector, TabWidget and balance slider

   KTabWidget* m_ioTab;

	std::vector<ViewBase*> _views;
   int m_id;

   TDEActionMenu *m_toggleMixerChannels;

   bool _iconsEnabled;
   bool _labelsEnabled;
   bool _ticksEnabled;
   int _valueStyle;
   MixDevice::DeviceCategory m_categoryMask;

   void createLayout(ViewBase::ViewFlags vflags);
   void possiblyAddView(ViewBase* vbase);
};

#endif