Beispiel #1
0
        public OggFile GetPrevFile()
        {
            if (m_FileHeap == null)
            {
                return(null);
            }
            if (m_FileHeap.Count <= 0)
            {
                return(null);
            }
            if (m_PreviousFile == null)
            {
                return(null);
            }
            OggPlaylistFile tmp = m_CurrentFile;

            m_CurrentFile  = m_PreviousFile;
            m_PreviousFile = tmp;
            if (m_AutoUncache)
            {
                if (m_PreviousFile != null)
                {
                    m_PreviousFile.UnCacheFile();
                }
            }
            m_Position = m_FileHeap.IndexOf(m_CurrentFile);
            if (!m_CurrentFile.Cached)
            {
                m_CurrentFile.CacheFile();
            }
            return(m_CurrentFile.File);
        }
Beispiel #2
0
 /// <summary>
 /// Retrieves the next file for playback & advance the internal pointers
 /// </summary>
 /// <returns>
 /// A <see cref="OggFile"/>
 /// </returns>
 public OggFile GetNextFile()
 {
     if (m_FileHeap == null)
     {
         return(null);
     }
     if (m_FileHeap.Count <= 0)
     {
         return(null);
     }
     m_PreviousFile = m_CurrentFile;
     if (m_AutoUncache)
     {
         if (m_PreviousFile != null)
         {
             m_PreviousFile.UnCacheFile();
         }
     }
     if (m_Random)
     {
         m_Position = m_RandomGenerator.Next(m_FileHeap.Count - 1);
     }
     else
     {
         m_Position++;
         if (m_Position > m_FileHeap.Count)
         {
             if (m_Repeat)
             {
                 m_Position = 0;
             }
             else
             {
                 return(null);
             }
         }
     }
     m_CurrentFile        = (OggPlaylistFile)m_FileHeap[m_Position - 1];
     m_CurrentFile.Played = true;
     if (!m_CurrentFile.Cached)
     {
         m_CurrentFile.CacheFile();
     }
     return(m_CurrentFile.File);
 }
Beispiel #3
0
 public OggFile GetPrevFile()
 {
     if (m_FileHeap==null) { return null; }
     if (m_FileHeap.Count<=0) { return null; }
     if (m_PreviousFile==null) { return null; }
     OggPlaylistFile tmp = m_CurrentFile;
     m_CurrentFile = m_PreviousFile;
     m_PreviousFile = tmp;
     if (m_AutoUncache) { if (m_PreviousFile!=null) { m_PreviousFile.UnCacheFile(); } }
     m_Position = m_FileHeap.IndexOf(m_CurrentFile);
     if (!m_CurrentFile.Cached) { m_CurrentFile.CacheFile(); }
     return m_CurrentFile.File;
 }
Beispiel #4
0
 /// <summary>
 /// Retrieves the next file for playback & advance the internal pointers
 /// </summary>
 /// <returns>
 /// A <see cref="OggFile"/>
 /// </returns>
 public OggFile GetNextFile()
 {
     if (m_FileHeap==null) { return null; }
     if (m_FileHeap.Count<=0) { return null; }
     m_PreviousFile = m_CurrentFile;
     if (m_AutoUncache) { if (m_PreviousFile!=null) { m_PreviousFile.UnCacheFile(); } }
     if (m_Random)
     {
         m_Position = m_RandomGenerator.Next(m_FileHeap.Count);
     }
     else
     {
         m_Position++;
         if (m_Position >= m_FileHeap.Count)
         {
             if (m_Repeat) { m_Position = 0; } else { return null; }
         }
     }
     m_CurrentFile = (OggPlaylistFile)m_FileHeap[m_Position];
     m_CurrentFile.Played = true;
     if (!m_CurrentFile.Cached) { m_CurrentFile.CacheFile(); }
     return m_CurrentFile.File;
 }