static void getFileInfo(char *file, char *title, int *length_in_ms) { char filename[MAX_PATH]; const char *hash; if (file == NULL || file[0] == '\0') file = playing_filename_with_song; title_song = extractSongNumber(file, filename); if (title_song < 0) expandPlaylistSongs(); if (!loadModule(filename, module, &module_len)) return; hash = atrFilenameHash(filename); if (!ASAPInfo_Load(title_info, hash != NULL ? hash + 1 : filename, module, module_len)) return; if (title_song < 0) title_song = ASAPInfo_GetDefaultSong(title_info); if (title != NULL) { waFormatTitle fmt_title = { NULL, NULL, title, 512, tagFunc, tagFreeFunc }; getTitle(title); // in case IPC_FORMAT_TITLE doesn't work... SendMessage(mod.hMainWindow, WM_WA_IPC, (WPARAM) &fmt_title, IPC_FORMAT_TITLE); } if (length_in_ms != NULL) *length_in_ms = getSongDuration(title_info, title_song); }
BOOL __cdecl GetInfo(char *filename, int audioDataOffset, TrackInfo *trackInfo) { BYTE module[ASAPInfo_MAX_MODULE_LENGTH]; int module_len; if (!loadModule(filename, module, &module_len)) return FALSE; ASAPInfo *info = ASAPInfo_New(); if (info == NULL) return FALSE; if (!ASAPInfo_Load(info, filename, module, module_len)) { ASAPInfo_Delete(info); return FALSE; } strcpy(trackInfo->suggestedTitle, ASAPInfo_GetTitle(info)); trackInfo->fileSize = module_len; trackInfo->seekable = TRUE; trackInfo->hasEqualizer = FALSE; int duration = getSongDuration(info, ASAPInfo_GetDefaultSong(info)); trackInfo->playingTime = duration >= 0 ? duration : -1; trackInfo->bitRate = 0; trackInfo->sampleRate = ASAP_SAMPLE_RATE; trackInfo->numChannels = ASAPInfo_GetChannels(info); trackInfo->bitResolution = BITS_PER_SAMPLE; strcpy(trackInfo->fileTypeDescription, "8-bit Atari music"); ASAPInfo_Delete(info); return TRUE; }
static BOOL WINAPI asapOpenFile(LPCTSTR pszFile, MAP_PLUGIN_FILE_INFO *pInfo) { CONVERT_FILENAME; if (!loadFile(pszFile)) return FALSE; if (!ASAP_Load(&asap, ANSI_FILENAME, module, module_len)) return FALSE; pInfo->nChannels = asap.module_info.channels; pInfo->nSampleRate = ASAP_SAMPLE_RATE; pInfo->nBitsPerSample = BITS_PER_SAMPLE; pInfo->nAvgBitrate = 8; pInfo->nDuration = getSongDuration(&asap.module_info, asap.module_info.default_song); return TRUE; }
BOOL __cdecl GetInfo(char *filename, int audioDataOffset, TrackInfo *trackInfo) { byte module[ASAP_MODULE_MAX]; int module_len; ASAP_ModuleInfo module_info; if (!loadModule(filename, module, &module_len)) return FALSE; if (!ASAP_GetModuleInfo(&module_info, filename, module, module_len)) return FALSE; strcpy(trackInfo->suggestedTitle, module_info.name); trackInfo->fileSize = module_len; trackInfo->seekable = TRUE; trackInfo->hasEqualizer = FALSE; int duration = getSongDuration(&module_info, module_info.default_song); trackInfo->playingTime = duration >= 0 ? duration : -1; trackInfo->bitRate = 0; trackInfo->sampleRate = ASAP_SAMPLE_RATE; trackInfo->numChannels = module_info.channels; trackInfo->bitResolution = BITS_PER_SAMPLE; strcpy(trackInfo->fileTypeDescription, "8-bit Atari music"); return TRUE; }
static void getFileInfo(char *file, char *title, int *length_in_ms) { char filename[MAX_PATH]; if (file == NULL || file[0] == '\0') file = current_filename_with_song; title_song = extractSongNumber(file, filename); if (title_song < 0) expandPlaylistSongs(); if (!loadModule(filename, module, &module_len)) return; if (!ASAP_GetModuleInfo(&title_module_info, filename, module, module_len)) return; if (title_song < 0) title_song = title_module_info.default_song; if (title != NULL) { waFormatTitle fmt_title = { NULL, NULL, title, 512, tagFunc, tagFreeFunc }; getTitle(title); // in case IPC_FORMAT_TITLE doesn't work... SendMessage(mod.hMainWindow, WM_WA_IPC, (WPARAM) &fmt_title, IPC_FORMAT_TITLE); } if (length_in_ms != NULL) *length_in_ms = getSongDuration(&title_module_info, title_song); }