1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
//=========================================================
// MusE
// Linux Music Editor
// $Id: alsamidi.h,v 1.1.1.1 2003/10/29 10:06:12 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
//=========================================================
#ifndef __ALSAMIDI_H__
#define __ALSAMIDI_H__
// use autoconf configuration
#include <config.h>
#include <alsa/asoundlib.h>
#include "mididev.h"
extern int alsaSeqFd;
extern snd_seq_addr_t musePort;
//---------------------------------------------------------
// MidiAlsaDevice
//---------------------------------------------------------
class MidiAlsaDevice : public MidiDevice {
public:
snd_seq_addr_t adr;
private:
int rwFlag;
virtual QString open(int);
virtual void close();
virtual void processInput() {}
virtual int selectRfd() { return -1; }
virtual int selectWfd();
void prepareEvent(snd_seq_event_t* event) {
memset(event, 0, sizeof(event));
event->queue = SND_SEQ_QUEUE_DIRECT;
event->source = musePort;
event->dest = adr;
}
void putEvent(snd_seq_event_t*);
public:
MidiAlsaDevice() {}
MidiAlsaDevice(const snd_seq_addr_t&, const QString& name);
virtual ~MidiAlsaDevice() {}
virtual void putEvent(const MidiPlayEvent*);
virtual void putClock();
virtual void putStart();
virtual void putStop();
virtual void putContinue();
virtual void putSongpos(int);
};
extern bool initMidiAlsa();
extern int alsaSelectRfd();
extern int alsaSelectWfd();
extern void alsaProcessMidiInput();
extern void alsaScanMidiPorts();
extern snd_seq_t* alsaSeq;
#endif
|