mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 21:56:30 +01:00
[Summary] For sample rate changed algorithm for conversion string to float
This commit is contained in:
parent
654bce5c84
commit
9ac221f53e
1 changed files with 25 additions and 2 deletions
|
|
@ -1658,8 +1658,31 @@ TracksControlPanel::bufsize_as_string (uint32_t sz)
|
||||||
framecnt_t
|
framecnt_t
|
||||||
TracksControlPanel::get_sample_rate () const
|
TracksControlPanel::get_sample_rate () const
|
||||||
{
|
{
|
||||||
float r = atof (_sample_rate_combo.get_active_text ());
|
const string sample_rate = _sample_rate_combo.get_active_text ();
|
||||||
/* the string may have been translated with an abbreviation for
|
|
||||||
|
if ( "44.1 kHz" == sample_rate )
|
||||||
|
{
|
||||||
|
return 44100;
|
||||||
|
} else if ( "48 kHz" == sample_rate )
|
||||||
|
{
|
||||||
|
return 48000;
|
||||||
|
} else if ( "88.2 kHz" == sample_rate )
|
||||||
|
{
|
||||||
|
return 88200;
|
||||||
|
} else if ( "96 kHz" == sample_rate )
|
||||||
|
{
|
||||||
|
return 96000;
|
||||||
|
} else if ( "172.4 kHz" == sample_rate )
|
||||||
|
{
|
||||||
|
return 172400;
|
||||||
|
} else if ( "192 kHz" == sample_rate )
|
||||||
|
{
|
||||||
|
return 192000;
|
||||||
|
}
|
||||||
|
|
||||||
|
float r = atof (sample_rate);
|
||||||
|
|
||||||
|
/* the string may have been translated with an abbreviation for
|
||||||
* thousands, so use a crude heuristic to fix this.
|
* thousands, so use a crude heuristic to fix this.
|
||||||
*/
|
*/
|
||||||
if (r < 1000.0) {
|
if (r < 1000.0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue