Beispiel #1
0
void updateBrowser(void)
{
	if(keysPres & KEY_TOUCH) {
		drgY[0] = stylus.y;
	}
	if(keysHold & KEY_TOUCH) {
		drgY[1] = stylus.y;
		drgTime++;
	}

	if(keysReleased & KEY_TOUCH) {
		if(drgTime < 30 && abs(drgY[1]-drgY[0])<3) {
			if(!(TouchedArea(256-FL_ICONSZ, 0, 256, FL_ICONSZ))){
				int selected = (scrollY + drgY[0])/ICON_SZ;
				CLAMP(selected, 0, numEnt);
				if(list[selected][ENTRY_TYPE]==DT_DIR)
					retrieveDir(&list[selected][ENTRY_NAME]);
				else {
					if(getStreamState() == STREAM_STOP) {
						char * file = &list[selected][ENTRY_NAME];
						if(playFile(file))
							return;
					}
				}
			}
		}
		scrollY+=(drgY[0]-drgY[1]);
		CLAMP(scrollY, 0, ((numEnt+1)<=(192/ICON_SZ))? 0 :  ((numEnt * ICON_SZ)-192));
		kinEn = ((drgY[0]-drgY[1])/(drgTime))<<SCHUIF;
		if(abs(kinEn) > MAX_EN ) {
			if(kinEn >0)
				kinEn = MAX_EN;
			else
				kinEn = -MAX_EN;
		}
		drgY[1] = drgY[0] = 0;
		drgTime = 0;
	}
	scrollY += (kinEn>>SCHUIF);
	if(kinEn > 0)
		kinEn--;
	else if(kinEn < 0)
		kinEn++;
	// Update scrolling variables used by drawList() in the next frame
	CLAMP(scrollY, 0, ((numEnt+1)<=(192/ICON_SZ))? 0 :  ((numEnt * ICON_SZ)-192));
	scrolly = (scrollY + (drgY[0]-drgY[1]));
	CLAMP(scrolly, 0, ((numEnt+1)<=(192/ICON_SZ))? 0 :  ((numEnt * ICON_SZ)-192));
	beginY = -(scrolly%ICON_SZ);
	begin = (scrolly/ICON_SZ);
	CLAMP(begin, 0, numEnt);
	setConsoleCooAbs(0, -beginY);
	updateIcons();
}
Beispiel #2
0
void FAT::changeDirectory(string dirName){
	if (strcmp(dirName.c_str(), "NULL") == 0){
		parentDir = NULL;
		currentDir = NULL;
	} else if (strcmp(dirName.c_str(), "..") == 0){
		if (parentDir == NULL){
			currentDir == NULL;
		} else {

		}
	} else{
		parentDir = currentDir;
		currentDir = retrieveDir(dirName);
	}
}
Beispiel #3
0
void FAT::print(string dirName){
	d_entry* d = retrieveDir(dirName);
	cout << d->_cDate << endl;
}