Index: /branches/streaming-rework/configure.ac =================================================================== --- /branches/streaming-rework/configure.ac (revision 400) +++ /branches/streaming-rework/configure.ac (revision 404) @@ -203,7 +203,6 @@ dnl Conditional compilation of targets -dnl Build BeBoB code? - -build_bebob=true +dnl --- Build BeBoB code? + AC_ARG_ENABLE(bebob, AC_HELP_STRING([--enable-bebob], @@ -213,9 +212,9 @@ no) build_bebob=false;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-bebob) ;; -esac],[build_bebob=false]) - -dnl Build Motu code? - -build_motu=false +esac], +[build_bebob=true]) + +dnl --- Build Motu code? + AC_ARG_ENABLE(motu, AC_HELP_STRING([--enable-motu], @@ -225,9 +224,9 @@ no) build_motu=false;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-motu) ;; -esac],[build_motu=false]) - -dnl Build DICE code? - -build_dice=false +esac], +[build_motu=false]) + +dnl --- Build DICE code? + AC_ARG_ENABLE(dice, AC_HELP_STRING([--enable-dice], @@ -237,17 +236,54 @@ no) build_dice=false;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-dice) ;; -esac],[build_dice=false]) - -dnl Build Metric Halo code? - -build_metric_halo=false +esac], +[build_dice=false]) + +dnl --- Build Metric Halo code? + AC_ARG_ENABLE(metric-halo, AC_HELP_STRING([--enable-metric-halo], - [build Metric Halo support (default=no)]), + [build Metric Halo support (note: completely useless) (default=no)]), [case "${enableval}" in yes) build_metric_halo=true;; no) build_metric_halo=false;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-metric-halo) ;; -esac],[build_metric_halo=false]) +esac], +[build_metric_halo=false]) + +dnl --- Build Metric Halo code? + +AC_ARG_ENABLE(rme, + AC_HELP_STRING([--enable-rme], + [build RME support (note: completely useless) (default=no)]), +[case "${enableval}" in + yes) build_rme=true;; + no) build_rme=false;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-rme) ;; +esac], +[build_rme=false]) + +dnl --- Build Bounce device code? + +AC_ARG_ENABLE(bounce, + AC_HELP_STRING([--enable-bounce], + [build Bounce device support (default=no)]), +[case "${enableval}" in + yes) build_bounce=true;; + no) build_bounce=false;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-bounce) ;; +esac], +[build_bounce=false]) + +dnl --- Build support for all supported devices? + +AC_ARG_ENABLE(all-devices, + AC_HELP_STRING([--enable-all-devices], + [build support for all supported devices (default=no)]), +[case "${enableval}" in + yes) build_all=true;; + no) build_all=false;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-all-devices) ;; +esac], +[build_all=false]) @@ -264,8 +300,18 @@ dnl Device classes +if test "${build_all}" = true; then + build_bebob=true + build_motu=true + build_dice=true + build_metric_halo=true + build_bounce=true + build_rme=true +fi; + if test "${build_bebob}" = true; then CFLAGS="$CFLAGS -DENABLE_BEBOB" CXXFLAGS="$CXXFLAGS -DENABLE_BEBOB" supported_devices="${supported_devices}BeBoB " + BIN_PROGRAMS="$BIN_PROGRAMS freebob-downloader freebob-sync" fi; @@ -274,4 +320,5 @@ CXXFLAGS="$CXXFLAGS -DENABLE_MOTU" supported_devices="${supported_devices}Motu " + BIN_PROGRAMS="$BIN_PROGRAMS" fi; @@ -280,4 +327,5 @@ CXXFLAGS="$CXXFLAGS -DENABLE_DICE" supported_devices="${supported_devices}DICE " + BIN_PROGRAMS="$BIN_PROGRAMS" fi; @@ -285,5 +333,20 @@ CFLAGS="$CFLAGS -DENABLE_METRIC_HALO" CXXFLAGS="$CXXFLAGS -DENABLE_METRIC_HALO" - supported_devices="${supported_devices}Metric Halo " + supported_devices="${supported_devices}Metric Halo (useless) " + BIN_PROGRAMS="$BIN_PROGRAMS" +fi; + +if test "${build_bounce}" = true; then + CFLAGS="$CFLAGS -DENABLE_BOUNCE" + CXXFLAGS="$CXXFLAGS -DENABLE_BOUNCE" + supported_devices="${supported_devices}Bounce " + BIN_PROGRAMS="$BIN_PROGRAMS" +fi; + +if test "${build_rme}" = true; then + CFLAGS="$CFLAGS -DENABLE_RME" + CXXFLAGS="$CXXFLAGS -DENABLE_RME" + supported_devices="${supported_devices}RME (useless) " + BIN_PROGRAMS="$BIN_PROGRAMS" fi; @@ -312,4 +375,6 @@ AC_SUBST([LIBXML_CFLAGS]) +AC_SUBST([BIN_PROGRAMS]) + AC_CONFIG_FILES([Makefile doc/Makefile Index: /branches/streaming-rework/src/libstreaming/MotuPort.h =================================================================== --- /branches/streaming-rework/src/libstreaming/MotuPort.h (revision 312) +++ /branches/streaming-rework/src/libstreaming/MotuPort.h (revision 404) @@ -26,4 +26,7 @@ * */ + +#ifdef ENABLE_MOTU + #ifndef __FREEBOB_MOTUPORT__ #define __FREEBOB_MOTUPORT__ @@ -118,3 +121,4 @@ #endif /* __FREEBOB_MOTUPORT__ */ +#endif //#ifdef ENABLE_MOTU Index: /branches/streaming-rework/src/libstreaming/MotuPortInfo.cpp =================================================================== --- /branches/streaming-rework/src/libstreaming/MotuPortInfo.cpp (revision 246) +++ /branches/streaming-rework/src/libstreaming/MotuPortInfo.cpp (revision 404) @@ -26,8 +26,9 @@ * */ + +#ifdef ENABLE_MOTU #include "MotuPortInfo.h" #include - namespace FreebobStreaming { @@ -35,2 +36,4 @@ } // end of namespace FreebobStreaming + +#endif //#ifdef ENABLE_MOTU Index: /branches/streaming-rework/src/libstreaming/MotuPortInfo.h =================================================================== --- /branches/streaming-rework/src/libstreaming/MotuPortInfo.h (revision 265) +++ /branches/streaming-rework/src/libstreaming/MotuPortInfo.h (revision 404) @@ -26,4 +26,6 @@ * */ +#ifdef ENABLE_MOTU + #ifndef __FREEBOB_MOTUPORTINFO__ #define __FREEBOB_MOTUPORTINFO__ @@ -91,3 +93,4 @@ #endif /* __FREEBOB_MOTUPORTINFO__ */ +#endif //#ifdef ENABLE_MOTU Index: /branches/streaming-rework/src/libstreaming/AmdtpPort.cpp =================================================================== --- /branches/streaming-rework/src/libstreaming/AmdtpPort.cpp (revision 228) +++ /branches/streaming-rework/src/libstreaming/AmdtpPort.cpp (revision 404) @@ -26,4 +26,23 @@ * */ +#ifdef ENABLE_BEBOB + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_DICE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_BOUNCE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_AMDTP_SP #include "AmdtpPort.h" @@ -33,2 +52,4 @@ } // end of namespace FreebobStreaming + +#endif // #ifdef ENABLE_AMDTP_SP Index: /branches/streaming-rework/src/libstreaming/AmdtpPort.h =================================================================== --- /branches/streaming-rework/src/libstreaming/AmdtpPort.h (revision 228) +++ /branches/streaming-rework/src/libstreaming/AmdtpPort.h (revision 404) @@ -26,4 +26,24 @@ * */ +#ifdef ENABLE_BEBOB + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_DICE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_BOUNCE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_AMDTP_SP + #ifndef __FREEBOB_AMDTPPORT__ #define __FREEBOB_AMDTPPORT__ @@ -100,3 +120,3 @@ #endif /* __FREEBOB_AMDTPPORT__ */ - +#endif // #ifdef ENABLE_AMDTP_SP Index: /branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.cpp =================================================================== --- /branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.cpp (revision 402) +++ /branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.cpp (revision 404) @@ -7,5 +7,5 @@ * http://freebob.sf.net * - * Copyright (C) 2005,2006 Pieter Palmers + * Copyright (C) 2005,2006,2007 Pieter Palmers * * This program is free software {} you can redistribute it and/or modify @@ -26,4 +26,24 @@ * */ + +#ifdef ENABLE_BEBOB + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_DICE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_BOUNCE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_AMDTP_SP #include "AmdtpStreamProcessor.h" @@ -1421,2 +1441,4 @@ } // end of namespace FreebobStreaming + +#endif // #ifdef ENABLE_AMDTP_SP Index: /branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.h =================================================================== --- /branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.h (revision 402) +++ /branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.h (revision 404) @@ -7,5 +7,5 @@ * http://freebob.sf.net * - * Copyright (C) 2005,2006 Pieter Palmers + * Copyright (C) 2005,2006,2007 Pieter Palmers * * This program is free software {} you can redistribute it and/or modify @@ -26,4 +26,24 @@ * */ +#ifdef ENABLE_BEBOB + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_DICE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_BOUNCE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_AMDTP_SP + #ifndef __FREEBOB_AMDTPSTREAMPROCESSOR__ #define __FREEBOB_AMDTPSTREAMPROCESSOR__ @@ -215,3 +235,4 @@ #endif /* __FREEBOB_AMDTPSTREAMPROCESSOR__ */ - +#endif // #ifdef ENABLE_AMDTP_SP + Index: /branches/streaming-rework/src/libstreaming/AmdtpPortInfo.cpp =================================================================== --- /branches/streaming-rework/src/libstreaming/AmdtpPortInfo.cpp (revision 221) +++ /branches/streaming-rework/src/libstreaming/AmdtpPortInfo.cpp (revision 404) @@ -7,5 +7,5 @@ * http://freebob.sf.net * - * Copyright (C) 2005,2006 Pieter Palmers + * Copyright (C) 2005,2006,2007 Pieter Palmers * * This program is free software {} you can redistribute it and/or modify @@ -27,4 +27,24 @@ */ +#ifdef ENABLE_BEBOB + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_DICE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_BOUNCE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_AMDTP_SP + #include "AmdtpPortInfo.h" #include @@ -35,2 +55,4 @@ } // end of namespace FreebobStreaming + +#endif // #ifdef ENABLE_AMDTP_SP Index: /branches/streaming-rework/src/libstreaming/MotuPort.cpp =================================================================== --- /branches/streaming-rework/src/libstreaming/MotuPort.cpp (revision 246) +++ /branches/streaming-rework/src/libstreaming/MotuPort.cpp (revision 404) @@ -27,4 +27,6 @@ */ +#ifdef ENABLE_MOTU + #include "MotuPort.h" #include @@ -33,2 +35,4 @@ } // end of namespace FreebobStreaming + +#endif //#ifdef ENABLE_MOTU Index: /branches/streaming-rework/src/libstreaming/AmdtpPortInfo.h =================================================================== --- /branches/streaming-rework/src/libstreaming/AmdtpPortInfo.h (revision 246) +++ /branches/streaming-rework/src/libstreaming/AmdtpPortInfo.h (revision 404) @@ -7,5 +7,5 @@ * http://freebob.sf.net * - * Copyright (C) 2005,2006 Pieter Palmers + * Copyright (C) 2005,2006,2007 Pieter Palmers * * This program is free software {} you can redistribute it and/or modify @@ -26,4 +26,25 @@ * */ + +#ifdef ENABLE_BEBOB + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_DICE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_BOUNCE + #ifndef ENABLE_AMDTP_SP + #define ENABLE_AMDTP_SP + #endif +#endif + +#ifdef ENABLE_AMDTP_SP + #ifndef __FREEBOB_AMDTPPORTINFO__ #define __FREEBOB_AMDTPPORTINFO__ @@ -87,3 +108,3 @@ #endif /* __FREEBOB_AMDTPPORTINFO__ */ - +#endif // #ifdef ENABLE_AMDTP_SP Index: /branches/streaming-rework/src/rme/rme_avdevice.h =================================================================== --- /branches/streaming-rework/src/rme/rme_avdevice.h (revision 336) +++ /branches/streaming-rework/src/rme/rme_avdevice.h (revision 404) @@ -1,5 +1,5 @@ /* rme_avdevice.h * Copyright (C) 2006 Jonathan Woithe - * Copyright (C) 2006 by Pieter Palmers + * Copyright (C) 2006,2007 by Pieter Palmers * * This file is part of FreeBob. @@ -20,4 +20,6 @@ */ +#ifdef ENABLE_RME + #ifndef RMEDEVICE_H #define RMEDEVICE_H @@ -36,10 +38,14 @@ namespace Rme { +// struct to define the supported devices +struct VendorModelEntry { + unsigned int vendor_id; + unsigned int model_id; + char *vendor_name; + char *model_name; +}; + class RmeDevice : public IAvDevice { public: - enum ERmeModel { - RME_MODEL_NONE = 0x0000, - RME_MODEL_FIREFACE800 = 0x0001, - }; RmeDevice( std::auto_ptr( configRom ), @@ -80,5 +86,6 @@ Ieee1394Service* m_1394Service; - signed int m_rme_model; + struct VendorModelEntry *m_model; + int m_nodeId; int m_verboseLevel; @@ -102,15 +109,4 @@ signed int WriteRegister(unsigned int reg, quadlet_t data); - // IEEE1394 Vendor IDs. One would expect only RME, but you never - // know if a clone might appear some day. - enum EVendorId { - RME_VENDOR_RME = 0x00000a35, - }; - - // IEEE1394 Model IDs for different RME hardware - enum EUnitVersionId { - RME_MODELID_FIREFACE800 = 0x00101800, - }; - // debug support DECLARE_DEBUG_MODULE; @@ -120,2 +116,4 @@ #endif + +#endif //#ifdef ENABLE_RME Index: /branches/streaming-rework/src/rme/rme_avdevice.cpp =================================================================== --- /branches/streaming-rework/src/rme/rme_avdevice.cpp (revision 386) +++ /branches/streaming-rework/src/rme/rme_avdevice.cpp (revision 404) @@ -1,5 +1,5 @@ /* rme_avdevice.cpp * Copyright (C) 2006 by Jonathan Woithe - * Copyright (C) 2006 by Pieter Palmers + * Copyright (C) 2006,2007 by Pieter Palmers * * This file is part of FreeBob. @@ -20,4 +20,7 @@ */ +#ifdef ENABLE_RME +#warning RME support is currently useless (detection only) + #include "rme/rme_avdevice.h" #include "configrom.h" @@ -44,5 +47,9 @@ IMPL_DEBUG_MODULE( RmeDevice, RmeDevice, DEBUG_LEVEL_NORMAL ); -char *rme_modelname[] = {"[unknown]","Fireface-800"}; +// to define the supported devices +static VendorModelEntry supportedDeviceList[] = +{ + {0x00000a35, 0x0001, "RME", "Fireface-800"}, // RME Fireface-800 +}; /* ======================================================================= */ @@ -102,5 +109,5 @@ : m_configRom( configRom ) , m_1394Service( &ieee1394service ) - , m_rme_model( RME_MODEL_NONE ) + , m_model( NULL ) , m_nodeId( nodeId ) , m_verboseLevel( verboseLevel ) @@ -144,15 +151,4 @@ } -struct VendorModelEntry { - unsigned int vendor_id; - unsigned int model_id; -}; - -static VendorModelEntry supportedDeviceList[] = -{ - {0x00000a35, 0x0001}, // RME Fireface-800 - -}; - bool RmeDevice::probe( ConfigRom& configRom ) @@ -179,19 +175,26 @@ RmeDevice::discover() { - // Find out if this device is one we know about - if (m_configRom->getUnitSpecifierId() == RME_VENDOR_RME) { - switch (m_configRom->getModelId()) { - case RME_MODELID_FIREFACE800: - m_rme_model = RME_MODEL_FIREFACE800; - break; - } + unsigned int vendorId = m_configRom->getNodeVendorId(); + unsigned int modelId = m_configRom->getModelId(); + + for ( unsigned int i = 0; + i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); + ++i ) + { + if ( ( supportedDeviceList[i].vendor_id == vendorId ) + && ( supportedDeviceList[i].model_id == modelId ) + ) + { + m_model = &(supportedDeviceList[i]); } - if (m_rme_model != RME_MODEL_NONE) { - debugOutput( DEBUG_LEVEL_VERBOSE, "found RME %s\n", - rme_modelname[m_rme_model]); - return true; - } - - return false; + } + + if (m_model != NULL) { + debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", + m_model->vendor_name, m_model->model_name); + return true; + } + + return false; } @@ -225,5 +228,5 @@ { debugOutput(DEBUG_LEVEL_VERBOSE, - "RME %s at node %d\n", rme_modelname[m_rme_model], + "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, m_nodeId); } @@ -547,2 +550,4 @@ } + +#endif //#ifdef ENABLE_RME Index: /branches/streaming-rework/src/motu/motu_avdevice.h =================================================================== --- /branches/streaming-rework/src/motu/motu_avdevice.h (revision 384) +++ /branches/streaming-rework/src/motu/motu_avdevice.h (revision 404) @@ -75,11 +75,22 @@ namespace Motu { -class MotuDevice : public IAvDevice { -public: - enum EMotuModel { +enum EMotuModel { MOTUFW_MODEL_NONE = 0x0000, MOTUFW_MODEL_828mkII = 0x0001, MOTUFW_MODEL_TRAVELER = 0x0002, - }; +}; + +struct VendorModelEntry { + unsigned int vendor_id; + unsigned int model_id; + unsigned int unit_version; + unsigned int unit_specifier_id; + enum EMotuModel model; + char *vendor_name; + char *model_name; +}; + +class MotuDevice : public IAvDevice { +public: MotuDevice( std::auto_ptr( configRom ), @@ -123,4 +134,5 @@ signed int m_motu_model; + struct VendorModelEntry * m_model; int m_nodeId; int m_verboseLevel; @@ -144,16 +156,4 @@ signed int WriteRegister(unsigned int reg, quadlet_t data); - // IEEE1394 Vendor IDs. One would expect only MOTU, but you never - // know if a clone might appear some day. - enum EVendorId { - MOTUFW_VENDOR_MOTU = 0x000001f2, - }; - - // IEEE1394 Unit directory version IDs for different MOTU hardware - enum EUnitVersionId { - MOTUFW_UNITVER_828mkII = 0x00000003, - MOTUFW_UNITVER_TRAVELER = 0x00000009, - }; - // debug support DECLARE_DEBUG_MODULE; Index: /branches/streaming-rework/src/motu/motu_avdevice.cpp =================================================================== --- /branches/streaming-rework/src/motu/motu_avdevice.cpp (revision 402) +++ /branches/streaming-rework/src/motu/motu_avdevice.cpp (revision 404) @@ -1,4 +1,4 @@ /* motu_avdevice.cpp - * Copyright (C) 2006 by Pieter Palmers + * Copyright (C) 2006,2007 by Pieter Palmers * Copyright (C) 2006 by Jonathan Woithe * @@ -46,5 +46,11 @@ IMPL_DEBUG_MODULE( MotuDevice, MotuDevice, DEBUG_LEVEL_NORMAL ); -char *motufw_modelname[] = {"[unknown]","828MkII", "Traveler"}; +// to define the supported devices +static VendorModelEntry supportedDeviceList[] = +{ +// {vendor_id, model_id, unit_version, unit_specifier_id, model, vendor_name,model_name} + {0x000001f2, 0, 0x00000003, 0x000001f2, MOTUFW_MODEL_828mkII, "MOTU", "828MkII"}, + {0x000001f2, 0, 0x00000009, 0x000001f2, MOTUFW_MODEL_TRAVELER, "MOTU", "Traveler"}, +}; /* ======================================================================= */ @@ -145,20 +151,11 @@ } -struct VendorModelEntry { - unsigned int vendor_id; - unsigned int model_id; -}; - -static VendorModelEntry supportedDeviceList[] = -{ - {0x0001f2, 0x00000000}, // Motu device, model entry not used - -}; - bool MotuDevice::probe( ConfigRom& configRom ) { unsigned int vendorId = configRom.getNodeVendorId(); - unsigned int modelId = configRom.getModelId(); +// unsigned int modelId = configRom.getModelId(); + unsigned int unitVersion = configRom.getUnitVersion(); + unsigned int unitSpecifierId = configRom.getUnitSpecifierId(); for ( unsigned int i = 0; @@ -167,13 +164,10 @@ { if ( ( supportedDeviceList[i].vendor_id == vendorId ) - //&& ( supportedDeviceList[i].model_id == modelId ) - ) +// && ( supportedDeviceList[i].model_id == modelId ) + && ( supportedDeviceList[i].unit_version == unitVersion ) + && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) + ) { - switch (configRom.getUnitVersion()) { - case MOTUFW_UNITVER_828mkII: - return true; - case MOTUFW_UNITVER_TRAVELER: - return true; - } + return true; } } @@ -185,23 +179,31 @@ MotuDevice::discover() { - // Find out if this device is one we know about - if (m_configRom->getUnitSpecifierId() == MOTUFW_VENDOR_MOTU) { - switch (m_configRom->getUnitVersion()) { - case MOTUFW_UNITVER_828mkII: - m_motu_model = MOTUFW_MODEL_828mkII; - break; - case MOTUFW_UNITVER_TRAVELER: - m_motu_model = MOTUFW_MODEL_TRAVELER; - break; - } + unsigned int vendorId = m_configRom->getNodeVendorId(); +// unsigned int modelId = m_configRom->getModelId(); + unsigned int unitVersion = m_configRom->getUnitVersion(); + unsigned int unitSpecifierId = m_configRom->getUnitSpecifierId(); + + for ( unsigned int i = 0; + i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); + ++i ) + { + if ( ( supportedDeviceList[i].vendor_id == vendorId ) +// && ( supportedDeviceList[i].model_id == modelId ) + && ( supportedDeviceList[i].unit_version == unitVersion ) + && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) + ) + { + m_model = &(supportedDeviceList[i]); + m_motu_model=supportedDeviceList[i].model; } - - if (m_motu_model != MOTUFW_MODEL_NONE) { - debugOutput( DEBUG_LEVEL_VERBOSE, "found MOTU %s\n", - motufw_modelname[m_motu_model]); - return true; - } - - return false; + } + + if (m_model != NULL) { + debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", + m_model->vendor_name, m_model->model_name); + return true; + } + + return false; } @@ -364,7 +366,7 @@ MotuDevice::showDevice() const { - debugOutput(DEBUG_LEVEL_VERBOSE, - "MOTU %s at node %d\n", motufw_modelname[m_motu_model], - m_nodeId); + debugOutput(DEBUG_LEVEL_VERBOSE, + "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, + m_nodeId); } Index: /branches/streaming-rework/src/metrichalo/mh_avdevice.h =================================================================== --- /branches/streaming-rework/src/metrichalo/mh_avdevice.h (revision 404) +++ /branches/streaming-rework/src/metrichalo/mh_avdevice.h (revision 404) @@ -0,0 +1,103 @@ +/* mh_avdevice.h + * Copyright (C) 2007 by Pieter Palmers + * + * This file is part of FreeBob. + * + * FreeBob is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * FreeBob is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FreeBob; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA. + */ + +#ifdef ENABLE_METRIC_HALO + +#ifndef MHDEVICE_H +#define MHDEVICE_H + +#include "iavdevice.h" + +#include "debugmodule/debugmodule.h" +#include "libfreebobavc/avc_definitions.h" +#include "libfreebob/xmlparser.h" + +// #include "libstreaming/MHStreamProcessor.h" + +class ConfigRom; +class Ieee1394Service; + +namespace MetricHalo { + +// struct to define the supported devices +struct VendorModelEntry { + unsigned int vendor_id; + unsigned int model_id; + char *vendor_name; + char *model_name; +}; + +class MHAvDevice : public IAvDevice { +public: + MHAvDevice( std::auto_ptr( configRom ), + Ieee1394Service& ieee1394Service, + int nodeId, + int verboseLevel ); + virtual ~MHAvDevice(); + + static bool probe( ConfigRom& configRom ); + virtual bool discover(); + virtual ConfigRom& getConfigRom() const; + + // obsolete, will be removed soon, unused + virtual bool addXmlDescription( xmlNodePtr deviceNode ) {return true;}; + + virtual void showDevice() const; + + virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); + virtual int getSamplingFrequency( ); + + virtual bool setId(unsigned int id); + + virtual int getStreamCount(); + virtual FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i); + + virtual bool prepare(); + + virtual int startStreamByIndex(int i); + virtual int stopStreamByIndex(int i); + + signed int getIsoRecvChannel(void); + signed int getIsoSendChannel(void); + +protected: + std::auto_ptr( m_configRom ); + Ieee1394Service* m_1394Service; + + struct VendorModelEntry *m_model; + + int m_nodeId; + int m_verboseLevel; + signed int m_id; + signed int m_iso_recv_channel, m_iso_send_channel; + +// FreebobStreaming::MHReceiveStreamProcessor *m_receiveProcessor; +// FreebobStreaming::MHTransmitStreamProcessor *m_transmitProcessor; + +private: + // debug support + DECLARE_DEBUG_MODULE; +}; + +} + +#endif + +#endif //#ifdef ENABLE_MH Index: /branches/streaming-rework/src/metrichalo/mh_avdevice.cpp =================================================================== --- /branches/streaming-rework/src/metrichalo/mh_avdevice.cpp (revision 404) +++ /branches/streaming-rework/src/metrichalo/mh_avdevice.cpp (revision 404) @@ -0,0 +1,242 @@ +/* mh_avdevice.cpp + * Copyright (C) 2007 by Pieter Palmers + * + * This file is part of FreeBob. + * + * FreeBob is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * FreeBob is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FreeBob; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA. + */ + +#ifdef ENABLE_METRIC_HALO +#warning Metric Halo support is currently useless + +#include "metrichalo/mh_avdevice.h" +#include "configrom.h" + +#include "libfreebobavc/ieee1394service.h" +#include "libfreebobavc/avc_definitions.h" + +#include "debugmodule/debugmodule.h" + +#include +#include +#include +#include + +#include + +namespace MetricHalo { + +IMPL_DEBUG_MODULE( MHAvDevice, MHAvDevice, DEBUG_LEVEL_NORMAL ); + +// to define the supported devices +static VendorModelEntry supportedDeviceList[] = +{ + {0x00000000, 0x0000, "Metric Halo", "XXX"}, +}; + +MHAvDevice::MHAvDevice( std::auto_ptr< ConfigRom >( configRom ), + Ieee1394Service& ieee1394service, + int nodeId, + int verboseLevel ) + : m_configRom( configRom ) + , m_1394Service( &ieee1394service ) + , m_model( NULL ) + , m_nodeId( nodeId ) + , m_verboseLevel( verboseLevel ) + , m_id(0) + , m_iso_recv_channel ( -1 ) + , m_iso_send_channel ( -1 ) + +{ + setDebugLevel( verboseLevel ); + + debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::MHAvDevice (NodeID %d)\n", + nodeId ); + +} + +MHAvDevice::~MHAvDevice() +{ + +} + +ConfigRom& +MHAvDevice::getConfigRom() const +{ + return *m_configRom; +} + +bool +MHAvDevice::probe( ConfigRom& configRom ) +{ + unsigned int vendorId = configRom.getNodeVendorId(); + unsigned int modelId = configRom.getModelId(); + + for ( unsigned int i = 0; + i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); + ++i ) + { + if ( ( supportedDeviceList[i].vendor_id == vendorId ) + && ( supportedDeviceList[i].model_id == modelId ) + ) + { + return true; + } + } + + return false; +} + +bool +MHAvDevice::discover() +{ + unsigned int vendorId = m_configRom->getNodeVendorId(); + unsigned int modelId = m_configRom->getModelId(); + + for ( unsigned int i = 0; + i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); + ++i ) + { + if ( ( supportedDeviceList[i].vendor_id == vendorId ) + && ( supportedDeviceList[i].model_id == modelId ) + ) + { + m_model = &(supportedDeviceList[i]); + } + } + + if (m_model != NULL) { + debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", + m_model->vendor_name, m_model->model_name); + return true; + } + + return false; +} + +int +MHAvDevice::getSamplingFrequency( ) { + return 0; +} + +bool +MHAvDevice::setSamplingFrequency( ESamplingFrequency samplingFrequency ) +{ + + return false; +} + +bool MHAvDevice::setId( unsigned int id) { + debugOutput( DEBUG_LEVEL_VERBOSE, "Set id to %d...\n", id); + m_id=id; + return true; +} + +void +MHAvDevice::showDevice() const +{ + debugOutput(DEBUG_LEVEL_VERBOSE, + "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, + m_nodeId); +} + +bool +MHAvDevice::prepare() { + + return true; +} + +int +MHAvDevice::getStreamCount() { + return 0; // one receive, one transmit +} + +FreebobStreaming::StreamProcessor * +MHAvDevice::getStreamProcessorByIndex(int i) { + +// switch (i) { +// case 0: +// return m_receiveProcessor; +// case 1: +// return m_transmitProcessor; +// default: +// return NULL; +// } +// return 0; + return NULL; +} + +int +MHAvDevice::startStreamByIndex(int i) { + + // NOTE: this assumes that you have two streams + switch (i) { + case 0: + // TODO: do the stuff that is nescessary to make the device + // transmit a stream + + // Set the streamprocessor channel to the one obtained by + // the connection management +// m_receiveProcessor->setChannel(m_iso_recv_channel); + + break; + case 1: + // TODO: do the stuff that is nescessary to make the device + // receive a stream + + // Set the streamprocessor channel to the one obtained by + // the connection management +// m_transmitProcessor->setChannel(m_iso_send_channel); + + break; + + default: // Invalid stream index + return -1; + } + + return 0; +} + +int +MHAvDevice::stopStreamByIndex(int i) { + + // TODO: connection management: break connection + // cfr the start function + + // NOTE: this assumes that you have two streams + switch (i) { + case 0: + break; + case 1: + break; + + default: // Invalid stream index + return -1; + } + + return 0; +} + +signed int MHAvDevice::getIsoRecvChannel(void) { + return m_iso_recv_channel; +} + +signed int MHAvDevice::getIsoSendChannel(void) { + return m_iso_send_channel; +} + +} + +#endif //#ifdef ENABLE_METRIC_HALO Index: /branches/streaming-rework/src/dice/dice_avdevice.h =================================================================== --- /branches/streaming-rework/src/dice/dice_avdevice.h (revision 404) +++ /branches/streaming-rework/src/dice/dice_avdevice.h (revision 404) @@ -0,0 +1,103 @@ +/* mh_avdevice.h + * Copyright (C) 2007 by Pieter Palmers + * + * This file is part of FreeBob. + * + * FreeBob is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * FreeBob is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FreeBob; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA. + */ + +#ifdef ENABLE_DICE + +#ifndef DICEDEVICE_H +#define DICEDEVICE_H + +#include "iavdevice.h" + +#include "debugmodule/debugmodule.h" +#include "libfreebobavc/avc_definitions.h" +#include "libfreebob/xmlparser.h" + +#include "libstreaming/AmdtpStreamProcessor.h" + +class ConfigRom; +class Ieee1394Service; + +namespace Dice { + +// struct to define the supported devices +struct VendorModelEntry { + unsigned int vendor_id; + unsigned int model_id; + char *vendor_name; + char *model_name; +}; + +class DiceAvDevice : public IAvDevice { +public: + DiceAvDevice( std::auto_ptr( configRom ), + Ieee1394Service& ieee1394Service, + int nodeId, + int verboseLevel ); + virtual ~DiceAvDevice(); + + static bool probe( ConfigRom& configRom ); + virtual bool discover(); + virtual ConfigRom& getConfigRom() const; + + // obsolete, will be removed soon, unused + virtual bool addXmlDescription( xmlNodePtr deviceNode ) {return true;}; + + virtual void showDevice() const; + + virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); + virtual int getSamplingFrequency( ); + + virtual bool setId(unsigned int id); + + virtual int getStreamCount(); + virtual FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i); + + virtual bool prepare(); + + virtual int startStreamByIndex(int i); + virtual int stopStreamByIndex(int i); + + signed int getIsoRecvChannel(void); + signed int getIsoSendChannel(void); + +protected: + std::auto_ptr( m_configRom ); + Ieee1394Service* m_1394Service; + + struct VendorModelEntry *m_model; + + int m_nodeId; + int m_verboseLevel; + signed int m_id; + signed int m_iso_recv_channel, m_iso_send_channel; + + FreebobStreaming::AmdtpReceiveStreamProcessor *m_receiveProcessor; + FreebobStreaming::AmdtpTransmitStreamProcessor *m_transmitProcessor; + +private: + // debug support + DECLARE_DEBUG_MODULE; +}; + +} + +#endif + +#endif //#ifdef ENABLE_DICE Index: /branches/streaming-rework/src/dice/dice_avdevice.cpp =================================================================== --- /branches/streaming-rework/src/dice/dice_avdevice.cpp (revision 404) +++ /branches/streaming-rework/src/dice/dice_avdevice.cpp (revision 404) @@ -0,0 +1,244 @@ +/* dice_avdevice.cpp + * Copyright (C) 2007 by Pieter Palmers + * + * This file is part of FreeBob. + * + * FreeBob is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * FreeBob is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FreeBob; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA. + */ + +#ifdef ENABLE_DICE +#warning DICE support is currently useless + +#include "dice/dice_avdevice.h" +#include "configrom.h" + +#include "libfreebobavc/ieee1394service.h" +#include "libfreebobavc/avc_definitions.h" + +#include "debugmodule/debugmodule.h" + +#include +#include +#include +#include + +#include + +#include "libstreaming/AmdtpStreamProcessor.h" + +namespace Dice { + +IMPL_DEBUG_MODULE( DiceAvDevice, DiceAvDevice, DEBUG_LEVEL_NORMAL ); + +// to define the supported devices +static VendorModelEntry supportedDeviceList[] = +{ + {0x00000000, 0x0000, "DICE VENDOR", "XXX"}, +}; + +DiceAvDevice::DiceAvDevice( std::auto_ptr< ConfigRom >( configRom ), + Ieee1394Service& ieee1394service, + int nodeId, + int verboseLevel ) + : m_configRom( configRom ) + , m_1394Service( &ieee1394service ) + , m_model( NULL ) + , m_nodeId( nodeId ) + , m_verboseLevel( verboseLevel ) + , m_id(0) + , m_iso_recv_channel ( -1 ) + , m_iso_send_channel ( -1 ) + +{ + setDebugLevel( verboseLevel ); + + debugOutput( DEBUG_LEVEL_VERBOSE, "Created Dice::DiceAvDevice (NodeID %d)\n", + nodeId ); + +} + +DiceAvDevice::~DiceAvDevice() +{ + +} + +ConfigRom& +DiceAvDevice::getConfigRom() const +{ + return *m_configRom; +} + +bool +DiceAvDevice::probe( ConfigRom& configRom ) +{ + unsigned int vendorId = configRom.getNodeVendorId(); + unsigned int modelId = configRom.getModelId(); + + for ( unsigned int i = 0; + i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); + ++i ) + { + if ( ( supportedDeviceList[i].vendor_id == vendorId ) + && ( supportedDeviceList[i].model_id == modelId ) + ) + { + return true; + } + } + + return false; +} + +bool +DiceAvDevice::discover() +{ + unsigned int vendorId = m_configRom->getNodeVendorId(); + unsigned int modelId = m_configRom->getModelId(); + + for ( unsigned int i = 0; + i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); + ++i ) + { + if ( ( supportedDeviceList[i].vendor_id == vendorId ) + && ( supportedDeviceList[i].model_id == modelId ) + ) + { + m_model = &(supportedDeviceList[i]); + } + } + + if (m_model != NULL) { + debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", + m_model->vendor_name, m_model->model_name); + return true; + } + + return false; +} + +int +DiceAvDevice::getSamplingFrequency( ) { + return 0; +} + +bool +DiceAvDevice::setSamplingFrequency( ESamplingFrequency samplingFrequency ) +{ + + return false; +} + +bool DiceAvDevice::setId( unsigned int id) { + debugOutput( DEBUG_LEVEL_VERBOSE, "Set id to %d...\n", id); + m_id=id; + return true; +} + +void +DiceAvDevice::showDevice() const +{ + debugOutput(DEBUG_LEVEL_VERBOSE, + "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, + m_nodeId); +} + +bool +DiceAvDevice::prepare() { + + return true; +} + +int +DiceAvDevice::getStreamCount() { + return 0; // one receive, one transmit +} + +FreebobStreaming::StreamProcessor * +DiceAvDevice::getStreamProcessorByIndex(int i) { + +// switch (i) { +// case 0: +// return m_receiveProcessor; +// case 1: +// return m_transmitProcessor; +// default: +// return NULL; +// } +// return 0; + return NULL; +} + +int +DiceAvDevice::startStreamByIndex(int i) { + + // NOTE: this assumes that you have two streams + switch (i) { + case 0: + // TODO: do the stuff that is nescessary to make the device + // transmit a stream + + // Set the streamprocessor channel to the one obtained by + // the connection management +// m_receiveProcessor->setChannel(m_iso_recv_channel); + + break; + case 1: + // TODO: do the stuff that is nescessary to make the device + // receive a stream + + // Set the streamprocessor channel to the one obtained by + // the connection management +// m_transmitProcessor->setChannel(m_iso_send_channel); + + break; + + default: // Invalid stream index + return -1; + } + + return 0; +} + +int +DiceAvDevice::stopStreamByIndex(int i) { + + // TODO: connection management: break connection + // cfr the start function + + // NOTE: this assumes that you have two streams + switch (i) { + case 0: + break; + case 1: + break; + + default: // Invalid stream index + return -1; + } + + return 0; +} + +signed int DiceAvDevice::getIsoRecvChannel(void) { + return m_iso_recv_channel; +} + +signed int DiceAvDevice::getIsoSendChannel(void) { + return m_iso_send_channel; +} + +} + +#endif //#ifdef ENABLE_DICE Index: /branches/streaming-rework/src/bebob/bebob_functionblock.h =================================================================== --- /branches/streaming-rework/src/bebob/bebob_functionblock.h (revision 378) +++ /branches/streaming-rework/src/bebob/bebob_functionblock.h (revision 404) @@ -19,4 +19,6 @@ */ +#ifdef ENABLE_BEBOB + #ifndef BEBOB_FUNCTION_BLOCK_H #define BEBOB_FUNCTION_BLOCK_H @@ -218,2 +220,4 @@ #endif + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_avdevice_xml.cpp =================================================================== --- /branches/streaming-rework/src/bebob/bebob_avdevice_xml.cpp (revision 336) +++ /branches/streaming-rework/src/bebob/bebob_avdevice_xml.cpp (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB // AvDevice XML stuff @@ -120,2 +122,4 @@ } + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_dl_bcd.cpp =================================================================== --- /branches/streaming-rework/src/bebob/bebob_dl_bcd.cpp (revision 336) +++ /branches/streaming-rework/src/bebob/bebob_dl_bcd.cpp (revision 404) @@ -19,4 +19,6 @@ */ +#ifdef ENABLE_BEBOB + #include "bebob_dl_bcd.h" @@ -383,2 +385,3 @@ } +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_dl_mgr.h =================================================================== --- /branches/streaming-rework/src/bebob/bebob_dl_mgr.h (revision 336) +++ /branches/streaming-rework/src/bebob/bebob_dl_mgr.h (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB #ifndef BEBOB_DL_MGR_H @@ -125,2 +127,4 @@ #endif + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_dl_codes.cpp =================================================================== --- /branches/streaming-rework/src/bebob/bebob_dl_codes.cpp (revision 336) +++ /branches/streaming-rework/src/bebob/bebob_dl_codes.cpp (revision 404) @@ -19,4 +19,6 @@ */ +#ifdef ENABLE_BEBOB + #include "bebob/bebob_dl_codes.h" #include "bebob/bebob_dl_bcd.h" @@ -344,2 +346,4 @@ return result; } + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_dl_bcd.h =================================================================== --- /branches/streaming-rework/src/bebob/bebob_dl_bcd.h (revision 336) +++ /branches/streaming-rework/src/bebob/bebob_dl_bcd.h (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB #ifndef BEBOB_DL_BCD_H @@ -114,2 +116,4 @@ #endif + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_avplug_xml.cpp =================================================================== --- /branches/streaming-rework/src/bebob/bebob_avplug_xml.cpp (revision 375) +++ /branches/streaming-rework/src/bebob/bebob_avplug_xml.cpp (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB // AvPlug XML stuff @@ -298,2 +300,4 @@ } + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_dl_codes.h =================================================================== --- /branches/streaming-rework/src/bebob/bebob_dl_codes.h (revision 365) +++ /branches/streaming-rework/src/bebob/bebob_dl_codes.h (revision 404) @@ -19,4 +19,6 @@ */ +#ifdef ENABLE_BEBOB + #ifndef BEBOB_DL_CODES_H #define BEBOB_DL_CODES_H @@ -311,2 +313,4 @@ }; #endif + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_avdevice.cpp =================================================================== --- /branches/streaming-rework/src/bebob/bebob_avdevice.cpp (revision 396) +++ /branches/streaming-rework/src/bebob/bebob_avdevice.cpp (revision 404) @@ -19,4 +19,6 @@ */ +#ifdef ENABLE_BEBOB + #include "bebob/bebob_avdevice.h" #include "bebob/bebob_avdevice_subunit.h" @@ -39,4 +41,28 @@ IMPL_DEBUG_MODULE( AvDevice, AvDevice, DEBUG_LEVEL_NORMAL ); + +static VendorModelEntry supportedDeviceList[] = +{ + {0x00000f, 0x00010065, "Mackie", "Onyx Firewire"}, + + {0x0003db, 0x00010048, "Apogee Electronics", "Rosetta 200"}, + + {0x0007f5, 0x00010048, "BridgeCo", "RD Audio1"}, + + {0x000a92, 0x00010000, "PreSonus", "FIREBOX"}, + {0x000a92, 0x00010066, "PreSonus", "FirePOD"}, + + {0x000aac, 0x00000003, "TerraTec Electronic GmbH", "Phase 88 FW"}, + {0x000aac, 0x00000004, "TerraTec Electronic GmbH", "Phase X24 FW (model version 4)"}, + {0x000aac, 0x00000007, "TerraTec Electronic GmbH", "Phase X24 FW (model version 7)"}, + + {0x000f1b, 0x00010064, "ESI", "Quatafire 610"}, + + {0x00130e, 0x00000003, "Focusrite", "Saffire Pro26IO"}, + + {0x0040ab, 0x00010048, "EDIROL", "FA-101"}, + {0x0040ab, 0x00010049, "EDIROL", "FA-66"}, +}; + AvDevice::AvDevice( std::auto_ptr< ConfigRom >( configRom ), @@ -49,4 +75,6 @@ , m_pPlugManager( new AvPlugManager( verboseLevel ) ) , m_activeSyncInfo( 0 ) + , m_model ( NULL ) + , m_nodeId ( nodeId ) , m_id( 0 ) , m_receiveProcessor ( 0 ) @@ -66,4 +94,6 @@ , m_pPlugManager( 0 ) , m_activeSyncInfo( 0 ) + , m_model ( NULL ) + , m_nodeId ( -1 ) , m_id( 0 ) , m_receiveProcessor ( 0 ) @@ -108,32 +138,4 @@ } -struct VendorModelEntry { - unsigned int vendor_id; - unsigned int model_id; -}; - -static VendorModelEntry supportedDeviceList[] = -{ - {0x00000f, 0x00010065}, // Mackie, Onyx Firewire - - {0x0003db, 0x00010048}, // Apogee Electronics, Rosetta 200 - - {0x0007f5, 0x00010048}, // BridgeCo, RD Audio1 - - {0x000a92, 0x00010000}, // PreSonus FIREBOX - {0x000a92, 0x00010066}, // PreSonus FirePOD - - {0x000aac, 0x00000003}, // TerraTec Electronic GmbH, Phase 88 FW - {0x000aac, 0x00000004}, // TerraTec Electronic GmbH, Phase X24 FW (model version 4) - {0x000aac, 0x00000007}, // TerraTec Electronic GmbH, Phase X24 FW (model version 7) - - {0x000f1b, 0x00010064}, // ESI, Quatafire 610 - - {0x00130e, 0x00000003}, // Focusrite, Pro26IO (Saffire 26) - - {0x0040ab, 0x00010048}, // EDIROL, FA-101 - {0x0040ab, 0x00010049}, // EDIROL, FA-66 -}; - bool AvDevice::probe( ConfigRom& configRom ) @@ -159,4 +161,24 @@ AvDevice::discover() { + unsigned int vendorId = m_pConfigRom->getNodeVendorId(); + unsigned int modelId = m_pConfigRom->getModelId(); + + for ( unsigned int i = 0; + i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); + ++i ) + { + if ( ( supportedDeviceList[i].vendor_id == vendorId ) + && ( supportedDeviceList[i].model_id == modelId ) + ) + { + m_model = &(supportedDeviceList[i]); + } + } + + if (m_model != NULL) { + debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", + m_model->vendor_name, m_model->model_name); + } else return false; + if ( !enumerateSubUnits() ) { debugError( "Could not enumarate sub units\n" ); @@ -871,4 +893,8 @@ AvDevice::showDevice() const { + debugOutput(DEBUG_LEVEL_VERBOSE, + "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, + m_nodeId); + m_pPlugManager->showPlugs(); } @@ -1581,2 +1607,4 @@ } // end of namespace + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_avdevice.h =================================================================== --- /branches/streaming-rework/src/bebob/bebob_avdevice.h (revision 379) +++ /branches/streaming-rework/src/bebob/bebob_avdevice.h (revision 404) @@ -19,4 +19,6 @@ */ +#ifdef ENABLE_BEBOB + #ifndef BEBOB_AVDEVICE_H #define BEBOB_AVDEVICE_H @@ -47,4 +49,11 @@ namespace BeBoB { + +struct VendorModelEntry { + unsigned int vendor_id; + unsigned int model_id; + char *vendor_name; + char *model_name; +}; class AvDevice : public IAvDevice { @@ -171,4 +180,6 @@ SyncInfoVector m_syncInfos; SyncInfo* m_activeSyncInfo; + struct VendorModelEntry* m_model; + int m_nodeId; unsigned int m_id; @@ -186,2 +197,4 @@ #endif + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_avplug.cpp =================================================================== --- /branches/streaming-rework/src/bebob/bebob_avplug.cpp (revision 376) +++ /branches/streaming-rework/src/bebob/bebob_avplug.cpp (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB #include "bebob/bebob_avplug.h" @@ -2220,2 +2222,4 @@ } + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_avdevice_subunit.cpp =================================================================== --- /branches/streaming-rework/src/bebob/bebob_avdevice_subunit.cpp (revision 378) +++ /branches/streaming-rework/src/bebob/bebob_avdevice_subunit.cpp (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB #include "bebob/bebob_functionblock.h" @@ -586,2 +588,4 @@ return true; } + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_functionblock.cpp =================================================================== --- /branches/streaming-rework/src/bebob/bebob_functionblock.cpp (revision 378) +++ /branches/streaming-rework/src/bebob/bebob_functionblock.cpp (revision 404) @@ -19,4 +19,6 @@ */ +#ifdef ENABLE_BEBOB + #include "bebob/bebob_functionblock.h" #include "bebob/bebob_avdevice_subunit.h" @@ -551,2 +553,4 @@ return true; } + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_avplug.h =================================================================== --- /branches/streaming-rework/src/bebob/bebob_avplug.h (revision 376) +++ /branches/streaming-rework/src/bebob/bebob_avplug.h (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB #ifndef BEBOB_AVPLUG_H @@ -356,2 +358,4 @@ #endif + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_dl_mgr.cpp =================================================================== --- /branches/streaming-rework/src/bebob/bebob_dl_mgr.cpp (revision 365) +++ /branches/streaming-rework/src/bebob/bebob_dl_mgr.cpp (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB #include "bebob_dl_mgr.h" @@ -714,2 +716,4 @@ return false; } + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/bebob/bebob_avdevice_subunit.h =================================================================== --- /branches/streaming-rework/src/bebob/bebob_avdevice_subunit.h (revision 376) +++ /branches/streaming-rework/src/bebob/bebob_avdevice_subunit.h (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB #ifndef BEBOB_AVDEVICESUBUNIT_H @@ -154,2 +156,4 @@ #endif + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/Makefile.am =================================================================== --- /branches/streaming-rework/src/Makefile.am (revision 391) +++ /branches/streaming-rework/src/Makefile.am (revision 404) @@ -31,5 +31,7 @@ bebob/bebob_avdevice_subunit.h bebob/bebob_avplug.h bebob/bebob_dl_bcd.h bebob/bebob_dl_codes.h \ bebob/bebob_dl_mgr.h bebob/bebob_functionblock.h bounce/bounce_avdevice.h \ - maudio/maudio_avdevice.h motu/motu_avdevice.h rme/rme_avdevice.h libfreebobavc/avc_connect.h \ + maudio/maudio_avdevice.h motu/motu_avdevice.h rme/rme_avdevice.h \ + metrichalo/mh_avdevice.h dice/dice_avdevice.h \ + libfreebobavc/avc_connect.h \ libfreebobavc/avc_definitions.h libfreebobavc/avc_extended_cmd_generic.h \ libfreebobavc/avc_extended_plug_info.h libfreebobavc/avc_extended_stream_format.h \ @@ -65,5 +67,7 @@ bebob/bebob_functionblock.cpp \ bounce/bounce_avdevice.cpp \ + dice/dice_avdevice.cpp \ maudio/maudio_avdevice.cpp \ + metrichalo/mh_avdevice.cpp \ motu/motu_avdevice.cpp \ rme/rme_avdevice.cpp \ @@ -121,6 +125,7 @@ ############### -bin_PROGRAMS = freebob-downloader freebob-sync +bin_PROGRAMS = @BIN_PROGRAMS@ +EXTRA_PROGRAMS = freebob-downloader freebob-sync freebob_downloader_SOURCES = freebob-downloader.cpp freebob_downloader_LDADD = $(top_builddir)/src/libfreebob.la Index: /branches/streaming-rework/src/devicemanager.cpp =================================================================== --- /branches/streaming-rework/src/devicemanager.cpp (revision 384) +++ /branches/streaming-rework/src/devicemanager.cpp (revision 404) @@ -32,4 +32,6 @@ #include "rme/rme_avdevice.h" #include "maudio/maudio_avdevice.h" +#include "dice/dice_avdevice.h" +#include "metrichalo/mh_avdevice.h" #include @@ -149,22 +151,41 @@ int id, int level ) { +#ifdef ENABLE_BEBOB if ( BeBoB::AvDevice::probe( *configRom.get() ) ) { return new BeBoB::AvDevice( configRom, *m_1394Service, id, level ); } - -#ifdef ENABLE_MOTU +#endif + +#ifdef ENABLE_BEBOB if ( MAudio::AvDevice::probe( *configRom.get() ) ) { return new MAudio::AvDevice( configRom, *m_1394Service, id, level ); } - - +#endif + +#ifdef ENABLE_MOTU if ( Motu::MotuDevice::probe( *configRom.get() ) ) { return new Motu::MotuDevice( configRom, *m_1394Service, id, level ); } - +#endif + +#ifdef ENABLE_DICE + if ( Dice::DiceAvDevice::probe( *configRom.get() ) ) { + return new Dice::DiceAvDevice( configRom, *m_1394Service, id, level ); + } +#endif + +#ifdef ENABLE_METRIC_HALO + if ( MetricHalo::MHAvDevice::probe( *configRom.get() ) ) { + return new MetricHalo::MHAvDevice( configRom, *m_1394Service, id, level ); + } +#endif + +#ifdef ENABLE_RME if ( Rme::RmeDevice::probe( *configRom.get() ) ) { return new Rme::RmeDevice( configRom, *m_1394Service, id, level ); } - +#endif + +#ifdef ENABLE_BOUNCE if ( Bounce::BounceDevice::probe( *configRom.get() ) ) { return new Bounce::BounceDevice( configRom, *m_1394Service, id, level ); @@ -366,10 +387,15 @@ DeviceManager::saveCache( Glib::ustring fileName ) { - int i = 0; - for ( IAvDeviceVectorIterator it = m_avDevices.begin(); - it != m_avDevices.end(); - ++it ) - { - IAvDevice* pAvDevice = *it; + int i; + i=0; // avoids unused warning + + for ( IAvDeviceVectorIterator it = m_avDevices.begin(); + it != m_avDevices.end(); + ++it ) + { + IAvDevice* pAvDevice; + pAvDevice = *it; // avoids unused warning + + #ifdef ENABLE_BEBOB BeBoB::AvDevice* pBeBoBDevice = reinterpret_cast< BeBoB::AvDevice* >( pAvDevice ); if ( pBeBoBDevice ) { @@ -390,4 +416,5 @@ std::cout << "a bebob device serialized" << std::endl; } + #endif } return true; @@ -397,7 +424,7 @@ DeviceManager::loadCache( Glib::ustring fileName ) { + int i; + i=0; // avoids unused warning Util::XMLDeserialize deser( fileName ); - BeBoB::AvDevice* pBeBoBDevice = 0; - int i = 0; typedef std::vector ConfigRomVector; @@ -425,4 +452,6 @@ } + #ifdef ENABLE_BEBOB + BeBoB::AvDevice* pBeBoBDevice = 0; do { ostringstream strstrm; @@ -449,5 +478,6 @@ } } while ( pBeBoBDevice ); - + #endif + return true; } Index: /branches/streaming-rework/src/bounce/bounce_avdevice.cpp =================================================================== --- /branches/streaming-rework/src/bounce/bounce_avdevice.cpp (revision 386) +++ /branches/streaming-rework/src/bounce/bounce_avdevice.cpp (revision 404) @@ -20,4 +20,6 @@ */ +#ifdef ENABLE_BOUNCE + #include "bounce/bounce_avdevice.h" #include "configrom.h" @@ -377,5 +379,5 @@ } - - -} +} // namespace + +#endif // #ifdef ENABLE_BOUNCE Index: /branches/streaming-rework/src/bounce/bounce_avdevice.h =================================================================== --- /branches/streaming-rework/src/bounce/bounce_avdevice.h (revision 336) +++ /branches/streaming-rework/src/bounce/bounce_avdevice.h (revision 404) @@ -19,4 +19,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BOUNCE #ifndef BOUNCEDEVICE_H @@ -100,2 +102,4 @@ #endif + +#endif // #ifdef ENABLE_BOUNCE Index: /branches/streaming-rework/src/maudio/maudio_avdevice.cpp =================================================================== --- /branches/streaming-rework/src/maudio/maudio_avdevice.cpp (revision 386) +++ /branches/streaming-rework/src/maudio/maudio_avdevice.cpp (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB #include "maudio/maudio_avdevice.h" @@ -546,2 +548,4 @@ } + +#endif //#ifdef ENABLE_BEBOB Index: /branches/streaming-rework/src/maudio/maudio_avdevice.h =================================================================== --- /branches/streaming-rework/src/maudio/maudio_avdevice.h (revision 336) +++ /branches/streaming-rework/src/maudio/maudio_avdevice.h (revision 404) @@ -18,4 +18,6 @@ * MA 02111-1307 USA. */ + +#ifdef ENABLE_BEBOB #ifndef MAUDIODEVICE_H @@ -87,2 +89,4 @@ #endif + +#endif //#ifdef ENABLE_BEBOB