Changeset 26 for trunk/freebob

Show
Ignore:
Timestamp:
11/28/04 04:41:04 (19 years ago)
Author:
pieterpalmers
Message:

- Added subunit abstraction classes
- Implemented Audio & Music subunit detection in the AvDevice?
- Changed the debugPrint routine to be able to control debug output more granulary:

Debug output is now printed based upon the presence of a certain bit-flag.

- Various fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freebob/src/avaudioinfoblock.cpp

    r24 r26  
    3636                bValid=false; 
    3737        }        
    38         debugPrint(DEBUG_LEVEL_INFO,"AvAudioInfoBlock: Creating... length=0x%04X\n",getLength()); 
     38        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvAudioInfoBlock: Creating... length=0x%04X\n",getLength()); 
    3939         
    4040        // PP: I assume that there is only an audio block, no optional blocks. 
    4141        cNameInfoBlock=new AvNameInfoBlock(parent, address+7); 
    42         debugPrint(DEBUG_LEVEL_INFO,"AvAudioInfoBlock: Created\n"); 
     42        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvAudioInfoBlock: Created\n"); 
    4343         
    4444} 
  • trunk/freebob/src/avaudiosyncinfoblock.cpp

    r23 r26  
    3535                bValid=false; 
    3636        } 
    37         debugPrint(DEBUG_LEVEL_INFO,"AvAudioSyncInfoBlock: Creating... length=0x%04X\n",getLength()); 
    38         debugPrint(DEBUG_LEVEL_INFO,"AvAudioSyncInfoBlock: Created\n"); 
     37        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvAudioSyncInfoBlock: Creating... length=0x%04X\n",getLength()); 
     38        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvAudioSyncInfoBlock: Created\n"); 
    3939 
    4040} 
  • trunk/freebob/src/avdescriptor.cpp

    r25 r26  
    164164        iLength=response[2] & 0xFFFF; 
    165165         
    166         fprintf(stderr,"Descriptor length=0x%04X %d\n",iLength,iLength);       
     166        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"Descriptor length=0x%04X %d\n",iLength,iLength);    
    167167 
    168168        // now get the rest of the descriptor 
     
    183183        // first read 
    184184        if(bytes_read<iLength) { 
    185                 fprintf(stderr,".");   
     185                debugPrint(DEBUG_LEVEL_DESCRIPTOR,".");        
    186186                // apparently the lib modifies the request, so redefine it completely 
    187187                request[0] = AVC1394_CTYPE_CONTROL | qTarget 
     
    208208        // now do the remaining reads 
    209209        while(bytes_read<iLength) { 
    210                 fprintf(stderr,".");   
     210                debugPrint(DEBUG_LEVEL_DESCRIPTOR,".");        
    211211                // apparently the lib modifies the request, so redefine it completely 
    212212                request[0] = AVC1394_CTYPE_CONTROL | qTarget 
     
    229229                 
    230230        } 
    231         fprintf(stderr,"\n");  
     231        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\n");       
    232232         
    233233         
     
    248248 
    249249        if (((response[0] & 0xFF000000)==AVC1394_RESPONSE_NOT_IMPLEMENTED) || ((response[1] & 0xFF000000)==0x04)) {  
    250                 fprintf(stderr,"Descriptor not present.\n"); 
     250                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"Descriptor not present.\n"); 
    251251                bValid=false; 
    252252                return false; 
  • trunk/freebob/src/avdevice.cpp

    r21 r26  
    11/* avdevice.cpp 
    2  * Copyright (C) 2004 by Daniel Wagner 
     2 * Copyright (C) 2004 by Daniel Wagner, Pieter Palmers 
     3 *                        
    34 * 
    45 * This file is part of FreeBob. 
     
    2324#include "debugmodule.h" 
    2425#include "avdevice.h" 
     26#include "avdevicesubunit.h" 
     27#include "avdeviceaudiosubunit.h" 
     28#include "avdevicemusicsubunit.h" 
    2529 
    2630AvDevice::AvDevice(int port, int node) 
     
    3034 
    3135        // check to see if a device is really present? 
     36         
     37        // probably initialisation would be better done here 
    3238} 
    3339 
     
    3945        if ( !m_handle ) { 
    4046            if ( !errno ) { 
    41                 fprintf( stderr,  "libraw1394 not compatible.\n" ); 
     47                debugPrint(DEBUG_LEVEL_DEVICE,  "libraw1394 not compatible.\n" ); 
    4248            } else { 
    4349                perror ("Could not get 1394 handle"); 
    44                 fprintf (stderr, "Is ieee1394 and raw1394 driver loaded?\n"); 
     50                debugPrint(DEBUG_LEVEL_DEVICE, "Is ieee1394 and raw1394 driver loaded?\n"); 
    4551            } 
    4652            return eFBRC_Creating1394HandleFailed; 
     
    5561   } 
    5662    
     63   // enumerate the subunits present in this device, create an AvDeviceSubunit for them, and add this object to the cSubUnits vector 
     64        unsigned char table_entry; 
     65        unsigned char subunit_maxid; 
     66        unsigned char subunit_type; 
     67        quadlet_t table_entries; // buffer these table entries, because the memory content pointed to by  
     68                                 // the response pointer can change due to other libraw operations on this handle 
     69         
     70        quadlet_t request[6]; 
     71        quadlet_t *response; 
     72        AvDeviceSubunit *tmpAvDeviceSubunit=NULL; 
     73         
     74        // check the number of I/O plugs 
     75         
     76        request[0] = AVC1394_CTYPE_STATUS | AVC1394_SUBUNIT_TYPE_UNIT | AVC1394_SUBUNIT_ID_IGNORE 
     77                                        | AVC1394_COMMAND_PLUG_INFO | 0x00; 
     78        request[1] = 0xFFFFFFFF; 
     79        response = avcExecuteTransaction(request, 2, 2); 
     80        if (response != NULL) { 
     81                iNbIsoDestinationPlugs= (unsigned char) ((response[1]>>24) & 0xff); 
     82                iNbIsoSourcePlugs= (unsigned char) ((response[1]>>16) & 0xff); 
     83                iNbExtDestinationPlugs= (unsigned char) ((response[1]>>8) & 0xff); 
     84                iNbExtSourcePlugs= (unsigned char) ((response[1]>>0) & 0xff); 
     85        } 
     86        request[0] = AVC1394_CTYPE_STATUS | AVC1394_SUBUNIT_TYPE_UNIT | AVC1394_SUBUNIT_ID_IGNORE 
     87                                        | AVC1394_COMMAND_PLUG_INFO | 0x01; 
     88        request[1] = 0xFFFFFFFF; 
     89        response = avcExecuteTransaction(request, 2, 2); 
     90        if (response != NULL) { 
     91                iNbAsyncDestinationPlugs= (unsigned char) ((response[1]>>24) & 0xff); 
     92                iNbAsyncSourcePlugs= (unsigned char) ((response[1]>>16) & 0xff); 
     93        } 
     94         
     95        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: %d Isochronous source plugs, %d Isochronous destination plugs\n",iNbIsoSourcePlugs,iNbIsoDestinationPlugs); 
     96        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: %d External source plugs, %d External destination plugs\n",iNbExtSourcePlugs,iNbExtDestinationPlugs); 
     97        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: %d Asynchronous source plugs, %d Asynchronous destination plugs\n",iNbAsyncSourcePlugs,iNbAsyncDestinationPlugs); 
     98         
     99        // create the subunits 
     100        for (unsigned int i=0;i<8;i++) { // cycle through the 8 pages (max 32 subunits; 4 subunits/page) 
     101                request[0] = AVC1394_CTYPE_STATUS | AVC1394_SUBUNIT_TYPE_UNIT | AVC1394_SUBUNIT_ID_IGNORE 
     102                                | AVC1394_COMMAND_SUBUNIT_INFO | ((i<<4) & 0xF0) | 0x07; 
     103                request[1] = 0xFFFFFFFF; 
     104                response = avcExecuteTransaction(request, 6, 2); 
     105                 
     106                table_entries=response[1]; 
     107                 
     108                if (response != NULL) { 
     109                        // this way of processing the table entries assumes that the subunit type is not "extended" 
     110                         
     111                        // warning: don't do unsigned int j! comparison >= 0 is always true for uint 
     112                        for (int j=3;j>=0;j--) { // cycle through the 8 pages (max 32 subunits; 4 subunits/page) 
     113                                table_entry=(table_entries >> (j*8)) & 0xFF; 
     114                                subunit_maxid=table_entry& 0x07; 
     115                                subunit_type=(table_entry >> 3) & 0x1F; 
     116                                //debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: Page %d, item %d: Table entry=0x%02X, subunit_maxid=0x%02X, subunit_type=0x%02X\n",i,j,table_entry,subunit_maxid,subunit_type); 
     117                                 
     118                                // according to spec we could stop processing 
     119                                // at the first 0xFF entry, but doing it this way 
     120                                // is a little more robust 
     121                                if (table_entry != 0xFF) { 
     122                                        for (unsigned char subunit_id=0;subunit_id<subunit_maxid+1;subunit_id++) { 
     123                                                 
     124                                                // only two types of specific subunits are supported: audio and music 
     125                                                switch (subunit_type) { 
     126                                                        case 0x01: // audio subunit 
     127                                                                tmpAvDeviceSubunit=new AvDeviceAudioSubunit(this,subunit_id); 
     128                                                        break; 
     129                                                        case 0x0C: // music subunit 
     130                                                                tmpAvDeviceSubunit=new AvDeviceMusicSubunit(this,subunit_id); 
     131                                                        break; 
     132                                                         
     133                                                        default: // generic 
     134                                                                tmpAvDeviceSubunit=new AvDeviceSubunit(this,subunit_type,subunit_id); 
     135                                                        break; 
     136                                                }  
     137                                                 
     138                                                if(tmpAvDeviceSubunit && tmpAvDeviceSubunit->isValid()) { 
     139                                                        cSubUnits.push_back(tmpAvDeviceSubunit); 
     140                                                } else { 
     141                                                        if (tmpAvDeviceSubunit) { 
     142                                                                debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: Unsupported AvDeviceSubunit encountered. Page %d, item %d: Table entry=0x%02X, subunit_maxid=0x%02X, subunit_type=0x%02X, subunit_id=%0x02X\n",i,j,table_entry,subunit_maxid,subunit_id); 
     143         
     144                                                                delete tmpAvDeviceSubunit; 
     145                                                        } else { 
     146                                                                debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: Could not create AvDeviceSubunit object.\n"); 
     147                                                        } 
     148                                                } 
     149                                        } 
     150                                } 
     151                        } 
     152                } 
     153        } 
     154    
    57155   m_bInitialised = true; 
    58156   return eFBRC_Success; 
     
    66164AvDevice::~AvDevice() 
    67165{ 
     166 
     167        vector<AvDeviceSubunit *>::iterator it; 
     168        for( it = cSubUnits.begin(); it != cSubUnits.end(); it++ ) { 
     169                delete *it; 
     170        } 
     171 
    68172    if ( m_handle ) { 
    69173        raw1394_destroy_handle( m_handle ); 
  • trunk/freebob/src/avdevice.h

    r18 r26  
    11/* avdevice.h 
    2  * Copyright (C) 2004 by Daniel Wagner 
     2 * Copyright (C) 2004 by Daniel Wagner, Pieter Palmers 
     3 *                        
    34 * 
    45 * This file is part of FreeBob. 
     
    1920 */ 
    2021 
     22#include "ieee1394service.h" 
     23 
     24#include <vector> 
     25using std::vector; 
     26 
     27 
    2128#ifndef AVDEVICE_H 
    2229#define AVDEVICE_H 
    2330 
    24 #include "ieee1394service.h" 
     31class AvDeviceSubunit; 
    2532 
    2633class AvDevice { 
     
    4047        int m_iPort; 
    4148        bool m_bInitialised; 
     49        vector<AvDeviceSubunit *> cSubUnits; 
     50         
     51        unsigned char iNbAsyncDestinationPlugs; 
     52        unsigned char iNbAsyncSourcePlugs; 
     53        unsigned char iNbIsoDestinationPlugs; 
     54        unsigned char iNbIsoSourcePlugs; 
     55        unsigned char iNbExtDestinationPlugs; 
     56        unsigned char iNbExtSourcePlugs; 
     57         
    4258}; 
    4359 
  • trunk/freebob/src/avmidiinfoblock.cpp

    r23 r26  
    4141        AvNameInfoBlock *tmpNameBlock; 
    4242         
    43         debugPrint(DEBUG_LEVEL_INFO,"AvMidiInfoBlock: Creating... length=0x%04X\n",getLength()); 
     43        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvMidiInfoBlock: Creating... length=0x%04X\n",getLength()); 
    4444         
    4545        if (nb_streams>0) { 
     
    5555                                cNameInfoBlocks.push_back(tmpNameBlock); 
    5656                        } else { 
    57                                 debugPrint(DEBUG_LEVEL_INFO,"Invalid name block in Midi info Block...\n"); 
     57                                debugPrint(DEBUG_LEVEL_INFOBLOCK,"Invalid name block in Midi info Block...\n"); 
    5858                                bValid=false; 
    5959                                break; // what to do now? 
     
    6262                 
    6363        } 
    64         debugPrint(DEBUG_LEVEL_INFO,"AvMidiInfoBlock: Created\n"); 
     64        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvMidiInfoBlock: Created\n"); 
    6565         
    6666        // no optional info blocks please... 
  • trunk/freebob/src/avmusicidentifierdescriptor.cpp

    r21 r26  
    2323#include "avmusicidentifierdescriptor.h" 
    2424 
    25 AvMusicIdentifierDescriptor::AvMusicIdentifierDescriptor(AvDevice *parent) : AvDescriptor(parent, AVC1394_SUBUNIT_TYPE_MUSIC | AVC1394_SUBUNIT_ID_0,0x00) { 
    26  
     25AvMusicIdentifierDescriptor::AvMusicIdentifierDescriptor(AvDevice *parent, unsigned char id) : AvDescriptor(parent, AVC1394_SUBUNIT_TYPE_MUSIC | (id<<16),0x00) { 
     26        if (!(this->AvDescriptor::isPresent())) { 
     27                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"AvMusicIdentifierDescriptor: Descriptor not present!\n"); 
     28                return; 
     29        } 
     30         
     31        if (!(this->AvDescriptor::isOpen())) { 
     32                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"AvMusicIdentifierDescriptor: Opening descriptor...\n"); 
     33                this->AvDescriptor::OpenReadOnly(); 
     34                if (!(this->AvDescriptor::isOpen()) ) { 
     35                        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"AvMusicIdentifierDescriptor:   Failed!\n"); 
     36                        return; 
     37                } 
     38        } 
     39         
     40        if (!(this->AvDescriptor::isLoaded())) { 
     41                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"AvMusicIdentifierDescriptor: Loading descriptor...\n"); 
     42                this->AvDescriptor::Load(); 
     43                if (!(this->AvDescriptor::isLoaded())) { 
     44                        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"AvMusicIdentifierDescriptor:   Failed!\n"); 
     45                        return; 
     46                } 
     47        } 
    2748} 
    2849 
     
    3253 
    3354void AvMusicIdentifierDescriptor::printCapabilities() { 
    34         if (!(this->AvDescriptor::isPresent())) { 
    35                 fprintf(stderr,"AvMusicIdentifierDescriptor: Descriptor not present!\n"); 
    36                 return; 
    37         } 
     55 
    3856         
    39         if (!(this->AvDescriptor::isOpen())) { 
    40                 fprintf(stderr,"AvMusicIdentifierDescriptor: Opening descriptor...\n"); 
    41                 this->AvDescriptor::OpenReadOnly(); 
    42                 if (!(this->AvDescriptor::isOpen()) ) { 
    43                         fprintf(stderr,"AvMusicIdentifierDescriptor:   Failed!\n"); 
    44                         return; 
    45                 } 
    46         } 
    47          
    48         if (!(this->AvDescriptor::isLoaded())) { 
    49                 fprintf(stderr,"AvMusicIdentifierDescriptor: Loading descriptor...\n"); 
    50                 this->AvDescriptor::Load(); 
    51                 if (!(this->AvDescriptor::isLoaded())) { 
    52                         fprintf(stderr,"AvMusicIdentifierDescriptor:   Failed!\n"); 
    53                         return; 
    54                 } 
    55         } 
    56          
    57         fprintf(stderr,"AvMusicIdentifierDescriptor: \n"); 
     57        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"AvMusicIdentifierDescriptor: \n"); 
    5858        // PP: calculate the offset to accomodate for the presence of root lists [not implemented] 
    5959         
    6060        int offset=8; // update offset when beginning at a new table in the specs for easy reading 
    61         fprintf(stderr,"\t music_subunit_dependant_info_fields_length:     0x%04X %03d\n",readWord(offset+0),readWord(offset+0)); 
    62         fprintf(stderr,"\t attributes:                                       0x%02X %03d\n",readByte(offset+2),readByte(offset+2)); 
     61        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t music_subunit_dependant_info_fields_length:     0x%04X %03d\n",readWord(offset+0),readWord(offset+0)); 
     62        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t attributes:                                       0x%02X %03d\n",readByte(offset+2),readByte(offset+2)); 
    6363         
    6464        // PP: read the optional extra attribute bytes [not implemented] 
    6565         
    66         fprintf(stderr,"\t music_subunit_version:                            0x%02X %03d\n",readByte(offset+3),readByte(offset+3)); 
     66        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t music_subunit_version:                            0x%02X %03d\n",readByte(offset+3),readByte(offset+3)); 
    6767         
    68         fprintf(stderr,"\t music_subunit_specific_information_length:      0x%04X %03d\n",readWord(offset+4),readWord(offset+4)); 
     68        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t music_subunit_specific_information_length:      0x%04X %03d\n",readWord(offset+4),readWord(offset+4)); 
    6969         
    7070        offset=14; 
    7171        unsigned char capability_attributes=readByte(offset+0); 
    72         fprintf(stderr,"\t capability_attributes:                            0x%02X %03d\n",capability_attributes,capability_attributes); 
     72        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t capability_attributes:                            0x%02X %03d\n",capability_attributes,capability_attributes); 
    7373         
    7474        // PP: #defines in ieee1394service.h for the moment 
    75         fprintf(stderr,"\t   -> capabilities: "); 
     75        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t   -> capabilities: "); 
    7676        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_GENERAL)) { 
    77                 fprintf(stderr," general "); 
     77                debugPrint(DEBUG_LEVEL_DESCRIPTOR," general "); 
    7878        } 
    7979        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_AUDIO)) { 
    80                 fprintf(stderr," audio "); 
     80                debugPrint(DEBUG_LEVEL_DESCRIPTOR," audio "); 
    8181        } 
    8282        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_MIDI)) { 
    83                 fprintf(stderr," midi "); 
     83                debugPrint(DEBUG_LEVEL_DESCRIPTOR," midi "); 
    8484        } 
    8585        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_SMPTE)) { 
    86                 fprintf(stderr," smtpe "); 
     86                debugPrint(DEBUG_LEVEL_DESCRIPTOR," smtpe "); 
    8787        } 
    8888        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_SAMPLECOUNT)) { 
    89                 fprintf(stderr," samplecount "); 
     89                debugPrint(DEBUG_LEVEL_DESCRIPTOR," samplecount "); 
    9090        } 
    9191        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_AUDIOSYNC)) { 
    92                 fprintf(stderr," audiosync "); 
     92                debugPrint(DEBUG_LEVEL_DESCRIPTOR," audiosync "); 
    9393        } 
    94         fprintf(stderr,"\n"); 
     94        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\n"); 
    9595         
    9696        // start parsing the optional capability stuff 
    9797        offset=15; 
    9898        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_GENERAL)) { 
    99                 fprintf(stderr,"\t   general capabilities:\n"); 
     99                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t   general capabilities:\n"); 
    100100                 
    101101                unsigned char transmit_capability=readByte(offset+1); 
    102                 fprintf(stderr,"\t      transmit: %s%s\n", 
     102                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t      transmit: %s%s\n", 
    103103                        (transmit_capability & AVC1394_SUBUNIT_MUSIC_CAPABILITY_BLOCKING)?"blocking ":"", 
    104104                        (transmit_capability & AVC1394_SUBUNIT_MUSIC_CAPABILITY_NONBLOCKING)?"non-blocking ":""); 
    105105                 
    106106                unsigned char receive_capability=readByte(offset+2); 
    107                 fprintf(stderr,"\t      receive:  %s%s\n", 
     107                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t      receive:  %s%s\n", 
    108108                        (receive_capability & AVC1394_SUBUNIT_MUSIC_CAPABILITY_BLOCKING)?"blocking ":"", 
    109109                        (receive_capability & AVC1394_SUBUNIT_MUSIC_CAPABILITY_NONBLOCKING)?"non-blocking ":""); 
     
    114114        } 
    115115        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_AUDIO)) { 
    116                 fprintf(stderr,"\t   audio capabilities: (%d entries)\n",readByte(offset+1)); 
     116                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t   audio capabilities: (%d entries)\n",readByte(offset+1)); 
    117117                for (int i=0;i<readByte(offset+1);i++) { 
    118                         fprintf(stderr,"\t      %d: #inputs=%02d, #outputs=%02d, format=0x%04X)\n",i+1,readWord(offset+2+i*6),readWord(offset+4+i*6),readWord(offset+6+i*6)); 
     118                        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t      %d: #inputs=%02d, #outputs=%02d, format=0x%04X)\n",i+1,readWord(offset+2+i*6),readWord(offset+4+i*6),readWord(offset+6+i*6)); 
    119119                } 
    120120                 
     
    122122        } 
    123123        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_MIDI)) { 
    124                 fprintf(stderr,"\t   midi capabilities:\n"); 
    125                 fprintf(stderr,"\t      midi version:             %d.%d\n",((readByte(offset+1) & 0xF0) >> 4),(readByte(offset+1) & 0x0F)); 
    126                 fprintf(stderr,"\t      adaptation layer version: %d.%d\n",readByte(offset+2)); 
    127                 fprintf(stderr,"\t      #inputs=%02d, #outputs=%02d\n",readWord(offset+3),readWord(offset+5)); 
     124                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t   midi capabilities:\n"); 
     125                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t      midi version:             %d.%d\n",((readByte(offset+1) & 0xF0) >> 4),(readByte(offset+1) & 0x0F)); 
     126                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t      adaptation layer version: %d.%d\n",readByte(offset+2)); 
     127                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t      #inputs=%02d, #outputs=%02d\n",readWord(offset+3),readWord(offset+5)); 
    128128                offset += readByte(offset)+1; // update offset with length of this block incl the length field 
    129129        } 
    130130        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_SMPTE)) { 
    131                 fprintf(stderr,"\t   smtpe capabilities:\n"); 
     131                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t   smtpe capabilities:\n"); 
    132132                // PP: not present on my quatafire 
    133133                 
     
    135135        } 
    136136        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_SAMPLECOUNT)) { 
    137                 fprintf(stderr,"\t   samplecount capabilities:\n"); 
     137                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t   samplecount capabilities:\n"); 
    138138                // PP: not present on my quatafire 
    139139                offset += readByte(offset)+1; // update offset with length of this block incl the length field 
    140140        } 
    141141        if ((capability_attributes & AVC1394_SUBUNIT_MUSIC_CAPABILITY_AUDIOSYNC)) { 
    142                 fprintf(stderr,"\t   audiosync capabilities:\n"); 
     142                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t   audiosync capabilities:\n"); 
    143143                 
    144144                unsigned char audiosync_capability=readByte(offset+1); 
    145145                 
    146                 fprintf(stderr,"\t      sync from:  %s%s\n", 
     146                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"\t      sync from:  %s%s\n", 
    147147                        (audiosync_capability & AVC1394_SUBUNIT_MUSIC_CAPABILITY_AUDIOSYNC_BUS)?" 1394 bus ":"", 
    148148                        (audiosync_capability & AVC1394_SUBUNIT_MUSIC_CAPABILITY_AUDIOSYNC_EXTERNAL)?"  external source ":""); 
     
    150150                offset += readByte(offset)+1; // update offset with length of this block incl the length field 
    151151        } 
    152          
    153          
    154          
    155152} 
  • trunk/freebob/src/avmusicidentifierdescriptor.h

    r21 r26  
    3333class AvMusicIdentifierDescriptor : public AvDescriptor { 
    3434 public: 
    35     AvMusicIdentifierDescriptor(AvDevice *parent); 
     35    AvMusicIdentifierDescriptor(AvDevice *parent, unsigned char id); 
    3636    ~AvMusicIdentifierDescriptor(); 
    3737     
  • trunk/freebob/src/avmusicstatusdescriptor.cpp

    r25 r26  
    3232#include "avoutputplugstatusinfoblock.h" 
    3333 
    34 AvMusicStatusDescriptor::AvMusicStatusDescriptor(AvDevice *parent) : AvDescriptor(parent, AVC1394_SUBUNIT_TYPE_MUSIC | AVC1394_SUBUNIT_ID_0,0x80) { 
    35  
    36 
    37  
    38 AvMusicStatusDescriptor::~AvMusicStatusDescriptor()  { 
    39  
    40 
    41  
    42 void AvMusicStatusDescriptor::printCapabilities() { 
     34AvMusicStatusDescriptor::AvMusicStatusDescriptor(AvDevice *parent, unsigned char id) : AvDescriptor(parent, AVC1394_SUBUNIT_TYPE_MUSIC | (id << 16),0x80) { 
    4335        if (!(this->AvDescriptor::isPresent())) { 
    44                 fprintf(stderr,"AvMusicStatusDescriptor: Descriptor not present!\n"); 
     36                debugPrint(DEBUG_LEVEL_DESCRIPTOR,"AvMusicStatusDescriptor: Descriptor not present!\n"); 
    4537                return; 
    4638        } 
    4739         
    4840        if (!(this->AvDescriptor::isOpen())) { 
    49                 debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor: Opening descriptor...\n"); 
     41                debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor: Opening descriptor...\n"); 
    5042                this->AvDescriptor::OpenReadOnly(); 
    5143                if (!(this->AvDescriptor::isOpen()) ) { 
    52                         fprintf(stderr,"AvMusicStatusDescriptor:   Failed!\n"); 
     44                        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"AvMusicStatusDescriptor:   Failed!\n"); 
    5345                        bValid=false; 
    5446                        return; 
     
    5749         
    5850        if (!(this->AvDescriptor::isLoaded())) { 
    59                 debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor: Loading descriptor...\n"); 
     51                debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor: Loading descriptor...\n"); 
    6052                this->AvDescriptor::Load(); 
    6153                if (!(this->AvDescriptor::isLoaded())) { 
    62                         fprintf(stderr,"AvMusicStatusDescriptor:   Failed!\n"); 
     54                        debugPrint(DEBUG_LEVEL_DESCRIPTOR,"AvMusicStatusDescriptor:   Failed!\n"); 
    6355                        bValid=false; 
    6456                        return; 
     
    7062        cOutputPlugStatusInfoBlock=NULL; 
    7163         
    72         debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor: Creating AvGeneralMusicStatusInfoBlock... (offset=0x%04X)\n",offset); 
     64        debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor: Creating AvGeneralMusicStatusInfoBlock... (offset=0x%04X)\n",offset); 
    7365        cGeneralMusicInfoBlock=new AvGeneralMusicInfoBlock(this,offset); 
    7466        if (!(cGeneralMusicInfoBlock) || !(cGeneralMusicInfoBlock->isValid())) { 
    75                 debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor:  AvGeneralMusicStatusInfoBlock not found!\n"); 
     67                debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor:  AvGeneralMusicStatusInfoBlock not found!\n"); 
    7668                bValid=false; 
    7769                return; 
    7870        } 
    79         debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor:  AvGeneralMusicStatusInfoBlock found: length=0x%04X\n",cGeneralMusicInfoBlock->getLength()); 
     71        debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor:  AvGeneralMusicStatusInfoBlock found: length=0x%04X\n",cGeneralMusicInfoBlock->getLength()); 
    8072         
    8173        offset += cGeneralMusicInfoBlock->getLength()+2; 
    8274         
    8375         
    84         debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor: Creating AvOutputPlugStatusInfoBlock... (offset=0x%04X)\n",offset); 
     76        debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor: Creating AvOutputPlugStatusInfoBlock... (offset=0x%04X)\n",offset); 
    8577        cOutputPlugStatusInfoBlock=new AvOutputPlugStatusInfoBlock(this,offset); 
    8678        if (!(cOutputPlugStatusInfoBlock) || !(cOutputPlugStatusInfoBlock->isValid())) { 
    87                 debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor:  AvOutputPlugStatusInfoBlock not found!\n"); 
     79                debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor:  AvOutputPlugStatusInfoBlock not found!\n"); 
    8880                bValid=false; 
    8981                return; 
    9082        } 
    91         debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor:  AvOutputPlugStatusInfoBlock found: length=0x%04X\n",cOutputPlugStatusInfoBlock->getLength()); 
     83        debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor:  AvOutputPlugStatusInfoBlock found: length=0x%04X\n",cOutputPlugStatusInfoBlock->getLength()); 
    9284         
    9385        offset += cOutputPlugStatusInfoBlock->getLength()+2; 
     
    9587        // start parsing the optional infoblock(s) 
    9688        AvInfoBlock *tmpInfoBlock = NULL; 
    97         debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor: Parsing optional infoblocks...\n"); 
     89        debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor: Parsing optional infoblocks...\n"); 
    9890         
    9991        while (offset < getLength()) { 
    100                 debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor:  Optional block found...\n"); 
     92                debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor:  Optional block found...\n"); 
    10193                tmpInfoBlock = new AvInfoBlock(this,offset); 
    10294                if (tmpInfoBlock && tmpInfoBlock->isValid()) { 
    103                         debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor:  Optional block of type 0x%04X with length 0x%04X found\n",tmpInfoBlock->getType(), tmpInfoBlock->getLength()); 
     95                        debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor:  Optional block of type 0x%04X with length 0x%04X found\n",tmpInfoBlock->getType(), tmpInfoBlock->getLength()); 
    10496                         
    10597                        offset += tmpInfoBlock->getLength()+2; 
    10698                } else { 
    107                         debugPrint (DEBUG_LEVEL_INFO, "AvMusicStatusDescriptor:  error parsing optional infoblock\n"); 
     99                        if (tmpInfoBlock) { 
     100                                delete tmpInfoBlock; 
     101                                tmpInfoBlock=NULL; 
     102                        } 
     103                        debugPrint (DEBUG_LEVEL_DESCRIPTOR, "AvMusicStatusDescriptor:  error parsing optional infoblock\n"); 
    108104                        bValid=false; 
    109105                        return; 
     
    111107                 
    112108        } 
     109 
     110} 
     111 
     112AvMusicStatusDescriptor::~AvMusicStatusDescriptor()  { 
     113        if (cGeneralMusicInfoBlock) delete cGeneralMusicInfoBlock; 
     114        if (cOutputPlugStatusInfoBlock) delete cOutputPlugStatusInfoBlock; 
     115} 
     116 
     117void AvMusicStatusDescriptor::printCapabilities() { 
    113118         
    114119         
  • trunk/freebob/src/avmusicstatusdescriptor.h

    r25 r26  
    3636class AvMusicStatusDescriptor : public AvDescriptor { 
    3737 public: 
    38     AvMusicStatusDescriptor(AvDevice *parent); 
     38    AvMusicStatusDescriptor(AvDevice *parent, unsigned char id); 
    3939    ~AvMusicStatusDescriptor(); 
    4040     
  • trunk/freebob/src/avnameinfoblock.cpp

    r24 r26  
    6666                 
    6767                if((readlen=readBuffer(0x10,primary_field_length_textblock_1,nameBuffer))<primary_field_length_textblock_1) { 
    68                         debugPrint (DEBUG_LEVEL_INFO, "      truncated????\n"); 
     68                        debugPrint (DEBUG_LEVEL_INFOBLOCK, "      truncated????\n"); 
    6969                         
    7070                        nameBuffer[primary_field_length_textblock_1-1]=0; // make sure the string converter doesn't read past the buffer 
  • trunk/freebob/src/avoutputplugstatusinfoblock.cpp

    r24 r26  
    4141        AvSourcePlugInfoBlock *tmpAvSourcePlugInfoBlock=NULL; 
    4242 
    43         debugPrint(DEBUG_LEVEL_INFO,"AvOutputPlugStatusInfoBlock: Creating... length=0x%04X\n",getLength()); 
    44         debugPrint(DEBUG_LEVEL_INFO,"AvOutputPlugStatusInfoBlock:   Number of source plugs=%d\n",nb_sourceplugs); 
     43        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvOutputPlugStatusInfoBlock: Creating... length=0x%04X\n",getLength()); 
     44        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvOutputPlugStatusInfoBlock:   Number of source plugs=%d\n",nb_sourceplugs); 
    4545                 
    4646        if (nb_sourceplugs>0) { 
    4747                for (unsigned int i=0;i<nb_sourceplugs;i++) { 
    48                         debugPrint(DEBUG_LEVEL_INFO,"AvOutputPlugStatusInfoBlock: source plug=%d\n",i); 
     48                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvOutputPlugStatusInfoBlock: source plug=%d\n",i); 
    4949                        tmpAvSourcePlugInfoBlock=new AvSourcePlugInfoBlock(parent, next_block_position); 
    5050                         
    5151                        if (tmpAvSourcePlugInfoBlock && (tmpAvSourcePlugInfoBlock->isValid())) { 
    52                                 //debugPrint(DEBUG_LEVEL_INFO,"AvOutputPlugStatusInfoBlock: source plug type=0x%04X\n",tmpAvSourcePlugInfoBlock->getType()); 
     52                                //debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvOutputPlugStatusInfoBlock: source plug type=0x%04X\n",tmpAvSourcePlugInfoBlock->getType()); 
    5353                                next_block_position+=tmpAvSourcePlugInfoBlock->getLength()+2; // the 2 is due to the fact that the length of the length field of the infoblock isn't accounted for; 
    5454                                 
     
    5959                                 
    6060                        } else { 
    61                                 debugPrint(DEBUG_LEVEL_INFO,"AvOutputPlugStatusInfoBlock: Invalid block... parse error!\n"); 
     61                                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvOutputPlugStatusInfoBlock: Invalid block... parse error!\n"); 
    6262                                bValid=false; 
    6363                                break; // what to do now? 
     
    6767        } 
    6868         
    69         debugPrint(DEBUG_LEVEL_INFO,"AvOutputPlugStatusInfoBlock: Created\n"); 
     69        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvOutputPlugStatusInfoBlock: Created\n"); 
    7070         
    7171} 
  • trunk/freebob/src/avsourcepluginfoblock.cpp

    r24 r26  
    4545        cAudioSyncInfoBlock=NULL; 
    4646         
    47         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Creating... length=0x%04X\n",getLength()); 
     47        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Creating... length=0x%04X\n",getLength()); 
    4848 
    4949        // parse the child info blocks 
    5050        while ((next_block_position<address+getLength())) { 
    51                 debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Creating tmpInfoBlock\n"); 
     51                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Creating tmpInfoBlock\n"); 
    5252 
    5353                tmpInfoBlock=new AvInfoBlock(parent,next_block_position); 
    5454                 
    55                 debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: testing tmpInfoBlock\n"); 
     55                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: testing tmpInfoBlock\n"); 
    5656                if (tmpInfoBlock && tmpInfoBlock->isValid()) { 
    5757                        // read the type of the block 
    5858                        // note: only one block instance per type is supported (according to the specs) 
    59                         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: position=0x%04X  type=0x%04X\n",next_block_position,tmpInfoBlock->getType()); 
     59                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: position=0x%04X  type=0x%04X\n",next_block_position,tmpInfoBlock->getType()); 
    6060                        switch (tmpInfoBlock->getType()) { 
    6161                                case 0x8103: 
    62                                 debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Creating AudioInfoBlock\n"); 
     62                                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Creating AudioInfoBlock\n"); 
    6363                                        if(cAudioInfoBlock) { 
    64                                                 debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: deleting duplicate cAudioInfoBlock. Non-conformant info block!\n"); 
     64                                                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: deleting duplicate cAudioInfoBlock. Non-conformant info block!\n"); 
    6565                                                delete cAudioInfoBlock; 
    6666                                        } 
     
    6868                                break; 
    6969                                case 0x8104: 
    70                                         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Creating MidiInfoBlock\n"); 
     70                                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Creating MidiInfoBlock\n"); 
    7171                                        if(cMidiInfoBlock) { 
    72                                                 debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: deleting duplicate cMidiInfoBlock. Non-conformant info block!\n"); 
     72                                                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: deleting duplicate cMidiInfoBlock. Non-conformant info block!\n"); 
    7373                                                delete cMidiInfoBlock; 
    7474                                        } 
     
    7676                                break; 
    7777                                case 0x8105: 
    78                                         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Skipping SMPTE block, unsupported.\n"); 
     78                                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Skipping SMPTE block, unsupported.\n"); 
    7979                                break; 
    8080                                case 0x8106: 
    81                                         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Skipping SampleCount block, unsupported.\n"); 
     81                                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Skipping SampleCount block, unsupported.\n"); 
    8282                                break; 
    8383                                case 0x8107: 
    84                                         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Creating AudioSyncInfoBlock\n"); 
     84                                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Creating AudioSyncInfoBlock\n"); 
    8585                                        if(cAudioSyncInfoBlock) { 
    86                                                 debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: deleting duplicate cAudioSyncInfoBlock. Non-conformant info block!\n"); 
     86                                                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: deleting duplicate cAudioSyncInfoBlock. Non-conformant info block!\n"); 
    8787                                                delete cAudioSyncInfoBlock; 
    8888                                        } 
     
    9090                                break; 
    9191                                default: 
    92                                         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Skipping unknown block\n"); 
     92                                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Skipping unknown block\n"); 
    9393                                break; 
    9494                                 
     
    9696                        // update the block position pointer 
    9797                        next_block_position+=tmpInfoBlock->getLength()+2; 
    98                         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Advancing to position=0x%04X\n",next_block_position); 
     98                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Advancing to position=0x%04X\n",next_block_position); 
    9999                         
    100100                } else { 
    101                         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Parse error!\n"); 
     101                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Parse error!\n"); 
    102102                        bValid=false; 
    103103                        break; 
     
    115115        } 
    116116         
    117         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: Created\n"); 
     117        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: Created\n"); 
    118118         
    119119} 
     
    135135void AvSourcePlugInfoBlock::printContents() { 
    136136        if(cAudioInfoBlock) { 
    137                 debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: AudioInfoBlock: %s\n",cAudioInfoBlock->getName()); 
     137                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: AudioInfoBlock: %s\n",cAudioInfoBlock->getName()); 
    138138        } 
    139139        if(cMidiInfoBlock) { 
    140                 debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: MidiInfoBlock %d streams\n",cMidiInfoBlock->getNbStreams()); 
     140                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: MidiInfoBlock %d streams\n",cMidiInfoBlock->getNbStreams()); 
    141141                for (unsigned int i=0;i<cMidiInfoBlock->getNbStreams();i++) { 
    142                         debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: MidiInfoBlock stream %d: %s\n",i,cMidiInfoBlock->getName(i)); 
     142                        debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: MidiInfoBlock stream %d: %s\n",i,cMidiInfoBlock->getName(i)); 
    143143                } 
    144144        } 
    145145        if(cAudioSyncInfoBlock) { 
    146                 debugPrint(DEBUG_LEVEL_INFO,"AvSourcePlugInfoBlock: AudioSyncInfoBlock can sync to: Bus? %s / External? %s\n", 
     146                debugPrint(DEBUG_LEVEL_INFOBLOCK,"AvSourcePlugInfoBlock: AudioSyncInfoBlock can sync to: Bus? %s / External? %s\n", 
    147147                        cAudioSyncInfoBlock->canSyncBus()?"yes":"no", 
    148148                        cAudioSyncInfoBlock->canSyncExternal()?"yes":"no" 
  • trunk/freebob/src/debugmodule.h

    r21 r26  
    2525#include "ieee1394service.h" 
    2626 
    27 #define DEBUG_LEVEL_INFO          5 
    28 #define DEBUG_LEVEL_TRANSFERS     6 
     27#define DEBUG_LEVEL_INFO                (1<<0) 
     28#define DEBUG_LEVEL_DEVICE              (1<<1) 
     29#define DEBUG_LEVEL_SUBUNIT             (1<<2) 
     30#define DEBUG_LEVEL_DESCRIPTOR          (1<<3) 
     31#define DEBUG_LEVEL_INFOBLOCK           (1<<4) 
    2932 
    30 #define DEBUG_LEVEL DEBUG_LEVEL_INFO 
     33#define DEBUG_LEVEL_TRANSFERS          (1<<5) 
    3134 
    32 #define debugError(format, args...) fprintf( stderr, format,  ##args ) 
    33 #define debugPrint(Level, format, args...) if(DEBUG_LEVEL>=Level) printf( format, ##args ); 
     35#define DEBUG_LEVEL  (DEBUG_LEVEL_INFO | DEBUG_LEVEL_DEVICE | DEBUG_LEVEL_SUBUNIT) 
     36#define DEBUG 
     37 
     38#ifdef DEBUG 
     39        #define debugError(format, args...) fprintf( stderr, format,  ##args ) 
     40//      #define debugPrint(Level, format, args...) if(DEBUG_LEVEL & Level) { int idebug=Level; while(idebug) {printf(" "); idebug=idebug>>1;} printf( format, ##args ); } 
     41        #define debugPrint(Level, format, args...) if(DEBUG_LEVEL & Level) { printf( format, ##args ); } 
     42#else 
     43        #define debugError(format, args...)  
     44        #define debugPrint(Level, format, args...)  
     45#endif 
    3446 
    3547unsigned char toAscii(unsigned char c); 
  • trunk/freebob/src/ieee1394service.cpp

    r25 r26  
    161161                test->Initialize(); 
    162162                if (test->isInitialised()) { 
     163#if 0   // the commented out code enables some tests of the several decriptor/infoblock classes 
    163164                        debugPrint (DEBUG_LEVEL_INFO, "   Init successfull...\n"); 
    164165                        debugPrint (DEBUG_LEVEL_INFO, "   Trying to create an AvDescriptor...\n"); 
     
    212213                        // test the AvMusicIdentifierDescriptor 
    213214                        debugPrint (DEBUG_LEVEL_INFO, "   Trying to create an AvMusicIdentifierDescriptor...\n"); 
    214                         AvMusicIdentifierDescriptor *testdesc_mid=new AvMusicIdentifierDescriptor(test); 
     215                        AvMusicIdentifierDescriptor *testdesc_mid=new AvMusicIdentifierDescriptor(test,0x00); 
    215216                        debugPrint (DEBUG_LEVEL_INFO, "    Created...\n"); 
    216217                        testdesc_mid->printCapabilities(); 
     
    220221                        // test the AvMusicStatusDescriptor 
    221222                        debugPrint (DEBUG_LEVEL_INFO, "   Trying to create an AvMusicStatusDescriptor...\n"); 
    222                         AvMusicStatusDescriptor *testdesc_mid2=new AvMusicStatusDescriptor(test); 
     223                        AvMusicStatusDescriptor *testdesc_mid2=new AvMusicStatusDescriptor(test,0x00); 
    223224                        debugPrint (DEBUG_LEVEL_INFO, "    Created...\n"); 
    224225                        testdesc_mid2->printCapabilities(); 
    225 #if 0                  
     226                       
    226227                        // test the AvInfoBlock 
    227228                        debugPrint (DEBUG_LEVEL_INFO, "    Trying to create an AvInfoBlock...\n"); 
     
    312313                         
    313314                        delete testblock8; 
    314 #endif                   
    315315                        debugPrint (DEBUG_LEVEL_INFO, "    Deleting AvMusicStatusDescriptor...\n"); 
    316316                        delete testdesc_mid2;                    
     317#endif                   
    317318                } 
    318319                debugPrint (DEBUG_LEVEL_INFO, "   Deleting AvDevice...\n"); 
  • trunk/freebob/src/Makefile.am

    r23 r26  
    3232        avdevice.h \ 
    3333        avdevice.cpp \ 
     34        avdevicesubunit.h \ 
     35        avdevicesubunit.cpp \ 
     36        avdeviceaudiosubunit.h \ 
     37        avdeviceaudiosubunit.cpp \ 
     38        avdevicemusicsubunit.h \ 
     39        avdevicemusicsubunit.cpp \ 
    3440        avdevicepool.h \ 
    3541        avdevicepool.cpp \