mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
AudioDeviceSelectorComponent: Tweak buffer size combo box to display the actual buffer size, even it it does not match any reported available buffer size
This commit is contained in:
parent
e92cac9ae0
commit
28a2700a28
1 changed files with 9 additions and 2 deletions
|
|
@ -804,12 +804,19 @@ private:
|
|||
currentRate = 48000.0;
|
||||
|
||||
for (auto bs : currentDevice->getAvailableBufferSizes())
|
||||
bufferSizeDropDown->addItem (String (bs) + " samples (" + String (bs * 1000.0 / currentRate, 1) + " ms)", bs);
|
||||
bufferSizeDropDown->addItem (getBufferSizeText (bs, currentRate), bs);
|
||||
|
||||
const auto bufferSizeSamples = currentDevice->getCurrentBufferSizeSamples();
|
||||
bufferSizeDropDown->setText (getBufferSizeText (bufferSizeSamples, currentRate), dontSendNotification);
|
||||
|
||||
bufferSizeDropDown->setSelectedId (currentDevice->getCurrentBufferSizeSamples(), dontSendNotification);
|
||||
bufferSizeDropDown->onChange = [this] { updateConfig (false, false, false, true); };
|
||||
}
|
||||
|
||||
String getBufferSizeText (int bs, double currentRate) const
|
||||
{
|
||||
return String (bs) + " samples (" + String (bs * 1000.0 / currentRate, 1) + " ms)";
|
||||
}
|
||||
|
||||
public:
|
||||
//==============================================================================
|
||||
class ChannelSelectorListBox final : public ListBox,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue