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

#include <tqwidget.h>
#include <tqdatetime.h>

class PulseModel;
class AudioDevice;
class DeviceWidget;
class TQVBoxLayout;
class TQPushButton;

class TmixPopup : public TQWidget
{
    TQ_OBJECT

public:
    explicit TmixPopup( PulseModel *model, TQWidget *parent = 0 );

    // Position relative to tray icon and show, or hide if already visible.
    void toggleAt( const TQPoint &trayGlobalPos, const TQSize &traySize );

    // True for ~300ms after hiding — prevents re-show on the same click.
    bool justHidden() const;

signals:
    void showMixerRequested();

protected:
    void hideEvent( TQHideEvent *e );
    void wheelEvent( TQWheelEvent *e );

private slots:
    void onDefaultOutputChanged( AudioDevice *dev );

private:
    void setDevice( AudioDevice *dev );

    PulseModel   *m_model;
    DeviceWidget *m_devWidget;
    TQVBoxLayout  *m_layout;
    TQTime         m_hideTime;
};