/*  This file is part of the KDE project
    Copyright (C) 2007 Matthias Kretz <kretz@kde.org>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License version 2 as published by the Free Software Foundation.

    This library 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
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.

*/

#ifndef PHONON_MIXER_H
#define PHONON_MIXER_H

#include "phonon_mixer_export.h"

namespace Phonon { namespace Mixer { class Mixer; } }
PHONON_MIXER_EXPORT uint qHash(const Phonon::Mixer::Mixer &);

#include <QtCore/QList>
#include <QtGui/QIcon>
#include <QtCore/QtGlobal>
#include <Phonon/AudioOutputDevice>

#include "mixerenumcontrol.h"
#include "mixerintegercontrol.h"
#include "mixertogglecontrol.h"

namespace Phonon
{
namespace Mixer
{

class MixerPrivate;
class MixerElement;
class MixerControlSet;
class PHONON_MIXER_EXPORT Mixer
{
    friend class MixerControlSet;
    friend uint ::qHash(const Phonon::Mixer::Mixer &);
    Q_DECLARE_PRIVATE(Mixer)
    public:
        const QObject *notifier() const;
        operator const QObject *() const { return notifier(); }

        enum Type {
            Invalid = -1,
            PhononControls
        };
        Mixer();
        Mixer(const Phonon::AudioOutputDevice &device);
        Mixer(Type type);
        Mixer(const QString deviceId);

        ~Mixer();

        Mixer(const Mixer &);
        Mixer &operator=(const Mixer &);
        bool operator==(const Mixer &) const;
        inline bool operator!=(const Mixer &rhs) const { return !operator==(rhs); }

        bool isValid() const;

        QString name() const;
        QIcon icon() const;

        QList<MixerControl> allControls() const;
        QList<MixerToggleControl> toggleControls() const;
        QList<MixerIntegerControl> integerControls() const;
        QList<MixerEnumControl> enumControls() const;

        QList<MixerControlSet> controlSets() const;

        MixerToggleControl addControl(MixerToggleControl::Category category, MixerControlSet &set);
        MixerIntegerControl addControl(MixerIntegerControl::Category category, int min, int max, int singleStep, int pageStep, MixerControlSet &set);
        MixerEnumControl addControl(MixerEnumControl::Category category, const QStringList &options, MixerControlSet &set);
        bool removeControl(const MixerControl &);

    protected:
        MixerPrivate *const d_ptr;
        //Mixer(MixerPrivate &);
};

} // namespace Mixer
} // namespace Phonon

#endif // PHONON_MIXER_H
