#pragma once

#include <tqobject.h>
#include <tqstring.h>

class TmixApp;

class BackendController : public TQObject
{
    TQ_OBJECT
public:
    explicit BackendController( TQObject *parent = 0 );
    ~BackendController();

    void start();

public slots:
    void onSettingsChanged();

private slots:
    void doSwitch();

private:
    void stop();
    void startPulse( bool showWindow = false );
    void startAlsa(  bool showWindow = false );
    void startOss(   bool showWindow = false );

    TQString m_currentBackend;

#ifdef WITH_PULSE
    class PulseModel    *m_pulseModel;
    class MixerWindow   *m_pulseWin;
#endif
#ifdef WITH_ALSA
    class AlsaModel      *m_alsaModel;
    class AlsaMixerWindow *m_alsaWin;
    class AlsaTray        *m_alsaTray;
#endif
#ifdef WITH_OSS
    class OssModel       *m_ossModel;
    class OssMixerWindow *m_ossWin;
    class OssTray        *m_ossTray;
#endif
};
