/*  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 MIXERINTEGERCONTROL_P_H
#define MIXERINTEGERCONTROL_P_H

#include "mixercontrol_p.h"
#include "mixerintegercontrol.h"
#include "defs_p.h"

namespace Phonon
{
namespace Mixer
{

class MixerIntegerControlSharedData : public MixerControlSharedData
{
    friend class MixerIntegerControl;
    friend class MixerIntegerControlPrivate;
    friend class MixerSharedData;
    Q_OBJECT
    public:
        MixerIntegerControlSharedData(const MixerSharedData::Ptr &mixer, const AlsaElementId &id,
                MixerIntegerControl::Category category);

        typedef QExplicitlySharedDataPointer<MixerIntegerControlSharedData> Ptr;

        virtual void valueChangeEvent();

    Q_SIGNALS:
        void valueChanged(int);

    public Q_SLOTS:
        void setValue(int);

    private:
        virtual void init() {}
        int value() const;

        int m_lastValue;
        int m_minimumValue;
        int m_maximumValue;
        int m_singleStep;
        int m_pageStep;
        MixerIntegerControl::Category m_category;
};

class MixerIntegerControlPrivate : public MixerControlPrivate
{
    Q_DECLARE_PUBLIC(MixerIntegerControl)
    K_DECLARE_SHARED(MixerIntegerControl)
    public:
        MixerIntegerControlPrivate(MixerIntegerControlSharedData *s) : MixerControlPrivate(MixerControlSharedData::Ptr(s)) {}
};

} // namespace Mixer
} // namespace Phonon
#endif // MIXERINTEGERCONTROL_P_H
