예제 #1
0
        /// <summary>
        /// Метод, возвращающий реализацию интерфейса IVstPluginPrograms.
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        protected override IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
        {
            if (instance == null)
            {
                return(new PluginPrograms(this));
            }

            return(base.CreatePrograms(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 IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
        {
            if (instance == null)
            {
                return(new PluginPrograms(_plugin));
            }

            return(instance);    // reuse initial instance
        }
예제 #3
0
파일: Plugin.cs 프로젝트: tiwadara/vst.net
        /// <summary>
        /// Implement this when you implement plugin programs or presets.
        /// </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 IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
        {
            if (instance == null)
            {
                return(new PluginPrograms(this));
            }

            // TODO: implement a thread-safe wrapper.
            return(base.CreatePrograms(instance));
        }
예제 #4
0
 /// <summary>
 /// Implement this when you implement plugin programs or presets.
 /// </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 IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
 {
     //! This is availiable here but has not been linked to the parameters defined elsewhere.
     //! This should be integrated at some stage.
     if (instance == null)
     {
         return(new PluginPrograms(this));
     }
     return(base.CreatePrograms(instance));
 }
        /// <summary>
        /// Permet de créer une instance par défaut du Plugin Program ou d'utiliser l'existante
        /// </summary>
        protected override IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
        {
            // Si l'instance par défaut est nulle on la créé
            if (instance == null)
            {
                return(new PluginPrograms(_plugin));
            }

            // Sinon on utilise l'instance par défaut déjà existante
            return(instance);
        }
예제 #6
0
        /// <summary>
        /// Implement this when you implement plugin programs or presets.
        /// </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 IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
        {
            if (instance == null)
            {
                PluginPrograms pluginPrograms = new PluginPrograms();
                pluginPrograms.Init(() => this.MssHub.MssProgramMgr);
                return(pluginPrograms);
            }

            return(base.CreatePrograms(instance));
        }
        /// <summary>
        /// Copies the parameter values of the current <see cref="VstProgram"/> to the program indicated by <paramref name="programIndex"/>.
        /// </summary>
        /// <param name="programIndex">A zero-based index into the program collection.</param>
        /// <returns>Returns true when the program parameter values were successfully copied.</returns>
        /// <remarks>The name of the program itself is also copied.</remarks>
        public virtual bool CopyCurrentProgramTo(int programIndex)
        {
            IVstPluginPrograms programs = Plugin.GetInstance <IVstPluginPrograms>();

            if (programs != null && programs.ActiveProgram != null)
            {
                VstProgram targetProgram = programs.Programs[programIndex];
                // targetProgram.Categories is always the same between programs
                targetProgram.Name = programs.ActiveProgram.Name;

                // copy parameter values.
                for (int i = 0; i < programs.ActiveProgram.Parameters.Count; i++)
                {
                    targetProgram.Parameters[i].Value = programs.ActiveProgram.Parameters[i].Value;
                }

                return(true);
            }

            return(false);
        }
예제 #8
0
 protected override IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
 {
     return(null);
 }
 /// <summary>
 /// Called when an instance of the <see cref="IVstPluginPrograms"/> 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="IVstPluginPrograms"/> 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 IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
 {
     return(instance);
 }
예제 #10
0
파일: Plugin.cs 프로젝트: kavun/VSTNETSynth
        /// <summary>
        /// Implement this when you implement plugin programs or presets.
        /// </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 IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
        {
            if (instance == null)
            {
                return new PluginPrograms(this);
            }

            return base.CreatePrograms(instance);
        }
예제 #11
0
        /// <summary>
        /// Implement this when you implement plugin programs or presets.
        /// </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 IVstPluginPrograms CreatePrograms(IVstPluginPrograms instance)
        {
            if (instance == null)
            {
                PluginPrograms pluginPrograms = new PluginPrograms();
                pluginPrograms.Init(() => this.MssHub.MssProgramMgr);
                return pluginPrograms;
            }

            return base.CreatePrograms(instance);
        }