VirtualDirectory^ StorageDirectoryEnumerator::Current::get(void)
{
	StorageContainer^		container;			// Object to be returned
	StoragePath^			path;				// New StoragePath instance

	CHECK_DISPOSED(m_disposed);
	
	container = m_enum->Current;
	path = gcnew StoragePath(m_path, m_path->Full + "/" + container->Name);
	return gcnew StorageDirectory(path, container);
}
예제 #2
0
VirtualFile^ StorageFileEnumerator::Current::get(void)
{
	StorageObject^			object;			// Object to be returned
	StoragePath^			path;			// New virtual file path

	CHECK_DISPOSED(m_disposed);
	
	object = m_enum->Current;
	path = gcnew StoragePath(m_path, m_path->Full + "/" + object->Name);
	return gcnew StorageFile(path, object);
}
예제 #3
0
/** play history .*/
int SrvPlayHistory(void)
{
	int status = -1;
	play_history_t his;
	
	stopServer();
	
	LOCK_PLAYMUTEX();	
	playState = NMS_STATUS_PLAYER_PLAY; 
	UNLOCK_PLAYMUTEX();
	
	if (!GetPlayHistory(&his))
	{
		int loc_playtype = playtype;
		
		LOCK_PLAYMUTEX();	
		loc_playtype =
			playtype = his.type;
		UNLOCK_PLAYMUTEX();	
		
		switch (loc_playtype)
		{
		case NPT_FILE: status = SrvPlayFile(his.path); break;
		case NPT_DIR:  status = SrvPlayDir(his.path); break;
		default: break;
		}
	}
	
	if (!status)
	{
		//DBGMSG("playing history data-type:[%d] idx:[%d]"
		//"mark: [%d] path:[%s]", 
		//his.type, his.fileIdx, his.mark, his.path); 
		SrvSeek(his.mark);
	}
	else
		// No history available, or history is unplayable
		// play the first available removable media.
	{
#if 0	  
		int * st;
		int num;
		
		DBGMSG("history not available, play from first storage.");
		// fetch available storage.
		num = CoolStorageAvailable(&st);
		if (num <= 1) return -1;
		
		num--;
		// now search to play available storage.
		do 
		{
			st++; 
			status = SrvPlayDir((char*)StoragePath(*st));
			if (!status) break;
		} while (--num);
#endif	
	}
	
	if (!status) 
	{
		LOCK_PLAYMUTEX();
		errorStatus = NMS_STATUS_OK;
		UNLOCK_PLAYMUTEX();
	}
	
	return status;
}