Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/midi/hss1394enumerator.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                            hss1394enumerator.cpp
00003                     HSS1394 Device Enumerator Class
00004                     --------------------------------
00005     begin                : Fri Feb 26 2010
00006     copyright            : (C) 2010 Sean M. Pappalardo
00007     email                : spappalardo@mixxx.org
00008 
00009 ***************************************************************************/
00010 
00011 /***************************************************************************
00012 *                                                                         *
00013 *   This program is free software; you can redistribute it and/or modify  *
00014 *   it under the terms of the GNU General Public License as published by  *
00015 *   the Free Software Foundation; either version 2 of the License, or     *
00016 *   (at your option) any later version.                                   *
00017 *                                                                         *
00018 ***************************************************************************/
00019 
00020 #include <hss1394/HSS1394.h>
00021 
00022 #include "mididevicehss1394.h"
00023 #include "hss1394enumerator.h"
00024 
00025 
00026 Hss1394Enumerator::Hss1394Enumerator() : MidiDeviceEnumerator() {
00027 }
00028 
00029 Hss1394Enumerator::~Hss1394Enumerator() {
00030     qDebug() << "Deleting HSS1394 devices...";
00031     QListIterator<MidiDevice*> dev_it(m_devices);
00032     while (dev_it.hasNext()) {
00033         delete dev_it.next();
00034     }
00035     using namespace hss1394;
00036         Node::Shutdown();
00037 }
00038 
00039 // Enumerate the HSS1394 MIDI devices
00040 QList<MidiDevice*> Hss1394Enumerator::queryDevices() {
00041     qDebug() << "Scanning HSS1394 devices:";
00042     using namespace hss1394;
00043 
00044     hss1394::uint uNodes = Node::Instance()->GetNodeCount();
00045     qDebug() << "   Nodes detected:" << uNodes;
00046 
00047     for(hss1394::uint i=0; i<40; i++) {
00048         TNodeInfo tNodeInfo;
00049         bool bInstalled;
00050                 if (true == Node::Instance()->GetNodeInfo(tNodeInfo, i, NULL, &bInstalled)) {
00051             QString message = QString("Node %1 (%2): Name = <%3>, GUID = %4 %5, FW[%6]")
00052                 .arg(i)
00053                 .arg((bInstalled)?"installed":"not installed")
00054                 .arg(tNodeInfo.sName.c_str())
00055                 .arg(tNodeInfo.uGUID.mu32High, 0, 16)
00056                 .arg(tNodeInfo.uGUID.mu32Low, 0 ,16)
00057                 .arg(tNodeInfo.uProtocolVersion, 0, 16);
00058             qDebug() << " " << message;
00059             MidiDeviceHss1394 *currentDevice = new MidiDeviceHss1394(/*new MidiControlProcessor(NULL)*/ NULL,
00060                                                                           tNodeInfo,
00061                                                                           i);
00062             m_devices.push_back((MidiDevice*)currentDevice);
00063                 }
00064 
00065         }
00066 
00067     return m_devices;
00068 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines