.TH "MidiTrack" 3 "28 Jan 2004" "libkmid Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
MidiTrack \- Stores a MIDI track. Stores a MIDI track with a simple API.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <track.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBMidiTrack\fP (FILE *file, int tpcn, int Id)"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "\fB~MidiTrack\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "int \fBticksPassed\fP (\fBulong\fP ticks)"
.br
.RI "\fIMakes the iterator advance the given number of ticks. \fP"
.ti -1c
.RI "int \fBmsPassed\fP (\fBulong\fP ms)"
.br
.RI "\fIMakes the iterator advance the given number of milliseconds. \fP"
.ti -1c
.RI "int \fBcurrentMs\fP (double ms)"
.br
.RI "\fIReturns the current millisecond which the iterator is at. \fP"
.ti -1c
.RI "\fBulong\fP \fBwaitTicks\fP (void)"
.br
.RI "\fIReturns the number of ticks left for the next event. \fP"
.ti -1c
.RI "double \fBabsMsOfNextEvent\fP (void)"
.br
.RI "\fIReturns the absolute number of milliseconds of the next event. \fP"
.ti -1c
.RI "void \fBchangeTempo\fP (\fBulong\fP t)"
.br
.RI "\fIChange the tempo of the song. \fP"
.ti -1c
.RI "void \fBreadEvent\fP (\fBMidiEvent\fP *ev)"
.br
.RI "\fIReads the event at the iterator position, and puts it on the structure pointed to by \fCev\fP. \fP"
.ti -1c
.RI "void \fBinit\fP (void)"
.br
.RI "\fIInitializes the iterator. \fP"
.ti -1c
.RI "void \fBclear\fP (void)"
.br
.RI "\fIClears the internal variables. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Stores a MIDI track. Stores a MIDI track with a simple API. 

This can be thought of as a list of MIDI events.
.PP
The data types used to store the track is similar to how events are stored on a MIDI file, but used in a way that allows for faster parses.
.PP
This class is used on \fBMidiPlayer::loadSong\fP() to load the song and later play it with \fBMidiPlayer::play\fP().
.PP
\fBVersion:\fP
.RS 4
0.9.5 17/01/2000 
.RE
.PP
\fBAuthor:\fP
.RS 4
Antonio Larrosa Jimenez <larrosa@kde.org> 
.RE
.PP

.PP
Definition at line 126 of file track.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "MidiTrack::MidiTrack (FILE * file, int tpcn, int Id)"
.PP
Constructor. \fBParameters:\fP
.RS 4
\fIfile\fP the file to read the track from. It should be ready at the start of a track. MidiTrack reads just that track and the file is left at the end of this track). 
.br
\fItpcn\fP the ticks per cuarter note used in this file. 
.br
\fIId\fP the ID for this track. 
.RE
.PP
Definition at line 49 of file track.cc.
.PP
References clear(), and init().
.SS "MidiTrack::~\fBMidiTrack\fP ()"
.PP
Destructor. Definition at line 88 of file track.cc.
.SH "Member Function Documentation"
.PP 
.SS "int MidiTrack::ticksPassed (\fBulong\fP ticks)"
.PP
Makes the iterator advance the given number of ticks. \fBReturns:\fP
.RS 4
0 if OK, and 1 if you didn't handle this track well and you forgot to take an event (thing that will never happen if you use \fBMidiPlayer::play\fP() ). 
.RE
.PP
Definition at line 146 of file track.cc.
.SS "int MidiTrack::msPassed (\fBulong\fP ms)"
.PP
Makes the iterator advance the given number of milliseconds. \fBReturns:\fP
.RS 4
0 if OK, and 1 if you didn't handle this track well and you forgot to take an event (thing that will never happen if you use \fBMidiPlayer::play\fP() ). 
.RE
.PP
Definition at line 158 of file track.cc.
.SS "int MidiTrack::currentMs (double ms)"
.PP
Returns the current millisecond which the iterator is at. Definition at line 174 of file track.cc.
.PP
Referenced by MidiPlayer::play(), and MidiPlayer::setPos().
.SS "\fBulong\fP MidiTrack::waitTicks (void)\fC [inline]\fP"
.PP
Returns the number of ticks left for the next event. Definition at line 205 of file track.h.
.SS "double MidiTrack::absMsOfNextEvent (void)\fC [inline]\fP"
.PP
Returns the absolute number of milliseconds of the next event. Definition at line 212 of file track.h.
.PP
Referenced by MidiPlayer::play(), and MidiPlayer::setPos().
.SS "void MidiTrack::changeTempo (\fBulong\fP t)"
.PP
Change the tempo of the song. Definition at line 544 of file track.cc.
.PP
Referenced by MidiPlayer::play(), and MidiPlayer::setPos().
.SS "void MidiTrack::readEvent (\fBMidiEvent\fP * ev)"
.PP
Reads the event at the iterator position, and puts it on the structure pointed to by \fCev\fP. Definition at line 190 of file track.cc.
.PP
References MidiEvent::chn, MidiEvent::command, MidiEvent::ctl, MidiEvent::d1, MidiEvent::d2, MidiEvent::d3, MidiEvent::d4, MidiEvent::d5, MidiEvent::data, MidiEvent::length, MidiEvent::note, MidiEvent::patch, and MidiEvent::vel.
.PP
Referenced by MidiPlayer::play(), and MidiPlayer::setPos().
.SS "void MidiTrack::init (void)"
.PP
Initializes the iterator. Definition at line 519 of file track.cc.
.PP
References clear().
.PP
Referenced by MidiTrack(), MidiPlayer::play(), and MidiPlayer::setPos().
.SS "void MidiTrack::clear (void)"
.PP
Clears the internal variables. Definition at line 498 of file track.cc.
.PP
Referenced by init(), and MidiTrack().

.SH "Author"
.PP 
Generated automatically by Doxygen for libkmid Library from the source code.
