Add control over Recursive function

Hello All, below i attached a code where i need a control on recursive function. Means, it should wait for my button press signal to move further.

`void PlaySongs::performance(int step){

step++;

if (waitForInterruptSys (iOnePin, -1) >0)
{
   cout<<"Push Button is pressed"<<endl;

   SoundNamespace::SoundProject::SoundProject project;

   project.Init();
   project.InitSound();

   project.StartInterruptThreads();
   project.LoadProject();
   project.AdjustSounds();
   project.LoadSounds(true);
   project.StartPlayingSounds();

   cout << "Initialization finished." << endl;


// Some C++ control statement NEEDS here  <--

/* here i need control, so that, after button pressed on bread board, it should move further
i.e. perform next statements, otherwise wait infinite time. something like cvWaitKey(0) from
opencv. Interrupt detected by (waitForInterruptSys (iOnePin, -1) >0). like written above. */.

if(step==3)
     return;
else
    performance(step);


 }
}`
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories