alsaout.h
/* alsaout.cc - class AlsaOut which represents an alsa client/port pair
This file is part of LibKMid 0.9.5
Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez
LibKMid's homepage : http://www.arrakis.es/~rlarrosa/libkmid.html
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Send comments and bug fixes to Antonio Larrosa <larrosa@kde.org>
***************************************************************************/
#ifndef _ALSAOUT_H
#define _ALSAOUT_H
#include <libkmid/midiout.h>
struct snd_seq_event;
typedef struct snd_seq_event snd_seq_event_t;
class AlsaOut : public MidiOut
{
friend class DeviceManager;
protected:
int ndevs;
int nmidiports;
double count;
double lastcount;
double lasttime;
double begintime;
int m_rate;
double convertrate;
long int time;
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);
public:
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 { return devicetype; }
virtual const char * deviceName (void) const;
int rate (void) { return m_rate; }
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 )
{ volumepercentage = volper; }
int ok (void)
{ if (seqfd<0) return 0;
return (_ok>0);
}
virtual void wait (double ticks);
virtual void tmrSetTempo (int v);
virtual void tmrStart (int tpcn);
virtual void tmrStart () { tmrStart(-1); }
virtual void tmrStop ();
virtual void tmrContinue ();
void sync (int i=0);
class AlsaOutPrivate;
AlsaOutPrivate *di;
};
#endif // _ALSAOUT_H
AlsaOut::AlsaOut
AlsaOut(int d, int client=64, int port=0, const char *cname="", const char *pname="")
Constructor.
Definition: alsaout.cc:111
AlsaOut::chnPressure
virtual void chnPressure(uchar chn, uchar vel)
See DeviceManager::chnPressure()
Definition: alsaout.cc:360
AlsaOut::channelMute
virtual void channelMute(uchar chn, int b)
Mute or "unmute" a given channel .
Definition: alsaout.cc:441
AlsaOut::chnPatchChange
virtual void chnPatchChange(uchar chn, uchar patch)
See DeviceManager::chnPatchChange()
Definition: alsaout.cc:343
AlsaOut::noteOff
virtual void noteOff(uchar chn, uchar note, uchar vel)
See DeviceManager::noteOff()
Definition: alsaout.cc:316
DeviceManager::tmrStart
void tmrStart(long int tpcn)
Starts the timer.
Definition: deviceman.cc:565
DeviceManager::tmrStop
void tmrStop(void)
Stops the timer.
Definition: deviceman.cc:591
AlsaOut::setVolumePercentage
virtual void setVolumePercentage(int volper)
Change all channel volume events multiplying it by this percentage correction Instead of forcing a ch...
Definition: alsaout.h:203
AlsaOut::chnPitchBender
virtual void chnPitchBender(uchar chn, uchar lsb, uchar msb)
See DeviceManager::chnPitchBender()
Definition: alsaout.cc:374
AlsaOut::deviceName
virtual const char * deviceName(void) const
Returns the name and type of this MIDI device.
Definition: alsaout.cc:564
AlsaOut::closeDev
virtual void closeDev()
Closes the device.
Definition: alsaout.cc:181
AlsaOut::noteOn
virtual void noteOn(uchar chn, uchar note, uchar vel)
See DeviceManager::noteOn()
Definition: alsaout.cc:294
AlsaOut::ok
int ok(void)
Returns true if everything's ok and false if there has been any problem.
Definition: alsaout.h:209
MidiOut
External MIDI port output class .
Definition: midiout.h:51
DeviceManager::type
const char * type(int i)
Returns the type of device the i-th device is , in a user-friendly string .
Definition: deviceman.cc:736
AlsaOut::sysex
virtual void sysex(uchar *data, ulong size)
See DeviceManager::sysex()
Definition: alsaout.cc:411
AlsaOut::chnController
virtual void chnController(uchar chn, uchar ctl, uchar v)
See DeviceManager::chnController()
Definition: alsaout.cc:390
AlsaOut::initDev
virtual void initDev()
Initializes the device sending generic standard midi events and controllers, such as changing the pat...
Definition: alsaout.cc:209
DeviceManager::wait
void wait(double ms)
Sets the number of milliseconds at which the next event will be sent.
Definition: deviceman.cc:537
DeviceManager::sync
void sync(bool f=0)
Synchronizes with the MIDI buffer.
Definition: deviceman.cc:632
AlsaOut::channelSilence
virtual void channelSilence(uchar chn)
Mutes all notes being played on a given channel.
Definition: alsaout.cc:427
DeviceManager::rate
int rate(void)
Returns the SNDCTL_SEQ_CTRLRATE ioctl value.
Definition: deviceman.h:493
AlsaOut::keyPressure
virtual void keyPressure(uchar chn, uchar note, uchar vel)
See DeviceManager::keyPressure()
Definition: alsaout.cc:331
DeviceManager::tmrSetTempo
void tmrSetTempo(int v)
Sets the tempo which will be used to convert between ticks and milliseconds.
Definition: deviceman.cc:553
AlsaOut
Sends MIDI events to a MIDI devices using ALSA.
Definition: alsaout.h:37
AlsaOut::~AlsaOut
virtual ~AlsaOut()
Destructor.
Definition: alsaout.cc:126
DeviceManager
MIDI Device Manager class .
Definition: deviceman.h:47
AlsaOut::deviceType
int deviceType() const
Definition: alsaout.h:129
DeviceManager::tmrContinue
void tmrContinue(void)
Continue the stopped timer .
Definition: deviceman.cc:612
AlsaOut::openDev
virtual void openDev(int sqfd)
Opens the device.
Definition: alsaout.cc:132

KDE Home | KDE Accessibility Home | Description of Access Keys