summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_tokens.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c39
1 files changed, 3 insertions, 36 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 50704fd66e..2528a0af55 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -47,10 +47,8 @@
47#include "albumart.h" 47#include "albumart.h"
48#endif 48#endif
49#include "playlist.h" 49#include "playlist.h"
50#if CONFIG_CODEC == SWCODEC
51#include "playback.h" 50#include "playback.h"
52#include "tdspeed.h" 51#include "tdspeed.h"
53#endif
54#include "viewport.h" 52#include "viewport.h"
55#include "tagcache.h" 53#include "tagcache.h"
56 54
@@ -558,18 +556,16 @@ static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename)
558 static char filename_buf[MAX_PATH + 1]; 556 static char filename_buf[MAX_PATH + 1];
559 fname = playlist_peek(offset, filename_buf, sizeof(filename_buf)); 557 fname = playlist_peek(offset, filename_buf, sizeof(filename_buf));
560 *filename = (char*)fname; 558 *filename = (char*)fname;
561#if CONFIG_CODEC == SWCODEC
562 static struct mp3entry tempid3; 559 static struct mp3entry tempid3;
563 if ( 560 if (
564#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) 561#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
565 tagcache_fill_tags(&tempid3, fname) || 562 tagcache_fill_tags(&tempid3, fname) ||
566#endif 563#endif
567 audio_peek_track(&tempid3, offset) 564 audio_peek_track(&tempid3, offset)
568 ) 565 )
569 { 566 {
570 pid3 = &tempid3; 567 pid3 = &tempid3;
571 } 568 }
572#endif
573 } 569 }
574 return pid3; 570 return pid3;
575} 571}
@@ -1224,7 +1220,6 @@ const char *get_token_value(struct gui_wps *gwps,
1224 } 1220 }
1225#endif 1221#endif
1226 1222
1227#if (CONFIG_CODEC == SWCODEC)
1228 case SKIN_TOKEN_CROSSFADE: 1223 case SKIN_TOKEN_CROSSFADE:
1229#ifdef HAVE_CROSSFADE 1224#ifdef HAVE_CROSSFADE
1230 if (intval) 1225 if (intval)
@@ -1277,7 +1272,6 @@ const char *get_token_value(struct gui_wps *gwps,
1277 } 1272 }
1278 return buf; 1273 return buf;
1279 } 1274 }
1280#endif /* (CONFIG_CODEC == SWCODEC) */
1281 1275
1282#if defined (HAVE_PITCHCONTROL) 1276#if defined (HAVE_PITCHCONTROL)
1283 case SKIN_TOKEN_SOUND_PITCH: 1277 case SKIN_TOKEN_SOUND_PITCH:
@@ -1294,7 +1288,7 @@ const char *get_token_value(struct gui_wps *gwps,
1294 } 1288 }
1295#endif 1289#endif
1296 1290
1297#if (CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL) 1291#if defined (HAVE_PITCHCONTROL)
1298 case SKIN_TOKEN_SOUND_SPEED: 1292 case SKIN_TOKEN_SOUND_SPEED:
1299 { 1293 {
1300 int32_t pitch = sound_get_pitch(); 1294 int32_t pitch = sound_get_pitch();
@@ -1462,7 +1456,6 @@ const char *get_token_value(struct gui_wps *gwps,
1462 return NULL; 1456 return NULL;
1463 case SKIN_TOKEN_REC_FREQ: /* order from REC_FREQ_CFG_VAL_LIST */ 1457 case SKIN_TOKEN_REC_FREQ: /* order from REC_FREQ_CFG_VAL_LIST */
1464 { 1458 {
1465#if CONFIG_CODEC == SWCODEC
1466 unsigned long samprk; 1459 unsigned long samprk;
1467 int rec_freq = global_settings.rec_frequency; 1460 int rec_freq = global_settings.rec_frequency;
1468 1461
@@ -1528,26 +1521,8 @@ const char *get_token_value(struct gui_wps *gwps,
1528 } 1521 }
1529 } 1522 }
1530 snprintf(buf, buf_size, "%lu.%1lu", samprk/1000,samprk%1000); 1523 snprintf(buf, buf_size, "%lu.%1lu", samprk/1000,samprk%1000);
1531#else /* HWCODEC */
1532
1533 static const char * const freq_strings[] =
1534 {"--", "44", "48", "32", "22", "24", "16"};
1535 int freq = 1 + global_settings.rec_frequency;
1536#ifdef HAVE_SPDIF_REC
1537 if (global_settings.rec_source == AUDIO_SRC_SPDIF)
1538 {
1539 /* Can't measure S/PDIF sample rate on Archos/Sim yet */
1540 freq = 0;
1541 }
1542#endif /* HAVE_SPDIF_IN */
1543 if (intval)
1544 *intval = freq+1; /* so the token gets a value 1<=x<=7 */
1545 snprintf(buf, buf_size, "%s\n",
1546 freq_strings[global_settings.rec_frequency]);
1547#endif
1548 return buf; 1524 return buf;
1549 } 1525 }
1550#if CONFIG_CODEC == SWCODEC
1551 case SKIN_TOKEN_REC_ENCODER: 1526 case SKIN_TOKEN_REC_ENCODER:
1552 { 1527 {
1553 int rec_format = global_settings.rec_format+1; /* WAV, AIFF, WV, MPEG */ 1528 int rec_format = global_settings.rec_format+1; /* WAV, AIFF, WV, MPEG */
@@ -1568,9 +1543,7 @@ const char *get_token_value(struct gui_wps *gwps,
1568 } 1543 }
1569 break; 1544 break;
1570 } 1545 }
1571#endif
1572 case SKIN_TOKEN_REC_BITRATE: 1546 case SKIN_TOKEN_REC_BITRATE:
1573#if CONFIG_CODEC == SWCODEC
1574 if (global_settings.rec_format == REC_FORMAT_MPA_L3) 1547 if (global_settings.rec_format == REC_FORMAT_MPA_L3)
1575 { 1548 {
1576 if (intval) 1549 if (intval)
@@ -1632,17 +1605,11 @@ const char *get_token_value(struct gui_wps *gwps,
1632 } 1605 }
1633 else 1606 else
1634 return NULL; /* Fixme later */ 1607 return NULL; /* Fixme later */
1635#else /* CONFIG_CODEC == HWCODEC */
1636 if (intval)
1637 *intval = global_settings.rec_quality+1;
1638 snprintf(buf, buf_size, "%d", global_settings.rec_quality);
1639 return buf;
1640#endif
1641 case SKIN_TOKEN_REC_MONO: 1608 case SKIN_TOKEN_REC_MONO:
1642 if (!global_settings.rec_channels) 1609 if (!global_settings.rec_channels)
1643 return "m"; 1610 return "m";
1644 return NULL; 1611 return NULL;
1645 1612
1646 case SKIN_TOKEN_REC_SECONDS: 1613 case SKIN_TOKEN_REC_SECONDS:
1647 { 1614 {
1648 int time = (audio_recorded_time() / HZ) % 60; 1615 int time = (audio_recorded_time() / HZ) % 60;