logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

get_midi_length - Determines the total playing time of a midi, in seconds. Allegro game programming

Description

       This function will simulate playing the given MIDI, from start to end, to determine how long it takes  to
       play.  After calling this function, midi_pos will contain the negative number of beats, and midi_time the
       length of the midi, in seconds.

       Note that any currently playing midi is stopped when you call this function.  Usually you would  call  it
       before play_midi, to get the length of the midi to be played, like in this example:

          length = get_midi_length(my_midi);
          play_midi(my_midi);
          do {
             pos = midi_time;
             textprintf_ex(screen, font, 0, 0, c, -1, "%d:%02d / %d:%02d\n",
                pos / 60, pos % 60, length / 60, length % 60);
             rest(100);
          } while(pos <= length);

Name

       get_midi_length  -  Determines  the  total  playing  time of a midi, in seconds. Allegro game programming
       library.

Return Value

       Returns the value of midi_time, the length of the midi.

See Also

load_midi(3alleg4), midi_time(3alleg4), midi_pos(3alleg4), exmidi(3alleg4)

Allegro                                           version 4.4.3                         get_midi_length(3alleg4)

Synopsis

#include<allegro.h>intget_midi_length(MIDI*midi);

See Also