mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
plugins: playing time: Show info in 2 lines (header + details)
Improves readability on small screens. See WPS -> Context Menu -> Current Playlist -> Playing time Also, Russian translation is adjusted accordingly. Change-Id: I23662ccb324f07a742179ff274453416bb8eff08
This commit is contained in:
parent
54e2facb85
commit
5d39d987c0
3 changed files with 118 additions and 58 deletions
|
@ -12589,10 +12589,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Playlist elapsed: %s / %s %ld%%"
|
*: "Playlist elapsed:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Playlist elapsed: %s / %s %ld%%"
|
*: "Playlist elapsed:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Playlist elapsed"
|
*: "Playlist elapsed"
|
||||||
|
@ -12603,10 +12603,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Track elapsed: %s / %s %ld%%"
|
*: "Track elapsed:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Track elapsed: %s / %s %ld%%"
|
*: "Track elapsed:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Track elapsed"
|
*: "Track elapsed"
|
||||||
|
@ -12617,10 +12617,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Playlist remaining: %s"
|
*: "Playlist remaining:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Playlist remaining: %s"
|
*: "Playlist remaining:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Playlist remaining"
|
*: "Playlist remaining"
|
||||||
|
@ -12631,10 +12631,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Track remaining: %s"
|
*: "Track remaining:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Track remaining: %s"
|
*: "Track remaining:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Track remaining"
|
*: "Track remaining"
|
||||||
|
@ -12645,10 +12645,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Track %d / %d %d%%"
|
*: "Track:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Track %d / %d %d%%"
|
*: "Track:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Track"
|
*: "Track"
|
||||||
|
@ -12659,10 +12659,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Storage: %s (done %s, remaining %s)"
|
*: "Storage (Done / Remaining):"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Storage: %s (done %s, remaining %s)"
|
*: "Storage (Done / Remaining):"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Storage"
|
*: "Storage"
|
||||||
|
@ -12687,10 +12687,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Average track size: %s"
|
*: "Average track size:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Average track size: %s"
|
*: "Average track size:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Average track size"
|
*: "Average track size"
|
||||||
|
@ -12701,10 +12701,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Average bitrate: %ld kbps"
|
*: "Average bitrate:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Average bitrate: %ld kbps"
|
*: "Average bitrate:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Average bit rate"
|
*: "Average bit rate"
|
||||||
|
@ -16472,3 +16472,17 @@
|
||||||
*: "English"
|
*: "English"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
id: LANG_PERCENT_FORMAT
|
||||||
|
desc: percent formatting ( `10%` is default , for `10 %` use '%ld %%' , for `%10` use '%%%ld' and so on)
|
||||||
|
user: core
|
||||||
|
<source>
|
||||||
|
*: "%ld%%"
|
||||||
|
</source>
|
||||||
|
<dest>
|
||||||
|
*: "%ld%%"
|
||||||
|
</dest>
|
||||||
|
<voice>
|
||||||
|
*: none
|
||||||
|
</voice>
|
||||||
|
</phrase>
|
||||||
|
|
|
@ -13576,10 +13576,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Playlist remaining: %s"
|
*: "Playlist remaining:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "В списке осталось: %s"
|
*: "В списке осталось:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "В списке осталось"
|
*: "В списке осталось"
|
||||||
|
@ -13590,10 +13590,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Playlist elapsed: %s / %s %ld%%"
|
*: "Playlist elapsed:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "В списке проиграно: %s / %s %ld%%"
|
*: "В списке проиграно:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "В списке проиграно"
|
*: "В списке проиграно"
|
||||||
|
@ -13924,10 +13924,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Track elapsed: %s / %s %ld%%"
|
*: "Track elapsed:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "В треке проиграно: %s / %s %ld%%"
|
*: "В треке проиграно:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "В трэке проиграно"
|
*: "В трэке проиграно"
|
||||||
|
@ -14118,10 +14118,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Track remaining: %s"
|
*: "Track remaining:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "В треке осталось: %s"
|
*: "В треке осталось:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "В трэке осталось"
|
*: "В трэке осталось"
|
||||||
|
@ -14272,10 +14272,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Average bitrate: %ld kbps"
|
*: "Average bitrate:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Средний битрейт: %ld kbps"
|
*: "Средний битрейт:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Средний битрейт"
|
*: "Средний битрейт"
|
||||||
|
@ -14331,10 +14331,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Average track size: %s"
|
*: "Average track size:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Средний размер трека: %s"
|
*: "Средний размер трека:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Средний размер трэка"
|
*: "Средний размер трэка"
|
||||||
|
@ -14452,10 +14452,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Storage: %s (done %s, remaining %s)"
|
*: "Storage (Done / Remaining):"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Объём памяти: %s (проиграно %s, осталось %s)"
|
*: "Объём памяти (Проиграно / Осталось):"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Объём памяти"
|
*: "Объём памяти"
|
||||||
|
@ -14607,10 +14607,10 @@
|
||||||
desc: playing time screen
|
desc: playing time screen
|
||||||
user: core
|
user: core
|
||||||
<source>
|
<source>
|
||||||
*: "Track %d / %d %d%%"
|
*: "Track:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Трек %d / %d %d%%"
|
*: "Трек:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Трэк"
|
*: "Трэк"
|
||||||
|
|
|
@ -31,6 +31,17 @@ const unsigned char * const byte_units[] =
|
||||||
ID2P(LANG_GIBIBYTE)
|
ID2P(LANG_GIBIBYTE)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const int menu_items[] = {
|
||||||
|
LANG_PLAYTIME_ELAPSED,
|
||||||
|
LANG_PLAYTIME_REMAINING,
|
||||||
|
LANG_PLAYTIME_TRK_ELAPSED,
|
||||||
|
LANG_PLAYTIME_TRK_REMAINING,
|
||||||
|
LANG_PLAYTIME_TRACK,
|
||||||
|
LANG_PLAYTIME_STORAGE,
|
||||||
|
LANG_PLAYTIME_AVG_TRACK_SIZE,
|
||||||
|
LANG_PLAYTIME_AVG_BITRATE,
|
||||||
|
};
|
||||||
|
|
||||||
const unsigned char * const * const kibyte_units = &byte_units[1];
|
const unsigned char * const * const kibyte_units = &byte_units[1];
|
||||||
|
|
||||||
enum ePT_SECS {
|
enum ePT_SECS {
|
||||||
|
@ -68,6 +79,27 @@ struct playing_time_info {
|
||||||
long kbs[ePT_KBS_COUNT];
|
long kbs[ePT_KBS_COUNT];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static char* get_percent_str(long percents)
|
||||||
|
{
|
||||||
|
static char val[10];
|
||||||
|
rb->snprintf(val, 10, rb->str(LANG_PERCENT_FORMAT), percents);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void prepare_time_string(const char *buf, size_t buffer_len, long elapsed_pct, const char *timestr1, const char *timestr2)
|
||||||
|
{
|
||||||
|
if (rb->lang_is_rtl())
|
||||||
|
{
|
||||||
|
rb->snprintf(buf, buffer_len, "%s %s / %s",
|
||||||
|
get_percent_str(elapsed_pct), timestr2, timestr1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rb->snprintf(buf, buffer_len, "%s / %s %s",
|
||||||
|
timestr1, timestr2, get_percent_str(elapsed_pct));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* list callback for playing_time screen */
|
/* list callback for playing_time screen */
|
||||||
static const char * playing_time_get_or_speak_info(int selected_item, void * data,
|
static const char * playing_time_get_or_speak_info(int selected_item, void * data,
|
||||||
char *buf, size_t buffer_len,
|
char *buf, size_t buffer_len,
|
||||||
|
@ -75,14 +107,22 @@ static const char * playing_time_get_or_speak_info(int selected_item, void * dat
|
||||||
{
|
{
|
||||||
long elapsed_pct; /* percentage of duration elapsed */
|
long elapsed_pct; /* percentage of duration elapsed */
|
||||||
struct playing_time_info *pti = (struct playing_time_info *)data;
|
struct playing_time_info *pti = (struct playing_time_info *)data;
|
||||||
switch(selected_item) {
|
int info_no = selected_item/2;
|
||||||
|
const int menu_name_id = menu_items[info_no];
|
||||||
|
|
||||||
|
if (!(selected_item%2))
|
||||||
|
{/* header */
|
||||||
|
return rb->str(menu_name_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(info_no) {
|
||||||
case 0: { /* elapsed and total time */
|
case 0: { /* elapsed and total time */
|
||||||
char timestr1[25], timestr2[25];
|
char timestr1[25], timestr2[25];
|
||||||
rb->format_time_auto(timestr1, sizeof(timestr1),
|
rb->format_time_auto(timestr1, sizeof(timestr1),
|
||||||
pti->secs[ePT_SECS_BEF], UNIT_SEC, false);
|
pti->secs[ePT_SECS_BEF], UNIT_SEC, true);
|
||||||
|
|
||||||
rb->format_time_auto(timestr2, sizeof(timestr2),
|
rb->format_time_auto(timestr2, sizeof(timestr2),
|
||||||
pti->secs[ePT_SECS_TTL], UNIT_SEC, false);
|
pti->secs[ePT_SECS_TTL], UNIT_SEC, true);
|
||||||
|
|
||||||
if (pti->secs[ePT_SECS_TTL] == 0)
|
if (pti->secs[ePT_SECS_TTL] == 0)
|
||||||
elapsed_pct = 0;
|
elapsed_pct = 0;
|
||||||
|
@ -96,11 +136,10 @@ static const char * playing_time_get_or_speak_info(int selected_item, void * dat
|
||||||
elapsed_pct = (pti->secs[ePT_SECS_BEF] >> 7) * 100
|
elapsed_pct = (pti->secs[ePT_SECS_BEF] >> 7) * 100
|
||||||
/ (pti->secs[ePT_SECS_TTL] >> 7);
|
/ (pti->secs[ePT_SECS_TTL] >> 7);
|
||||||
}
|
}
|
||||||
rb->snprintf(buf, buffer_len, rb->str(LANG_PLAYTIME_ELAPSED),
|
prepare_time_string(buf, buffer_len, elapsed_pct, timestr1, timestr2);
|
||||||
timestr1, timestr2, elapsed_pct);
|
|
||||||
|
|
||||||
if (say_it)
|
if (say_it)
|
||||||
rb_talk_ids(false, LANG_PLAYTIME_ELAPSED,
|
rb_talk_ids(false, menu_name_id,
|
||||||
TALK_ID(pti->secs[ePT_SECS_BEF], UNIT_TIME),
|
TALK_ID(pti->secs[ePT_SECS_BEF], UNIT_TIME),
|
||||||
VOICE_OF,
|
VOICE_OF,
|
||||||
TALK_ID(pti->secs[ePT_SECS_TTL], UNIT_TIME),
|
TALK_ID(pti->secs[ePT_SECS_TTL], UNIT_TIME),
|
||||||
|
@ -112,10 +151,10 @@ static const char * playing_time_get_or_speak_info(int selected_item, void * dat
|
||||||
char timestr[25];
|
char timestr[25];
|
||||||
rb->format_time_auto(timestr, sizeof(timestr), pti->secs[ePT_SECS_AFT],
|
rb->format_time_auto(timestr, sizeof(timestr), pti->secs[ePT_SECS_AFT],
|
||||||
UNIT_SEC, false);
|
UNIT_SEC, false);
|
||||||
rb->snprintf(buf, buffer_len, rb->str(LANG_PLAYTIME_REMAINING), timestr);
|
rb->snprintf(buf, buffer_len, "%s", timestr);
|
||||||
|
|
||||||
if (say_it)
|
if (say_it)
|
||||||
rb_talk_ids(false, LANG_PLAYTIME_REMAINING,
|
rb_talk_ids(false, menu_name_id,
|
||||||
TALK_ID(pti->secs[ePT_SECS_AFT], UNIT_TIME));
|
TALK_ID(pti->secs[ePT_SECS_AFT], UNIT_TIME));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -123,9 +162,9 @@ static const char * playing_time_get_or_speak_info(int selected_item, void * dat
|
||||||
char timestr1[25], timestr2[25];
|
char timestr1[25], timestr2[25];
|
||||||
|
|
||||||
rb->format_time_auto(timestr1, sizeof(timestr1), pti->trk_secs[ePT_SECS_BEF],
|
rb->format_time_auto(timestr1, sizeof(timestr1), pti->trk_secs[ePT_SECS_BEF],
|
||||||
UNIT_SEC, false);
|
UNIT_SEC, true);
|
||||||
rb->format_time_auto(timestr2, sizeof(timestr2), pti->trk_secs[ePT_SECS_TTL],
|
rb->format_time_auto(timestr2, sizeof(timestr2), pti->trk_secs[ePT_SECS_TTL],
|
||||||
UNIT_SEC, false);
|
UNIT_SEC, true);
|
||||||
|
|
||||||
if (pti->trk_secs[ePT_SECS_TTL] == 0)
|
if (pti->trk_secs[ePT_SECS_TTL] == 0)
|
||||||
elapsed_pct = 0;
|
elapsed_pct = 0;
|
||||||
|
@ -139,11 +178,10 @@ static const char * playing_time_get_or_speak_info(int selected_item, void * dat
|
||||||
elapsed_pct = (pti->trk_secs[ePT_SECS_BEF] >> 7) * 100
|
elapsed_pct = (pti->trk_secs[ePT_SECS_BEF] >> 7) * 100
|
||||||
/ (pti->trk_secs[ePT_SECS_TTL] >> 7);
|
/ (pti->trk_secs[ePT_SECS_TTL] >> 7);
|
||||||
}
|
}
|
||||||
rb->snprintf(buf, buffer_len, rb->str(LANG_PLAYTIME_TRK_ELAPSED),
|
prepare_time_string(buf, buffer_len, elapsed_pct, timestr1, timestr2);
|
||||||
timestr1, timestr2, elapsed_pct);
|
|
||||||
|
|
||||||
if (say_it)
|
if (say_it)
|
||||||
rb_talk_ids(false, LANG_PLAYTIME_TRK_ELAPSED,
|
rb_talk_ids(false, menu_name_id,
|
||||||
TALK_ID(pti->trk_secs[ePT_SECS_BEF], UNIT_TIME),
|
TALK_ID(pti->trk_secs[ePT_SECS_BEF], UNIT_TIME),
|
||||||
VOICE_OF,
|
VOICE_OF,
|
||||||
TALK_ID(pti->trk_secs[ePT_SECS_TTL], UNIT_TIME),
|
TALK_ID(pti->trk_secs[ePT_SECS_TTL], UNIT_TIME),
|
||||||
|
@ -155,21 +193,29 @@ static const char * playing_time_get_or_speak_info(int selected_item, void * dat
|
||||||
char timestr[25];
|
char timestr[25];
|
||||||
rb->format_time_auto(timestr, sizeof(timestr), pti->trk_secs[ePT_SECS_AFT],
|
rb->format_time_auto(timestr, sizeof(timestr), pti->trk_secs[ePT_SECS_AFT],
|
||||||
UNIT_SEC, false);
|
UNIT_SEC, false);
|
||||||
rb->snprintf(buf, buffer_len, rb->str(LANG_PLAYTIME_TRK_REMAINING), timestr);
|
rb->snprintf(buf, buffer_len, "%s", timestr);
|
||||||
|
|
||||||
if (say_it)
|
if (say_it)
|
||||||
rb_talk_ids(false, LANG_PLAYTIME_TRK_REMAINING,
|
rb_talk_ids(false, menu_name_id,
|
||||||
TALK_ID(pti->trk_secs[ePT_SECS_AFT], UNIT_TIME));
|
TALK_ID(pti->trk_secs[ePT_SECS_AFT], UNIT_TIME));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4: { /* track index */
|
case 4: { /* track index */
|
||||||
int track_pct = pti->curr_display_index * 100 / pti->nb_tracks;
|
int track_pct = pti->curr_display_index * 100 / pti->nb_tracks;
|
||||||
|
|
||||||
rb->snprintf(buf, buffer_len, rb->str(LANG_PLAYTIME_TRACK),
|
if (rb->lang_is_rtl())
|
||||||
pti->curr_display_index, pti->nb_tracks, track_pct);
|
{
|
||||||
|
rb->snprintf(buf, buffer_len, "%s %d / %d",
|
||||||
|
get_percent_str(track_pct), pti->nb_tracks, pti->curr_display_index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rb->snprintf(buf, buffer_len, "%d / %d %s",
|
||||||
|
pti->curr_display_index, pti->nb_tracks, get_percent_str(track_pct));
|
||||||
|
}
|
||||||
|
|
||||||
if (say_it)
|
if (say_it)
|
||||||
rb_talk_ids(false, LANG_PLAYTIME_TRACK,
|
rb_talk_ids(false, menu_name_id,
|
||||||
TALK_ID(pti->curr_display_index, UNIT_INT),
|
TALK_ID(pti->curr_display_index, UNIT_INT),
|
||||||
VOICE_OF,
|
VOICE_OF,
|
||||||
TALK_ID(pti->nb_tracks, UNIT_INT),
|
TALK_ID(pti->nb_tracks, UNIT_INT),
|
||||||
|
@ -185,12 +231,12 @@ static const char * playing_time_get_or_speak_info(int selected_item, void * dat
|
||||||
rb->output_dyn_value(kbstr[i], sizeof(kbstr[i]),
|
rb->output_dyn_value(kbstr[i], sizeof(kbstr[i]),
|
||||||
pti->kbs[i], kibyte_units, 3, true);
|
pti->kbs[i], kibyte_units, 3, true);
|
||||||
}
|
}
|
||||||
rb->snprintf(buf, buffer_len, rb->str(LANG_PLAYTIME_STORAGE),
|
rb->snprintf(buf, buffer_len, "%s (%s / %s)",
|
||||||
kbstr[ePT_KBS_TTL], kbstr[ePT_KBS_BEF],kbstr[ePT_KBS_AFT]);
|
kbstr[ePT_KBS_TTL], kbstr[ePT_KBS_BEF],kbstr[ePT_KBS_AFT]);
|
||||||
|
|
||||||
if (say_it) {
|
if (say_it) {
|
||||||
int32_t voice_ids[ePT_KBS_COUNT];
|
int32_t voice_ids[ePT_KBS_COUNT];
|
||||||
voice_ids[ePT_KBS_TTL] = LANG_PLAYTIME_STORAGE;
|
voice_ids[ePT_KBS_TTL] = menu_name_id;
|
||||||
voice_ids[ePT_KBS_BEF] = VOICE_PLAYTIME_DONE;
|
voice_ids[ePT_KBS_BEF] = VOICE_PLAYTIME_DONE;
|
||||||
voice_ids[ePT_KBS_AFT] = LANG_PLAYTIME_REMAINING;
|
voice_ids[ePT_KBS_AFT] = LANG_PLAYTIME_REMAINING;
|
||||||
|
|
||||||
|
@ -205,10 +251,10 @@ static const char * playing_time_get_or_speak_info(int selected_item, void * dat
|
||||||
char str[10];
|
char str[10];
|
||||||
long avg_track_size = pti->kbs[ePT_KBS_TTL] / pti->nb_tracks;
|
long avg_track_size = pti->kbs[ePT_KBS_TTL] / pti->nb_tracks;
|
||||||
rb->output_dyn_value(str, sizeof(str), avg_track_size, kibyte_units, 3, true);
|
rb->output_dyn_value(str, sizeof(str), avg_track_size, kibyte_units, 3, true);
|
||||||
rb->snprintf(buf, buffer_len, rb->str(LANG_PLAYTIME_AVG_TRACK_SIZE), str);
|
rb->snprintf(buf, buffer_len, "%s", str);
|
||||||
|
|
||||||
if (say_it) {
|
if (say_it) {
|
||||||
rb->talk_id(LANG_PLAYTIME_AVG_TRACK_SIZE, false);
|
rb->talk_id(menu_name_id, false);
|
||||||
rb->output_dyn_value(NULL, 0, avg_track_size, kibyte_units, 3, true);
|
rb->output_dyn_value(NULL, 0, avg_track_size, kibyte_units, 3, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -217,10 +263,10 @@ static const char * playing_time_get_or_speak_info(int selected_item, void * dat
|
||||||
/* Convert power of 2 kilobytes to power of 10 kilobits */
|
/* Convert power of 2 kilobytes to power of 10 kilobits */
|
||||||
long avg_bitrate = (pti->kbs[ePT_KBS_TTL] / pti->secs[ePT_SECS_TTL]
|
long avg_bitrate = (pti->kbs[ePT_KBS_TTL] / pti->secs[ePT_SECS_TTL]
|
||||||
* 1024 * 8 / 1000);
|
* 1024 * 8 / 1000);
|
||||||
rb->snprintf(buf, buffer_len, rb->str(LANG_PLAYTIME_AVG_BITRATE), avg_bitrate);
|
rb->snprintf(buf, buffer_len, "%ld kbps", avg_bitrate);
|
||||||
|
|
||||||
if (say_it)
|
if (say_it)
|
||||||
rb_talk_ids(false, LANG_PLAYTIME_AVG_BITRATE,
|
rb_talk_ids(false, menu_name_id,
|
||||||
TALK_ID(avg_bitrate, UNIT_KBIT));
|
TALK_ID(avg_bitrate, UNIT_KBIT));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -340,10 +386,10 @@ static bool playing_time(void)
|
||||||
struct gui_synclist pt_lists;
|
struct gui_synclist pt_lists;
|
||||||
int key;
|
int key;
|
||||||
|
|
||||||
rb->gui_synclist_init(&pt_lists, &playing_time_get_info, &pti, true, 1, NULL);
|
rb->gui_synclist_init(&pt_lists, &playing_time_get_info, &pti, true, 2, NULL);
|
||||||
if (rb->global_settings->talk_menu)
|
if (rb->global_settings->talk_menu)
|
||||||
rb->gui_synclist_set_voice_callback(&pt_lists, playing_time_speak_info);
|
rb->gui_synclist_set_voice_callback(&pt_lists, playing_time_speak_info);
|
||||||
rb->gui_synclist_set_nb_items(&pt_lists, 8);
|
rb->gui_synclist_set_nb_items(&pt_lists, 16);
|
||||||
rb->gui_synclist_set_title(&pt_lists, rb->str(LANG_PLAYING_TIME), NOICON);
|
rb->gui_synclist_set_title(&pt_lists, rb->str(LANG_PLAYING_TIME), NOICON);
|
||||||
rb->gui_synclist_draw(&pt_lists);
|
rb->gui_synclist_draw(&pt_lists);
|
||||||
rb->gui_synclist_speak_item(&pt_lists);
|
rb->gui_synclist_speak_item(&pt_lists);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue