Skip to content

Commit

Permalink
Delay/Chorus menu fix (#777)
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 #675
  • Loading branch information
baconpaul authored Mar 13, 2019
1 parent d8462d0 commit 91debf4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
9 changes: 4 additions & 5 deletions resources/data/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</osc>
<fx>
<type i="0" name="Off" />
<type i="1" name="Delay/Chorus">
<type i="1" name="Delay">
<snapshot p0="-1.000000" p0_temposync="1" p1="-1.000000" p1_temposync="1" p2="0.000000" p3="0.000000" p4="-14.105346" p5="48.289276" p6="-1.179463" p7="0.000000" p8="0.000000" p9="0.000000" p10="1.000000" name="Init" />
<snapshot p0="-1.000000" p0_temposync="1" p1="-1.000000" p1_temposync="1" p2="0.709821" p3="0.000000" p4="-14.105346" p5="48.289276" p6="-1.179463" p7="0.337500" p8="0.000000" p9="0.000000" p10="1.000000" name="Wide 1/4" />
<snapshot p0="-2.000000" p0_temposync="1" p1="-2.000000" p1_temposync="1" p2="0.709821" p3="0.000000" p4="-14.105346" p5="48.289276" p6="-1.179463" p7="0.337500" p8="0.000000" p9="0.000000" p10="1.000000" name="Wide 1/8" />
Expand All @@ -30,10 +30,6 @@
<snapshot p0="-2.000000" p0_temposync="1" p1="-2.000000" p1_temposync="1" p2="0.000000" p3="0.725893" p4="-13.092855" p5="43.724987" p6="-1.179463" p7="0.401786" p8="1.000000" p10="1.000000" name="Ping-Pong 1/8" />
<snapshot p0="-3.000000" p0_temposync="1" p1="-3.000000" p1_temposync="1" p2="0.000000" p3="0.835715" p4="-13.092855" p5="43.724987" p6="-1.179463" p7="0.401786" p8="1.000000" p10="1.000000" name="Ping-Pong 1/16" />
<snapshot p0="0.000000" p0_temposync="1" p1="0.000000" p1_temposync="1" p2="0.000000" p3="0.000000" p4="-52.242855" p5="66.000000" p6="-1.179463" p7="0.000000" p8="0.000000" p10="1.000000" name="Repeat" />
<snapshot p0="-8.000000" p1="-8.000000" p2="0.000000" p3="0.000000" p4="-15.792830" p5="39.851772" p6="0.583039" p7="0.332143" p8="0.000000" p9="0.000000" p10="0.563393" name="Chorus 1" />
<snapshot p0="-8.000000" p1="-8.000000" p2="0.000000" p3="0.000000" p4="-15.792830" p5="39.851772" p6="1.764290" p7="0.476786" p8="0.000000" p9="0.000000" p10="0.563393" name="Chorus 2" />
<snapshot p0="-8.000000" p1="-8.000000" p2="0.000000" p3="0.000000" p4="-15.792830" p5="39.851772" p6="0.583039" p7="0.332143" p8="0.000000" p10="0.318750" p11="9.771431" name="Wide Chorus 1" />
<snapshot p0="-8.000000" p1="-8.000000" p2="0.000000" p3="0.000000" p4="-15.792830" p5="39.851772" p6="1.764290" p7="0.476786" p8="0.000000" p10="0.305357" p11="12.985722" name="Wide Chorus 2" />
<type i="1" name="Arty">
<snapshot p0="-5.000000" p0_temposync="1" p1="-5.000000" p1_temposync="1" p2="0.680688" p3="0.000000" p4="-60.000000" p5="70.000000" p6="-7.000000" p7="0.000000" p8="0.000000" p10="1.000000" p11="0.000000" name="Arty Delay 1/64" />
<snapshot p0="-4.000000" p0_temposync="1" p1="-4.000000" p1_temposync="1" p2="0.680688" p3="0.000000" p4="-60.000000" p5="70.000000" p6="-7.000000" p7="0.000000" p8="0.000000" p10="1.000000" p11="0.000000" name="Arty Delay 1/32" />
Expand Down Expand Up @@ -68,6 +64,9 @@
<snapshot p0="-7.885717" p1="-2.850000" p2="0.669643" p3="0.000000" p4="-23.625008" p5="65.662498" p6="0.367857" name="Init" />
<snapshot p0="-7.885717" p1="-0.693749" p2="0.530357" p3="0.000000" p4="-23.625008" p5="65.662498" p6="0.386607" name="Faster" />
<snapshot p0="-6.385716" p1="-0.431251" p2="0.503571" p3="0.000000" p4="-11.137505" p5="56.212494" p6="0.431250" name="Deep" />

<snapshot i="1" p0="-8.000000" p1="-8.000000" p2="0.000000" p3="0.000000" p4="-15.792830" p5="39.851772" p6="0.583039" p7="0.332143" p8="0.000000" p9="0.000000" p10="0.563393" name="Chorus (using Delay)" />
<snapshot i="1" p0="-8.000000" p1="-8.000000" p2="0.000000" p3="0.000000" p4="-15.792830" p5="39.851772" p6="1.764290" p7="0.476786" p8="0.000000" p10="0.305357" p11="12.985722" name="Wide Chorus (using Delay)" />
</type>
<type i="3" name="Phaser">
<snapshot p0="0.000000" p1="0.000000" p2="0.000000" p3="-7.00000" p4="0.000000" p5="0.000000" p6="0.000000" name="Init" />
Expand Down
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 91debf4

Please sign in to comment.