/// <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 }
/// <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)); }
/// <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); }
/// <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)); }
/// <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); }
/// <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)); }
protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance) { return(instance ?? new AudioProcessor()); }
protected override IVstPluginAudioProcessor CreateAudioProcessor(IVstPluginAudioProcessor instance) { return instance ?? new AudioProcessor(); }
/// <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; }
/// <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); }
/// <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); }
/// <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); }