mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-28 02:30:05 +00:00
BLOCKS: Prevent ConfigMetaData having incorrect default index of 0
This commit is contained in:
parent
e49e2bac7a
commit
d38cf1f679
4 changed files with 7 additions and 4 deletions
|
|
@ -366,7 +366,9 @@ public:
|
|||
options
|
||||
};
|
||||
|
||||
ConfigMetaData() = default;
|
||||
ConfigMetaData (uint32 itemIndex)
|
||||
: item (itemIndex)
|
||||
{}
|
||||
|
||||
// Constructor to work around VS2015 bugs...
|
||||
ConfigMetaData (uint32 itemIndex,
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ struct BlockConfigManager
|
|||
if (getIndexForItem (item, itemIndex))
|
||||
return configList[itemIndex].toConfigMetaData();
|
||||
|
||||
return {};
|
||||
return { static_cast<juce::uint32> (item) };
|
||||
}
|
||||
|
||||
void resetConfigListActiveStatus()
|
||||
|
|
|
|||
|
|
@ -334,7 +334,8 @@ public:
|
|||
|
||||
this->resetConfigListActiveStatus();
|
||||
|
||||
handleConfigItemChanged ({}, getMaxConfigIndex());
|
||||
const auto legacyProgramChangeConfigIndex = getMaxConfigIndex();
|
||||
handleConfigItemChanged ({ legacyProgramChangeConfigIndex }, legacyProgramChangeConfigIndex);
|
||||
|
||||
shouldSaveProgramAsDefault = persistency == ProgramPersistency::setAsDefault;
|
||||
startTimer (20);
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ struct Detector : public ReferenceCountedObject,
|
|||
void notifyBlockOfConfigChange (BlockImpl& bi, uint32 item)
|
||||
{
|
||||
if (item >= bi.getMaxConfigIndex())
|
||||
bi.handleConfigItemChanged ({}, item);
|
||||
bi.handleConfigItemChanged ({ item }, item);
|
||||
else
|
||||
bi.handleConfigItemChanged (bi.getLocalConfigMetaData (item), item);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue