public static Tone2014 LoadFromXmlTemplateFile(string toneTemplateFilePath) { Tone2014 tone = null; var serializer = new DataContractSerializer(typeof(Tone2014)); using (var stm = new XmlTextReader(toneTemplateFilePath)) { tone = (Tone2014)serializer.ReadObject(stm); } return(tone); }
public Tone2014 ToneToTone2014(Tone rs1Tone, Song rs1Song) { Tone2014 tone2014 = new Tone2014(); Pedal2014 amp = new Pedal2014(); Pedal2014 cabinet = new Pedal2014(); Pedal2014 prepedal1 = new Pedal2014(); Pedal2014 rack1 = new Pedal2014(); Pedal2014 rack2 = new Pedal2014(); tone2014.ToneDescriptors = new List<string>(); // use Tone Key for better conversion tone2014.Name = rs1Tone.Name ?? "Default"; tone2014.Key = rs1Tone.Key ?? "DEFAULT"; tone2014.Volume = rs1Tone.Volume; tone2014.IsCustom = true; tone2014.NameSeparator = " - "; tone2014.SortOrder = 0; // setup some possible tone approximation conversions // no direct mapping for RS1 -> RS2 Tones // look here IEnumerable<ToneDescriptor> List() // TODO: figure out better method for tone mapping if (tone2014.Key.ToUpper().Contains("COMBO")) tone2014.Key = "Combo_OD"; if (tone2014.Key.ToUpper().Contains("OD")) { tone2014.ToneDescriptors.Add("$[35716]OVERDRIVE"); amp.Type = "Amps"; amp.Category = "Amp"; amp.PedalKey = "Amp_MarshallJTM45"; cabinet.Type = "Cabinets"; cabinet.Category = "Dynamic_Cone"; cabinet.PedalKey = "Cab_Marshall1936_57_Cone"; rack1.Type = "Racks"; rack1.Category = "Filter"; rack1.PedalKey = "Rack_StudioEQ"; rack2.Type = "Racks"; rack2.Category = "Reverb"; rack2.PedalKey = "Rack_StudioVerb"; prepedal1.Type = "Pedals"; prepedal1.Category = "Distortion"; prepedal1.PedalKey = "Pedal_SuperDrive"; tone2014.GearList = new Gear2014() { Amp = amp, Cabinet = cabinet, Rack1 = rack1, Rack2 = rack2, PrePedal1 = prepedal1 }; } else if (tone2014.Key.ToUpper().Contains("LEAD")) { tone2014.ToneDescriptors.Add("$[35724]LEAD"); amp.Type = "Amps"; amp.Category = "Amp"; amp.PedalKey = "Amp_AT120"; cabinet.Type = "Cabinets"; cabinet.Category = "Dynamic_Cone"; cabinet.PedalKey = "Cab_OrangePPC412_57_Cone"; rack1.Type = "Racks"; rack1.Category = "Filter"; rack1.PedalKey = "Rack_StudioEQ"; prepedal1.Type = "Pedals"; prepedal1.Category = "Distortion"; prepedal1.PedalKey = "Pedal_GermaniumDrive"; tone2014.GearList = new Gear2014() { Amp = amp, Cabinet = cabinet, Rack1 = rack1, PrePedal1 = prepedal1 }; } else if (tone2014.Key.ToUpper().Contains("DIS")) { tone2014.ToneDescriptors.Add("$[35722]DISTORTION"); amp.Type = "Amps"; amp.Category = "Amp"; amp.PedalKey = "Amp_GB100"; cabinet.Type = "Cabinets"; cabinet.Category = "Dynamic_Cone"; cabinet.PedalKey = "Cab_GB412CMKIII_57_Cone"; rack1.Type = "Racks"; rack1.Category = "Filter"; rack1.PedalKey = "Rack_StudioEQ"; rack2.Type = "Racks"; rack2.Category = "Reverb"; rack2.PedalKey = "Rack_StudioVerb"; prepedal1.Type = "Pedals"; prepedal1.Category = "Distortion"; prepedal1.PedalKey = "Pedal_GermaniumDrive"; tone2014.GearList = new Gear2014() { Amp = amp, Cabinet = cabinet, Rack1 = rack1, Rack2 = rack2, PrePedal1 = prepedal1 }; } else if (tone2014.Key.ToUpper().Contains("CLEAN")) { tone2014.ToneDescriptors.Add("$[35720]CLEAN"); amp.Type = "Amps"; amp.Category = "Amp"; amp.PedalKey = "Amp_TW40"; cabinet.Type = "Cabinets"; cabinet.Category = "Dynamic_Cone"; cabinet.PedalKey = "Cab_TW112C_57_Cone"; rack1.Type = "Racks"; rack1.Category = "Filter"; rack1.PedalKey = "Rack_StudioEQ"; tone2014.GearList = new Gear2014() { Amp = amp, Cabinet = cabinet, Rack1 = rack1 }; } else if (tone2014.Key.ToUpper().Contains("ACOU")) { tone2014.ToneDescriptors.Add("$[35721]ACOUSTIC"); amp.Type = "Amps"; amp.Category = "Amp"; amp.PedalKey = "Amp_TW40"; cabinet.Type = "Cabinets"; cabinet.Category = "Dynamic_Cone"; cabinet.PedalKey = "Cab_GB412CMKIII_57_Cone"; rack1.Type = "Racks"; rack1.Category = "Filter"; rack1.PedalKey = "Rack_StudioEQ"; rack2.Type = "Racks"; rack2.Category = "Dynamics"; rack2.PedalKey = "Rack_StudioCompressor"; prepedal1.Type = "Pedals"; prepedal1.Category = "Filter"; prepedal1.PedalKey = "Pedal_AcousticEmulator"; tone2014.GearList = new Gear2014() { Amp = amp, Cabinet = cabinet, Rack1 = rack1, Rack2 = rack2, PrePedal1 = prepedal1 }; } else if (tone2014.Key.ToUpper().Contains("BASS")) { tone2014.ToneDescriptors.Add("$[35715]BASS"); amp.Type = "Amps"; amp.Category = "Amp"; amp.PedalKey = "Bass_Amp_CH300B"; cabinet.Type = "Cabinets"; cabinet.Category = "Dynamic_Cone"; cabinet.PedalKey = "Bass_Cab_BT410BC_57_Cone"; rack1.Type = "Racks"; rack1.Category = "Filter"; rack1.PedalKey = "Rack_StudioEQ"; tone2014.GearList = new Gear2014() { Amp = amp, Cabinet = cabinet, Rack1 = rack1 }; } else // default acoustic is better than nothing { // this is fix for bad RS1 CDLC tones tone2014.Key = "DEFAULT"; // tone2014.ToneDescriptors.Add("$[35721]ACOUSTIC"); amp.Type = "Amps"; amp.Category = "Amp"; amp.PedalKey = "Amp_TW40"; cabinet.Type = "Cabinets"; cabinet.Category = "Dynamic_Cone"; cabinet.PedalKey = "Cab_GB412CMKIII_57_Cone"; rack1.Type = "Racks"; rack1.Category = "Filter"; rack1.PedalKey = "Rack_StudioEQ"; rack2.Type = "Racks"; rack2.Category = "Dynamics"; rack2.PedalKey = "Rack_StudioCompressor"; prepedal1.Type = "Pedals"; prepedal1.Category = "Filter"; prepedal1.PedalKey = "Pedal_AcousticEmulator"; tone2014.GearList = new Gear2014() { Amp = amp, Cabinet = cabinet, Rack1 = rack1, Rack2 = rack2, PrePedal1 = prepedal1 }; } return tone2014; }