private void RestoreMixerChannels(ProjectFile file) { foreach (JUMO.MixerChannel ch in _mixerManager.MixerChannels) { ch.UnloadAllEffects(); } int chCount = Math.Min(_mixerManager.MixerChannels.Length, file.MixerChannels.Length); for (int i = 0; i < chCount; i++) { MixerChannel source = file.MixerChannels[i]; JUMO.MixerChannel target = _mixerManager.MixerChannels[i]; target.Panning = source.Panning; target.Volume = source.Volume; target.IsMuted = source.IsMuted; foreach (EffectPlugin plugin in source.Plugins) { Vst.EffectPlugin p = target.AddEffect(plugin.PluginPath); if (p == null) { // Fail? Open a OpenFileDialog? } else { plugin.Restore(p); } } } }
public MixerChannel(JUMO.MixerChannel source) { Panning = source.Panning; Volume = source.Volume; IsMuted = source.IsMuted; Plugins = new EffectPlugin[source.Plugins.Count]; int pluginIndex = 0; foreach (Vst.EffectPlugin plugin in source.Plugins) { Plugins[pluginIndex++] = new EffectPlugin(plugin); } }