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

libtdemid

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

#include <alsaout.h>

Inheritance diagram for AlsaOut:
MidiOut

Public Member Functions

 AlsaOut (int d, int client=64, int port=0, const char *cname="", const char *pname="")
 
virtual ~AlsaOut ()
 
virtual void openDev (int sqfd)
 
virtual void closeDev ()
 
virtual void initDev ()
 
int deviceType () const
 
virtual const char * deviceName (void) const
 
int rate (void)
 
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)
 
virtual void channelSilence (uchar chn)
 
virtual void channelMute (uchar chn, int b)
 
virtual void setVolumePercentage (int volper)
 
int ok (void)
 
virtual void wait (double ticks)
 
virtual void tmrSetTempo (int v)
 
virtual void tmrStart (int tpcn)
 
virtual void tmrStart ()
 
virtual void tmrStop ()
 
virtual void tmrContinue ()
 
void sync (int i=0)
 
- Public Member Functions inherited from MidiOut
 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)
 

Public Attributes

AlsaOutPrivate * di
 

Protected Member Functions

virtual void seqbuf_dump (void)
 
virtual void seqbuf_clean (void)
 
void eventInit (snd_seq_event_t *ev)
 
void eventSend (snd_seq_event_t *ep)
 
void timerEventSend (int type)
 
- Protected Member Functions inherited from MidiOut
void seqbuf_dump (void)
 
void seqbuf_clean (void)
 

Protected Attributes

int ndevs
 
int nmidiports
 
double count
 
double lastcount
 
double lasttime
 
double begintime
 
int m_rate
 
double convertrate
 
long int time
 
- Protected Attributes inherited from MidiOut
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
 

Friends

class DeviceManager
 

Detailed Description

Sends MIDI events to a MIDI devices using ALSA.

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 37 of file alsaout.h.

Constructor & Destructor Documentation

◆ AlsaOut()

AlsaOut::AlsaOut ( int  d,
int  client = 64,
int  port = 0,
const char *  cname = "",
const char *  pname = "" 
)

Constructor.

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

Definition at line 111 of file alsaout.cpp.

◆ ~AlsaOut()

AlsaOut::~AlsaOut ( )
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 126 of file alsaout.cpp.

Member Function Documentation

◆ channelMute()

void AlsaOut::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 from MidiOut.

Definition at line 441 of file alsaout.cpp.

◆ channelSilence()

void AlsaOut::channelSilence ( uchar  chn)
virtual

Mutes all notes being played on a given channel.

Reimplemented from MidiOut.

Definition at line 427 of file alsaout.cpp.

◆ chnController()

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

See DeviceManager::chnController()

Reimplemented from MidiOut.

Definition at line 390 of file alsaout.cpp.

◆ chnPatchChange()

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

See DeviceManager::chnPatchChange()

Reimplemented from MidiOut.

Definition at line 343 of file alsaout.cpp.

◆ chnPitchBender()

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

See DeviceManager::chnPitchBender()

Reimplemented from MidiOut.

Definition at line 374 of file alsaout.cpp.

◆ chnPressure()

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

See DeviceManager::chnPressure()

Reimplemented from MidiOut.

Definition at line 360 of file alsaout.cpp.

◆ closeDev()

void AlsaOut::closeDev ( void  )
virtual

Closes the device.

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

See also
openDev

Reimplemented from MidiOut.

Definition at line 181 of file alsaout.cpp.

◆ deviceName()

const char * AlsaOut::deviceName ( void  ) const
virtual

Returns the name and type of this MIDI device.

See also
deviceType

Definition at line 564 of file alsaout.cpp.

◆ deviceType()

int AlsaOut::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 129 of file alsaout.h.

◆ initDev()

void AlsaOut::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 from MidiOut.

Definition at line 209 of file alsaout.cpp.

◆ keyPressure()

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

See DeviceManager::keyPressure()

Reimplemented from MidiOut.

Definition at line 331 of file alsaout.cpp.

◆ noteOff()

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

See DeviceManager::noteOff()

Reimplemented from MidiOut.

Definition at line 316 of file alsaout.cpp.

◆ noteOn()

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

See DeviceManager::noteOn()

Reimplemented from MidiOut.

Definition at line 294 of file alsaout.cpp.

◆ ok()

int AlsaOut::ok ( void  )
inline

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

Definition at line 209 of file alsaout.h.

◆ openDev()

void AlsaOut::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 from MidiOut.

Definition at line 132 of file alsaout.cpp.

◆ rate()

int AlsaOut::rate ( void  )
inline

Definition at line 140 of file alsaout.h.

◆ seqbuf_clean()

void AlsaOut::seqbuf_clean ( void  )
protectedvirtual

Definition at line 464 of file alsaout.cpp.

◆ seqbuf_dump()

void AlsaOut::seqbuf_dump ( void  )
protectedvirtual

Definition at line 459 of file alsaout.cpp.

◆ setVolumePercentage()

virtual void AlsaOut::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 from MidiOut.

Definition at line 203 of file alsaout.h.

◆ sync()

void AlsaOut::sync ( int  i = 0)

Definition at line 500 of file alsaout.cpp.

◆ sysex()

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

See DeviceManager::sysex()

Reimplemented from MidiOut.

Definition at line 411 of file alsaout.cpp.

◆ tmrContinue()

void AlsaOut::tmrContinue ( void  )
virtual

Definition at line 560 of file alsaout.cpp.

◆ tmrSetTempo()

void AlsaOut::tmrSetTempo ( int  v)
virtual

Definition at line 480 of file alsaout.cpp.

◆ tmrStart() [1/2]

virtual void AlsaOut::tmrStart ( )
inlinevirtual

Definition at line 217 of file alsaout.h.

◆ tmrStart() [2/2]

void AlsaOut::tmrStart ( int  tpcn)
virtual

Definition at line 523 of file alsaout.cpp.

◆ tmrStop()

void AlsaOut::tmrStop ( void  )
virtual

Definition at line 552 of file alsaout.cpp.

◆ wait()

void AlsaOut::wait ( double  ticks)
virtual

Definition at line 469 of file alsaout.cpp.

Friends And Related Function Documentation

◆ DeviceManager

friend class DeviceManager
friend

Definition at line 39 of file alsaout.h.

Member Data Documentation

◆ begintime

double AlsaOut::begintime
protected

Definition at line 58 of file alsaout.h.

◆ convertrate

double AlsaOut::convertrate
protected

Definition at line 65 of file alsaout.h.

◆ count

double AlsaOut::count
protected

Definition at line 55 of file alsaout.h.

◆ di

AlsaOutPrivate* AlsaOut::di

Definition at line 228 of file alsaout.h.

◆ lastcount

double AlsaOut::lastcount
protected

Definition at line 56 of file alsaout.h.

◆ lasttime

double AlsaOut::lasttime
protected

Definition at line 57 of file alsaout.h.

◆ m_rate

int AlsaOut::m_rate
protected

Definition at line 59 of file alsaout.h.

◆ ndevs

int AlsaOut::ndevs
protected

Definition at line 47 of file alsaout.h.

◆ nmidiports

int AlsaOut::nmidiports
protected

Definition at line 53 of file alsaout.h.

◆ time

long int AlsaOut::time
protected

Definition at line 67 of file alsaout.h.


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