Merge lp:~cmiller/ubuntuone-android-music/hide-meaningless-bitrate-and-filetype into lp:ubuntuone-android-music

Proposed by Chad Miller
Status: Merged
Merged at revision: 453
Proposed branch: lp:~cmiller/ubuntuone-android-music/hide-meaningless-bitrate-and-filetype
Merge into: lp:ubuntuone-android-music
Diff against target: 37 lines (+16/-7)
1 file modified
src/net/sourceforge/subsonic/androidapp/util/SongView.java (+16/-7)
To merge this branch: bzr merge lp:~cmiller/ubuntuone-android-music/hide-meaningless-bitrate-and-filetype
Reviewer Review Type Date Requested Status
Ubuntu One hackers Pending
Review via email: mp+37262@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tim Cole (tcole) wrote :

If we're to be consistent with Ubuntu/Debian generally, shouldn't it be "kib" (base-2/"kibi") rather than "kb" (base-10/"kilo")?

Revision history for this message
Chad Miller (cmiller) wrote :

On 10/01/2010 10:25 AM, Tim Cole wrote:
> If we're to be consistent with Ubuntu/Debian generally, shouldn't it be "kib" (base-2/"kibi") rather than "kb" (base-10/"kilo")?

Maybe. I'm merely copying the nomenclature of the coding systems.

This isn't a storage system, where the difference would matter for
deciding capacity and being disappointed, so I need to be convinced that
the cost of "kib" confusion is worth this proposed accuracy.

Since it's a function of time, it may really be thousands. I've never
heard "kibihertz", evar.

oggenc man page:
  target bitrate to n (in kb/s).

lame man page:
  bitrate of n kbits

same for mencoder and all of its related codecs
cmiller@zippy:~$ man mencoder |grep kib
cmiller@zippy:~$ man mencoder |grep -c kb
30

Revision history for this message
Stuart Langridge (sil) wrote :

https://wiki.ubuntu.com/UnitsPolicy says:
Use base-10 for: network bandwidth (for example, 6 Mbit/s or 50 kB/s)

This does mean that we should do the calculation of bitrate with dividers of 1000, not dividers of 1024.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/net/sourceforge/subsonic/androidapp/util/SongView.java'
2--- src/net/sourceforge/subsonic/androidapp/util/SongView.java 2010-09-23 20:16:28 +0000
3+++ src/net/sourceforge/subsonic/androidapp/util/SongView.java 2010-10-01 14:20:35 +0000
4@@ -78,18 +78,27 @@
5 MusicDirectory.Entry song = downloadFile.getSong();
6
7 StringBuilder text = new StringBuilder(40);
8- text.append(song.getArtist()).append(" (");
9- if (song.getBitRate() != null) {
10- text.append(song.getBitRate()).append("k ");
11+ text.append(song.getArtist());
12+
13+ StringBuilder additional = new StringBuilder(40);
14+ if ((song.getBitRate() != null) && (song.getBitRate() != 0)) {
15+ additional.append(song.getBitRate()).append("kb");
16 }
17- text.append(song.getSuffix());
18+ if (song.getSuffix() != null) {
19+ if (additional.length() != 0)
20+ additional.append(" ");
21+ additional.append(song.getSuffix());
22+ }
23 if (song.getTranscodedSuffix() != null && !song.getTranscodedSuffix().equals(song.getSuffix())) {
24- text.append(" > ").append(song.getTranscodedSuffix());
25+ additional.append(" > ").append(song.getTranscodedSuffix());
26 }
27- text.append(")");
28
29 textView1.setText(song.getTitle());
30- textView2.setText(text);
31+ if (additional.length() != 0) {
32+ textView2.setText(text + " (" + additional + ")");
33+ } else {
34+ textView2.setText(text);
35+ }
36 textView3.setText(Util.formatDuration(song.getDuration()));
37 checkedTextView.setVisibility(checkable ? View.VISIBLE : View.GONE);
38

Subscribers

People subscribed via source and target branches

to status/vote changes: