using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace CSharpPlayerDemo
{
    public class CLS_Players
    {
        //播放器个数
        private int m_iPlayerNum;

        //读入数据的最大字节数
        private const int MAX_READBUFFER = 102400;

        //播放器信息数组
        public int[] m_iArrID;
        public int[] m_iSpeed;
        public FileStream[] m_fsArr;
        public int[] m_iAudioArr;
        public Byte[][] m_fileDataBuff;
   
        public CLS_Players(int _pnum)   
        {
            m_iPlayerNum = _pnum;
            m_iArrID = new int[_pnum];
            m_iSpeed = new int[_pnum];
            m_fsArr = new FileStream[_pnum];
            m_iAudioArr = new int[_pnum];
            m_fileDataBuff = new Byte[_pnum][];
        }

        public void InitPlayers()
        {
            for(int i=0;i<m_iPlayerNum;i++)
            {
                m_iArrID[i] = -1;
                m_iSpeed[i] = 0;
                m_fsArr[i] = null;
                m_fileDataBuff[i] = new Byte[MAX_READBUFFER];
                m_iAudioArr[i] = -1;
            }
        }

        public int GetPlayerCount()
        {
            return m_iPlayerNum;
        }
    }
}
