static void setSaved(void) { int i; _tcscpy(saved_author, ASAPInfo_GetAuthor(edited_info)); _tcscpy(saved_title, ASAPInfo_GetTitle(edited_info)); _tcscpy(saved_date, ASAPInfo_GetDate(edited_info)); for (i = 0; i < ASAPInfo_GetSongs(edited_info); i++) { saved_durations[i] = ASAPInfo_GetDuration(edited_info, i); saved_loops[i] = ASAPInfo_GetLoop(edited_info, i); } }
int getSongDurationInternal(const ASAPInfo *info, int song, ASAP *asap) { int duration = ASAPInfo_GetDuration(info, song); if (duration < 0) { if (asap != NULL) ASAP_DetectSilence(asap, silence_seconds); return 1000 * song_length; } if (asap != NULL) ASAP_DetectSilence(asap, 0); if (play_loops && ASAPInfo_GetLoop(info, song)) return 1000 * song_length; return duration; }
int get_song_duration(int song, bool play) { const ASAPInfo *info = ASAP_GetInfo(asap); int duration = ASAPInfo_GetDuration(info, song); if (duration < 0) { if (play) ASAP_DetectSilence(asap, silence_seconds); return 1000 * song_length; } if (play) ASAP_DetectSilence(asap, 0); if (play_loops && ASAPInfo_GetLoop(info, song)) return 1000 * song_length; return duration; }
static BOOL infoChanged(void) { int i; if (_tcscmp(ASAPInfo_GetAuthor(edited_info), saved_author) != 0) return TRUE; if (_tcscmp(ASAPInfo_GetTitle(edited_info), saved_title) != 0) return TRUE; if (_tcscmp(ASAPInfo_GetDate(edited_info), saved_date) != 0) return TRUE; for (i = 0; i < ASAPInfo_GetSongs(edited_info); i++) { if (ASAPInfo_GetDuration(edited_info, i) != saved_durations[i]) return TRUE; if (saved_durations[i] >= 0 && ASAPInfo_GetLoop(edited_info, i) != saved_loops[i]) return TRUE; } return FALSE; }
static void setEditedSong(int song) { _TCHAR filename[MAX_PATH]; unsigned char str[ASAPWriter_MAX_DURATION_LENGTH + 1]; int len; edited_song = song; len = ASAPWriter_DurationToString(str, ASAPInfo_GetDuration(edited_info, song)); str[len] = '\0'; SendDlgItemMessage(infoDialog, IDC_TIME, WM_SETTEXT, 0, (LPARAM) str); CheckDlgButton(infoDialog, IDC_LOOP, ASAPInfo_GetLoop(edited_info, song) ? BST_CHECKED : BST_UNCHECKED); EnableWindow(GetDlgItem(infoDialog, IDC_LOOP), len > 0); SendDlgItemMessage(infoDialog, IDC_FILENAME, WM_GETTEXT, MAX_PATH, (LPARAM) filename); ASTIL_Load(astil, filename, song); SendDlgItemMessage(infoDialog, IDC_STILFILE, WM_SETTEXT, 0, (LPARAM) ASTIL_GetStilFilename(astil)); updateStil(); }
cibool EMSCRIPTEN_KEEPALIVE asapinfo_GetLoop(int song) { return ASAPInfo_GetLoop(info, song); }