/**
*
- * \mainpage libsmf - general usage instructions
+ * \page libsmf libsmf - general usage instructions
*
* An smf_t structure represents a "song". Every valid smf contains one or more tracks.
* Tracks contain zero or more events. Libsmf doesn't care about actual MIDI data, as long
* adding the event (using smf_track_add_event_seconds(), smf_track_add_event_pulses() or
* smf_track_add_event_delta_pulses()); the remaining two values are computed from that.
*
- * Tempo related stuff happens automatically - when you add a metaevent that is Tempo Change or
- * Time Signature, libsmf adds that event to the tempo map. If you remove Tempo Change event
+ * Tempo related stuff happens automatically - when you add a metaevent that is Tempo PropertyChange or
+ * Time Signature, libsmf adds that event to the tempo map. If you remove Tempo PropertyChange event
* that is in the middle of the song, the rest of the events will have their event->time_seconds
* recomputed from event->time_pulses before smf_event_remove_from_track() function returns.
- * Adding Tempo Change in the middle of the song works in a similar way.
+ * Adding Tempo PropertyChange in the middle of the song works in a similar way.
*
* MIDI data (event->midi_buffer) is always kept in normalized form - it always begins with
* status byte (no running status), there are no System Realtime events embedded in them etc.
/* Routines for manipulating smf_event_t. */
smf_event_t *smf_event_new(void) WARN_UNUSED_RESULT;
-smf_event_t *smf_event_new_from_pointer(void *midi_data, size_t len) WARN_UNUSED_RESULT;
+smf_event_t *smf_event_new_from_pointer(const void *midi_data, size_t len) WARN_UNUSED_RESULT;
smf_event_t *smf_event_new_from_bytes(int byte1, int byte2, int byte3) WARN_UNUSED_RESULT;
smf_event_t *smf_event_new_textual(int type, const char *text);
void smf_event_delete(smf_event_t *event);
char *smf_event_decode(const smf_event_t *event) WARN_UNUSED_RESULT;
char *smf_event_extract_text(const smf_event_t *event) WARN_UNUSED_RESULT;
+/* Routines for dealing with Variable Length Quantities (VLQ's).
+ Slightly odd names reflect original static names within libsmf
+ */
+int smf_format_vlq (unsigned char *buf, int length, unsigned long value);
+int smf_extract_vlq(const unsigned char *buf, const size_t buffer_length, uint32_t *value, uint32_t *len);
+
/* Routines for loading SMF files. */
-smf_t *smf_load(const char *file_name) WARN_UNUSED_RESULT;
+smf_t *smf_load(FILE *) WARN_UNUSED_RESULT;
smf_t *smf_load_from_memory(const void *buffer, const size_t buffer_length) WARN_UNUSED_RESULT;
/* Routine for writing SMF files. */
-int smf_save(smf_t *smf, const char *file_name) WARN_UNUSED_RESULT;
+int smf_save(smf_t *smf, FILE *file) WARN_UNUSED_RESULT;
/* Routines for manipulating smf_tempo_t. */
smf_tempo_t *smf_get_tempo_by_pulses(const smf_t *smf, size_t pulses) WARN_UNUSED_RESULT;