Commits

piorekf  committed bea2b9e

Changed the way effects are positioned after loading from file

  • Participants
  • Parent commits f0c0864

Comments (0)

Files changed (2)

File plug/loadfromfile.cpp

 void LoadFromFile::parseFX()
 {
     int x = 0;
-    bool fx_slots[4] = {false, false, false, false};
+    int fx_slots[8] = {0, 0, 0, 0, 0, 0, 0, 0};
 
     xml->readNextStartElement();
     while(xml->name() != "FX")
                 x = 3;
             else if(xml->name() == "Module")
             {
-                int i = xml->attributes().value("POS").toString().toInt();
+                int position = xml->attributes().value("POS").toString().toInt();
 
-                if(i > 3)
+                if(position > 3)
                     fx_settings[x].put_post_amp = true;
                 else
                     fx_settings[x].put_post_amp = false;
 
-                while(fx_slots[i%4])
-                    i++;
-                fx_slots[i%4] = true;
-                fx_settings[x].fx_slot = i%4;
+                fx_slots[position] = x+1;
 
                 switch(xml->attributes().value("ID").toString().toInt())
                 {
         }
         xml->readNext();
     }
+
+    for(int i = 0, j = 0; i < 8; i++)
+    {
+        if(fx_slots[i])
+        {
+            fx_settings[fx_slots[i]-1].fx_slot = j;
+            j++;
+        }
+    }
 }
 
 void LoadFromFile::parseFUSE()

File plug/mainwindow.cpp

         amp->send_amp();
     if(settings.value("Settings/popupChangedWindows").toBool())
         amp->show();
+
     for(int i = 0; i < 4; i++)
     {
         switch(effects_set[i].fx_slot)
         {
         case 0x00:
-        case 0x04:
             effect1->load(effects_set[i]);
             if(connected)
                 effect1->send_fx();
             break;
 
         case 0x01:
-        case 0x05:
             effect2->load(effects_set[i]);
             if(connected)
                 effect2->send_fx();
             break;
 
         case 0x02:
-        case 0x06:
             effect3->load(effects_set[i]);
             if(connected)
                 effect3->send_fx();
             break;
 
         case 0x03:
-        case 0x07:
             effect4->load(effects_set[i]);
             if(connected)
                 effect4->send_fx();