Пример #1
0
        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);
                    }
                }
            }
        }
Пример #2
0
        public void Restore(Vst.EffectPlugin target)
        {
            target.Name      = Name;
            target.EffectMix = EffectMix;

            target.LoadParameters(Parameters);
        }
Пример #3
0
 public EffectPlugin(Vst.EffectPlugin source)
 {
     Name       = source.Name;
     PluginPath = source.PluginPath;
     EffectMix  = source.EffectMix;
     Parameters = source.DumpParameters();
 }
Пример #4
0
        public void Restore(Vst.EffectPlugin target)
        {
            target.Name      = Name;
            target.EffectMix = EffectMix;

            if (target.PluginCommandStub.PluginContext.PluginInfo.Flags.HasFlag(VstPluginFlags.ProgramChunks))
            {
                target.PluginCommandStub.SetChunk(Chunk, false);
            }

            target.LoadParameters(Parameters);
        }
Пример #5
0
        public EffectPlugin(Vst.EffectPlugin source)
        {
            Name       = source.Name;
            PluginPath = source.PluginPath;
            EffectMix  = source.EffectMix;
            Parameters = source.DumpParameters();

            if (source.PluginCommandStub.PluginContext.PluginInfo.Flags.HasFlag(VstPluginFlags.ProgramChunks))
            {
                Chunk     = source.PluginCommandStub.GetChunk(false);
                ChunkSize = Chunk.Length;
            }
            else
            {
                Chunk     = new byte[0];
                ChunkSize = 0;
            }
        }