Example #1
0
        public static TownsAudioInterfaceInternal AddNewRef(IMixer mixer, TownsAudioInterface owner, ITownsAudioInterfacePluginDriver driver, bool externalMutexHandling)
        {
            _refCount++;
            if (_refCount == 1 && _refInstance == null)
            {
                _refInstance = new TownsAudioInterfaceInternal(mixer, owner, driver, externalMutexHandling);
            }
            else if (_refCount < 2 || _refInstance == null)
            {
                throw new InvalidOperationException("TownsAudioInterfaceInternal::addNewRef(): Internal reference management failure");
            }
            else if (!_refInstance.AssignPluginDriver(owner, driver, externalMutexHandling))
            {
                throw new InvalidOperationException("TownsAudioInterfaceInternal::addNewRef(): Plugin driver conflict");
            }

            return(_refInstance);
        }
Example #2
0
 public TownsAudioInterface(IMixer mixer, ITownsAudioInterfacePluginDriver driver, bool externalMutexHandling = false)
 {
     _intf = TownsAudioInterfaceInternal.AddNewRef(mixer, this, driver, externalMutexHandling);
 }
Example #3
0
 public void Dispose()
 {
     TownsAudioInterfaceInternal.ReleaseRef(this);
     _intf = null;
 }
        public static TownsAudioInterfaceInternal AddNewRef(IMixer mixer, TownsAudioInterface owner, ITownsAudioInterfacePluginDriver driver, bool externalMutexHandling)
        {
            _refCount++;
            if (_refCount == 1 && _refInstance == null)
                _refInstance = new TownsAudioInterfaceInternal(mixer, owner, driver, externalMutexHandling);
            else if (_refCount < 2 || _refInstance == null)
                throw new InvalidOperationException("TownsAudioInterfaceInternal::addNewRef(): Internal reference management failure");
            else if (!_refInstance.AssignPluginDriver(owner, driver, externalMutexHandling))
                throw new InvalidOperationException("TownsAudioInterfaceInternal::addNewRef(): Plugin driver conflict");

            return _refInstance;
        }