/***************************************************************************
 * trackPosmodel.cpp
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 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 "trackposmodel.h"
#include "util/assert.h"

#include <limits>

TrackPosModel::TrackPosModel()
: mPosition()
{
}

TrackPosModel::TrackPosModel(int chord, int time, int bar)
: mPosition(chord, time, bar)
{
}

TrackPosModel::~TrackPosModel()
{
}

void TrackPosModel::clone(const TrackPos& position)
{
	mPosition.clone(position);
	
	notifyPositionUpdated();
}

TrackPos TrackPosModel::position() const
{
	return mPosition;
}

void TrackPosModel::incChord()
{
	mPosition.incChord();
	
	notifyPositionUpdated();
}

void TrackPosModel::decChord()
{
	mPosition.decChord();
	
	notifyPositionUpdated();
}

void TrackPosModel::setChord(int chord)
{
	mPosition.setChord(chord);
	
	notifyPositionUpdated();
}

int TrackPosModel::chord() const
{
	return mPosition.chord();;
}

void TrackPosModel::incBar()
{
	mPosition.incBar();
	
	notifyPositionUpdated();
}

void TrackPosModel::decBar()
{
	mPosition.decBar();
	
	notifyPositionUpdated();
}

void TrackPosModel::setBar(int bar)
{
	mPosition.setBar(bar);
	
	notifyPositionUpdated();
}

int TrackPosModel::bar() const
{
	return mPosition.bar();
}

void TrackPosModel::incTimes()
{
	mPosition.incTimes();
	
	notifyPositionUpdated();
}

void TrackPosModel::decTimes()
{
	mPosition.decTimes();
	
	notifyPositionUpdated();
}

void TrackPosModel::setTimes(int notes)
{
	mPosition.setTimes(notes);
	
	notifyPositionUpdated();
}

int TrackPosModel::times() const
{
	return mPosition.times();
}

bool TrackPosModel::operator==(const TrackPos& position) const
{
	return mPosition.operator==(position);
}

bool TrackPosModel::operator!=(const TrackPos& position) const
{
	return mPosition.operator!=(position);
}

bool TrackPosModel::operator<(const TrackPos& position) const
{
	return mPosition.operator<(position);
}

bool TrackPosModel::operator<=(const TrackPos& position) const
{
	return mPosition.operator<=(position);
}

bool TrackPosModel::operator>(const TrackPos& position) const
{
	return mPosition.operator>(position);
}

bool TrackPosModel::operator>=(const TrackPos& position) const
{
	return mPosition.operator>=(position);
}
