StringForRate()

Introduce a function to generate the string representation of a bitrate
(kbps, mbps, gbps, etc..)

* Factor out the code from MediaPlayer InfoWindow
* Allow different bases (/1000 or /1024)
This commit is contained in:
Philippe Saint-Pierre
2012-06-25 13:29:22 -04:00
parent 9741d697e8
commit 8d87f2b43a
4 changed files with 90 additions and 7 deletions
+24
View File
@@ -0,0 +1,24 @@
/*
* Copyright 2010 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef STRING_FOR_RATE_H
#define STRING_FOR_RATE_H
#include <SupportDefs.h>
namespace BPrivate {
const char* string_for_rate(double rate, char* string, size_t stringSize,
double base = 1024.0f);
} // namespace BPrivate
using BPrivate::string_for_rate;
#endif // COLOR_QUANTIZER_H