/***************************************************************************
 * tabgracenote.h: implementation of TabGraceNote class
 *
 * This file is part of KGuitar, a KDE tabulature editor
 *
 * copyright (C) 2006- 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 "tabgracenote.h"
#include "util/assert.h"

TabGraceNote::TabGraceNote()
: mDuration(0),
  mDynamic(NoneDynamic),
  mFret(0),
  mTransition(NoneTransition)
{
}

TabGraceNote::~TabGraceNote()
{
}

void TabGraceNote::clone(const TabGraceNote* grace)
{
	PRECONDITION( grace != 0x0 );
	
	mDuration = grace->mDuration;
	mDynamic = grace->mDynamic;
	mFret = grace->mFret;
	mTransition = grace->mTransition;
}

void TabGraceNote::setGraceNoteDuration(int i)
{
	mDuration = i;
}

int TabGraceNote::graceNoteDuration() const
{
	return mDuration;
}

void TabGraceNote::setGraceNoteDynamic(Dynamic d)
{
	mDynamic = d;
}

Dynamic TabGraceNote::graceNoteDynamic() const
{
	return mDynamic;
}

void TabGraceNote::setGraceNoteFret(int i)
{
	mFret = i;
}

int TabGraceNote::graceNoteFret() const
{
	return mFret;
}

void TabGraceNote::setGraceNoteTransition(GraceNoteTransition g)
{
	mTransition = g;
}

GraceNoteTransition TabGraceNote::graceNoteTransition() const
{
	return mTransition;
}

bool TabGraceNote::operator==(const TabGraceNote& grace) const
{
	return (mDuration == grace.mDuration && mDynamic == grace.mDynamic &&
			mFret == grace.mFret && mTransition == grace.mTransition);
}

bool TabGraceNote::operator!=(const TabGraceNote& grace) const
{
	return !this->operator==(grace);
}
