Created
January 29, 2019 06:14
-
-
Save jpcima/adde9f5d25fe339e97e472de43ac08a0 to your computer and use it in GitHub Desktop.
libsmf test case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "smf.h" | |
#include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
if (argc != 2) | |
return 1; | |
smf_t *smf = smf_load(argv[1]); | |
if (!smf) { | |
fprintf(stderr, "cannot load\n"); | |
return 0; | |
} | |
// if (char *dec = smf_decode(smf)) { | |
// printf("%s\n", dec); | |
// free(dec); | |
// } | |
unsigned trackno = 1; | |
while (smf_track_t *track = smf_get_track_by_number(smf, trackno)) { | |
unsigned evno = 1; | |
while (smf_event_t *ev = smf_track_get_event_by_number(track, evno)) { | |
// if (char *dec = smf_event_decode(ev)) { | |
// printf("%s\n", dec); | |
// free(dec); | |
// } | |
evno++; | |
} | |
++trackno; | |
} | |
smf_delete(smf); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment