/*
    This file is part of kenvy24 KDE multimedia utility
    Copyright (c) 2007  Valentin RUSU kenvy24@rusu.info

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License or (at
    your option) version 3 or, at the discretion of KDE e.V. (which shall
    act as a proxy as in section 14 of the GPLv3), any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef MIXERPART_H_INCLUDED
#define MIXERPART_H_INCLUDED

#include <kenvy24part.h>

class Ui_MixerPart;
class QWidget;
class EnvyCard;
class QTimer;
class MixerPartChannel;

/**
 * This part displays the mixer controls
 */
class MixerPart : public KEnvy24Part< Ui_MixerPart>
{
    Q_OBJECT

    private:
        EnvyCard*           envyCard;
        QTimer*             updateTimer;
        MixerPartChannel*   channelWav1;
        MixerPartChannel*   channelWav2;
        MixerPartChannel*   channelWav3;
        MixerPartChannel*   channelWav4;
        MixerPartChannel*   channelMaster;
        MixerPartChannel*   channelCdIn;
        MixerPartChannel*   channelLineIn;
        MixerPartChannel*   channelMicIn;
        MixerPartChannel*   channelDigitalIn;


    protected:
        virtual bool saveFile ();
        virtual bool openFile ();
        virtual void setActiveCard( EnvyCard* );
        virtual void widgetResizeEvent( QResizeEvent* );

    public:
        MixerPart( QWidget* parentWidget, QObject* parent, const QVariantList& );
        ~MixerPart();

    protected Q_SLOTS:
        void updateMeters();
        void lineInSourceChanged(int);
        void micInSourceChanged(int);

    Q_SIGNALS:
        void envyCardChanged( EnvyCard* );

    protected:
        virtual void saveConfig( KConfigGroup* configGroup );
        virtual void loadConfig( KConfigGroup* configGroup );

    private:
        void disconnectCard();
        void connectCard();
        void configureForCard();
};


#endif // MIXERPART_H_INCLUDED
// kate: space-indent on; indent-width 4; replace-tabs on;
