summaryrefslogtreecommitdiff
path: root/src/ui/mixerwindow.h
blob: fa613cdf09d63e93d41dfe791704ece33ebdc052 (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
#pragma once

#include <tqmap.h>
#include <tdemainwindow.h>

#include "../model/audiodevice.h"

class PulseModel;
class KTabWidget;
class TQHBoxLayout;
class TQWidgetStack;
class TQToolButton;
class DevicesPage;
class TQResizeEvent;

class MixerWindow : public TDEMainWindow
{
    TQ_OBJECT

public:
    explicit MixerWindow( PulseModel *model, TQWidget *parent = 0 );
    ~MixerWindow() {}

    struct Tab {
        TQWidget      *scroll;
        TQWidget      *page;
        TQHBoxLayout  *layout;
        int           count;
    };

protected:
    bool queryClose();
    bool eventFilter( TQObject *obj, TQEvent *e );
    void showEvent( TQShowEvent *e );

public slots:
    void bringToFront();

private slots:
    void onDeviceAdded( AudioDevice *dev );
    void onDeviceRemoved( AudioDevice *dev );
    void onDefaultOutputChanged( AudioDevice *dev );
    void showAbout();
    void showPreferences();
    void applySettings();
    void quit();
    void onAppAboutToQuit();
    void toggleDevices();

private:
    Tab &tabForCategory( AudioDevice::Category cat );
    void rebuildView();
    void updateDevicesButton();
    void repositionDevicesBtn();

    PulseModel        *m_model;
    KTabWidget        *m_tabs;
    class PreferencesDlg *m_prefsDlg;
    TQWidgetStack  *m_outerStack;
    TQWidgetStack  *m_stack;
    TQWidget       *m_allPage;
    TQWidget       *m_allStrip;
    TQHBoxLayout   *m_allLayout;
    int            m_allCount;
    class TmixTray *m_tray;
    TQToolButton   *m_devicesBtn;
    DevicesPage   *m_devicesPage;
    bool           m_devicesInTabs;  // true = DevicesPage is a tab in m_tabs
    bool           m_quitting;

    Tab m_output;
    Tab m_input;
    Tab m_playback;
    Tab m_recording;

    TQMap<AudioDevice*, TQWidget*> m_widgets;
};