//-------------------------------------------------------------- void kinectGuiApp::keyPressed(int key){ if (key == 'H') { showGui = !showGui; } if (key == 'F') { ofToggleFullscreen(); } if (key == 'S') { saveSettings(); } if (key == 'L') { loadSettings(); } if (key == 'G') { grabMask(); } if (key == 'p') { playVideo(); } if (key == 'P') { pauseVideo(); } //if (key == ' ') { togglePlayVideo(); } if (key == ' ') { showBlobs = false; showMain = false; } if (key == 'C') { cueNextVideo(); } if (key == 'N') { playNextVideo(); } if (key == '1') { cueVideo(0); } if (key == '2') { cueVideo(1); } if (key == '3') { cueVideo(2); } if (key == '4') { cueVideo(3); } if (key == '5') { cueVideo(4); } if (key == '6') { cueVideo(5); } if (key == '7') { cueVideo(6); } if (key == '8') { cueVideo(7); } if (key == '9') { cueVideo(8); } if (key == '0') { cueVideo(9); } else if (key == 'g') { kinect.lineColor.set(ofColor(0,230,0,32)); } else if (key == 'b') { kinect.lineColor.set(ofColor(0,0,200,32)); } else if (key == 'y') { kinect.lineColor.set(ofColor(200,200,0,32)); } else if (key == 'm') { showBlobs = false; showMain = true; } }
//according to the request this fuction composes //checks if the request is valid and construct //a response string to reply the client void getResponse(rtspd_t* rtspd, char response[]){ int status = BAD_REQUEST; printf("getting ----------- response\n"); if(strcmp(rtspd->request, "SETUP") == 0){ printf("send setup response\n"); rtspd->sessionid = getSessionId(); status = getVideo(); printf("video file ok: %d\n", status); //initMovie(rtspd->videoName, rtspd->client_fd); rtspd->data = send_frame_data_new(rtspd->videoName, rtspd->client_fd); composeResponse(rtspd, status, response); //setup complete change state to ready strcpy(rtspd->current_state, "READY"); }else if(strcmp(rtspd->request, "PLAY") == 0&& strcmp(rtspd->current_state,"READY")==0){ status = OK; composeResponse(rtspd, status, response); streamVideo(rtspd->data); strcpy(rtspd->current_state, "PLAYING"); }else if(strcmp(rtspd->request, "PLAY")==0 && strcmp(rtspd->current_state, "PLAYING")==0){ status = OK; printf("start playing, %s, %d\n\n", rtspd->videoName,rtspd->client_fd); composeResponse(rtspd, status, response); streamVideo(rtspd->data); strcpy(rtspd->current_state, "PLAYING"); }else if(strcmp(rtspd->request, "PAUSE")==0 && strcmp(rtspd->current_state, "PLAYING")==0){ status = OK; printf("pause video \n"); pauseVideo(rtspd->data); composeResponse(rtspd, status, response); strcpy(rtspd->current_state, "READY"); }else if(strcmp(rtspd->request, "TEARDOWN")==0 &&(strcmp(rtspd->current_state, "PLAYING")==0 || strcmp(rtspd->current_state, "READY")==0)){ status = OK; printf("TEARDOWN video \n"); deleteTimer(rtspd->data); composeResponse(rtspd, status, response); strcpy(rtspd->current_state, "INIT"); }else{ status = NOT_VALID; composeResponse(rtspd, status, response); } }
VideoEditor::VideoEditor(NotesModule::Video* vid ,QWidget *parent) :QWidget(parent), ui(new Ui::VideoEditor), video(vid) { ui->setupUi(this); ui->videoPlayer->setMinimumHeight(170); ui->volumeSlider->setAudioOutput(ui->videoPlayer->audioOutput()); ui->volumeSlider->setEnabled(false); ui->pushButtonDelete->setEnabled(false); if (video){ ui->lineEditTitle->setText(dynamic_cast<NotesModule::Note*>(video)->getTitle()); ui->textEditDescription->setText(dynamic_cast<NotesModule::Multimedia*>(video)->getDescription()); } QObject::connect(ui->pushButtonSave,SIGNAL(clicked()),this,SLOT(saveVideo())); QObject::connect(ui->lineEditTitle,SIGNAL(textEdited(QString)),this,SLOT(activateSave(QString))); QObject::connect(ui->textEditDescription,SIGNAL(textChanged()),this,SLOT(activateSave())); QObject::connect(ui->pushButtonBrowse,SIGNAL(clicked()),this,SLOT(getVideoPath())); QObject::connect(ui->pushButtonPlay,SIGNAL(clicked()),this,SLOT(playVideo())); QObject::connect(ui->pushButtonStop,SIGNAL(clicked()),this,SLOT(stopVideo())); QObject::connect(ui->pushButtonPause,SIGNAL(clicked()),this,SLOT(pauseVideo())); QObject::connect(ui->pushButtonDelete,SIGNAL(clicked()),this,SLOT(delete_note())); }
void VideoPlayer::pauseAll(bool pause) { for (int i = 0; i < kVideoSlotCount; i++) pauseVideo(i, pause); }
JNIEXPORT void JNICALL Java_com_anvato_android_player_hls_HLSNativeConverter_Pause(JNIEnv *env, jobject obj, jdouble period) { LOGD("Pause() called %f", period); pauseVideo( period ); }
void kinectGuiApp::togglePlayVideo() { ofVideoPlayer vid = getCurVideo(); if ( vid.isPaused() ) { playVideo(); } else { pauseVideo(); } }