class AlsaOut

# class AlsaOut | Sends MIDI events to a MIDI devices using ALSA. More...
Definition | `#include <alsaout.h>`
Inherits | MidiOut [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- 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 a )
- 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 Members

- Forward AlsaOutPrivate
- AlsaOutPrivate *di

#### Protected Methods

- 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 Members

- int ndevs
- int nmidiports
- double count
- double lastcount
- double lasttime
- double begintime
- int m_rate
- double convertrate
- long int time

## Detailed Description

int ndevs | ### ndevs

[protected]

int nmidiports | ### nmidiports

[protected]

double count | ### count

[protected]

double lastcount | ### lastcount

[protected]

double lasttime | ### lasttime

[protected]

double begintime | ### begintime

[protected]

int m_rate | ### m_rate

[protected]

double convertrate | ### convertrate

[protected]

long int time | ### time

[protected]

void seqbuf_dump (void) | ### seqbuf_dump

[protected virtual]

A "constant" used to convert from milliseconds to the computer rate

Reimplemented from MidiOut.

void seqbuf_clean (void) | ### seqbuf_clean

[protected virtual]

Reimplemented from MidiOut.

void eventInit (snd_seq_event_t *ev) | ### eventInit

[protected]

void eventSend (snd_seq_event_t *ep) | ### eventSend

[protected]

void timerEventSend (int type) | ### timerEventSend

[protected]

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

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

~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.

void openDev (int sqfd) | ### openDev

[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:

sqfd | a file descriptor of /dev/sequencer

See also: closeDev, initDev

Reimplemented from MidiOut.

void closeDev () | ### closeDev

[virtual]

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

See also: openDev

Reimplemented from MidiOut.

void initDev () | ### initDev

[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.

int deviceType () | ### deviceType

[const]

- 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

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 :

See also: deviceName

Reimplemented from MidiOut.

const char * deviceName (void) | ### deviceName

[const virtual]

Returns the name and type of this MIDI device.

See also: deviceType

Reimplemented from MidiOut.

int rate (void) | ### rate

void noteOn ( uchar chn, uchar note, uchar vel ) | ### noteOn

[virtual]

See DeviceManager::noteOn()

Reimplemented from MidiOut.

void noteOff ( uchar chn, uchar note, uchar vel ) | ### noteOff

[virtual]

See DeviceManager::noteOff()

Reimplemented from MidiOut.

void keyPressure ( uchar chn, uchar note, uchar vel ) | ### keyPressure

[virtual]

See DeviceManager::keyPressure()

Reimplemented from MidiOut.

void chnPatchChange ( uchar chn, uchar patch ) | ### chnPatchChange

[virtual]

See DeviceManager::chnPatchChange()

Reimplemented from MidiOut.

void chnPressure ( uchar chn, uchar vel ) | ### chnPressure

[virtual]

See DeviceManager::chnPressure()

Reimplemented from MidiOut.

void chnPitchBender ( uchar chn, uchar lsb, uchar msb ) | ### chnPitchBender

[virtual]

See DeviceManager::chnPitchBender()

Reimplemented from MidiOut.

void chnController ( uchar chn, uchar ctl , uchar v ) | ### chnController

[virtual]

See DeviceManager::chnController()

Reimplemented from MidiOut.

void sysex ( uchar *data,ulong size) | ### sysex

[virtual]

See DeviceManager::sysex()

Reimplemented from MidiOut.

void channelSilence ( uchar chn ) | ### channelSilence

[virtual]

Mutes all notes being played on a given channel.

Reimplemented from MidiOut.

void channelMute ( uchar chn, int a ) | ### channelMute

[virtual]

Mute or "unmute" a given channel .

Parameters:

chn | channel to work on
b | if 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.

void setVolumePercentage ( int volper ) | ### setVolumePercentage

[virtual]

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:

volper | is 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.

int ok (void) | ### ok

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

Reimplemented from MidiOut.

void wait (double ticks) | ### wait

[virtual]

void tmrSetTempo (int v) | ### tmrSetTempo

[virtual]

void tmrStart (int tpcn) | ### tmrStart

[virtual]

void tmrStart () | ### tmrStart

[virtual]

void tmrStop () | ### tmrStop

[virtual]

void tmrContinue () | ### tmrContinue

[virtual]

void sync (int i=0) | ### sync

If i==1 syncronizes by cleaning the buffer instead of sending it (in fact, this is what syncronizing really means :-) )

Reimplemented from MidiOut.

AlsaOutPrivate * di | ### di

- Version: 0.9.5 17/01/2000
- Author: Antonio Larrosa Jimenez
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:38:06 2003, using kdoc 2.0a54.