Changeset 234

Show
Ignore:
Timestamp:
05/29/06 12:14:23 (18 years ago)
Author:
pieterpalmers
Message:

- ported over the port naming change from the 1.0 branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libfreebob-2.0/src/bebob_light/bebob_light_avdevice.cpp

    r230 r234  
    3434#include "debugmodule/debugmodule.h" 
    3535 
    36 #include <iostream> 
     36#include <iostream>      
     37#include <sstream> 
    3738#include <stdint.h> 
    3839 
     
    4950    , m_nodeId( nodeId ) 
    5051    , m_verboseLevel( verboseLevel ) 
     52    , m_id(0) 
    5153    , m_receiveProcessor ( 0 ) 
    5254    , m_receiveProcessorBandwidth ( -1 ) 
     
    12651267        return false; 
    12661268    } 
     1269     
     1270    asprintf( &result, "%d", m_id & 0xFF ); 
     1271    if ( !xmlNewChild( connection,  0, 
     1272                       BAD_CAST "Id",  BAD_CAST result ) ) { 
     1273        debugError( "Couldn't create 'Id' node\n" ); 
     1274        return false; 
     1275    } 
    12671276 
    12681277    asprintf( &result, "%d", m_1394Service->getPort() ); 
     
    17001709{ 
    17011710    debugWarning( "showDevice: not implemented\n" ); 
     1711} 
     1712 
     1713bool AvDevice::setId( unsigned int id) { 
     1714    m_id=id; 
     1715    return true; 
    17021716} 
    17031717 
     
    17921806        { 
    17931807            const AvPlug::ChannelInfo* channelInfo = &( *it ); 
    1794  
     1808                std::ostringstream portname; 
     1809                 
     1810                portname << "dev" << m_id << "_" << channelInfo->m_name; 
     1811                 
    17951812                        FreebobStreaming::Port *p=NULL; 
    17961813                        switch(clusterInfo->m_portType) { 
     
    18011818                        case ExtendedPlugInfoClusterInfoSpecificData::ePT_Analog: 
    18021819                                p=new FreebobStreaming::AmdtpAudioPort( 
    1803                                                 channelInfo->m_name
     1820                                                portname.str()
    18041821                                                direction,  
    18051822                                                // \todo: streaming backend expects indexing starting from 0 
     
    18151832                        case ExtendedPlugInfoClusterInfoSpecificData::ePT_MIDI: 
    18161833                                p=new FreebobStreaming::AmdtpMidiPort( 
    1817                                                 channelInfo->m_name,  
     1834                                                portname.str(), 
    18181835                                                direction,  
    18191836                                                // \todo: streaming backend expects indexing starting from 0 
  • branches/libfreebob-2.0/src/bebob_light/bebob_light_avdevice.h

    r225 r234  
    5858    virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); 
    5959    virtual int getSamplingFrequency( ); 
     60 
     61    virtual bool setId(unsigned int id); 
    6062 
    6163        virtual int getStreamCount(); 
     
    128130    nr_of_plugs_t m_serialBusIsochronousOutputPlugs; 
    129131 
     132    unsigned int m_id; 
     133 
    130134        // streaming stuff 
    131135        FreebobStreaming::AmdtpReceiveStreamProcessor *m_receiveProcessor; 
  • branches/libfreebob-2.0/src/devicemanager.cpp

    r221 r234  
    121121            if ( avDevice ) { 
    122122                m_avDevices.push_back( avDevice ); 
     123                if (!avDevice->setId(m_avDevices.size())) { 
     124                    debugError("Could not set Id of AvDevice\n"); 
     125                } 
    123126                if ( verboseLevel ) { 
    124127                    avDevice->showDevice(); 
  • branches/libfreebob-2.0/src/iavdevice.h

    r225 r234  
    5050        virtual int getSamplingFrequency( ) = 0; 
    5151         
     52    virtual bool setId(unsigned int id) = 0; 
     53         
    5254        /// obsolete 
    5355        virtual bool addXmlDescription( xmlNodePtr deviceNode ) = 0;