Loopp/src/controllerupdater.hxx

82 lines
1.9 KiB
C++
Raw Normal View History

2013-05-18 22:12:36 +02:00
#ifndef LUPPP_CONTROLLER_UPDATER_H
#define LUPPP_CONTROLLER_UPDATER_H
#include <vector>
#include <iostream>
#include "controller/apc.hxx"
#include "controller/controller.hxx"
#include "gridlogic.hxx"
2013-05-18 22:12:36 +02:00
using namespace std;
/** ControllerUpdater
* Updates each registered controller when a certain event occurs. All output
* devices (MIDI controllers, GUI, OSC-UI's etc) are registered in order to
* stay up-to-date.
*
* This class does no scheduling, it passes the events to the Controllers
* immidiatly.
*
* The Logic class is the opposite of this: it takes input and Luppp processes
* it, pushing the relevant updates in state through ControllerUpdater to each
* registered device.
**/
2013-05-19 03:39:06 +02:00
class ControllerUpdater
2013-05-18 22:12:36 +02:00
{
public:
ControllerUpdater() {}
void registerController( Controller* controller )
2013-05-18 22:12:36 +02:00
{
std::cout << "ControllerUpdater registering " << controller->getName()
<< endl;
c.push_back( controller );
2013-05-18 22:12:36 +02:00
}
2013-05-18 22:12:36 +02:00
void mute(int t, bool b)
{
for(unsigned int i = 0; i < c.size(); i++)
c.at(i)->mute(t,b);
2013-05-18 22:12:36 +02:00
}
void setTrackSceneProgress(int t, int s, float p)
{
for(unsigned int i = 0; i < c.size(); i++)
c.at(i)->progress(t,s,p);
}
void setTrackSend(int t, int send, float v)
{
for(unsigned int i = 0; i < c.size(); i++)
c.at(i)->fxTrackSend(t, send, v);
}
void setSceneState(int t, int clip, GridLogic::State s)
2013-05-18 22:12:36 +02:00
{
2013-07-30 02:17:40 +02:00
for(unsigned int i = 0; i < c.size(); i++)
c.at(i)->setSceneState(t,clip,s);
2013-05-18 22:12:36 +02:00
}
void recordArm(int t, bool r)
2013-05-18 22:12:36 +02:00
{
2013-07-30 02:17:40 +02:00
for(unsigned int i = 0; i < c.size(); i++)
c.at(i)->recordArm(t,r);
2013-05-18 22:12:36 +02:00
}
void volume(int t, float v)
{
2013-07-30 02:17:40 +02:00
for(unsigned int i = 0; i < c.size(); i++) c.at(i)->volume(t,v);
2013-05-18 22:12:36 +02:00
}
private:
2013-05-19 02:26:18 +02:00
std::vector<Controller*> c;
2013-05-18 22:12:36 +02:00
};
#endif // LUPPP_CONTROLLER_UPDATER_H