summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine')
-rw-r--r--apps/gui/skin_engine/skin_parser.c3
-rw-r--r--apps/gui/skin_engine/skin_tokens.c20
-rw-r--r--apps/gui/skin_engine/skin_tokens.h1
3 files changed, 24 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index d06494d908..0e21ec0c81 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -279,6 +279,9 @@ static const struct wps_tag all_tags[] = {
279#if (CONFIG_CODEC != MAS3507D) 279#if (CONFIG_CODEC != MAS3507D)
280 { WPS_TOKEN_SOUND_PITCH, "Sp", WPS_REFRESH_DYNAMIC, NULL }, 280 { WPS_TOKEN_SOUND_PITCH, "Sp", WPS_REFRESH_DYNAMIC, NULL },
281#endif 281#endif
282#if (CONFIG_CODEC == SWCODEC)
283 { WPS_TOKEN_SOUND_SPEED, "Ss", WPS_REFRESH_DYNAMIC, NULL },
284#endif
282#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) 285#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
283 { WPS_TOKEN_VLED_HDD, "lh", WPS_REFRESH_DYNAMIC, NULL }, 286 { WPS_TOKEN_VLED_HDD, "lh", WPS_REFRESH_DYNAMIC, NULL },
284#endif 287#endif
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 9cd8dfcdb0..b271bfedfc 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -49,6 +49,7 @@
49#include "playlist.h" 49#include "playlist.h"
50#if CONFIG_CODEC == SWCODEC 50#if CONFIG_CODEC == SWCODEC
51#include "playback.h" 51#include "playback.h"
52#include "tdspeed.h"
52#endif 53#endif
53#include "viewport.h" 54#include "viewport.h"
54 55
@@ -832,6 +833,25 @@ const char *get_token_value(struct gui_wps *gwps,
832 } 833 }
833#endif 834#endif
834 835
836#if CONFIG_CODEC == SWCODEC
837 case WPS_TOKEN_SOUND_SPEED:
838 {
839 int32_t pitch = sound_get_pitch();
840 int32_t speed;
841 if (dsp_timestretch_available())
842 speed = GET_SPEED(pitch, dsp_get_timestretch());
843 else
844 speed = pitch;
845 snprintf(buf, buf_size, "%ld.%ld",
846 speed / PITCH_SPEED_PRECISION,
847 (speed % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10));
848 if (intval)
849 *intval = pitch_speed_enum(limit, speed,
850 PITCH_SPEED_PRECISION * 100);
851 return buf;
852 }
853#endif
854
835 case WPS_TOKEN_MAIN_HOLD: 855 case WPS_TOKEN_MAIN_HOLD:
836#ifdef HAS_BUTTON_HOLD 856#ifdef HAS_BUTTON_HOLD
837 if (button_hold()) 857 if (button_hold())
diff --git a/apps/gui/skin_engine/skin_tokens.h b/apps/gui/skin_engine/skin_tokens.h
index cb8e671097..27594db27f 100644
--- a/apps/gui/skin_engine/skin_tokens.h
+++ b/apps/gui/skin_engine/skin_tokens.h
@@ -68,6 +68,7 @@ enum wps_token_type {
68 WPS_TOKEN_SOUND_PITCH, 68 WPS_TOKEN_SOUND_PITCH,
69#endif 69#endif
70#if (CONFIG_CODEC == SWCODEC) 70#if (CONFIG_CODEC == SWCODEC)
71 WPS_TOKEN_SOUND_SPEED,
71 WPS_TOKEN_REPLAYGAIN, 72 WPS_TOKEN_REPLAYGAIN,
72 WPS_TOKEN_CROSSFADE, 73 WPS_TOKEN_CROSSFADE,
73#endif 74#endif