Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/midi/mididevicehss1394.h

Go to the documentation of this file.
00001 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef MIDIDEVICEHSS1394_H
00019 #define MIDIDEVICEHSS1394_H
00020 
00021 #include <QtCore>
00022 #include <hss1394/HSS1394.h>
00023 #include "mididevice.h"
00024 
00025 #define MIXXX_HSS1394_BUFFER_LEN 64 
00026 #define MIXXX_HSS1394_NO_DEVICE_STRING "None" 
00031 class DeviceChannelListener : public hss1394::ChannelListener {
00032     public:
00033         DeviceChannelListener(int id, QString name, MidiDevice* midiDevice);
00034         void Process(const hss1394::uint8 *pBuffer, hss1394::uint uBufferSize);
00035         void Disconnected();
00036         void Reconnected();
00037     private:
00038         int m_iId;
00039         QString m_sName;
00040         MidiDevice *m_pMidiDevice;
00041 };
00042 
00044 class MidiDeviceHss1394 : public MidiDevice {
00045     public:
00046         MidiDeviceHss1394(MidiMapping* mapping,
00047                            const hss1394::TNodeInfo deviceInfo,
00048                            int deviceIndex);
00049         ~MidiDeviceHss1394();
00050         int open();
00051         int close();
00052         void sendShortMsg(unsigned int word);
00053         void sendSysexMsg(unsigned char data[], unsigned int length);
00054 
00055     protected:
00056         void run() { };
00057         hss1394::TNodeInfo m_deviceInfo;
00058         int m_iDeviceIndex;
00059         static QList<QString> m_deviceList;
00060         QMutex m_mutex;         
00061         static QMutex m_sHSSLock;    // HSS1394 is not thread-safe, so we need to only allow one thread at a time
00062         hss1394::Channel* m_pChannel;
00063         DeviceChannelListener *m_pChannelListener;
00064 };
00065 
00066 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines