/***************************************************************************
 * tabmixchanges.h: implementation of TabMixChanges
 *
 * This file is part of KGuitar, a KDE tabulature editor
 *
 * copyright (C) 2003-2007 the KTabEdit development team <mrgwen@gmail.com>
 ***************************************************************************/

/***************************************************************************
 * 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) any later version.
 *
 * See the file COPYING for more information.
 ***************************************************************************/
 
#include "tabmixtablechanges.h"

#include "util/assert.h"

TabMixTableChanges::TabMixTableChanges()
: instrumentMix(-1),
  volumeMix(-1),
  balanceMix(-1),
  chorusMix(-1),
  reverbMix(-1),
  phaserMix(-1),
  tremoloMix(-1),
  tempoMix(-1)
{
}

TabMixTableChanges::~TabMixTableChanges()
{
}

void TabMixTableChanges::clone(const TabMixTableChanges* mix)
{
	PRECONDITION( mix != 0x0 );
	
	instrumentMix = mix->instrumentMix;
	volumeMix = mix->volumeMix;
	balanceMix = mix->balanceMix;
	chorusMix = mix->chorusMix;
	reverbMix = mix->reverbMix;
	phaserMix = mix->phaserMix;
	tremoloMix = mix->tremoloMix;
	tempoMix = mix->tempoMix;
}

void TabMixTableChanges::setInstrument(int i)
{
	if (i < 0 || i > 255)
		return ;
	
	instrumentMix = i;
	
	emit mixChanged();
}

int TabMixTableChanges::instrument() const
{
	return instrumentMix;
}

void TabMixTableChanges::setVolume(int i)
{
	if (i < 0)
		return ;
	
	volumeMix = i;
	
	emit mixChanged();
}

int TabMixTableChanges::volume() const
{
	return volumeMix;
}

void TabMixTableChanges::setBalance(int i)
{
	balanceMix = i;
	
	emit mixChanged();
}

int TabMixTableChanges::balance() const
{
	return balanceMix;
}

void TabMixTableChanges::setChorus(int i)
{
	chorusMix = i;
	
	emit mixChanged();
}

int TabMixTableChanges::chorus() const
{
	return chorusMix;
}

void TabMixTableChanges::setReverb(int i)
{
	reverbMix = i;
	
	emit mixChanged();
}

int TabMixTableChanges::reverb() const
{
	return reverbMix;
}

void TabMixTableChanges::setPhaser(int i)
{
	phaserMix = i;
	
	emit mixChanged();
}

int TabMixTableChanges::phaser() const
{
	return phaserMix;
}

void TabMixTableChanges::setTremolo(int i)
{
	tremoloMix = i;
	
	emit mixChanged();
}

int TabMixTableChanges::tremolo() const
{
	return tremoloMix;
}

void TabMixTableChanges::setTempo(int i)
{
	tempoMix = i;
	
	emit mixChanged();
}

int TabMixTableChanges::tempo() const
{
	return tempoMix;
}

bool TabMixTableChanges::operator==(const TabMixTableChanges &mix) const
{
	return (this->instrumentMix == mix.instrumentMix
	&& this->volumeMix == mix.volumeMix
	&& this->balanceMix == mix.balanceMix
	&& this->chorusMix == mix.chorusMix
	&& this->reverbMix == mix.reverbMix
	&& this->phaserMix == mix.phaserMix
	&& this->tremoloMix == mix.tremoloMix
	&& this->tempoMix == mix.tempoMix);
}

bool TabMixTableChanges::operator!=(const TabMixTableChanges &mix) const
{
	return !(*this == mix);
}

#include "tabmixtablechanges.moc"
