00001 /* 00002 * @(#)plt/Alsa.h 3.00 12 October 2000 00003 * 00004 * Copyright (c) 2000 Pete Goodliffe (pete@cthree.org) 00005 * 00006 * This file is part of TSE3 - the Trax Sequencer Engine version 3.00. 00007 * 00008 * This library is modifiable/redistributable under the terms of the GNU 00009 * General Public License. 00010 * 00011 * You should have received a copy of the GNU General Public License along 00012 * with this program; see the file COPYING. If not, write to the Free Software 00013 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00014 * 00015 */ 00016 00017 #ifndef TSE3_PLT_ALSA_H 00018 #define TSE3_PLT_ALSA_H 00019 00020 #include "tse3/MidiScheduler.h" 00021 00022 namespace TSE3 00023 { 00024 namespace Plt 00025 { 00035 class AlsaMidiScheduler : public MidiScheduler 00036 { 00037 public: 00038 00042 AlsaMidiScheduler(); 00043 virtual ~AlsaMidiScheduler(); 00044 00045 protected: 00046 00050 virtual const char *impl_implementationName() const; 00054 virtual const char *impl_portName(int port) const; 00058 virtual const char *impl_portType(int port) const; 00062 virtual bool impl_portReadable(int port) const; 00066 virtual bool impl_portWriteable(int port) const; 00070 virtual void impl_start(Clock clock); 00074 virtual void impl_stop(Clock clock); 00078 virtual void impl_moveTo(Clock moveTime, Clock newTime); 00082 virtual Clock impl_clock(); 00086 virtual int impl_msecs(); 00090 virtual void impl_setTempo(int tempo, Clock changeTime); 00094 virtual bool impl_eventWaiting(); 00098 virtual MidiEvent impl_rx(); 00102 virtual void impl_tx(MidiCommand mc); 00106 virtual void impl_tx(MidiEvent mc); 00110 virtual void impl_txSysEx(int port, 00111 const unsigned char *data, 00112 size_t size); 00113 00114 private: 00115 00116 AlsaMidiScheduler(const AlsaMidiScheduler &); 00117 AlsaMidiScheduler &operator=(const AlsaMidiScheduler &); 00118 00119 // Private Alsa interface functions 00120 00125 void getSystemInfo(); 00126 00135 void alsa_tx(MidiCommand mc, int queue, 00136 long int sec = 0, long int nsec = 0); 00137 00138 class AlsaImpl *pimpl; 00139 }; 00140 } 00141 } 00142 00143 #endif