Exemple #1
0
        internal static void AddUser()
        {
            OpenAL.Debug("Adding OpenAL user");

            int now = Interlocked.Increment(ref counter);

            if (now != 1 || running)
            {
                return;
            }

            lock (SyncRoot)
            {
                if (running)
                {
                    return;
                }

                running = true;
                (runnerThread = new Thread(Runner)
                {
                    IsBackground = true,
                    Name = "OpenAL Runner"
                }).Start();
            }
        }
Exemple #2
0
        internal static void AddPlaybackProvider(OpenALPlaybackProvider provider)
        {
            OpenAL.Debug("Adding OpenAL Playback Provider");

            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            lock (PlaybackProviders)
                PlaybackProviders.Add(provider);
        }
Exemple #3
0
        internal static void RemoveCaptureProvider(OpenALCaptureProvider provider)
        {
            OpenAL.Debug("Removing OpenAL Capture Provider");

            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            lock (CaptureProviders)
                CaptureProviders.Remove(provider);
        }
Exemple #4
0
        internal static void RemoveUser()
        {
            OpenAL.Debug("Removing OpenAL user");

            int now = Interlocked.Decrement(ref counter);

            if (now != 0 || !running)
            {
                return;
            }

            lock (SyncRoot)
            {
                if (!running)
                {
                    return;
                }

                running = false;
            }
        }