pan: load and save of value implemented (close #164)

main
Harry van Haaren 2017-01-09 14:45:47 +00:00
parent 0de1784e8f
commit 908bb89878
10 changed files with 26 additions and 2 deletions

View File

@ -84,6 +84,7 @@ public:
virtual void specialScene(int t, int scene) {}
/// track functionality
virtual void pan(int t, float p) {}
virtual void mute(int t, bool b) {}
virtual void volume(int t, float f) {}
virtual void progress(int t, int s, float f) {}

View File

@ -142,6 +142,12 @@ void LupppGUI::volume(int t, float f)
writeToGuiRingbuffer( &e );
}
void LupppGUI::pan(int t, float p)
{
EventTrackPan e( t, p );
writeToGuiRingbuffer( &e );
}
void LupppGUI::progress(int t, int s, float f)
{
EventLooperProgress e( t, f );

View File

@ -53,6 +53,7 @@ public:
void specialScene(int t, int scene);
void pan(int t, float p);
void mute(int t, bool b);
void volume(int t, float f);
void progress(int t, int s, float p);

View File

@ -172,6 +172,11 @@ void ControllerUpdater::volume(int t, float v)
for(unsigned int i = 0; i < c.size(); i++) c.at(i)->volume(t,v);
}
void ControllerUpdater::pan(int t, float p)
{
for(unsigned int i = 0; i < c.size(); i++) c.at(i)->pan(t,p);
}
void ControllerUpdater::tapTempo(bool b)
{
for(unsigned int i = 0; i < c.size(); i++) c.at(i)->tapTempo(b);

View File

@ -81,6 +81,8 @@ public:
void volume(int t, float v);
void pan(int t, float p);
void tapTempo(bool b);
void metronomeEnable(bool b);

View File

@ -599,6 +599,7 @@ int DiskReader::readTracks()
} else {
EventTrackPan e( t, pan->valuedouble );
writeToDspRingbuffer( &e );
LUPPP_WARN("Track %i has pan %f", pan->valuedouble);
}
}
// sends

View File

@ -396,7 +396,6 @@ int DiskWriter::writeSession()
cJSON_AddNumberToObject( track, "fader", gui->getTrack(t)->getVolume()->value() );
cJSON_AddNumberToObject( track, "pan", gui->getTrack(t)->getPan());
cJSON_AddNumberToObject( track, "sendAmount" , gui->getTrack(t)->getSend() );
cJSON_AddNumberToObject( track, "sendActive" , gui->getTrack(t)->getSendActive() );

View File

@ -178,6 +178,14 @@ void handleGuiEvents()
}
break;
}
case Event::TRACK_PAN: {
if ( availableRead >= sizeof(EventTrackPan) ) {
EventTrackPan ev;
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventTrackPan) );
gui->getTrack(ev.track)->setPan( ev.pan );
}
break;
}
case Event::TRACK_RECORD_ARM: {

View File

@ -67,6 +67,7 @@ public:
float getSend();
float getXSide();
float getPan() {return panDial.value(); }
float setPan(float p) {panDial.value( (p+1.f)*0.5 ); }
bool getSendActive();
bool getKeyActive();

View File

@ -75,7 +75,7 @@ void Logic::trackPan(int t, float p)
{
if ( t >= 0 && t < NTRACKS ) {
jack->getTrackOutput( t )->setPan( p );
//jack->getControllerUpdater()->volume( t, v );
jack->getControllerUpdater()->pan( t, p );
}
}