2013-08-05 14:56:38 +02:00
|
|
|
|
|
|
|
#include "logic.hxx"
|
|
|
|
|
|
|
|
#include "jack.hxx"
|
|
|
|
extern Jack* jack;
|
|
|
|
|
|
|
|
Logic::Logic()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-08-05 18:52:53 +02:00
|
|
|
void Logic::tapTempo()
|
|
|
|
{
|
|
|
|
jack->getTimeManager()->tap();
|
|
|
|
}
|
|
|
|
|
2013-08-05 14:56:38 +02:00
|
|
|
void Logic::trackVolume(int t, float v)
|
|
|
|
{
|
2013-08-16 13:50:31 +02:00
|
|
|
if ( t < 0 ) // master track
|
|
|
|
{
|
|
|
|
jack->masterVolume(v);
|
|
|
|
jack->getControllerUpdater()->masterVolume( v );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jack->getTrackOutput( t )->setMaster( v );
|
|
|
|
jack->getControllerUpdater()->volume( t, v );
|
|
|
|
}
|
2013-08-05 14:56:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Logic::trackRecordArm(int t, bool v)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Logic::trackSend(int t, int send, float v)
|
|
|
|
{
|
|
|
|
jack->getTrackOutput( t )->setSend( send, v );
|
|
|
|
jack->getControllerUpdater()->setTrackSend( t, send, v );
|
|
|
|
}
|
2013-08-13 18:03:33 +02:00
|
|
|
|
|
|
|
void Logic::looperClipLenght(int t, int s, int l)
|
|
|
|
{
|
|
|
|
jack->getLooper( t )->getClip( s )->setBeats(l);
|
|
|
|
}
|
2013-08-13 19:34:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
void Logic::looperUseAsTempo(int t, int s)
|
|
|
|
{
|
2013-08-22 00:50:52 +02:00
|
|
|
size_t clipBeats = jack->getLooper( t )->getClip( s )->getBeats();
|
|
|
|
size_t clipFrames = jack->getLooper( t )->getClip( s )->getBufferLenght();
|
2013-08-13 19:34:08 +02:00
|
|
|
|
2013-08-22 00:50:52 +02:00
|
|
|
if ( clipBeats > 0 )
|
2013-08-13 19:34:08 +02:00
|
|
|
{
|
2013-08-22 00:50:52 +02:00
|
|
|
size_t framesPerBeat = clipFrames / clipBeats;
|
|
|
|
jack->getTimeManager()->setFpb( framesPerBeat );
|
2013-08-13 19:34:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|