smf_t *smf = (smf_t*)malloc(sizeof(smf_t));
if (smf == NULL) {
- g_critical("Cannot allocate smf_t structure: %s", strerror(errno));
+ g_warning("Cannot allocate smf_t structure: %s", strerror(errno));
return (NULL);
}
{
smf_track_t *track = (smf_track_t*)malloc(sizeof(smf_track_t));
if (track == NULL) {
- g_critical("Cannot allocate smf_track_t structure: %s", strerror(errno));
+ g_warning("Cannot allocate smf_track_t structure: %s", strerror(errno));
return (NULL);
}
{
smf_event_t *event = (smf_event_t*)malloc(sizeof(smf_event_t));
if (event == NULL) {
- g_critical("Cannot allocate smf_event_t structure: %s", strerror(errno));
+ g_warning("Cannot allocate smf_event_t structure: %s", strerror(errno));
return (NULL);
}
event->midi_buffer_length = len;
event->midi_buffer = (uint8_t*)malloc(event->midi_buffer_length);
if (event->midi_buffer == NULL) {
- g_critical("Cannot allocate MIDI buffer structure: %s", strerror(errno));
+ g_warning("Cannot allocate MIDI buffer structure: %s", strerror(errno));
smf_event_delete(event);
return (NULL);
return (NULL);
if (first_byte < 0) {
- g_critical("First byte of MIDI message cannot be < 0");
+ g_warning("First byte of MIDI message cannot be < 0");
smf_event_delete(event);
return (NULL);
}
if (first_byte > 255) {
- g_critical("smf_event_new_from_bytes: first byte is %d, which is larger than 255.", first_byte);
+ g_warning("smf_event_new_from_bytes: first byte is %d, which is larger than 255.", first_byte);
return (NULL);
}
if (!is_status_byte(first_byte)) {
- g_critical("smf_event_new_from_bytes: first byte is not a valid status byte.");
+ g_warning("smf_event_new_from_bytes: first byte is not a valid status byte.");
return (NULL);
}
if (len > 1) {
if (second_byte > 255) {
- g_critical("smf_event_new_from_bytes: second byte is %d, which is larger than 255.", second_byte);
+ g_warning("smf_event_new_from_bytes: second byte is %d, which is larger than 255.", second_byte);
return (NULL);
}
if (is_status_byte(second_byte)) {
- g_critical("smf_event_new_from_bytes: second byte cannot be a status byte.");
+ g_warning("smf_event_new_from_bytes: second byte cannot be a status byte.");
return (NULL);
}
}
if (len > 2) {
if (third_byte > 255) {
- g_critical("smf_event_new_from_bytes: third byte is %d, which is larger than 255.", third_byte);
+ g_warning("smf_event_new_from_bytes: third byte is %d, which is larger than 255.", third_byte);
return (NULL);
}
if (is_status_byte(third_byte)) {
- g_critical("smf_event_new_from_bytes: third byte cannot be a status byte.");
+ g_warning("smf_event_new_from_bytes: third byte cannot be a status byte.");
return (NULL);
}
}
event->midi_buffer_length = len;
event->midi_buffer = (uint8_t*)malloc(event->midi_buffer_length);
if (event->midi_buffer == NULL) {
- g_critical("Cannot allocate MIDI buffer structure: %s", strerror(errno));
+ g_warning("Cannot allocate MIDI buffer structure: %s", strerror(errno));
smf_event_delete(event);
return (NULL);
assert(format == 0 || format == 1);
if (smf->number_of_tracks > 1 && format == 0) {
- g_critical("There is more than one track, cannot set format to 0.");
+ g_warning("There is more than one track, cannot set format to 0.");
return (-1);
}
event = smf_peek_next_event(smf);
if (event == NULL) {
- g_critical("Trying to seek past the end of song.");
+ g_warning("Trying to seek past the end of song.");
return (-1);
}
event = smf_peek_next_event(smf);
if (event == NULL) {
- g_critical("Trying to seek past the end of song.");
+ g_warning("Trying to seek past the end of song.");
return (-1);
}