Exemplo n.º 1
0
/**
 * \brief Draws a subrectangle of this object, applying dynamic effects.
 * \param region The rectangle to draw in this object.
 * \param dst_surface The destination surface
 * \param dst_position Position on this surface
 * (will be added to the position obtained by previous movements).
 */
void Drawable::draw_region(const Rectangle& region,
    Surface& dst_surface, const Rectangle& dst_position) {

  Rectangle dst_position2(dst_position);
  dst_position2.add_xy(xy);

  if (transition != NULL) {
    draw_transition(*transition);
  }

  raw_draw_region(region, dst_surface, dst_position2);
}
Exemplo n.º 2
0
void gui_update(enum gui_update_view view, enum gui_update_elt *element,
                struct display_file_list *lst_str, struct file_info *info,
                struct player_info *player)
{
  static enum gui_update_view last_view = GUI_UPDATE_VIEW_NONE;
  static bool clear_in_progress_done=false;

  if (!(*element & GUI_UPDATE_ELT_IN_PROGRESS))
  {
    if (!clear_in_progress_done)
    {
      clear_in_progress_done=true;
      clear_in_progress(view);
    }
  }
  else
  {
    draw_in_progress(view);
    clear_in_progress_done=false;
    *element &= ~GUI_UPDATE_ELT_IN_PROGRESS;
  }

  switch (view)
  {
  case GUI_UPDATE_VIEW_NONE:
    break;
  case GUI_UPDATE_VIEW_IDLE:
    if (last_view != GUI_UPDATE_VIEW_IDLE)
    {
      draw_startup(0, 0);
      last_view = GUI_UPDATE_VIEW_IDLE;
      break;
    }
    call_draw_fct(*element, GUI_UPDATE_ELT_IDLE_NO_DEVICE_PRESENT, draw_device_not_present, );
    call_draw_fct(*element, GUI_UPDATE_ELT_IDLE_DEVICE_PRESENT, draw_device_present, );
    call_draw_fct(*element, GUI_UPDATE_ELT_IDLE_NOT_SUPPORTED, draw_device_not_supported, );
    break;
  case GUI_UPDATE_VIEW_NAVIGATION:
    if (last_view != GUI_UPDATE_VIEW_NAVIGATION)
    {
      switch(last_view)
      {
      case GUI_UPDATE_VIEW_IDLE_TRANSITION:
      case GUI_UPDATE_VIEW_IDLE:
        last_view = GUI_UPDATE_VIEW_IDLE_TRANSITION;
        if (!draw_transition(draw_startup, draw_navigation, TRANSITION_FROM_LEFT_TO_RIGHT))
          return;
        break;
      case GUI_UPDATE_VIEW_PLAYBACK_TRANSITION:
      case GUI_UPDATE_VIEW_PLAYBACK:
        last_view = GUI_UPDATE_VIEW_PLAYBACK_TRANSITION;
        if (!draw_transition(draw_play_view, draw_navigation, TRANSITION_FROM_RIGHT_TO_LEFT))
          return;
        break;
      default:
        break;
      }
      draw_navigation(0, 0);
      last_view = GUI_UPDATE_VIEW_NAVIGATION;
      break;
    }
    call_draw_fct(*element, GUI_UPDATE_ELT_NAVIGATION_CURSOR, draw_cursor, lst_str);
    call_draw_fct(*element, GUI_UPDATE_ELT_NAVIGATION_FILE_LIST, draw_file_list, lst_str);
    call_draw_fct(*element, GUI_UPDATE_ELT_NAVIGATION_NO_FILES, draw_no_file, lst_str);
    break;
  case GUI_UPDATE_VIEW_PLAYBACK:
    if (last_view != GUI_UPDATE_VIEW_PLAYBACK)
    {
      switch(last_view)
      {
      case GUI_UPDATE_VIEW_NAVIGATION_TRANSITION:
      case GUI_UPDATE_VIEW_NAVIGATION:
        last_view = GUI_UPDATE_VIEW_NAVIGATION_TRANSITION;
        if (!draw_transition(draw_navigation, draw_play_view, TRANSITION_FROM_LEFT_TO_RIGHT))
          return;
        break;
      case GUI_UPDATE_VIEW_CONFIG_TRANSITION:
      case GUI_UPDATE_VIEW_CONFIG:
        last_view = GUI_UPDATE_VIEW_CONFIG_TRANSITION;
        if (!draw_transition(draw_config, draw_play_view, TRANSITION_FROM_RIGHT_TO_LEFT))
          return;
        break;
      default:
        break;
      }
      draw_play_view(0, 0);
      last_view = GUI_UPDATE_VIEW_PLAYBACK;
      break;
    }
    call_draw_fct(*element, GUI_UPDATE_ELT_PLAYBACK_PLAY, draw_play_button, );
    call_draw_fct(*element, GUI_UPDATE_ELT_PLAYBACK_PAUSE, draw_pause_button, );
    call_draw_fct(*element, GUI_UPDATE_ELT_PLAYBACK_ELAPSED_TIME, draw_playtime_update, info);
    call_draw_fct(*element, GUI_UPDATE_ELT_PLAYBACK_VOLUME, draw_volume_bar, info);
    call_draw_fct(*element, GUI_UPDATE_ELT_PLAYBACK_FILE_NAME, draw_play_view_print_file, info);
    call_draw_fct(*element, GUI_UPDATE_ELT_PLAYBACK_ARTIST, draw_play_view_print_artist, info);
    call_draw_fct(*element, GUI_UPDATE_ELT_PLAYBACK_TITLE, draw_play_view_print_title, info);
    call_draw_fct(*element, GUI_UPDATE_ELT_PLAYBACK_TOTAL_TIME, draw_play_view_print_total_time, info);
    call_draw_fct(*element, GUI_UPDATE_ELT_PLAYBACK_COVER_ART, draw_cover_art, info);
    break;
  case GUI_UPDATE_VIEW_CONFIG:
    if (last_view != GUI_UPDATE_VIEW_CONFIG)
    {
      switch(last_view)
      {
      case GUI_UPDATE_VIEW_PLAYBACK_TRANSITION:
      case GUI_UPDATE_VIEW_PLAYBACK:
        last_view = GUI_UPDATE_VIEW_PLAYBACK_TRANSITION;
        if (!draw_transition(draw_play_view, draw_config, TRANSITION_FROM_LEFT_TO_RIGHT))
          return;
        break;
      default:
        break;
      }
      draw_config(0, 0);
      last_view = GUI_UPDATE_VIEW_CONFIG;
      break;
    }
    call_draw_fct(*element, GUI_UPDATE_ELT_CONFIG_REPEAT, draw_config_view_print_repeat, player);
    call_draw_fct(*element, GUI_UPDATE_ELT_CONFIG_SHUFFLE, draw_config_view_print_shuffle, player);
    call_draw_fct(*element, GUI_UPDATE_ELT_CONFIG_CURSOR, draw_config_view_print_cursor, lst_str);
    break;
  default:
    break;
  }
}