Index: apps/gui/skin_engine/skin_parser.c =================================================================== --- apps/gui/skin_engine/skin_parser.c (revision 23481) +++ apps/gui/skin_engine/skin_parser.c (working copy) @@ -360,7 +360,15 @@ { WPS_TOKEN_LASTTOUCH, "Tl", WPS_REFRESH_DYNAMIC, parse_timeout }, { WPS_TOKEN_CURRENT_SCREEN, "cs", WPS_REFRESH_DYNAMIC, NULL }, { WPS_NO_TOKEN, "T", 0, parse_touchregion }, - + + + /* Recording Tokens */ + { WPS_TOKEN_HAVE_RECORDING, "Rp", WPS_REFRESH_STATIC, NULL }, +#ifdef HAVE_RECORDING + { WPS_TOKEN_REC_FREQ, "Rf", WPS_REFRESH_DYNAMIC, NULL }, + { WPS_TOKEN_REC_ENCODER, "Re", WPS_REFRESH_DYNAMIC, NULL }, + { WPS_TOKEN_REC_BITRATE, "Rb", WPS_REFRESH_DYNAMIC, NULL }, +#endif { WPS_TOKEN_UNKNOWN, "", 0, NULL } /* the array MUST end with an empty string (first char is \0) */ }; Index: apps/gui/skin_engine/skin_tokens.c =================================================================== --- apps/gui/skin_engine/skin_tokens.c (revision 23481) +++ apps/gui/skin_engine/skin_tokens.c (working copy) @@ -34,6 +34,7 @@ #include "powermgmt.h" #include "sound.h" #include "debug.h" +#include "pcm_record.h" #ifdef HAVE_LCD_CHARCELLS #include "hwcompat.h" #endif @@ -873,6 +874,167 @@ cfg_to_string(token->value.i,buf,buf_size); return buf; } + /* Recording tokens */ + case WPS_TOKEN_HAVE_RECORDING: +#ifdef HAVE_RECORDING + return "r"; +#else + return NULL; +#endif + +#ifdef HAVE_RECORDING + case WPS_TOKEN_REC_FREQ: /* order from REC_FREQ_CFG_VAL_LIST */ + { + unsigned long samprk; + int rec_freq = global_settings.rec_frequency; + +#ifdef SIMULATOR + samprk = 44100; +#else +#ifdef HAVE_SPDIF_REC + if (global_settings.rec_source == AUDIO_SRC_SPDIF) + { + /* Use rate in use, not current measured rate if it changed */ + samprk = pcm_rec_sample_rate(); + rec_freq = 0; + while (rec_freq < SAMPR_NUM_FREQ && + audio_master_sampr_list[rec_freq] != samprk) + { + rec_freq++; + } + } + else +#endif + samprk = rec_freq_sampr[global_settings.rec_frequency]; +#endif /* SIMULATOR */ + if (intval) + { + switch (rec_freq) + { + REC_HAVE_96_(case REC_FREQ_96: + *intval = 1; + break;) + REC_HAVE_88_(case REC_FREQ_88: + *intval = 2; + break;) + REC_HAVE_64_(case REC_FREQ_64: + *intval = 3; + break;) + REC_HAVE_48_(case REC_FREQ_48: + *intval = 4; + break;) + REC_HAVE_44_(case REC_FREQ_44: + *intval = 5; + break;) + REC_HAVE_32_(case REC_FREQ_32: + *intval = 6; + break;) + REC_HAVE_24_(case REC_FREQ_24: + *intval = 7; + break;) + REC_HAVE_22_(case REC_FREQ_22: + *intval = 8; + break;) + REC_HAVE_16_(case REC_FREQ_16: + *intval = 9; + break;) + REC_HAVE_12_(case REC_FREQ_12: + *intval = 10; + break;) + REC_HAVE_11_(case REC_FREQ_11: + *intval = 11; + break;) + REC_HAVE_8_(case REC_FREQ_8: + *intval = 12; + break;) + } + } + snprintf(buf, buf_size, "%d.%1d", samprk/1000,samprk%1000); + return buf; + } + case WPS_TOKEN_REC_ENCODER: + { + int rec_format = global_settings.rec_format+1; /* WAV, AIFF, WV, MPEG */ + if (intval) + *intval = rec_format; + switch (rec_format) + { + case REC_FORMAT_PCM_WAV: + return "wav"; + case REC_FORMAT_AIFF: + return "aiff"; + case REC_FORMAT_WAVPACK: + return "wv"; + case REC_FORMAT_MPA_L3: + return "MP3"; + default: + return NULL; + } + break; + } + case WPS_TOKEN_REC_BITRATE: + if (global_settings.rec_format == REC_FORMAT_MPA_L3) + { + if (intval) + { + #if 0 /* FIXME: I dont know if this is needed? */ + switch (1< + # Battery area, Icons -%Vl|a|0|0|-|8|0|-|-| +%Vl|a|0|0|16|8|0|-|-| %?bl<%xdBa|%xdBa|%xdBb|%xdBc|%xdBd|%xdBe|%xdBf|%xdBg|%xdBh|%xdBi|%xdBj> # charging icon -%Vl|a|16|0|-|8|0|-|-| +%Vl|a|16|0|8|8|0|-|-| %?bc<%xdSa|> # battery area, no icons @@ -48,18 +55,28 @@ # Icons, all in the same bmp strip, so need to use multiple viewports # Playback mode -%V|46|0|-|8|0|-|-| +%Vl|p|46|0|-|8|0|-|-| %?mp<%xdSc|%xdSb|%xdSd|%xdSe|%xdSf|%xdSg|%xdSh|%xdSi|%xdSj> # Repeat mode -%V|54|0|-|8|0|-|-| +%Vl|r|54|0|-|8|0|-|-| %?mm<|%xdSi|%xdSj|%xdSk|%xdSl> # Shuffle mode -%V|64|0|-|8|0|-|-| +%Vl|s|64|0|-|8|0|-|-| %?ps<%xdSk|> +# Recording section +# encoder/mpeg bitrate +%Vl|z|27|0|18|8|0|-|-| +%?Rp<%?Re<%xdea|%xdeb|%xdec|%?Rb<%xdma|%xdmb|%xdmc|%xdmd|%xdme|%xdmf|%xdmg|%xdmh|%xdmi|%xdmj|%xdmk|%xdml|%xdmm|%xdmn|%xdmo|%xdmp|%xdmq|%xdmr>>> +# status icon +%Vl|z|46|0|8|8|0|-|-| +%?mp<%xdSc|%xdSb|%xdSd|%xdSe|%xdSf|%xdSg|%xdSh|%xdSi|%xdSj> +# frequency +%Vl|z|54|0|-|8|0|-|-| +%?Rp<%?Rf<%xdfa|%xdfb|%xdfc|%xdfd|%xdfe|%xdff|%xdfg|%xdfh|%xdfi|%xdfj|%xdfk|%xdfl>> # Clock on RTC able targets, and disk access %V|-36|0|-6|8|0|-|-| # align on the right with room for 6 SYSFONT digits