Show
Ignore:
Timestamp:
02/25/07 02:46:00 (17 years ago)
Author:
pieterpalmers
Message:

- Introduced a generic option mechanism. AvDevices? now automatically

inherit from OptionContainer? (via IAvDevice) and can specify options
(e.g. at construction). These can then be get/set using the container
functions from the outside.

- Modified the bebob, bounce, motu, mh, rme AvDevices? to make use of the

option system for their Id value and the 'snoopMode' option.

- Made M-Audio avdevice a subclass of the BeBoB avdevice to avoid code

duplication.

- Extended the bounce device

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/streaming-rework/src/metrichalo/mh_avdevice.cpp

    r415 r416  
    3434#include <assert.h> 
    3535#include <netinet/in.h> 
     36#include <iostream> 
     37#include <sstream> 
    3638 
    3739#include <libraw1394/csr.h> 
     
    5658    , m_nodeId( nodeId ) 
    5759    , m_verboseLevel( verboseLevel ) 
    58     , m_id(0) 
    59     , m_iso_recv_channel ( -1 ) 
    60     , m_iso_send_channel ( -1 ) 
    6160     
    6261{ 
     
    6564    debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::MHAvDevice (NodeID %d)\n", 
    6665                 nodeId ); 
     66    addOption(FreebobUtil::OptionContainer::Option("id",std::string("dev?"))); 
    6767 
    6868} 
     
    140140 
    141141bool MHAvDevice::setId( unsigned int id) { 
    142     debugOutput( DEBUG_LEVEL_VERBOSE, "Set id to %d...\n", id); 
    143     m_id=id; 
    144     return true; 
     142    // FIXME: decent ID system nescessary 
     143    std::ostringstream idstr; 
     144 
     145    idstr << "dev" << id; 
     146     
     147    debugOutput( DEBUG_LEVEL_VERBOSE, "Set id to %s...\n", idstr.str().c_str()); 
     148     
     149    return setOption("id",idstr.str()); 
    145150} 
    146151 
     
    174179int  
    175180MHAvDevice::getStreamCount() { 
    176     return 0; // one receive, one transmit 
     181    return 0; 
    177182} 
    178183 
     
    180185MHAvDevice::getStreamProcessorByIndex(int i) { 
    181186 
    182 //    switch (i) { 
    183 //    case 0: 
    184 //        return m_receiveProcessor; 
    185 //    case 1: 
    186 //        return m_transmitProcessor; 
    187 //    default: 
    188 //        return NULL; 
    189 //    } 
    190 //    return 0; 
    191187    return NULL; 
    192188} 
     
    194190bool 
    195191MHAvDevice::startStreamByIndex(int i) { 
    196  
    197192    return false; 
    198193} 
     
    203198} 
    204199 
    205 signed int MHAvDevice::getIsoRecvChannel(void) { 
    206     return m_iso_recv_channel; 
    207 
    208  
    209 signed int MHAvDevice::getIsoSendChannel(void) { 
    210     return m_iso_send_channel; 
    211 
    212  
    213 
     200
  • branches/streaming-rework/src/metrichalo/mh_avdevice.h

    r415 r416  
    8686    int              m_nodeId; 
    8787    int              m_verboseLevel; 
    88     signed int m_id; 
    89     signed int m_iso_recv_channel, m_iso_send_channel; 
    90      
    91 //      FreebobStreaming::MHReceiveStreamProcessor *m_receiveProcessor; 
    92 //      FreebobStreaming::MHTransmitStreamProcessor *m_transmitProcessor; 
    9388 
    9489private: