예제 #1
0
        /// <summary>
        /// Creates a default instance and reuses that for all threads.
        /// </summary>
        /// <param name="instance">A reference to the default instance or null.</param>
        /// <returns>Returns the default instance.</returns>
        protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
        {
            if (instance == null)
            {
                return(new AudioProcessor(_plugin));
            }

            return(instance);    // reuse initial instance
        }
예제 #2
0
        /// <summary>
        /// Creates a default instance and reuses that for all threads.
        /// </summary>
        /// <param name="instance">A reference to the default instance or null.</param>
        /// <returns>Returns the default instance.</returns>
        protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
        {
            if (instance == null)
            {
                return(AudioProcessor = new AudioProcessor(this));
            }

            return(base.CreateAudioProcessor(instance));
        }
예제 #3
0
        /// <summary>
        /// Implement this when you do audio processing.
        /// </summary>
        /// <param name="instance">A previous instance returned by this method.
        /// When non-null, return a thread-safe version (or wrapper) for the object.</param>
        /// <returns>Returns null when not supported by the plugin.</returns>
        protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
        {
            if (instance == null)
            {
                return(new AudioProcessor(this));
            }

            // TODO: implement a thread-safe wrapper.
            return(base.CreateAudioProcessor(instance));
        }
        /// <summary>
        /// Permet de créer une instance par défaut du Processeur Audio ou d'utiliser l'existante
        /// </summary>
        protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
        {
            // Si l'instance par défaut est nulle on la créé
            if (instance == null)
            {
                return(new ProcesseurAudio(_plugin));
            }

            // Sinon on utilise l'instance par défaut déjà existante
            return(instance);
        }
예제 #5
0
        /// <summary>
        /// Permet de créer une instance de ProcesseurAudio
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
        {
            // Si notre instance de ProcesseurAudio est nulle on retourn une nouvelle instance prenant en paramètre notre objet.
            if (instance == null)
            {
                return(new ProcesseurAudio(this));
            }

            // Sinon on appelle la création de base avec l'instance courante.
            return(base.CreateAudioProcessor(instance));
        }
예제 #6
0
        /// <summary>
        /// Implement this when you do audio processing.
        /// </summary>
        /// <param name="instance">A previous instance returned by this method.
        /// When non-null, return a thread-safe version (or wrapper) for the object.</param>
        /// <returns>Returns null when not supported by the plugin.</returns>
        protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
        {
            if (instance == null)
            {
                DummyAudioHandler newDummpAudioHandler = new DummyAudioHandler();
                newDummpAudioHandler.Init(() => this.MssHub.HostInfoInputPort);
                return(newDummpAudioHandler);
            }

            return(base.CreateAudioProcessor(instance));
        }
        /// <summary>
        /// Assigns the <paramref name="blockSize"/> and <paramref name="sampleRate"/> to the audio processor.
        /// </summary>
        /// <param name="blockSize">The number of samples to be expected in each audio processing cycle.</param>
        /// <param name="sampleRate">The nuumber of samples per second.</param>
        /// <returns>Returns true when the information was assigned to the audio processor.
        /// When the plugin does not implement the audio processor, false is returned.</returns>
        public virtual bool SetBlockSizeAndSampleRate(int blockSize, float sampleRate)
        {
            IVstPluginAudioProcessor audioProcessor = Plugin.GetInstance <IVstPluginAudioProcessor>();

            if (audioProcessor != null)
            {
                audioProcessor.BlockSize  = blockSize;
                audioProcessor.SampleRate = sampleRate;

                return(true);
            }

            return(false);
        }
예제 #8
0
파일: Plugin.cs 프로젝트: tiwadara/vst.net
        /// <summary>
        /// Implement this when you do audio processing.
        /// </summary>
        /// <param name="instance">A previous instance returned by this method.
        /// When non-null, return a thread-safe version (or wrapper) for the object.</param>
        /// <returns>Returns null when not supported by the plugin.</returns>
        protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
        {
            // Dont expose an AudioProcessor if Midi is output in the MidiProcessor
            if (!MidiProcessor.SyncWithAudioProcessor)
            {
                return(null);
            }

            if (instance == null)
            {
                return(new DummyAudioProcessor(this));
            }

            // TODO: implement a thread-safe wrapper.
            return(base.CreateAudioProcessor(instance));
        }
예제 #9
0
 protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
 {
     return(instance ?? new AudioProcessor());
 }
 protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
 {
     return instance ?? new AudioProcessor();
 }
예제 #11
0
 /// <summary>
 /// Creates a default instance and reuses that for all threads.
 /// </summary>
 /// <param name="instance">A reference to the default instance or null.</param>
 /// <returns>Returns the default instance.</returns>
 protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
 {
     if (instance == null) return new AudioProcessor(this);
     return instance;
 }
예제 #12
0
 /// <summary>
 /// Called when an instance of the <see cref="IVstPluginAudioProcessor"/> interface is requested.
 /// </summary>
 /// <param name="instance">The default instance or null.</param>
 /// <returns>Returns <paramref name="instance"/>.</returns>
 /// <remarks>Override to create an instance of the <see cref="IVstPluginAudioProcessor"/> interface.
 /// When <paramref name="instance"/> is null, create the default instance. When the <paramref name="instance"/>
 /// is not null, create a Thread Safe instance, possibly wrapping the default <paramref name="instance"/>.</remarks>
 protected virtual IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
 {
     return(instance);
 }
예제 #13
0
파일: Plugin.cs 프로젝트: kavun/VSTNETSynth
        /// <summary>
        /// Implement this when you do audio processing.
        /// </summary>
        /// <param name="instance">A previous instance returned by this method. 
        /// When non-null, return a thread-safe version (or wrapper) for the object.</param>
        /// <returns>Returns null when not supported by the plugin.</returns>
        protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
        {
            // Dont expose an AudioProcessor if Midi is output in the MidiProcessor
            //if (!MidiProcessor.SyncWithAudioProcessor) return null;

            if (instance == null)
            {
                return new AudioProcessor(this);
            }

            // TODO: implement a thread-safe wrapper.
            return base.CreateAudioProcessor(instance);
        }
예제 #14
0
        /// <summary>
        /// Implement this when you do audio processing.
        /// </summary>
        /// <param name="instance">A previous instance returned by this method. 
        /// When non-null, return a thread-safe version (or wrapper) for the object.</param>
        /// <returns>Returns null when not supported by the plugin.</returns>
        protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance)
        {
            if (instance == null)
            {
                DummyAudioHandler newDummpAudioHandler = new DummyAudioHandler();
                newDummpAudioHandler.Init(() => this.MssHub.HostInfoInputPort);
                return newDummpAudioHandler;
            }

            return base.CreateAudioProcessor(instance);
        }