/// <summary>
 /// Internal helper to reset all the internal player flags & info
 /// </summary>
 private void ResetPlayerCondition()
 {
     m_PauseRequested      = false;
     m_SeekRequested       = false;
     m_BufferSeekRequested = false;
     m_StopRequested       = false;
     m_ReachedEOF          = false;
     m_BufferedTimeHeap    = new FloatQueue();
     m_BufferedSizeHeap    = new LongQueue();
     m_BufferRefs          = new Queue();
     m_BufferOffset        = 0;
     m_PlayingOffset       = 0;
     m_LastTick            = 0;
 }
 /// <summary>
 /// Dispose of the player safely
 /// </summary>
 public override void Dispose()
 {
     this.Playback_Stop();
     ClearBuffers();
     if (!DestroySource())
     {
         throw new OggPlayerSourceException("Source destruction failed");
     }
     if (m_Context != null)
     {
         m_Context.Dispose(); m_Context = null;
     }
     if (m_CurrentFile != null)
     {
         m_CurrentFile.Dispose(); m_CurrentFile = null;
     }
     m_BufferedTimeHeap = null;
     m_BufferedSizeHeap = null;
     m_BufferRefs       = null;
 }
        /// <summary>
        /// Internal helper to clean up the buffered data
        /// </summary>
        private void ClearBuffers()
        {
            // Remove any queued buffers from the source
            int BufferCount; AL.GetSource(m_Source, ALGetSourcei.BuffersQueued, out BufferCount);

            if (BufferCount > 0)
            {
                AL.SourceUnqueueBuffers((int)m_Source, BufferCount);
            }
            // De-allocate buffers from memory
            if (m_BufferRefs == null)
            {
                return;
            }
            while (m_BufferRefs.Count > 0)
            {
                uint BufferID = (uint)m_BufferRefs.Dequeue();
                AL.DeleteBuffer(ref BufferID);
            }
            m_BufferedTimeHeap = new FloatQueue();
            m_BufferedSizeHeap = new LongQueue();
        }
Exemple #4
0
 /// <summary>
 /// Internal helper to reset all the internal player flags & info
 /// </summary>
 private void ResetPlayerCondition()
 {
     m_PauseRequested = false;
     m_SeekRequested = false;
     m_BufferSeekRequested = false;
     m_StopRequested = false;
     m_ReachedEOF = false;
     m_BufferedTimeHeap = new FloatQueue();
     m_BufferedSizeHeap = new LongQueue();
     m_BufferRefs = new Queue();
     m_BufferOffset = 0;
     m_PlayingOffset = 0;
     m_LastTick = 0;
 }
Exemple #5
0
 /// <summary>
 /// Internal helper to clean up the buffered data
 /// </summary>
 private void ClearBuffers()
 {
     // Remove any queued buffers from the source
     int BufferCount; AL.GetSource(m_Source, ALGetSourcei.BuffersQueued, out BufferCount);
     if (BufferCount>0) { AL.SourceUnqueueBuffers((int)m_Source, BufferCount); }
     // De-allocate buffers from memory
     if (m_BufferRefs==null) { return; }
     while (m_BufferRefs.Count>0)
     {
         uint BufferID = (uint) m_BufferRefs.Dequeue();
         AL.DeleteBuffer(ref BufferID);
     }
     m_BufferedTimeHeap = new FloatQueue();
     m_BufferedSizeHeap = new LongQueue();
 }
Exemple #6
0
 /// <summary>
 /// Dispose of the player safely
 /// </summary>
 public override void Dispose()
 {
     this.Playback_Stop();
     ClearBuffers();
     if (!DestroySource()) { throw new OggPlayerSourceException("Source destruction failed"); }
     if (m_Context!=null) { m_Context.Dispose(); m_Context = null; }
     if (m_CurrentFile!=null) { m_CurrentFile.Dispose(); m_CurrentFile = null; }
     m_BufferedTimeHeap = null;
     m_BufferedSizeHeap = null;
     m_BufferRefs = null;
 }