NVorbis.OpenTKSupport.OggStream.Prepare C# (CSharp) Method

Prepare() public method

public Prepare ( ) : void
return void
        public void Prepare()
        {
            if (Preparing) return;

            var state = AL.GetSourceState(alSourceId);

            lock (stopMutex)
            {
                switch (state)
                {
                    case ALSourceState.Playing:
                    case ALSourceState.Paused:
                        return;

                    case ALSourceState.Stopped:
                        lock (prepareMutex)
                        {
                            Reader.DecodedTime = TimeSpan.Zero;
                            Ready = false;
                            Empty();
                        }
                        break;
                }

                if (!Ready)
                {
                    lock (prepareMutex)
                    {
                        Preparing = true;
                        Logger.Log(LogEvent.BeginPrepare, this);
                        Open(precache: true);
                        Logger.Log(LogEvent.EndPrepare, this);
                    }
                }
            }
        }

Usage Example

Esempio n. 1
0
 public SoundItem(String sourcefile)
 {
     OggStream ostream = new OggStream(sourcefile);
     ostream.Prepare();
     useStream = ostream;
     //AL.BufferData(_Buffer,ostream.g)
 }
All Usage Examples Of NVorbis.OpenTKSupport.OggStream::Prepare