libkmid Library API Documentation

alsaout.h

00001 /*  alsaout.cc   - class AlsaOut which represents an alsa client/port pair
00002     This file is part of LibKMid 0.9.5
00003     Copyright (C) 1997,98,99,2000  Antonio Larrosa Jimenez
00004     LibKMid's homepage : http://www.arrakis.es/~rlarrosa/libkmid.html
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 
00021     Send comments and bug fixes to Antonio Larrosa <larrosa@kde.org>
00022 
00023 ***************************************************************************/
00024 #ifndef _ALSAOUT_H
00025 #define _ALSAOUT_H
00026 
00027 #include <libkmid/midiout.h>
00028 
00029 struct snd_seq_event;
00030 typedef struct snd_seq_event snd_seq_event_t;
00031 
00037 class AlsaOut : public MidiOut
00038 {
00039   friend class DeviceManager;
00040 
00041   protected:
00042 
00047   int ndevs;
00048 
00053   int nmidiports;
00054 
00055   double count;
00056   double lastcount;
00057   double lasttime;
00058   double begintime;
00059   int m_rate;
00060 
00065   double convertrate;
00066 
00067   long int time;
00068 
00069   virtual void seqbuf_dump (void);
00070   virtual void seqbuf_clean(void);
00071   void eventInit(snd_seq_event_t *ev);
00072   void eventSend(snd_seq_event_t *ep);
00073   void timerEventSend(int type);
00074 
00075   public:
00076 
00082   AlsaOut(int d, int client=64, int port=0, const char *cname="", const char *pname="");
00083 
00089   virtual ~AlsaOut();
00090 
00099   virtual void openDev  (int sqfd);
00100 
00106   virtual void closeDev ();
00107 
00113   virtual void initDev  ();
00114 
00129   int          deviceType () const { return devicetype; };
00130 
00135   virtual const char * deviceName (void) const;
00136 
00140   int  rate    (void) { return m_rate; };
00141 
00145   virtual void noteOn   ( uchar chn, uchar note, uchar vel );
00146 
00150   virtual void noteOff  ( uchar chn, uchar note, uchar vel );
00151 
00155   virtual void keyPressure  ( uchar chn, uchar note, uchar vel );
00156 
00160   virtual void chnPatchChange   ( uchar chn, uchar patch );
00161 
00165   virtual void chnPressure  ( uchar chn, uchar vel );
00166 
00170   virtual void chnPitchBender   ( uchar chn, uchar lsb,  uchar msb );
00171 
00175   virtual void chnController    ( uchar chn, uchar ctl , uchar v );
00176 
00180   virtual void sysex        ( uchar *data,ulong size);
00181 
00185   virtual void channelSilence   ( uchar chn );
00186 
00194   virtual void channelMute  ( uchar chn, int a );
00195 
00203   virtual void setVolumePercentage ( int volper )
00204   { volumepercentage = volper; };
00205 
00209   int ok (void)
00210   { if (seqfd<0) return 0;
00211     return (_ok>0);
00212   };
00213 
00214   virtual void wait        (double ticks);
00215   virtual void tmrSetTempo (int v);
00216   virtual void tmrStart    (int tpcn);
00217   virtual void tmrStart    () { tmrStart(-1); }
00218   virtual void tmrStop     ();
00219   virtual void tmrContinue ();
00225   void sync        (int i=0);
00226 
00227   class AlsaOutPrivate;
00228   AlsaOutPrivate *di;
00229 };
00230 
00231 #endif // _ALSAOUT_H
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:59 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001