www.pudn.com > CP_IVR.zip > HPlayList.cpp


// HPlayList.cpp: implementation of the CHPlayList class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "HPlayList.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
CHPlayList::CHPlayList() 
{ 
	m_index=0; 
} 
 
CHPlayList::~CHPlayList() 
{ 
 
} 
 
void CHPlayList::Add(CString adr) 
{ 
	if (adr=="") return; 
	 
	m_list.Add(adr); 
} 
 
CString CHPlayList::GetNext() 
{ 
	if (m_index>=(UINT)m_list.GetSize()) 
		return "END_OF_LIST"; 
	return m_list.GetAt(m_index++); 
} 
 
UINT CHPlayList::GetCurrentIndex() 
{ 
	return m_index; 
} 
 
CString CHPlayList::GetPrevious() 
{ 
	if (m_index<=0) 
		return ""; 
	return m_list.GetAt(m_index-1); 
} 
 
CString CHPlayList::GetLast() 
{ 
	return m_list.GetAt(m_list.GetSize()-1); 
} 
 
UINT CHPlayList::GetCount() 
{ 
	return m_list.GetSize(); 
} 
 
void CHPlayList::Reset() 
{ 
	m_list.RemoveAll(); 
	m_index=0; 
//	m_list.FreeExtra(); 
}