mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
Merge pull request #218 from georgkrause/cleanup
Cleanup, thanks @georgkrause
This commit is contained in:
commit
e00c403b19
9 changed files with 1 additions and 301 deletions
|
@ -122,14 +122,4 @@ void AudioBuffer::nonRtResize(unsigned long size)
|
|||
{
|
||||
bufferL.resize(size);
|
||||
bufferR.resize(size);
|
||||
}
|
||||
|
||||
/*
|
||||
ostream& AudioBuffer::operator<<(ostream& o, const AudioBuffer& a)
|
||||
{
|
||||
o << "AudioBuffer " << a.name <<
|
||||
" beats: " << a.numBeats <<
|
||||
" audioFrames: " << a.audioFrames << endl;
|
||||
return o;
|
||||
}
|
||||
*/
|
||||
}
|
|
@ -61,8 +61,6 @@ public:
|
|||
|
||||
void nonRtResize(unsigned long size);
|
||||
|
||||
//friend ostream& operator<<(ostream& o, const AudioBuffer& a);
|
||||
|
||||
protected:
|
||||
static int privateID;
|
||||
int ID;
|
||||
|
|
|
@ -203,232 +203,6 @@ void GenericMIDI::trackJackSendActivate(int t, bool a)
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
void GenericMIDI::progress(int t, int s, float f)
|
||||
{
|
||||
|
||||
unsigned char data[3];
|
||||
data[0] = 176;
|
||||
data[1] = 48; // record enable LED
|
||||
data[2] = 127 * f;
|
||||
jack->midiObserverWriteMIDI( _port, &data[0] );
|
||||
|
||||
}
|
||||
|
||||
void GenericMIDI::trackSend(int t, int send, float v)
|
||||
{
|
||||
if ( t >= NTRACKS)
|
||||
{
|
||||
// master track
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned char data[3];
|
||||
|
||||
if ( send == SEND_KEY )
|
||||
{
|
||||
data[0] = 144 + t;
|
||||
data[1] = 49;
|
||||
data[2] = v > 0.5 ? 127 : 0 ;
|
||||
}
|
||||
else if ( send == SEND_XSIDE )
|
||||
{
|
||||
data[0] = 176 + t;
|
||||
data[1] = 16;
|
||||
data[2] = 127 * v;
|
||||
}
|
||||
else if ( send == SEND_POSTFADER )
|
||||
{
|
||||
data[0] = 176 + t;
|
||||
data[1] = 17;
|
||||
data[2] = 127 * v;
|
||||
}
|
||||
|
||||
jack->midiObserverWriteMIDI( _port, &data[0] );
|
||||
}
|
||||
|
||||
void GenericMIDI::launchScene( int s )
|
||||
{
|
||||
unsigned char data[3];
|
||||
|
||||
for(int i = 0; i < 5; i++ )
|
||||
{
|
||||
data[0] = 128;
|
||||
data[1] = 82 + i; // scene play
|
||||
data[2] = 0;
|
||||
jack->midiObserverWriteMIDI( _port, &data[0] );
|
||||
}
|
||||
|
||||
data[0] = 144;
|
||||
data[1] = 82 + s;
|
||||
data[2] = 127;
|
||||
jack->midiObserverWriteMIDI( _port, &data[0] );
|
||||
}
|
||||
|
||||
void GenericMIDI::mute(int t, bool b)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GenericMIDI::volume(int t, float f)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GenericMIDI::noteOn( int track, int note, int vel )
|
||||
{
|
||||
printf("apc noteOn: t = %i, n = %i, vel = %i\n", track, note, vel);
|
||||
if ( note >= 53 && note <= 57 )
|
||||
{
|
||||
if ( shiftPressed )
|
||||
{
|
||||
footpedalTrack = track;
|
||||
footpedalScene = note - 53;
|
||||
}
|
||||
else
|
||||
jack->getGridLogic()->pressed( track, note - 53 );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
switch( note )
|
||||
{
|
||||
case 48: { // record
|
||||
jack->getLogic()->trackRecordArm(track, true);
|
||||
} break;
|
||||
case 49: { // solo / cue
|
||||
jack->getLogic()->trackSend(track, SEND_KEY, 1);
|
||||
} break;
|
||||
|
||||
case 82: // Master Scene Clips
|
||||
case 83:
|
||||
case 84:
|
||||
case 85:
|
||||
case 86: {
|
||||
jack->getGridLogic()->launchScene(note - 82);
|
||||
} break;
|
||||
|
||||
case 98: { // Shift
|
||||
shiftPressed = true;
|
||||
break; }
|
||||
|
||||
case 99: { // tap tempo
|
||||
jack->getLogic()->tapTempo();
|
||||
jack->getControllerUpdater()->tapTempo( true );
|
||||
} break;
|
||||
case 100: { // nudge +
|
||||
|
||||
} break;
|
||||
case 101: { // nudge -
|
||||
|
||||
} break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void GenericMIDI::noteOff( int track, int note, int vel )
|
||||
{
|
||||
printf("apc noteOff: t = %i, n = %i, vel = %i\n", track, note, vel);
|
||||
if ( note >= 53 && note <= 57 )
|
||||
{
|
||||
jack->getGridLogic()->released( track, note - 53 );
|
||||
}
|
||||
|
||||
switch( note )
|
||||
{
|
||||
case 48: { // record
|
||||
jack->getLogic()->trackRecordArm(track, false);
|
||||
} break;
|
||||
case 49: { // solo / cue
|
||||
jack->getLogic()->trackSend(track, SEND_KEY, 0);
|
||||
}
|
||||
|
||||
case 99: { // tap tempo
|
||||
EventTimeTempoTap e(false);
|
||||
writeToGuiRingbuffer( &e );
|
||||
} break;
|
||||
|
||||
case 82: // scene launch
|
||||
case 83:
|
||||
case 84:
|
||||
case 85:
|
||||
case 86: {
|
||||
int s = jack->getGridLogic()->getLaunchedScene();
|
||||
launchScene( s );
|
||||
} break ;
|
||||
|
||||
case 98: { // Shift
|
||||
shiftPressed = false;
|
||||
break; }
|
||||
}
|
||||
}
|
||||
|
||||
void GenericMIDI::ccChange( int track, int cc, float value )
|
||||
{
|
||||
if ( track >= 0 && track < NTRACKS )
|
||||
{
|
||||
switch( cc )
|
||||
{
|
||||
/// Track faders
|
||||
case 7: {
|
||||
jack->getLogic()->trackVolume( track, value );
|
||||
break; }
|
||||
case 14: { // master
|
||||
jack->getLogic()->trackVolume( -1, value );
|
||||
break; }
|
||||
|
||||
/// X-Fader
|
||||
case 15: {
|
||||
jack->getTimeManager()->setBpm( 60 + value * 180 );
|
||||
break; }
|
||||
|
||||
/// Device Control
|
||||
case 16: {
|
||||
//jack->getLogic()->trackSend( track, SEND_KEY, value );
|
||||
break; }
|
||||
case 17: {
|
||||
jack->getLogic()->trackSend( track, SEND_XSIDE, value );
|
||||
break; }
|
||||
case 18: {
|
||||
jack->getLogic()->trackSend( track, SEND_POSTFADER, value );
|
||||
break; }
|
||||
|
||||
|
||||
case 64: { // FootSwitch 1
|
||||
if ( value > 0.5 )
|
||||
{
|
||||
printf("footpedal press %i, %i\n", footpedalTrack, footpedalScene );
|
||||
jack->getGridLogic()->pressed( footpedalTrack, footpedalScene );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("footpedal release %i, %i\n", footpedalTrack, footpedalScene );
|
||||
jack->getGridLogic()->released( footpedalTrack, footpedalScene );
|
||||
} break; }
|
||||
case 67: { // FootSwitch 2
|
||||
|
||||
break; }
|
||||
}
|
||||
}
|
||||
else
|
||||
// tracks outside normal track range
|
||||
// handle master track buttons etc here
|
||||
{
|
||||
if ( cc == 16 ) // master device control select
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
void GenericMIDI::midi(unsigned char* midi)
|
||||
{
|
||||
int status = midi[0];
|
||||
|
|
|
@ -52,9 +52,6 @@ public:
|
|||
std::string getAuthor();
|
||||
std::string getEmail();
|
||||
|
||||
/// track actions
|
||||
//void mute(int t, bool b);
|
||||
|
||||
void metronomeEnable(bool b);
|
||||
|
||||
void launchScene( int scene );
|
||||
|
@ -65,14 +62,6 @@ public:
|
|||
void recordArm(int t, bool b);
|
||||
void setSceneState(int track, int clip, GridLogic::State s);
|
||||
|
||||
/*
|
||||
void progress(int t, int s, float f);
|
||||
void launchScene( int scene );
|
||||
|
||||
/// track FX
|
||||
void trackSend(int t, int send, float v);
|
||||
*/
|
||||
|
||||
void trackSend(int t, int send, float v);
|
||||
void trackSendActive(int t, int send, bool a);
|
||||
|
||||
|
|
|
@ -218,33 +218,6 @@ int DiskWriter::writeControllerFile( Controller* c )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//std::vector<Binding*> b = g->getMidiToAction();
|
||||
/*
|
||||
cJSON* outputBindings = cJSON_CreateArray();
|
||||
cJSON_AddItemToObject(controllerJson, "outputBindings", outputBindings );
|
||||
|
||||
for(unsigned int i = 0; i < b.size(); i++ )
|
||||
{
|
||||
// create binding
|
||||
cJSON* binding = cJSON_CreateObject();
|
||||
cJSON_AddItemToArray( outputBindings, binding );
|
||||
|
||||
// add metadata to binding
|
||||
// FIXME: get action string from Event class: need to move function from GenericMIDI to there
|
||||
cJSON_AddItemToObject( binding, "action", cJSON_CreateString( "gridlogic:launchscene" ) );
|
||||
|
||||
cJSON_AddNumberToObject( binding, "status", b.at(i)->status );
|
||||
cJSON_AddNumberToObject( binding, "data" , b.at(i)->data );
|
||||
|
||||
cJSON_AddNumberToObject( binding, "track" , b.at(i)->track );
|
||||
cJSON_AddNumberToObject( binding, "scene" , b.at(i)->scene );
|
||||
cJSON_AddNumberToObject( binding, "send" , b.at(i)->send );
|
||||
cJSON_AddNumberToObject( binding, "active", b.at(i)->active );
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// write the sample JSON node to <samplePath>/sample.cfg
|
||||
stringstream controllerCfgPath;
|
||||
controllerCfgPath << getenv("HOME") << "/.config/openAV/luppp/controllers/" << g->getName() << ".ctlr";
|
||||
|
|
|
@ -300,14 +300,6 @@ void handleDspEvents()
|
|||
|
||||
case Event::FX_REVERB:
|
||||
break;
|
||||
/*{
|
||||
if ( availableRead >= sizeof(EventFxReverb) ) {
|
||||
EventFxReverb ev;
|
||||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventFxReverb) );
|
||||
// TODO implement reverb
|
||||
break; }
|
||||
}
|
||||
*/
|
||||
case Event::TRACK_VOLUME: {
|
||||
if ( availableRead >= sizeof(EventTrackVol) ) {
|
||||
EventTrackVol ev;
|
||||
|
|
|
@ -397,14 +397,6 @@ Gui::Gui(const char* argZero) :
|
|||
|
||||
window.color( fl_rgb_color (7,7,7) );
|
||||
|
||||
/*
|
||||
tooltipLabel = new Fl_2(130, 25, 500, 20, "");
|
||||
tooltipLabel->labelcolor( FL_LIGHT2 );
|
||||
tooltipLabel->color( FL_DARK2 );
|
||||
tooltipLabel->hide();
|
||||
//tooltipLabel->align( FL_ALIGN_TOP_LEFT );
|
||||
*/
|
||||
|
||||
// horizontal no-resize-images group
|
||||
Fl_Group* headerImages = new Fl_Group( 0, 0, 1110, 650, "header");
|
||||
{
|
||||
|
|
|
@ -96,10 +96,6 @@ Jack::Jack( std::string name ) :
|
|||
|
||||
resetMidiBindingState();
|
||||
|
||||
//GenericMIDI* tmp = new GenericMIDI("akai_apc.ctlr");
|
||||
//tmp->registerComponents();
|
||||
//controllerUpdater->registerController( static_cast<Controller*>(tmp) );
|
||||
|
||||
buffers.nframes = jack_get_buffer_size( client );
|
||||
buffers.samplerate = jack_get_sample_rate( client );
|
||||
|
||||
|
|
|
@ -74,10 +74,6 @@ void TimeManager::setBpm(float bpm)
|
|||
barCounter = 0;
|
||||
beatCounter = 0;
|
||||
beatFrameCountdown = -1;
|
||||
/*
|
||||
for(int i=0;i<observers.size();i++)
|
||||
observers[i]->resetTimeState();
|
||||
*/
|
||||
}
|
||||
|
||||
void TimeManager::setBpmZeroOne(float b)
|
||||
|
|
Loading…
Add table
Reference in a new issue