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

libtdemid

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MidiOut Class Reference

#include <midiout.h>

Inheritance diagram for MidiOut:
AlsaOut FMOut GUSOut SynthOut

Public Member Functions

 MidiOut (int d=0)
 
virtual ~MidiOut ()
 
virtual void openDev (int sqfd)
 
virtual void closeDev ()
 
virtual void initDev ()
 
int deviceType () const
 
const char * deviceName (void) const
 
void setMidiMapper (MidiMapper *map)
 
virtual void noteOn (uchar chn, uchar note, uchar vel)
 
virtual void noteOff (uchar chn, uchar note, uchar vel)
 
virtual void keyPressure (uchar chn, uchar note, uchar vel)
 
virtual void chnPatchChange (uchar chn, uchar patch)
 
virtual void chnPressure (uchar chn, uchar vel)
 
virtual void chnPitchBender (uchar chn, uchar lsb, uchar msb)
 
virtual void chnController (uchar chn, uchar ctl, uchar v)
 
virtual void sysex (uchar *data, ulong size)
 
void allNotesOff (void)
 
virtual void channelSilence (uchar chn)
 
virtual void channelMute (uchar chn, int b)
 
virtual void setVolumePercentage (int volper)
 
int ok (void)
 
const char * midiMapFilename ()
 
void sync (int i=0)
 

Protected Member Functions

void seqbuf_dump (void)
 
void seqbuf_clean (void)
 

Protected Attributes

int seqfd
 
int device
 
int devicetype
 
int volumepercentage
 
MidiMapper * map
 
uchar chnpatch [16]
 
int chnbender [16]
 
uchar chnpressure [16]
 
uchar chncontroller [16][256]
 
int chnmute [16]
 
int _ok
 

Detailed Description

External MIDI port output class .

This class is used to send midi events to external midi devices.

MidiOut is inherited by other MIDI devices classes (like SynthOut or FMOut) to support a common API.

In general, you don't want to use MidiOut directly, but within a DeviceManager object, which is the preferred way to generate music.

If you want to add support for other devices (I don't think there are any) you just have to create a class that inherits from MidiOut and create one object of your new class in DeviceManager::initManager().

Sends MIDI events to external MIDI devices

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 51 of file midiout.h.

Constructor & Destructor Documentation

◆ MidiOut()

MidiOut::MidiOut ( int  d = 0)

Constructor.

After constructing a MidiOut device, you must open it (using openDev() ). Additionally you may want to initialize it (with initDev() ),

Definition at line 46 of file midiout.cpp.

◆ ~MidiOut()

MidiOut::~MidiOut ( )
virtual

Destructor.

It doesn't matter if you close the device ( closeDev() ) before you destruct the object because in other case, it will be closed here.

Definition at line 57 of file midiout.cpp.

Member Function Documentation

◆ allNotesOff()

void MidiOut::allNotesOff ( void  )

Send a All Notes Off event to every channel.

Definition at line 220 of file midiout.cpp.

◆ channelMute()

void MidiOut::channelMute ( uchar  chn,
int  b 
)
virtual

Mute or "unmute" a given channel .

Parameters
chnchannel to work on
bif true, the device will ignore subsequent notes played on the chn channel, and mute all notes being played on it. If b is false, the channel is back to work.

Reimplemented in AlsaOut.

Definition at line 240 of file midiout.cpp.

◆ channelSilence()

void MidiOut::channelSilence ( uchar  chn)
virtual

Mutes all notes being played on a given channel.

Parameters
chnthe channel

Reimplemented in AlsaOut.

Definition at line 230 of file midiout.cpp.

◆ chnController()

void MidiOut::chnController ( uchar  chn,
uchar  ctl,
uchar  v 
)
virtual

See DeviceManager::chnController()

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 186 of file midiout.cpp.

◆ chnPatchChange()

void MidiOut::chnPatchChange ( uchar  chn,
uchar  patch 
)
virtual

See DeviceManager::chnPatchChange()

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 147 of file midiout.cpp.

◆ chnPitchBender()

void MidiOut::chnPitchBender ( uchar  chn,
uchar  lsb,
uchar  msb 
)
virtual

See DeviceManager::chnPitchBender()

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 166 of file midiout.cpp.

◆ chnPressure()

void MidiOut::chnPressure ( uchar  chn,
uchar  vel 
)
virtual

See DeviceManager::chnPressure()

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 158 of file midiout.cpp.

◆ closeDev()

void MidiOut::closeDev ( void  )
virtual

Closes the device.

It basically tells the device (the file descriptor) is going to be closed.

See also
openDev

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 77 of file midiout.cpp.

◆ deviceName()

const char * MidiOut::deviceName ( void  ) const

Returns the name and type of this MIDI device.

See also
deviceType

Definition at line 280 of file midiout.cpp.

◆ deviceType()

int MidiOut::deviceType ( ) const
inline
Returns
the device type of the object. This is to identify the inherited class that a given object is polymorphed to. The returned value is one of these :
  • KMID_EXTERNAL_MIDI if it's a MidiOut object
  • KMID_SYNTH if it's a SynthOut object (as an AWE device)
  • KMID_FM if it's a FMOut object
  • KMID_GUS if it's a GUSOut object

which are defined in midispec.h

See also
deviceName

Definition at line 139 of file midiout.h.

◆ initDev()

void MidiOut::initDev ( void  )
virtual

Initializes the device sending generic standard midi events and controllers, such as changing the patches of each channel to an Acoustic Piano (000), setting the volume to a normal value, etc.

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 86 of file midiout.cpp.

◆ keyPressure()

void MidiOut::keyPressure ( uchar  chn,
uchar  note,
uchar  vel 
)
virtual

See DeviceManager::keyPressure()

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 140 of file midiout.cpp.

◆ midiMapFilename()

const char * MidiOut::midiMapFilename ( void  )

Returns the path to the file where the current used MidiMapper object reads the configuration from, or an empty string if there's no MidiMapper.

Definition at line 275 of file midiout.cpp.

◆ noteOff()

void MidiOut::noteOff ( uchar  chn,
uchar  note,
uchar  vel 
)
virtual

See DeviceManager::noteOff()

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 130 of file midiout.cpp.

◆ noteOn()

void MidiOut::noteOn ( uchar  chn,
uchar  note,
uchar  vel 
)
virtual

See DeviceManager::noteOn()

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 113 of file midiout.cpp.

◆ ok()

int MidiOut::ok ( void  )
inline

Returns true if everything's ok and false if there has been any problem.

Definition at line 231 of file midiout.h.

◆ openDev()

void MidiOut::openDev ( int  sqfd)
virtual

Opens the device.

This is generally called from DeviceManager , so you shouldn't call this yourself (except if you created the MidiOut object yourself.

Parameters
sqfda file descriptor of /dev/sequencer
See also
closeDev
initDev

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 63 of file midiout.cpp.

◆ seqbuf_clean()

void MidiOut::seqbuf_clean ( void  )
protected

Definition at line 268 of file midiout.cpp.

◆ seqbuf_dump()

void MidiOut::seqbuf_dump ( void  )
protected

Definition at line 254 of file midiout.cpp.

◆ setMidiMapper()

void MidiOut::setMidiMapper ( MidiMapper *  map)

Sets a MidiMapper object to be used to modify the midi events before sending them.

Parameters
mapthe MidiMapper to use.
See also
MidiMapper
midiMapFilename

Definition at line 107 of file midiout.cpp.

◆ setVolumePercentage()

virtual void MidiOut::setVolumePercentage ( int  volper)
inlinevirtual

Change all channel volume events multiplying it by this percentage correction Instead of forcing a channel to a fixed volume, this method allows to music to fade out even when it was being played softly.

Parameters
volperis an integer value, where 0 is quiet, 100 is used to send an unmodified value, 200 play music twice louder than it should, etc.

Reimplemented in FMOut, and AlsaOut.

Definition at line 225 of file midiout.h.

◆ sync()

void MidiOut::sync ( int  i = 0)

Sends the buffer to the device and returns when it's played, so you can synchronize XXX: sync should be virtual after next bic release.

Definition at line 294 of file midiout.cpp.

◆ sysex()

void MidiOut::sysex ( uchar *  data,
ulong  size 
)
virtual

See DeviceManager::sysex()

Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut.

Definition at line 205 of file midiout.cpp.

Member Data Documentation

◆ _ok

int MidiOut::_ok
protected

Definition at line 80 of file midiout.h.

◆ chnbender

int MidiOut::chnbender[16]
protected

Definition at line 75 of file midiout.h.

◆ chncontroller

uchar MidiOut::chncontroller[16][256]
protected

Definition at line 77 of file midiout.h.

◆ chnmute

int MidiOut::chnmute[16]
protected

Definition at line 78 of file midiout.h.

◆ chnpatch

uchar MidiOut::chnpatch[16]
protected

Definition at line 74 of file midiout.h.

◆ chnpressure

uchar MidiOut::chnpressure[16]
protected

Definition at line 76 of file midiout.h.

◆ device

int MidiOut::device
protected

Definition at line 66 of file midiout.h.

◆ devicetype

int MidiOut::devicetype
protected

Definition at line 68 of file midiout.h.

◆ map

MidiMapper* MidiOut::map
protected

Definition at line 72 of file midiout.h.

◆ seqfd

int MidiOut::seqfd
protected

Definition at line 64 of file midiout.h.

◆ volumepercentage

int MidiOut::volumepercentage
protected

Definition at line 70 of file midiout.h.


The documentation for this class was generated from the following files:
  • midiout.h
  • midiout.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.