Major refactoring: State, mouse and more...
This commit is contained in:
@@ -82,6 +82,54 @@ namespace VISEQ::GRAPH::NODES {
|
||||
int Ggate(){
|
||||
return midi_gate;
|
||||
}
|
||||
void interact(){
|
||||
|
||||
if(IsKeyDown(KEY_LEFT_CONTROL) && !IsKeyDown(KEY_LEFT_ALT)){
|
||||
switch(state->settings.mode){
|
||||
case 0:{
|
||||
midiNode->midi_note += wheel;
|
||||
break;}
|
||||
case 1:{
|
||||
midiNode->midi_cc += wheel;
|
||||
break;}
|
||||
case 2:{
|
||||
midiNode->midi_pitch_bend += wheel;
|
||||
break;}
|
||||
};
|
||||
if(midiNode->midi_note < 0 ) midiNode->midi_note = VISEQ::MIDI::Notes.size()-1;
|
||||
if(midiNode->midi_note >= VISEQ::MIDI::Notes.size() ) midiNode->midi_note = 0;
|
||||
|
||||
if(midiNode->midi_cc < 0 ) midiNode->midi_cc = 127;
|
||||
if(midiNode->midi_cc > 127 ) midiNode->midi_cc = 0;
|
||||
|
||||
if(midiNode->midi_pitch_bend < 0 ) midiNode->midi_pitch_bend = 0;
|
||||
if(midiNode->midi_pitch_bend > 16383 ) midiNode->midi_pitch_bend = 16383;
|
||||
|
||||
} else if(IsKeyDown(KEY_LEFT_SHIFT) && !IsKeyDown(KEY_LEFT_ALT)) {
|
||||
midiNode->midi_velocity += wheel;
|
||||
if(midiNode->midi_velocity < 0 ) midiNode->midi_velocity = 127;
|
||||
if(midiNode->midi_velocity > 127 ) midiNode->midi_velocity = 0;
|
||||
} else if(IsKeyDown(KEY_LEFT_ALT)) {
|
||||
switch(state->settings.mode){
|
||||
case 0:{
|
||||
float incr = (float)wheel * (IsKeyDown(KEY_LEFT_SHIFT) ? 100.0f : IsKeyDown(KEY_LEFT_CONTROL) ? 1000.0f : 10.0f);
|
||||
midiNode->midi_gate += incr;
|
||||
if(midiNode->midi_gate < 0 ) midiNode->midi_gate = 0;
|
||||
break;}
|
||||
case 1:{
|
||||
midiNode->midi_cc_value += wheel;
|
||||
if(midiNode->midi_cc_value < 0 ) midiNode->midi_cc_value = 0;
|
||||
if(midiNode->midi_cc_value > 127 ) midiNode->midi_cc_value = 127;
|
||||
break;}
|
||||
case 2:{
|
||||
float incr = (float)wheel * (IsKeyDown(KEY_LEFT_SHIFT) ? 100.0f : IsKeyDown(KEY_LEFT_CONTROL) ? 1000.0f : 10.0f);
|
||||
midiNode->midi_pitch_bend += incr;
|
||||
if(midiNode->midi_pitch_bend < 0 ) midiNode->midi_pitch_bend = 0;
|
||||
if(midiNode->midi_pitch_bend > 16383 ) midiNode->midi_pitch_bend = 16383;
|
||||
break;}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void draw(Vec2Df mouse, Camera2D cam) override {
|
||||
Node::draw();
|
||||
|
||||
Reference in New Issue
Block a user