Пример #1
0
static void
slider_updated_actions(uint32_t GOP)
{
    // only do something if we have output, and auto refreshing
    if (options.auto_refresh)
        show_GOP(engine,GOP);

    if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button_run))) {
        display_flush(engine);
    }

    // make sure the parser is loaded
    if (mpeg2parser->getParsingState()==PARSER_STATE_FINISHED)
        update_GOP_info(GOP);

    // handle start/end button availability
    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button_start_mark))) {
        gtk_widget_set_sensitive(button_end_mark, (GOP >= mark_start));
    }
}
Пример #2
0
void game_draw(void)
{
	int i;
	
	// reset buffer at startup
	display_clear();
	
	// Draw players
	players_draw();
	
	// Draw ball
	display_drawCircle(ball->Location.x, ball->Location.y, ball->Radius);

	// Draw goals
	for(i = 20; i < LCD_HEIGHT - 20; i++)
	{
		display_drawPixel(5, i, 1);
		display_drawPixel(LCD_WIDTH - 6, i, 1);
	}
	
	display_flush();
}
Пример #3
0
void on_button_run_toggled(GtkToggleButton * togglebutton, gpointer user_data)
{
    uint32_t GOPs, i;

    GOPs = mpeg2parser->numGOPs();
    i = get_GOP_selected();

    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(togglebutton))) {
        // if you clicked "Run", you want to see it...
        run_saved_refresh = options.auto_refresh;
        options.auto_refresh = true;
    }

    while (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(togglebutton)))
    {
        set_GOP_selected(i);
        flush();
        i = get_GOP_selected();
        i+=options.run_speed;
        if (i >= GOPs)
        {
            if (options.run_loop)
                i = 0;
            else
            {
                // flip back off now
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(togglebutton),
                                             FALSE);
                flush();
            }
        }
    }
    flush();
    display_flush(engine);

    options.auto_refresh = run_saved_refresh;
}