1 /*
2  * KMix -- KDE's full featured mini mixer
3  *
4  *
5  * Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this program; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20  */
21 
22 #ifndef KMIXERWIDGET_H
23 #define KMIXERWIDGET_H
24 
25 #include <vector>
26 
27 #include <QWidget>
28 class QString;
29 
30 
31 #include "core/ControlManager.h"
32 #include "core/mixer.h"
33 #include "gui/mixdevicewidget.h"
34 
35 // Qt
36 #include <QVBoxLayout>
37 
38 // KDE
39 class KActionCollection;
40 class KConfig;
41 
42 // KMix
43 class GUIProfile;
44 class ProfTab;
45 class Mixer;
46 #include "viewbase.h"
47 // KMix experimental
48 
49 
50 class KMixerWidget : public QWidget
51 {
52    Q_OBJECT
53 
54   public:
55    explicit KMixerWidget( Mixer *mixer,
56                           QWidget *parent, ViewBase::ViewFlags vflags, const QString  &guiprofId, KActionCollection* coll = nullptr );
57    ~KMixerWidget();
58 
mixer()59    Mixer *mixer() { return _mixer; }
60    ViewBase* currentView();
getGuiprof()61    GUIProfile* getGuiprof() { return GUIProfile::find(_guiprofId); }
62 
63 
64   signals:
65    void toggleMenuBar();
66 
67   public slots:
68    void setIcons( bool on );
69    void toggleMenuBarSlot();
70 
71    void saveConfig( KConfig *config );
72    void loadConfig( KConfig *config );
73 
74   private:
75    Mixer *_mixer;
76    QVBoxLayout *m_topLayout; // contains TabWidget
77    QString _guiprofId;
78    ProfTab* _tab;
79    std::vector<ViewBase*> _views;
80    KActionCollection* _actionCollection;  // -<- applications wide action collection
81 
82    void createLayout(ViewBase::ViewFlags vflags);
83    bool possiblyAddView(ViewBase* vbase);
84 };
85 
86 #endif
87