2013-09-06 01:28:11 +02:00
|
|
|
|
|
|
|
#include "state.hxx"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include "../event.hxx"
|
|
|
|
#include "../eventhandler.hxx"
|
|
|
|
|
2013-09-06 02:28:14 +02:00
|
|
|
#include "../jack.hxx"
|
|
|
|
|
|
|
|
extern Jack* jack;
|
|
|
|
|
2013-09-06 01:28:11 +02:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
State::State()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void State::registerStately(Stately* s)
|
|
|
|
{
|
|
|
|
statelys.push_back( s );
|
|
|
|
}
|
|
|
|
|
|
|
|
void State::save()
|
|
|
|
{
|
|
|
|
for( unsigned int i = 0; i < statelys.size(); i++)
|
|
|
|
{
|
|
|
|
statelys.at(i)->save();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void State::reset()
|
|
|
|
{
|
|
|
|
for( unsigned int i = 0; i < statelys.size(); i++)
|
|
|
|
{
|
|
|
|
statelys.at(i)->reset();
|
|
|
|
}
|
2013-09-06 02:28:14 +02:00
|
|
|
|
|
|
|
jack->getGridLogic()->updateState();
|
2013-09-06 01:28:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void State::finish()
|
|
|
|
{
|
|
|
|
// trigger the GUI to write the metadata to disk, as each component of the
|
|
|
|
// engine is done saving
|
|
|
|
|
|
|
|
EventStateSaveFinish e;
|
|
|
|
writeToGuiRingbuffer( &e );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int State::getNumStatelys()
|
|
|
|
{
|
|
|
|
return statelys.size();
|
|
|
|
}
|