• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdemid
 

libtdemid

Public Member Functions | List of all members
MidiTrack Class Reference

#include <track.h>

Public Member Functions

 MidiTrack (FILE *file, int tpcn, int Id)
 
 ~MidiTrack ()
 
int ticksPassed (ulong ticks)
 
int msPassed (ulong ms)
 
int currentMs (double ms)
 
ulong waitTicks (void)
 
double absMsOfNextEvent (void)
 
void changeTempo (ulong t)
 
void readEvent (MidiEvent *ev)
 
void init (void)
 
void clear (void)
 

Detailed Description

Stores a MIDI track.

This can be thought of as a list of MIDI events.

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.

This class is used on MidiPlayer::loadSong() to load the song and later play it with MidiPlayer::play().

Stores a MIDI track with a simple API

Version
0.9.5 17/01/2000
Author
Antonio Larrosa Jimenez larro.nosp@m.sa@k.nosp@m.de.or.nosp@m.g

Definition at line 126 of file track.h.

Constructor & Destructor Documentation

◆ MidiTrack()

MidiTrack::MidiTrack ( FILE *  file,
int  tpcn,
int  Id 
)

Constructor.

Parameters
filethe 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).
tpcnthe ticks per cuarter note used in this file.
Idthe ID for this track.

Definition at line 49 of file track.cpp.

◆ ~MidiTrack()

MidiTrack::~MidiTrack ( )

Destructor.

Definition at line 88 of file track.cpp.

Member Function Documentation

◆ absMsOfNextEvent()

double MidiTrack::absMsOfNextEvent ( void  )
inline

Returns the absolute number of milliseconds of the next event.

Definition at line 212 of file track.h.

◆ changeTempo()

void MidiTrack::changeTempo ( ulong  t)

Change the tempo of the song.

Definition at line 544 of file track.cpp.

◆ clear()

void MidiTrack::clear ( void  )

Clears the internal variables.

Definition at line 498 of file track.cpp.

◆ currentMs()

int MidiTrack::currentMs ( double  ms)

Returns the current millisecond which the iterator is at.

Definition at line 174 of file track.cpp.

◆ init()

void MidiTrack::init ( void  )

Initializes the iterator.

Definition at line 519 of file track.cpp.

◆ msPassed()

int MidiTrack::msPassed ( ulong  ms)

Makes the iterator advance the given number of milliseconds.

Returns
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 MidiPlayer::play() ).

Definition at line 158 of file track.cpp.

◆ readEvent()

void MidiTrack::readEvent ( MidiEvent *  ev)

Reads the event at the iterator position, and puts it on the structure pointed to by ev.

Definition at line 190 of file track.cpp.

◆ ticksPassed()

int MidiTrack::ticksPassed ( ulong  ticks)

Makes the iterator advance the given number of ticks.

Returns
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 MidiPlayer::play() ).

Definition at line 146 of file track.cpp.

◆ waitTicks()

ulong MidiTrack::waitTicks ( void  )
inline

Returns the number of ticks left for the next event.

Definition at line 205 of file track.h.


The documentation for this class was generated from the following files:
  • track.h
  • track.cpp

libtdemid

Skip menu "libtdemid"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdemid

Skip menu "libtdemid"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for libtdemid by doxygen 1.9.4
This website is maintained by Timothy Pearson.