GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GET_MIDI_LENGTH (3)

NAME

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

CONTENTS

Synopsis
Description
See Also

SYNOPSIS

#include <allegro.h>

int get_midi_length(MIDI *midi);

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);

RETURN VALUE

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

SEE ALSO

load_midi(3), midi_time(3), midi_pos(3), exmidi(3)
Search for    or go to Top of page |  Section 3 |  Main Index


Allegro GET_MIDI_LENGTH (3) version 4.4.2

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.