Skip to content

Commit

Permalink
Delay/Chorus menu fix
Browse files Browse the repository at this point in the history
The reason the chorus-with-delay choruses were in the Delay/Chorus
menu was because the parent menu picked the effect type. So change
that so a snapshot can optionally have an 'i="num"' parameter which
overrides the type of the parent; and then move the Delay/Chorus
chorus settings into the Chorus menu; keep only two of them; rename
them to "Chorus (using Delay)" and "Wide Chorus (using Delay)"
and rename the awful "Delay/Chorus" menu to "Delay".

Closes surge-synthesizer#675
  • Loading branch information
baconpaul committed Mar 12, 2019
1 parent 4c1c4e5 commit cd1b860
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/common/gui/CSnapshotMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ void CSnapshotMenu::populateSubmenuFromTypeElement(TiXmlElement *type, VSTGUI::C
while (snapshot)
{
strcpy(txt, snapshot->Attribute("name"));
int snapshotTypeID = type_id;
int tmpI;
if (snapshot->Attribute("i", &tmpI) != nullptr)
{
snapshotTypeID = tmpI;
}

auto actionItem = new CCommandMenuItem(CCommandMenuItem::Desc(txt));
auto action = [this, snapshot, type_id](CCommandMenuItem* item) {
this->loadSnapshot(type_id, snapshot);
auto action = [this, snapshot, snapshotTypeID](CCommandMenuItem* item) {
this->loadSnapshot(snapshotTypeID, snapshot);
};

actionItem->setActions(action, nullptr);
Expand Down Expand Up @@ -286,9 +292,6 @@ void CFxMenu::loadSnapshot(int type, TiXmlElement* e)
fxbuffer->type.val.i = type;
if (e)
{
TiXmlElement* p = TINYXML_SAFE_TO_ELEMENT(e->Parent());
p->QueryIntAttribute("i", &type);
assert(within_range(0, type, num_fxtypes));
fxbuffer->type.val.i = type;
// storage->patch.update_controls();

Expand Down

0 comments on commit cd1b860

Please sign in to comment.