MediaPlayer InfoWindow: Add Bitrate info, fix duration display
* The duration minutes didn't include a leading zero when necessary * Added Bitrate info (#7782)
This commit is contained in:
@@ -405,6 +405,16 @@ printf("InfoWin::Update(0x%08lx)\n", which);
|
|||||||
rateString.ReplaceFirst("%d", "??");
|
rateString.ReplaceFirst("%d", "??");
|
||||||
s << rateString;
|
s << rateString;
|
||||||
}
|
}
|
||||||
|
if (format.type == B_MEDIA_ENCODED_AUDIO) {
|
||||||
|
float br = format.u.encoded_audio.bit_rate;
|
||||||
|
if (br > 0.0) {
|
||||||
|
char rateString[20];
|
||||||
|
snprintf(rateString, sizeof(rateString), B_TRANSLATE(", %.0f kbps"),
|
||||||
|
br / 1000);
|
||||||
|
s << rateString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s << "\n\n";
|
s << "\n\n";
|
||||||
fContentsView->Insert(s.String());
|
fContentsView->Insert(s.String());
|
||||||
}
|
}
|
||||||
@@ -430,6 +440,8 @@ printf("InfoWin::Update(0x%08lx)\n", which);
|
|||||||
d = d % (60 * 1000);
|
d = d % (60 * 1000);
|
||||||
s << v << ":";
|
s << v << ":";
|
||||||
v = d / 1000;
|
v = d / 1000;
|
||||||
|
if (v < 10)
|
||||||
|
s << '0';
|
||||||
s << v;
|
s << v;
|
||||||
if (hours)
|
if (hours)
|
||||||
s << " " << B_TRANSLATE_COMMENT("h", "Hours");
|
s << " " << B_TRANSLATE_COMMENT("h", "Hours");
|
||||||
|
|||||||
Reference in New Issue
Block a user