Пример #1
0
static void ui_update_video_checkbox (GtkWidget *w, gpointer data)
{
    DBG(("ui_update_video_checkbox (audio:%d video:%d)", sound_is_recording(), screenshot_is_recording()));
    if (data) {
        uicommands_sound_record_stop();
        screenshot_stop_recording();
    }
    if (sound_is_recording() || screenshot_is_recording()) {
        gtk_widget_show(video_ctrl_checkbox);
    } else {
        gtk_widget_hide(video_ctrl_checkbox);
    }
}
Пример #2
0
/* Show the speed index to the user.  */
void ui_display_speed(float percent, float framerate, int warp_flag)
{
    int i;
    int percent_int = (int)(percent + 0.5);
    int framerate_int = (int)(framerate + 0.5);
    char *str = NULL;
    int num_app_shells = get_num_shells();

    if (percent) {
        str = lib_msprintf("%d%%, %dfps %s", percent_int, framerate_int, warp_flag ? _("(warp)") : "");
    }

    for (i = 0; i < num_app_shells; i++) {
        if (!percent) {
            XtVaSetValues(app_shells[i].speed_label, XtNlabel, warp_flag ? _("(warp)") : "", NULL);
        } else {
            XtVaSetValues(app_shells[i].speed_label, XtNlabel, str, NULL);
        }
    }
    lib_free(str);
    if (statustext_display_time > 0) {
        statustext_display_time--;
        if (statustext_display_time == 0) {
            statusbar_setstatustext("");
        }
    }

    if (!screenshot_is_recording()) {
#if !DEBUG_LAYOUT
        XtUnmanageChild(rec_button);
#endif /* DEBUG_LAYOUT */
    }
}
Пример #3
0
static int set_video_halve_framerate(int val, void *param)
{
    if (video_halve_framerate != val && screenshot_is_recording()) {
        ui_error("Can't change framerate while recording. Try again later.");
        return 0;
    }
    video_halve_framerate = val;
    return 0;
}
Пример #4
0
void sdl_menu_ffmpeg_shutdown(void)
{
    if (screenshot_is_recording()) {
        screenshot_stop_recording();
    }
}
Пример #5
0
int ui_screenshot_dialog(char *name, struct video_canvas_s *wid)
{
    int res, i;
    char *fn, *tmp;
    const char *driver, *ext;
    
    if (screenshot_dialog) {
    	gdk_window_show(screenshot_dialog->window);
	gdk_window_raise(screenshot_dialog->window);
	gtk_widget_show(screenshot_dialog);
    } else {
	screenshot_dialog = build_screenshot_dialog();
	if (screenshot_dialog)
	    g_signal_connect(G_OBJECT(screenshot_dialog),
			     "destroy",
			     G_CALLBACK(gtk_widget_destroyed),
			     &screenshot_dialog);
	else
	    return -1;
    }

    ui_popup(screenshot_dialog, _("Save Screenshot"), FALSE);
    res = gtk_dialog_run(GTK_DIALOG(screenshot_dialog));
    ui_popdown(screenshot_dialog);
    
    if (res != GTK_RESPONSE_ACCEPT)
	return -1;
    
    fn = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fileentry));
    if (!fn) {
	ui_error(_("Invalid filename"));
	return -1;
    }

    i = gtk_combo_box_get_active(GTK_COMBO_BOX(drv_menu));
    if (i < 0)
	return -1;

    driver = buttons[i].driver;
    ext = buttons[i].ext;
    
#ifdef HAVE_FFMPEG
    if (strcmp(driver, "FFMPEG") == 0)
    {
	int audio_bitrate, video_bitrate;

	audio_bitrate = (int) 
	    gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ffmpg_audio));
	resources_set_int("FFMPEGAudioBitrate", audio_bitrate);
	video_bitrate = (int) 
	    gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ffmpg_video));
	resources_set_int("FFMPEGVideoBitrate", video_bitrate);
	
	resources_set_string("FFMPEGFormat", selected_driver);
	resources_set_int("FFMPEGAudioCodec", selected_ac);
	resources_set_int("FFMPEGVideoCodec", selected_vc);
	log_message(LOG_DEFAULT, "FFMPEG: Driver: %s, ac: %d, vc: %d\n",
		    selected_driver, selected_ac, selected_vc);
    }
#endif    
    tmp = lib_stralloc(fn);
    lib_free(fn);
    if (!util_get_extension(tmp))
	util_add_extension(&tmp, ext);
    if (screenshot_save(driver, tmp, wid) < 0) {
	ui_error(_("Couldn't write screenshot to `%s' with driver `%s'."), 
		 tmp, driver);
	lib_free(tmp);
	return -1;
    } else {
	if (screenshot_is_recording())
	    gtk_widget_show(video_ctrl_checkbox);
	ui_message(_("Successfully wrote `%s'"), tmp);
	lib_free(tmp);
    }

    return 0;
}
Пример #6
0
void screenshot_prepare_reopen(void)
{
    reopen = (screenshot_is_recording() ? 1 : 0);
}