/*  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.

*/

#include "mixerintegercontrol.h"
#include "mixerintegercontrol_p.h"

namespace Phonon
{
namespace Mixer
{

MixerIntegerControl::MixerIntegerControl(MixerIntegerControlPrivate &dd)
    : MixerControl(dd)
{
}

MixerIntegerControl::MixerIntegerControl(const MixerIntegerControl &rhs)
    : MixerControl(*new MixerIntegerControlPrivate(const_cast<MixerIntegerControlSharedData *>(rhs.d_func()->s_func())))
{
}

MixerIntegerControl &MixerIntegerControl::operator=(const MixerIntegerControl &rhs)
{
    MixerControl::operator=(rhs);
    return *this;
}

int MixerIntegerControl::minimumValue() const
{
    K_S(const MixerIntegerControl);
    return s->m_minimumValue;
}

int MixerIntegerControl::maximumValue() const
{
    K_S(const MixerIntegerControl);
    return s->m_maximumValue;
}

int MixerIntegerControl::singleStep() const
{
    K_S(const MixerIntegerControl);
    return s->m_singleStep;
}

int MixerIntegerControl::pageStep() const
{
    K_S(const MixerIntegerControl);
    return s->m_pageStep;
}

int MixerIntegerControl::value() const
{
    K_S(const MixerIntegerControl);
    return s->value();
}

void MixerIntegerControl::setValue(int v)
{
    K_S(MixerIntegerControl);
    s->setValue(v);
}

template<> MixerIntegerControl mixercontrol_cast<MixerIntegerControl>(const MixerControl &mc)
{
    if (mc.type() == MixerControl::Integer) {
        return static_cast<const MixerIntegerControl &>(mc);
    }
    return MixerIntegerControl(*new MixerIntegerControlPrivate(0));
}

MixerIntegerControl::Category MixerIntegerControl::category() const
{
    K_S(const MixerIntegerControl);
    return s->m_category;
}

} // namespace Mixer
} // namespace Phonon

template<> PHONON_MIXER_EXPORT Phonon::Mixer::MixerIntegerControl qobject_cast<Phonon::Mixer::MixerIntegerControl>(QObject *o)
{
    Phonon::Mixer::MixerIntegerControlSharedData *s = qobject_cast<Phonon::Mixer::MixerIntegerControlSharedData *>(o);
    return Phonon::Mixer::MixerIntegerControl(*new Phonon::Mixer::MixerIntegerControlPrivate(s));
}

// vim: sw=4 sts=4 et tw=100
