Commit e5d63bd6 authored by Harry van Haaren's avatar Harry van Haaren

-Arrow keys on keyboard move speical clip (thanks to ZTH for request)

parent 75e30def
......@@ -224,6 +224,8 @@ void handleGuiEvents()
{
gui->getTrack(i)->getClipSelector()->setSpecial( i == ev.track ? ev.scene : -1 );
}
gui->specialTrack = ev.track;
gui->specialScene = ev.scene;
} break; }
......
......@@ -126,6 +126,12 @@ void GridLogic::launchScene( int scene )
void GridLogic::specialScene(int t, int s)
{
if ( t < 0 ) t = 0;
if ( t >= NTRACKS ) t = NTRACKS-1;
if ( s < 0 ) s = 0;
if ( s >= NSCENES ) s = NSCENES-1;
selectedTrack = t;
selectedScene = s;
......
......@@ -425,7 +425,9 @@ Gui::Gui(const char* argZero) :
window.end();
tracks.at(0)->getClipSelector()->setSpecial( 0 );
specialTrack = 0;
specialScene = 0;
tracks.at( specialTrack )->getClipSelector()->setSpecial( specialScene );
optionWindow = new OptionsWindow();
......@@ -649,6 +651,12 @@ int Gui::keyboardHandler(int event)
}
}
// keyboard arrows to special key mapping
if ( Fl::event_key( FL_Left ) ) { EventGridSelectNewChosen e( gui->specialTrack-1, gui->specialScene ); writeToDspRingbuffer( &e ); return 1; }
if ( Fl::event_key( FL_Right ) ) { EventGridSelectNewChosen e( gui->specialTrack+1, gui->specialScene ); writeToDspRingbuffer( &e ); return 1; }
if ( Fl::event_key( FL_Up ) ) { EventGridSelectNewChosen e( gui->specialTrack , gui->specialScene-1); writeToDspRingbuffer( &e ); return 1; }
if ( Fl::event_key( FL_Down ) ) { EventGridSelectNewChosen e( gui->specialTrack , gui->specialScene+1); writeToDspRingbuffer( &e ); return 1; }
return 0;
}
......
......@@ -86,6 +86,12 @@ class Gui
int getWindowWidth(){return window.w();}
nsm_client_t* getNsm(){return nsm;}
/// current special clip:
int specialTrack;
int specialScene;
private:
vector<std::string> controllerVector;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment