This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 11th, 2010  |  syntax: None  |  size: 3.06 KB  |  views: 127  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: apps/gui/skin_engine/skin_parser.c
  2. ===================================================================
  3. --- apps/gui/skin_engine/skin_parser.c  (revision 25508)
  4. +++ apps/gui/skin_engine/skin_parser.c  (working copy)
  5. @@ -322,7 +322,8 @@
  6.      { WPS_TOKEN_PROGRESSBAR,              "pb",  WPS_REFRESH_PLAYER_PROGRESS,
  7.                                                           parse_progressbar },
  8.  
  9. -    { WPS_TOKEN_VOLUME,                   "pv",  WPS_REFRESH_DYNAMIC, NULL },
  10. +    { WPS_TOKEN_VOLUME,                   "pv",  WPS_REFRESH_DYNAMIC,
  11. +                                                         parse_progressbar },
  12.  
  13.      { WPS_TOKEN_TRACK_ELAPSED_PERCENT,    "px",  WPS_REFRESH_DYNAMIC, NULL },
  14.      { WPS_TOKEN_TRACK_TIME_ELAPSED,       "pc",  WPS_REFRESH_DYNAMIC, NULL },
  15. @@ -1118,7 +1119,7 @@
  16.  
  17.      return skip;
  18.  }
  19. -
  20. +  
  21.  static int parse_progressbar(const char *wps_bufptr,
  22.                               struct wps_token *token,
  23.                               struct wps_data *wps_data)
  24. @@ -1166,6 +1167,7 @@
  25.  
  26.          curr_vp->pb = pb;
  27.          add_to_ll_chain(&wps_data->progressbars, item);
  28. +        pb->type = token->type;
  29.          return 0;
  30.      }
  31.      ptr = wps_bufptr + 1;
  32. @@ -1222,7 +1224,9 @@
  33.  
  34.      curr_vp->pb = pb;
  35.      add_to_ll_chain(&wps_data->progressbars, item);
  36. -
  37. +    if (token->type == WPS_TOKEN_VOLUME)
  38. +        token->type = WPS_TOKEN_VOLUMEBAR;
  39. +    pb->type = token->type;
  40.      /* Skip the rest of the line */
  41.      return skip_end_of_line(wps_bufptr)-1;
  42.  #else
  43. Index: apps/gui/skin_engine/skin_display.c
  44. ===================================================================
  45. --- apps/gui/skin_engine/skin_display.c (revision 25508)
  46. +++ apps/gui/skin_engine/skin_display.c (working copy)
  47. @@ -26,6 +26,7 @@
  48.  #include "font.h"
  49.  #include "system.h"
  50.  #include "rbunicode.h"
  51. +#include "sound.h"
  52.  #ifdef DEBUG
  53.  #include "debug.h"
  54.  #endif
  55. @@ -146,6 +147,12 @@
  56.          length = 1;
  57.          elapsed = 0;
  58.      }
  59. +    if (pb->type == WPS_TOKEN_VOLUMEBAR)
  60. +    {
  61. +        int minvol = sound_min(SOUND_VOLUME);
  62. +        length = -minvol;
  63. +        elapsed = global_settings.volume > 0 ? length : global_settings.volume-minvol;
  64. +    }
  65.  
  66.      if (pb->have_bitmap_pb)
  67.          gui_bitmap_scrollbar_draw(display, pb->bm,
  68. Index: apps/gui/skin_engine/skin_tokens.h
  69. ===================================================================
  70. --- apps/gui/skin_engine/skin_tokens.h  (revision 25508)
  71. +++ apps/gui/skin_engine/skin_tokens.h  (working copy)
  72. @@ -202,6 +202,7 @@
  73.  #endif
  74.      /* Volume level */
  75.      WPS_TOKEN_VOLUME,
  76. +    WPS_TOKEN_VOLUMEBAR,
  77.      /* hold */
  78.      WPS_TOKEN_MAIN_HOLD,
  79.  #ifdef HAS_REMOTE_BUTTON_HOLD
  80. Index: apps/gui/skin_engine/wps_internals.h
  81. ===================================================================
  82. --- apps/gui/skin_engine/wps_internals.h        (revision 25508)
  83. +++ apps/gui/skin_engine/wps_internals.h        (working copy)
  84. @@ -91,6 +91,7 @@
  85.  
  86.  
  87.  struct progressbar {
  88. +    enum wps_token_type type;
  89.      /* regular pb */
  90.      short x;
  91.      /* >=0: explicitly set in the tag -> y-coord within the viewport
clone this paste RAW Paste Data