Show
Ignore:
Timestamp:
08/21/07 10:12:58 (16 years ago)
Author:
ppalmers
Message:

- make the BeBoB AvDevice? a child class of the GenericAVC AvDevice?. This
avoids a lot of code duplication.
- fix inconsistency in position/location numbering between ext pluginfo
cmd and descriptor.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/echoaudio/src/genericavc/avc_avdevice.cpp

    r541 r548  
    6565    debugOutput( DEBUG_LEVEL_VERBOSE, "Created GenericAVC::AvDevice (NodeID %d)\n", 
    6666                 nodeId ); 
     67    addOption(Util::OptionContainer::Option("snoopMode",false)); 
    6768} 
    6869 
     
    134135} 
    135136 
     137void 
     138AvDevice::setVerboseLevel(int l) 
     139{ 
     140    m_pPlugManager->setVerboseLevel(l); 
     141 
     142    FFADODevice::setVerboseLevel(l); 
     143    AVC::Unit::setVerboseLevel(l); 
     144} 
     145 
    136146int 
    137147AvDevice::getSamplingFrequency( ) { 
     
    159169AvDevice::setSamplingFrequency( int s ) 
    160170{ 
    161     ESamplingFrequency samplingFrequency=parseSampleRate( s ); 
    162171    bool snoopMode=false; 
    163172    if(!getOption("snoopMode", snoopMode)) { 
     
    167176    if(snoopMode) { 
    168177        int current_sr=getSamplingFrequency(); 
    169         if (current_sr != convertESamplingFrequency( samplingFrequency ) ) { 
     178        if (current_sr != s ) { 
    170179            debugError("In snoop mode it is impossible to set the sample rate.\n"); 
    171180            debugError("Please start the client with the correct setting.\n"); 
     
    180189        } 
    181190 
    182         if ( !plug->setSampleRate( convertESamplingFrequency( samplingFrequency ) ) ) 
     191        if ( !plug->setSampleRate( s ) ) 
    183192        { 
    184193            debugError( "setSampleRate: Setting sample rate failed\n" ); 
     
    192201        } 
    193202 
    194         if ( !plug->setSampleRate( convertESamplingFrequency( samplingFrequency ) ) ) 
     203        if ( !plug->setSampleRate( s ) ) 
    195204        { 
    196205            debugError( "setSampleRate: Setting sample rate failed\n" ); 
     
    200209        debugOutput( DEBUG_LEVEL_VERBOSE, 
    201210                     "setSampleRate: Set sample rate to %d\n", 
    202                      convertESamplingFrequency( samplingFrequency ) ); 
     211                     s ); 
    203212        return true; 
    204213    } 
     
    348357    Streaming::StreamProcessor *processor, 
    349358    Streaming::AmdtpAudioPort::E_Direction direction) { 
    350          
    351     debugOutput(DEBUG_LEVEL_VERBOSE, " Adding plug %s to processor\n", plug.getName()); 
    352359 
    353360    std::string id=std::string("dev?"); 
     
    362369    { 
    363370        const Plug::ClusterInfo* clusterInfo = &( *it ); 
    364          
    365         debugOutput(DEBUG_LEVEL_VERBOSE, " Adding cluster %s\n", clusterInfo->m_name.c_str()); 
    366371 
    367372        Plug::ChannelInfoVector channelInfos = clusterInfo->m_channelInfos; 
     
    370375              ++it ) 
    371376        { 
    372  
    373377            const Plug::ChannelInfo* channelInfo = &( *it ); 
    374              
    375378            std::ostringstream portname; 
    376379 
     
    396399 
    397400            case ExtendedPlugInfoClusterInfoSpecificData::ePT_MIDI: 
    398                 // HACK: for audiofire2 only !!! 
    399401                debugOutput(DEBUG_LEVEL_VERBOSE, " Adding MIDI channel %s (pos=0x%02X, loc=0x%02X)\n", 
    400                     channelInfo->m_name.c_str(), (direction==Streaming::Port::E_Capture?4:6), 
    401                     processor->getPortCount(Streaming::Port::E_Midi)); 
     402                    channelInfo->m_name.c_str(), channelInfo->m_streamPosition, processor->getPortCount(Streaming::Port::E_Midi)); 
    402403                p=new Streaming::AmdtpMidiPort( 
    403404                        portname.str(), 
    404405                        direction, 
    405                         (direction==Streaming::Port::E_Capture?4:6), 
    406 //                         channelInfo->m_streamPosition, 
     406                        channelInfo->m_streamPosition, 
    407407                        // Workaround for out-of-spec hardware 
    408408                        // should be: 
     
    420420            case ExtendedPlugInfoClusterInfoSpecificData::ePT_MADI: 
    421421            case ExtendedPlugInfoClusterInfoSpecificData::ePT_Digital: 
     422                debugOutput(DEBUG_LEVEL_VERBOSE, " Adding digital audio channel %s (pos=0x%02X, loc=0x%02X)\n", 
     423                    channelInfo->m_name.c_str(), channelInfo->m_streamPosition, channelInfo->m_location); 
     424                p=new Streaming::AmdtpAudioPort( 
     425                        portname.str(), 
     426                        direction, 
     427                        channelInfo->m_streamPosition, 
     428                        channelInfo->m_location, 
     429                        Streaming::AmdtpPortInfo::E_MBLA 
     430                ); 
     431                break; 
     432                 
    422433            case ExtendedPlugInfoClusterInfoSpecificData::ePT_NoType: 
    423434            default: