Changeset 1449 for branches

Show
Ignore:
Timestamp:
11/22/08 06:23:13 (15 years ago)
Author:
ppalmers
Message:

fix small bug in port enable. show port list when running verbose.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/src/libstreaming/generic/Port.cpp

    r904 r1449  
    126126Port::enable()  { 
    127127    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Enabling port %s...\n",m_Name.c_str()); 
    128     m_disabled=false; 
     128    m_disabled = false; 
    129129} 
    130130 
     
    133133Port::disable() { 
    134134    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Disabling port %s...\n",m_Name.c_str()); 
    135     m_disabled=false; 
     135    m_disabled = true; 
     136
     137 
     138 
     139/** 
     140 * Obtain the port type in string format 
     141 * @return type name of the port 
     142 */ 
     143std::string 
     144Port::getPortTypeName() 
     145
     146    switch(m_PortType) { 
     147        case E_Audio: 
     148            return "Audio"; 
     149        case E_Midi: 
     150            return "MIDI"; 
     151        case E_Control: 
     152            return "Control"; 
     153        default: 
     154            return "Invalid"; 
     155    } 
    136156} 
    137157 
  • branches/libffado-2.0/src/libstreaming/generic/Port.h

    r864 r1449  
    105105 
    106106    enum E_PortType getPortType() {return m_PortType;}; ///< returns the port type (is fixed) 
     107    std::string getPortTypeName(); 
    107108    enum E_Direction getDirection() {return m_Direction;}; ///< returns the direction (is fixed) 
    108109 
  • branches/libffado-2.0/src/libstreaming/StreamProcessorManager.cpp

    r1373 r1449  
    13171317    debugOutputShort( DEBUG_LEVEL_NORMAL, "----------------------------------------------------\n"); 
    13181318 
     1319    // list port info in verbose mode 
     1320    debugOutputShort( DEBUG_LEVEL_VERBOSE, "Port Information\n"); 
     1321    int nb_ports; 
     1322     
     1323    debugOutputShort( DEBUG_LEVEL_VERBOSE, " Playback\n"); 
     1324    nb_ports = getPortCount(Port::E_Playback); 
     1325    for(int i=0; i < nb_ports; i++) { 
     1326        Port *p = getPortByIndex(i, Port::E_Playback); 
     1327        debugOutputShort( DEBUG_LEVEL_VERBOSE, "  %3d (%p): ", i, p); 
     1328        if (p) { 
     1329            bool disabled = p->isDisabled(); 
     1330            debugOutputShort( DEBUG_LEVEL_VERBOSE, "[%p] [%3s] ", &p->getManager(), (disabled?"off":"on")); 
     1331            debugOutputShort( DEBUG_LEVEL_VERBOSE, "[%7s] ", p->getPortTypeName().c_str()); 
     1332            debugOutputShort( DEBUG_LEVEL_VERBOSE, "%3s ", p->getName().c_str()); 
     1333        } else { 
     1334            debugOutputShort( DEBUG_LEVEL_VERBOSE, "invalid "); 
     1335        } 
     1336        debugOutputShort( DEBUG_LEVEL_VERBOSE, "\n"); 
     1337    } 
     1338    debugOutputShort( DEBUG_LEVEL_VERBOSE, " Capture\n"); 
     1339    nb_ports = getPortCount(Port::E_Capture); 
     1340    for(int i=0; i < nb_ports; i++) { 
     1341        Port *p = getPortByIndex(i, Port::E_Capture); 
     1342        debugOutputShort( DEBUG_LEVEL_VERBOSE, "  %3d (%p): ", i, p); 
     1343        if (p) { 
     1344            bool disabled = p->isDisabled(); 
     1345            debugOutputShort( DEBUG_LEVEL_VERBOSE, "[%p] [%3s] ", &p->getManager(), (disabled?"off":"on")); 
     1346            debugOutputShort( DEBUG_LEVEL_VERBOSE, "[%7s] ", p->getPortTypeName().c_str()); 
     1347            debugOutputShort( DEBUG_LEVEL_VERBOSE, " %3s ", p->getName().c_str()); 
     1348        } else { 
     1349            debugOutputShort( DEBUG_LEVEL_VERBOSE, " invalid "); 
     1350        } 
     1351        debugOutputShort( DEBUG_LEVEL_VERBOSE, "\n"); 
     1352    } 
     1353 
     1354    debugOutputShort( DEBUG_LEVEL_VERBOSE, "----------------------------------------------------\n"); 
     1355 
    13191356} 
    13201357