static void start_preview(LiVESButton *button, lives_rfx_t *rfx) { int i; char *com; lives_widget_set_sensitive(mainw->framedraw_preview,FALSE); lives_widget_context_update(); if (mainw->did_rfx_preview) { lives_kill_subprocesses(cfile->handle,TRUE); if (cfile->start==0) { cfile->start=1; cfile->end=cfile->frames; } do_rfx_cleanup(rfx); } com=lives_strdup_printf("%s clear_pre_files \"%s\" 2>%s",prefs->backend_sync,cfile->handle,LIVES_DEVNULL); lives_system(com,TRUE); // clear any .pre files from before for (i=0; i<rfx->num_params; i++) { rfx->params[i].changed=FALSE; } mainw->cancelled=CANCEL_NONE; mainw->error=FALSE; // within do_effect() we check and if do_effect(rfx,TRUE); // actually start effect processing in the background lives_widget_set_sensitive(mainw->framedraw_spinbutton,TRUE); lives_widget_set_sensitive(mainw->framedraw_scale,TRUE); if (mainw->framedraw_frame>cfile->start&&!(cfile->start==0&&mainw->framedraw_frame==1)) lives_spin_button_set_value(LIVES_SPIN_BUTTON(mainw->framedraw_spinbutton),cfile->start); else { load_rfx_preview(rfx); } mainw->did_rfx_preview=TRUE; }
static void start_preview(LiVESButton *button, lives_rfx_t *rfx) { int i; char *com; lives_widget_set_sensitive(mainw->framedraw_preview,FALSE); lives_widget_context_update(); if (mainw->did_rfx_preview) { #ifndef IS_MINGW com=lives_strdup_printf("%s stopsubsub \"%s\" 2>/dev/null",prefs->backend_sync,cfile->handle); lives_system(com,TRUE); // try to stop any in-progress preview #else // get pid from backend FILE *rfile; ssize_t rlen; char val[16]; int pid; com=lives_strdup_printf("%s get_pid_for_handle \"%s\"",prefs->backend_sync,cfile->handle); rfile=popen(com,"r"); rlen=fread(val,1,16,rfile); pclose(rfile); memset(val+rlen,0,1); pid=atoi(val); lives_win32_kill_subprocesses(pid,TRUE); #endif lives_free(com); if (cfile->start==0) { cfile->start=1; cfile->end=cfile->frames; } do_rfx_cleanup(rfx); } #ifndef IS_MINGW com=lives_strdup_printf("%s clear_pre_files \"%s\" 2>/dev/null",prefs->backend_sync,cfile->handle); #else com=lives_strdup_printf("%s clear_pre_files \"%s\" 2>NUL",prefs->backend_sync,cfile->handle); #endif lives_system(com,TRUE); // clear any .pre files from before for (i=0; i<rfx->num_params; i++) { rfx->params[i].changed=FALSE; } mainw->cancelled=CANCEL_NONE; mainw->error=FALSE; // within do_effect() we check and if do_effect(rfx,TRUE); // actually start effect processing in the background lives_widget_set_sensitive(mainw->framedraw_spinbutton,TRUE); lives_widget_set_sensitive(mainw->framedraw_scale,TRUE); if (mainw->framedraw_frame>cfile->start&&!(cfile->start==0&&mainw->framedraw_frame==1)) lives_spin_button_set_value(LIVES_SPIN_BUTTON(mainw->framedraw_spinbutton),cfile->start); else { load_rfx_preview(rfx); } mainw->did_rfx_preview=TRUE; }