Example #1
0
static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
{
#ifdef HAVE_LCD_BITMAP
    static const struct bitmap* logos[NB_SCREENS] = {
        &bm_usblogo,
#ifdef HAVE_REMOTE_LCD
        &bm_remote_usblogo,
#endif
    };
#endif

    FOR_NB_SCREENS(i)
    {
        struct screen *screen = &screens[i];

        struct usb_screen_vps_t *usb_screen_vps = &usb_screen_vps_ar[i];
        struct viewport *parent = &usb_screen_vps->parent;
#ifdef HAVE_LCD_BITMAP
        struct viewport *logo = &usb_screen_vps->logo;
#endif

        screen->set_viewport(parent);
        screen->clear_viewport();
        screen->backlight_on();

#ifdef HAVE_LCD_BITMAP
        screen->set_viewport(logo);
        screen->bmp(logos[i], 0, 0);
        if (i == SCREEN_MAIN)
        {
#ifdef USB_ENABLE_HID
            if (usb_hid)
            {
                char modestring[100];
                screen->set_viewport(&usb_screen_vps->title);
                usb_screen_vps->title.flags |= VP_FLAG_ALIGN_CENTER;
                snprintf(modestring, sizeof(modestring), "%s: %s",
                        str(LANG_USB_KEYPAD_MODE),
                        str(keypad_mode_name_get()));
                screen->puts_scroll(0, 0, modestring);
            }
#endif /* USB_ENABLE_HID */
        }
        screen->set_viewport(parent);

#else /* !HAVE_LCD_BITMAP */
        screen->double_height(false);
        screen->puts_scroll(0, 0, "[USB Mode]");
        status_set_param(false);
        status_set_audio(false);
        status_set_usb(true);
#endif /* HAVE_LCD_BITMAP */

        screen->set_viewport(NULL);
        screen->update_viewport();
    }
}
Example #2
0
static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
{
    int i;
    FOR_NB_SCREENS(i)
    {
        struct screen *screen = &screens[i];

        struct usb_screen_vps_t *usb_screen_vps = &usb_screen_vps_ar[i];
        struct viewport *parent = &usb_screen_vps->parent;
#ifdef HAVE_LCD_BITMAP
        struct viewport *logo = &usb_screen_vps->logo;
#endif

        screen->set_viewport(parent);
        screen->clear_viewport();
        screen->backlight_on();

#ifdef HAVE_LCD_BITMAP
        screen->set_viewport(logo);
#ifdef HAVE_REMOTE_LCD
        if (i == SCREEN_REMOTE)
        {
            screen->bitmap(remote_usblogo, 0, 0, logo->width,
                logo->height);
        }
        else
#endif
        {
            screen->transparent_bitmap(usblogo, 0, 0, logo->width,
                logo->height);
#ifdef USB_ENABLE_HID
            if (usb_hid)
            {
                screen->set_viewport(&usb_screen_vps->title);
                usb_screen_vps->title.flags |= VP_FLAG_ALIGN_CENTER;
                screen->puts_scroll(0, 0, str(keypad_mode_name_get()));
            }
#endif /* USB_ENABLE_HID */
        }
        screen->set_viewport(parent);

#else /* HAVE_LCD_BITMAP */
        screen->double_height(false);
        screen->puts_scroll(0, 0, "[USB Mode]");
        status_set_param(false);
        status_set_audio(false);
        status_set_usb(true);
#endif /* HAVE_LCD_BITMAP */

        screen->set_viewport(NULL);
        screen->update_viewport();
    }
}
Example #3
0
static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
{
    int i;

    /* Clear main and remote screens to remove scrolling line artifacts */
    lcd_clear_display();
#ifdef HAVE_LCD_REMOTE
    lcd_remote_clear_display();
#endif

    FOR_NB_SCREENS(i)
    {
        struct screen *screen = &screens[i];

        struct usb_screen_vps_t *usb_screen_vps = &usb_screen_vps_ar[i];
        struct viewport *parent = &usb_screen_vps->parent;
#ifdef HAVE_LCD_BITMAP
        struct viewport *logo = &usb_screen_vps->logo;
#endif

        screen->set_viewport(parent);
        screen->clear_viewport();
        screen->backlight_on();

#ifdef HAVE_LCD_BITMAP
        screen->set_viewport(logo);
#ifdef HAVE_REMOTE_LCD
        if (i == SCREEN_REMOTE)
        {
            screen->bitmap(remote_usblogo, 0, 0, logo->width,
                logo->height);
        }
        else
#endif
        {
            screen->transparent_bitmap(usblogo, 0, 0, logo->width,
                logo->height);
#ifdef USB_ENABLE_HID
            if (usb_hid)
            {
                char modestring[100];
                screen->set_viewport(&usb_screen_vps->title);
                usb_screen_vps->title.flags |= VP_FLAG_ALIGN_CENTER;
                snprintf(modestring, sizeof(modestring), "%s: %s",
                        str(LANG_USB_KEYPAD_MODE),
                        str(keypad_mode_name_get()));
                screen->puts_scroll(0, 0, modestring);
            }
#endif /* USB_ENABLE_HID */
        }
        screen->set_viewport(parent);

#else /* HAVE_LCD_BITMAP */
        screen->double_height(false);
        screen->puts_scroll(0, 0, "[USB Mode]");
        status_set_param(false);
        status_set_audio(false);
        status_set_usb(true);
#endif /* HAVE_LCD_BITMAP */

        screen->set_viewport(NULL);
        screen->update_viewport();
    }
}