text
stringlengths 0
2.2M
|
---|
name.setBounds (label);
|
}
|
{
|
auto label = r.removeFromTop (24);
|
layoutLabel.setBounds (label.removeFromLeft (100));
|
layouts.setBounds (label);
|
}
|
}
|
private:
|
void updateBusButtons()
|
{
|
if (auto* plugin = owner.getAudioProcessor())
|
{
|
auto& header = ioBuses.getHeader();
|
header.removeAllColumns();
|
const int n = plugin->getBusCount (isInput);
|
for (int i = 0; i < n; ++i)
|
header.addColumn ("", i + 1, 40);
|
header.addColumn ("+", NumberedBoxes::plusButtonColumnId, 20);
|
header.addColumn ("-", NumberedBoxes::minusButtonColumnId, 20);
|
ioBuses.setCanAddColumn (plugin->canAddBus (isInput));
|
ioBuses.setCanRemoveColumn (plugin->canRemoveBus (isInput));
|
}
|
ioBuses.setSelected (currentBus + 1);
|
}
|
void updateBusLayout()
|
{
|
if (auto* plugin = owner.getAudioProcessor())
|
{
|
if (auto* bus = plugin->getBus (isInput, currentBus))
|
{
|
name.setText (bus->getName(), NotificationType::dontSendNotification);
|
// supported layouts have changed
|
layouts.clear (dontSendNotification);
|
auto* menu = layouts.getRootMenu();
|
auto itemId = 1;
|
auto selectedId = -1;
|
for (auto i = 1; i < AudioChannelSet::maxChannelsOfNamedLayout; ++i)
|
{
|
for (const auto& set : AudioChannelSet::channelSetsWithNumberOfChannels (i))
|
{
|
if (bus->isLayoutSupported (set))
|
{
|
menu->addItem (PopupMenu::Item { set.getDescription() }
|
.setAction ([this, set] { applyBusLayout (set); })
|
.setID (itemId));
|
}
|
if (bus->getCurrentLayout() == set)
|
selectedId = itemId;
|
++itemId;
|
}
|
}
|
layouts.setSelectedId (selectedId);
|
const bool canBeDisabled = bus->isNumberOfChannelsSupported (0);
|
if (canBeDisabled != enabledToggle.isEnabled())
|
enabledToggle.setEnabled (canBeDisabled);
|
enabledToggle.setToggleState (bus->isEnabled(), NotificationType::dontSendNotification);
|
}
|
}
|
}
|
//==============================================================================
|
void applyBusLayout (const AudioChannelSet& set)
|
{
|
if (auto* p = owner.getAudioProcessor())
|
{
|
if (auto* bus = p->getBus (isInput, currentBus))
|
{
|
if (bus->setCurrentLayoutWithoutEnabling (set))
|
{
|
if (auto* config = owner.getConfig (! isInput))
|
config->updateBusLayout();
|
owner.update();
|
}
|
}
|
}
|
}
|
void buttonClicked (Button*) override {}
|
void buttonStateChanged (Button* btn) override
|
{
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.