Example #1
0
 public static T GetInstance(Plugin creator)
 {
     if (creator == firstCreator)
     {
         return(firstInstance);
     }
     else if (firstCreator == null && Monitor.TryEnter(@lock))
     {
         try {
             firstCreator       = creator;
             firstInstance      = @base.Invoke(creator) as T;
             creator.onDispose += onDispose;
             return(firstInstance);
         }
         finally {
             Monitor.Exit(@lock);
         }
     }
     else
     {
         T currentInstance = creator.vstInstancesByInterface[typeof(T)] as T;
         if (currentInstance == null)
         {
             creator.vstInstancesByInterface[typeof(T)] = currentInstance = @base.Invoke(creator) as T;
         }
         return(currentInstance);
     }
 }
Example #2
0
 public AudioProcessor(ApplicationBase creator)
 {
     this.creator       = creator;
     tailSize           = DefaultTailSize;
     blockSize          = DefaultBlockSize;
     sampleRate         = DefaultSampleRate;    // the VST host sets the sample rate later on
     inputChannelCount  = DefaultChannelCount;
     outputChannelCount = DefaultChannelCount;
 }
Example #3
0
        public PresetsManager(ApplicationBase creator)
        {
            this.creator           = creator;
            thresholdParameterInfo = new VstParameterInfo {
                CanBeAutomated = true, CanRamp = true, DefaultValue = 0.125f, Label = "Threshold"
            };
            var thresholdParamMgr = new VstParameterManager(thresholdParameterInfo);

            thresholdParamMgr.PropertyChanged += onThresholdChanged;
        }
Example #4
0
 private static void onDispose()
 {
     (firstInstance as IDisposable)?.Dispose();
     firstInstance = null;
     firstCreator  = null;
 }
Example #5
0
 internal MainView(ApplicationBase creator)
 {
     this.creator = creator;
     InitializeComponent();
 }