#pragma once

#include <tdemainwindow.h>
#include <tqptrlist.h>
#include "ossdevicewidget.h"

class OssModel;
class OssDevice;
class OssTray;
class TQComboBox;
class TQTabWidget;
class TQHBoxLayout;
class TQLabel;
class TQWidgetStack;
class TQWidget;
class TDEGlobalAccel;

class OssMixerWindow : public TDEMainWindow
{
    TQ_OBJECT
public:
    explicit OssMixerWindow( OssModel *model, TQWidget *parent = 0 );

    void setTray( OssTray *tray ) { m_tray = tray; }

signals:
    void settingsChanged();

public slots:
    void bringToFront();
    void quit();
    void showPreferences();
    void showAbout();

private slots:
    void slotVolumeUp();
    void slotVolumeDown();
    void slotToggleMute();
    void slotConfigureGlobalShortcuts();

protected:
    bool queryClose();
    void showEvent( TQShowEvent *e );

private slots:
    void onCardChanged( int idx );
    void onDeviceAdded( OssDevice *dev );

private:
    void rebuildTabs( int cardIdx );

    OssModel       *m_model;
    OssTray        *m_tray;
    TDEGlobalAccel *m_globalAccel;
    bool          m_posRestored;
    TQWidgetStack *m_outerStack;
    TQLabel       *m_errorLabel;
    TQComboBox    *m_cardCombo;
    TQTabWidget   *m_tabs;
    TQWidget      *m_outputPage;
    TQWidget      *m_inputPage;
    TQHBoxLayout  *m_outputLayout;
    TQHBoxLayout  *m_inputLayout;
    TQPtrList<OssDeviceWidget> m_widgets;
};
