//============================================================================= // Function: GetVolumes // Purpose: Generate and return a list of all volumes (drives) available. // Notes: //============================================================================= wxArrayString wxFSVolumeBase::GetVolumes(int flagsSet, int flagsUnset) { wxArrayString list; UInt16 refNum; UInt32 it = vfsIteratorStart; while (it != vfsIteratorStop) { status_t err = VFSVolumeEnumerate(&refNum, &it); if (err == errNone) { // manual: "Volume labels can be up to 255 characters long." char label[256]; err = VFSVolumeGetLabel(refNum,label,256); if (err == errNone) { list.Add(wxString::FromAscii(label)); } } if (err != errNone) break; } return list; } // GetVolumes
/* Get a VFS volume label, replacing with a fake one if there is an error getting the real one. */ static void GetPluckerVolumeLabel ( UInt16 volRefNum, Char* volumeLabel, UInt16 length /* must be at least large enough to hold fake name */ ) { Err err; err = VFSVolumeGetLabel( volRefNum, volumeLabel, length ); if ( err != errNone ) StrPrintF( volumeLabel, fakeVolumeNameFormat, volRefNum ); }
void PckTunesCDPlayer::play(int track, int num_loops, int start_frame, int duration) { if (!num_loops && !start_frame) return; EventType e; Char nameP[256], fileP[100]; static const Char *ext[] = { "mp3", "ogg" }; _pckTrack = track; _pckLoops = num_loops; _pckTrackStartFrame = TO_MSECS(start_frame); _pckTrackDuration = TO_MSECS(duration); VFSVolumeGetLabel(gVars->VFS.volRefNum, nameP, 256); StrPrintF(fileP, "/Palm/Programs/ScummVM/Audio/%s_%03ld.%s", gameP, (track + gVars->CD.firstTrack - 1), ext[gVars->CD.format]); if (PocketTunesOpenFile(nameP, fileP, 0) == errNone) { EvtGetEvent(&e, evtNoWait); PocketTunesPauseIfPlaying(); _isPlaying = true; if (_pckTrackStartFrame == 0 && _pckTrackDuration == 0) { _pckTrackDuration = getDuration(); } else { setPosition(_pckTrackStartFrame); if (_pckTrackDuration == 0) _pckTrackDuration = getDuration() - _pckTrackStartFrame; } PocketTunesPlay(); } else { _isPlaying = false; _pckTrackDuration = gVars->CD.defaultTrackLength * 1000; } _pckStopTime = 0; _pckTrackEndFrame = _pckTrackStartFrame + _pckTrackDuration; }