There is just one video I want to play on the PC side.

If I give gesture from my sensor to PC through COM port (having 4 gestures defined as follows),

  1. COMFORT CLOSE, the video should play or resume from the stamp where it has been paused previously
  2. COMFORT CLOSE PUSH should pause the video when step 1 is happening and COMFORT OPEN SWIPE should pause the video when step 3 is happening
  3. COMFORT OPEN, it should play in reverse or resume in reverse from the stamp where it has been paused previously.

and I can do any gesture at any time but I need all the functionalities working at any instance. Please help me achieve this task. I am planning to design a GUI on python or MATLAB. But the algorithm itself is pretty confusing for me to design.

I tried to design it using state machine and I actually am sure that it doesnt make any sense to me.

stamp = 0;
state = pause;
switch (state)
    {
    case play:
        play_ video(stamp);
        if (COMFORT CLOSE PUSH){
        stamp = getStamp(video);
        state = pause;
        }
        else if (COMFORT OPEN){
        state = revplay;
        }
        break;
    case pause:
        pause_ video;
        if(COMFORT OPEN){
        state = revplay;
        }
        else if (COMFORT CLOSE){
        state = play;
        }
        break;
    case revplay: 
        revplay_ video(stamp);
        if(COMFORT CLOSE){
        state = play;
        }
        if(COMFORT OPEN SWIPE){
        stamp = getStamp(video);
        state = pause;
        }
        break;

    default: 
    }

Please help.

0 Answers