#pragma once

#include <ksystemtray.h>

class AudioDevice;
class PulseModel;
class TmixPopup;

class TmixTray : public KSystemTray
{
    TQ_OBJECT

public:
    TmixTray( TQWidget *parent );
    void setDevice( AudioDevice *dev );
    void setModel( PulseModel *model );

public slots:
    void updateIcon();
    void onRecordingActive( bool active );
    void onDeviceAdded( AudioDevice *dev );
    void onDeviceRemoved( AudioDevice *dev );

protected:
    void mousePressEvent( TQMouseEvent *e );
    void wheelEvent( TQWheelEvent *e );
    void contextMenuAboutToShow( TDEPopupMenu *menu );

public:
    void toggleRecordingPopup();

private slots:
    void executeSingleClick();

private:
    void updateRecordingTray();

    PulseModel   *m_model;
    AudioDevice  *m_device;
    KSystemTray  *m_recTray;
    TmixPopup    *m_popup;
    TmixPopup    *m_recPopup;
    int           m_popupMode;
    bool          m_popupShowOutput;
    bool          m_popupShowMic;
    bool          m_popupShowApps;
    int           m_recordingCount;
};
