/***************************************************************************
 * assistant.h: implementation of Assistant class
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 2003-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.
 ***************************************************************************/

#ifndef ASSISTANT_H
#define ASSISTANT_H

#include <QWizard>

#include <tse3/Error.h>
#include <tse3/listen/Transport.h>
#include <tse3/Metronome.h>
#include <tse3/MidiScheduler.h>
#include <tse3/Part.h>
#include <tse3/PhraseEdit.h>
#include <tse3/Song.h>
#include <tse3/TempoTrack.h>
#include <tse3/Track.h>
#include <tse3/Transport.h>
#include <tse3/util/MidiScheduler.h>

class QHBoxLayout;

class Timidity;
class TimidityLauncher;
class Tse3Assistant;

/**
	An assistant class. This class creates a wizard dialog within this wizard
	there is a timidity and TSE3 configuration utility.
*/
class Assistant: public QWizard {
	Q_OBJECT
public:
	/**
		Construct the wizard dialog box.
		The construtor creates the wizard dialog box and the pages inside this dialog
		box.
		@param parent the parent widget
		@param name the widget name
		@see QWizard constructor
	*/
	Assistant(TSE3::MidiSchedulerFactory& factory, QWidget* parent);
	
	/**
		Destructs the wizard dialog box.
		The destructor does nothing.
	*/
	virtual ~Assistant();
	
	/**
		Return the timidity launcher.
		@return the timidity launcher
	*/
	virtual TimidityLauncher* timidityLauncher() const;
	
	/**
		Return the midi scheduler.
		@return the midi scheduler
	*/
	virtual TSE3::MidiScheduler* midiScheduler() const;
	
	virtual void setupIntro();
	virtual void setupTimidity();
	virtual void setupTSE3();
	
	virtual void killTimidity();
	
	virtual void writeConfig();
public Q_SLOTS:
	virtual void back();
	virtual void next();
	virtual void restart();
	virtual void accept();
	virtual void reject();
private:
	enum { Page_Intro, Page_Timidity, Page_Tse3 };
	
	QHBoxLayout* mPage[3];
	TSE3::MidiScheduler* mScheduler;
	TimidityLauncher* mLauncher;
	Timidity* mTimidity;
	Tse3Assistant* mMidi;
	TSE3::MidiSchedulerFactory& mFactory;
};

#endif
