mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
Fixed table selection
This commit is contained in:
parent
a177988f97
commit
b9b0645f50
2 changed files with 14 additions and 3 deletions
|
|
@ -88,9 +88,15 @@ public:
|
||||||
menus[prefix].addItem (t, [this, t]
|
menus[prefix].addItem (t, [this, t]
|
||||||
{
|
{
|
||||||
if (idx == 0)
|
if (idx == 0)
|
||||||
|
{
|
||||||
|
proc.userTable1.reset();
|
||||||
proc.osc1Table = t;
|
proc.osc1Table = t;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
proc.userTable2.reset();
|
||||||
proc.osc2Table = t;
|
proc.osc2Table = t;
|
||||||
|
}
|
||||||
|
|
||||||
proc.reloadWavetables();
|
proc.reloadWavetables();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -506,7 +506,7 @@ void WavetableAudioProcessor::reloadWavetables()
|
||||||
if (shouldLoad (0, osc2Table.toString(), sr))
|
if (shouldLoad (0, osc2Table.toString(), sr))
|
||||||
loadWaveTable (osc2Tables, sr, userTable2, "wav");
|
loadWaveTable (osc2Tables, sr, userTable2, "wav");
|
||||||
}
|
}
|
||||||
if (auto mb = loadMemory (osc2Table.toString()); mb.getSize() > 0)
|
else if (auto mb = loadMemory (osc2Table.toString()); mb.getSize() > 0)
|
||||||
{
|
{
|
||||||
if (shouldLoad (1, osc2Table.toString(), sr))
|
if (shouldLoad (1, osc2Table.toString(), sr))
|
||||||
loadWaveTable (osc2Tables, sr, mb, "flac");
|
loadWaveTable (osc2Tables, sr, mb, "flac");
|
||||||
|
|
@ -517,10 +517,15 @@ void WavetableAudioProcessor::incWavetable (int osc, int delta)
|
||||||
{
|
{
|
||||||
auto& table = osc == 0 ? osc1Table : osc2Table;
|
auto& table = osc == 0 ? osc1Table : osc2Table;
|
||||||
|
|
||||||
|
if (osc == 0)
|
||||||
|
userTable1.reset();
|
||||||
|
else
|
||||||
|
userTable2.reset();
|
||||||
|
|
||||||
juce::StringArray tables;
|
juce::StringArray tables;
|
||||||
for (auto i = 0; i < BinaryData::namedResourceListSize; i++)
|
for (auto i = 0; i < BinaryData::namedResourceListSize; i++)
|
||||||
if (juce::String (BinaryData::originalFilenames[i]).endsWith (".wav"))
|
if (juce::String (BinaryData::originalFilenames[i]).endsWith (".wt2048"))
|
||||||
tables.add (juce::String (BinaryData::originalFilenames[i]).upToLastOccurrenceOf (".wav", false, false));
|
tables.add (juce::String (BinaryData::originalFilenames[i]).upToLastOccurrenceOf (".wt2048", false, false));
|
||||||
|
|
||||||
tables.sortNatural();
|
tables.sortNatural();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue