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

libtdemid

  • libtdemid
alsaout.h
1 /* alsaout.cpp - class AlsaOut which represents an alsa client/port pair
2  This file is part of LibKMid 0.9.5
3  Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez
4  LibKMid's homepage : http://www.arrakis.es/~rlarrosa/libtdemid.html
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 
21  Send comments and bug fixes to Antonio Larrosa <larrosa@kde.org>
22 
23 ***************************************************************************/
24 #ifndef _ALSAOUT_H
25 #define _ALSAOUT_H
26 
27 #include <libtdemid/midiout.h>
28 
29 struct snd_seq_event;
30 typedef struct snd_seq_event snd_seq_event_t;
31 
37 class AlsaOut : public MidiOut
38 {
39  friend class DeviceManager;
40 
41  protected:
42 
47  int ndevs;
48 
53  int nmidiports;
54 
55  double count;
56  double lastcount;
57  double lasttime;
58  double begintime;
59  int m_rate;
60 
65  double convertrate;
66 
67  long int time;
68 
69  virtual void seqbuf_dump (void);
70  virtual void seqbuf_clean(void);
71  void eventInit(snd_seq_event_t *ev);
72  void eventSend(snd_seq_event_t *ep);
73  void timerEventSend(int type);
74 
75  public:
76 
82  AlsaOut(int d, int client=64, int port=0, const char *cname="", const char *pname="");
83 
89  virtual ~AlsaOut();
90 
99  virtual void openDev (int sqfd);
100 
106  virtual void closeDev ();
107 
113  virtual void initDev ();
114 
129  int deviceType () const { return devicetype; }
130 
135  virtual const char * deviceName (void) const;
136 
140  int rate (void) { return m_rate; }
141 
145  virtual void noteOn ( uchar chn, uchar note, uchar vel );
146 
150  virtual void noteOff ( uchar chn, uchar note, uchar vel );
151 
155  virtual void keyPressure ( uchar chn, uchar note, uchar vel );
156 
160  virtual void chnPatchChange ( uchar chn, uchar patch );
161 
165  virtual void chnPressure ( uchar chn, uchar vel );
166 
170  virtual void chnPitchBender ( uchar chn, uchar lsb, uchar msb );
171 
175  virtual void chnController ( uchar chn, uchar ctl , uchar v );
176 
180  virtual void sysex ( uchar *data,ulong size);
181 
185  virtual void channelSilence ( uchar chn );
186 
194  virtual void channelMute ( uchar chn, int b );
195 
203  virtual void setVolumePercentage ( int volper )
204  { volumepercentage = volper; }
205 
209  int ok (void)
210  { if (seqfd<0) return 0;
211  return (_ok>0);
212  }
213 
214  virtual void wait (double ticks);
215  virtual void tmrSetTempo (int v);
216  virtual void tmrStart (int tpcn);
217  virtual void tmrStart () { tmrStart(-1); }
218  virtual void tmrStop ();
219  virtual void tmrContinue ();
225  void sync (int i=0);
226 
227  class AlsaOutPrivate;
228  AlsaOutPrivate *di;
229 };
230 
231 #endif // _ALSAOUT_H
AlsaOut::AlsaOut
AlsaOut(int d, int client=64, int port=0, const char *cname="", const char *pname="")
Constructor.
Definition: alsaout.cpp:111
AlsaOut::chnPressure
virtual void chnPressure(uchar chn, uchar vel)
See DeviceManager::chnPressure()
Definition: alsaout.cpp:360
AlsaOut::channelMute
virtual void channelMute(uchar chn, int b)
Mute or "unmute" a given channel .
Definition: alsaout.cpp:441
AlsaOut::chnPatchChange
virtual void chnPatchChange(uchar chn, uchar patch)
See DeviceManager::chnPatchChange()
Definition: alsaout.cpp:343
AlsaOut::noteOff
virtual void noteOff(uchar chn, uchar note, uchar vel)
See DeviceManager::noteOff()
Definition: alsaout.cpp:316
DeviceManager::tmrStart
void tmrStart(long int tpcn)
Starts the timer.
Definition: deviceman.cpp:565
DeviceManager::tmrStop
void tmrStop(void)
Stops the timer.
Definition: deviceman.cpp: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.cpp:374
AlsaOut::deviceName
virtual const char * deviceName(void) const
Returns the name and type of this MIDI device.
Definition: alsaout.cpp:564
AlsaOut::closeDev
virtual void closeDev()
Closes the device.
Definition: alsaout.cpp:181
AlsaOut::noteOn
virtual void noteOn(uchar chn, uchar note, uchar vel)
See DeviceManager::noteOn()
Definition: alsaout.cpp: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.cpp:734
AlsaOut::sysex
virtual void sysex(uchar *data, ulong size)
See DeviceManager::sysex()
Definition: alsaout.cpp:411
AlsaOut::chnController
virtual void chnController(uchar chn, uchar ctl, uchar v)
See DeviceManager::chnController()
Definition: alsaout.cpp:390
AlsaOut::initDev
virtual void initDev()
Initializes the device sending generic standard midi events and controllers, such as changing the pat...
Definition: alsaout.cpp:209
DeviceManager::wait
void wait(double ms)
Sets the number of milliseconds at which the next event will be sent.
Definition: deviceman.cpp:537
DeviceManager::sync
void sync(bool f=0)
Synchronizes with the MIDI buffer.
Definition: deviceman.cpp:632
AlsaOut::channelSilence
virtual void channelSilence(uchar chn)
Mutes all notes being played on a given channel.
Definition: alsaout.cpp: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.cpp:331
DeviceManager::tmrSetTempo
void tmrSetTempo(int v)
Sets the tempo which will be used to convert between ticks and milliseconds.
Definition: deviceman.cpp:553
AlsaOut
Sends MIDI events to a MIDI devices using ALSA.
Definition: alsaout.h:37
AlsaOut::~AlsaOut
virtual ~AlsaOut()
Destructor.
Definition: alsaout.cpp: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.cpp:612
AlsaOut::openDev
virtual void openDev(int sqfd)
Opens the device.
Definition: alsaout.cpp:132

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for libtdemid by doxygen 1.8.8
This website is maintained by Timothy Pearson.