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

libtdemid

  • libtdemid
midiout.h
1 /* midiout.h - class midiOut which handles the /dev/sequencer device
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 _MIDIOUT_H
25 #define _MIDIOUT_H
26 
27 #include <libtdemid/dattypes.h>
28 #include <libtdemid/deviceman.h>
29 #include <libtdemid/midimapper.h>
30 #include <stdio.h>
31 
51 class MidiOut
52 {
53  private:
54  class MidiOutPrivate;
55  MidiOutPrivate *d;
56 
57  protected:
58 
64  int seqfd;
65 
66  int device;
67 
68  int devicetype;
69 
70  int volumepercentage;
71 
72  MidiMapper *map;
73 
74  uchar chnpatch [16];
75  int chnbender [16];
76  uchar chnpressure [16];
77  uchar chncontroller [16][256];
78  int chnmute [16];
79 
80  int _ok;
81 
82  void seqbuf_dump (void);
83  void seqbuf_clean(void);
84 
85  public:
86 
92  MidiOut(int d=0);
93 
99  virtual ~MidiOut();
100 
109  virtual void openDev (int sqfd);
110 
116  virtual void closeDev ();
117 
123  virtual void initDev ();
124 
139  int deviceType () const { return devicetype; }
140 
145  const char * deviceName (void) const;
146 
156  void setMidiMapper ( MidiMapper *map );
157 
161  virtual void noteOn ( uchar chn, uchar note, uchar vel );
162 
166  virtual void noteOff ( uchar chn, uchar note, uchar vel );
167 
171  virtual void keyPressure ( uchar chn, uchar note, uchar vel );
172 
176  virtual void chnPatchChange ( uchar chn, uchar patch );
177 
181  virtual void chnPressure ( uchar chn, uchar vel );
182 
186  virtual void chnPitchBender ( uchar chn, uchar lsb, uchar msb );
187 
191  virtual void chnController ( uchar chn, uchar ctl , uchar v );
192 
196  virtual void sysex ( uchar *data,ulong size);
197 
201  void allNotesOff(void);
202 
207  virtual void channelSilence ( uchar chn );
208 
216  virtual void channelMute ( uchar chn, int b );
217 
225  virtual void setVolumePercentage ( int volper )
226  { volumepercentage = volper; }
227 
231  int ok (void)
232  { if (seqfd<0) return 0;
233  return (_ok>0);
234  }
235 
240  const char *midiMapFilename ();
241 
247  void sync(int i=0);
248 
249 };
250 
251 #endif
MidiMapper
A Midi Mapper class which defines the way MIDI events are translated (or "mapped") to different ones.
Definition: midimapper.h:60
MidiOut
External MIDI port output class .
Definition: midiout.h:52
MidiOut::setVolumePercentage
virtual void setVolumePercentage(int volper)
Change all channel volume events multiplying it by this percentage correction Instead of forcing a ch...
Definition: midiout.h:225
MidiOut::chnPitchBender
virtual void chnPitchBender(uchar chn, uchar lsb, uchar msb)
See DeviceManager::chnPitchBender()
Definition: midiout.cpp:166
MidiOut::deviceName
const char * deviceName(void) const
Returns the name and type of this MIDI device.
Definition: midiout.cpp:280
MidiOut::allNotesOff
void allNotesOff(void)
Send a All Notes Off event to every channel.
Definition: midiout.cpp:220
MidiOut::sync
void sync(int i=0)
Sends the buffer to the device and returns when it's played, so you can synchronize XXX: sync should ...
Definition: midiout.cpp:294
MidiOut::noteOn
virtual void noteOn(uchar chn, uchar note, uchar vel)
See DeviceManager::noteOn()
Definition: midiout.cpp:113
MidiOut::~MidiOut
virtual ~MidiOut()
Destructor.
Definition: midiout.cpp:57
MidiOut::deviceType
int deviceType() const
Definition: midiout.h:139
MidiOut::setMidiMapper
void setMidiMapper(MidiMapper *map)
Sets a MidiMapper object to be used to modify the midi events before sending them.
Definition: midiout.cpp:107
MidiOut::MidiOut
MidiOut(int d=0)
Constructor.
Definition: midiout.cpp:46
MidiOut::chnPatchChange
virtual void chnPatchChange(uchar chn, uchar patch)
See DeviceManager::chnPatchChange()
Definition: midiout.cpp:147
MidiOut::initDev
virtual void initDev()
Initializes the device sending generic standard midi events and controllers, such as changing the pat...
Definition: midiout.cpp:86
MidiOut::midiMapFilename
const char * midiMapFilename()
Returns the path to the file where the current used MidiMapper object reads the configuration from,...
Definition: midiout.cpp:275
MidiOut::openDev
virtual void openDev(int sqfd)
Opens the device.
Definition: midiout.cpp:63
MidiOut::closeDev
virtual void closeDev()
Closes the device.
Definition: midiout.cpp:77
MidiOut::chnPressure
virtual void chnPressure(uchar chn, uchar vel)
See DeviceManager::chnPressure()
Definition: midiout.cpp:158
MidiOut::channelMute
virtual void channelMute(uchar chn, int b)
Mute or "unmute" a given channel .
Definition: midiout.cpp:240
MidiOut::keyPressure
virtual void keyPressure(uchar chn, uchar note, uchar vel)
See DeviceManager::keyPressure()
Definition: midiout.cpp:140
MidiOut::noteOff
virtual void noteOff(uchar chn, uchar note, uchar vel)
See DeviceManager::noteOff()
Definition: midiout.cpp:130
MidiOut::channelSilence
virtual void channelSilence(uchar chn)
Mutes all notes being played on a given channel.
Definition: midiout.cpp:230
MidiOut::ok
int ok(void)
Returns true if everything's ok and false if there has been any problem.
Definition: midiout.h:231
MidiOut::chnController
virtual void chnController(uchar chn, uchar ctl, uchar v)
See DeviceManager::chnController()
Definition: midiout.cpp:186
MidiOut::sysex
virtual void sysex(uchar *data, ulong size)
See DeviceManager::sysex()
Definition: midiout.cpp:205

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.1
This website is maintained by Timothy Pearson.