Show
Ignore:
Timestamp:
08/22/07 10:15:34 (17 years ago)
Author:
ppalmers
Message:

Merge echoaudio branch into trunk.

This adds support for the Echo Audiofire devices to FFADO. Possibly also other devices working with the Apple Class Driver will work with this code. It is not fully complete yet, but the main rework is
done.

First of all the IAvDevice class/interface is renamed to FFADODevice, in order to separate the AV/C code from the FFADO API code. A device supported by FFADO implements a FFADODevice.

The BeBoB device has been split up into three groups:
- libavc/* : all code and commands that are specified by AV/C specs. Note that a lot of the code that used to be in BeBoB::AvDevice? now resides in AVC::Unit
- genericavc/* : a FFADODevice that uses AV/C descriptors & commands for discovery and config
- bebob/* : the bebob FFADODevice that inherits from GenericAVC::AvDevice? but that uses BridgeCo? commands for discovery

Everything has been moved as high as possible in the class hierarchy. If necessary, a subclass that uses device specific commands is introduced (e.g. BeBoB::Plug inherits from AVC::Plug and uses the
BridgeCo? extended plug info command to discover it's properties).

There are some other fixes along the way that have been done too.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r479 r554  
    5454                    Ieee1394Service& ieee1394service, 
    5555                    int nodeId ) 
    56     : IAvDevice( configRom, ieee1394service, nodeId ) 
     56    : FFADODevice( configRom, ieee1394service, nodeId ) 
    5757    , m_model( NULL ) 
    5858    , m_global_reg_offset (0xFFFFFFFFLU) 
     
    143143int 
    144144DiceAvDevice::getSamplingFrequency( ) { 
    145     ESamplingFrequency samplingFrequency; 
     145    int samplingFrequency; 
    146146 
    147147    fb_quadlet_t clockreg; 
     
    154154 
    155155    switch (clockreg) { 
    156         case DICE_RATE_32K:      samplingFrequency = eSF_32000Hz;  break; 
    157         case DICE_RATE_44K1:     samplingFrequency = eSF_44100Hz;  break; 
    158         case DICE_RATE_48K:      samplingFrequency = eSF_48000Hz;  break; 
    159         case DICE_RATE_88K2:     samplingFrequency = eSF_88200Hz;  break; 
    160         case DICE_RATE_96K:      samplingFrequency = eSF_96000Hz;  break; 
    161         case DICE_RATE_176K4:    samplingFrequency = eSF_176400Hz; break; 
    162         case DICE_RATE_192K:     samplingFrequency = eSF_192000Hz; break; 
    163         case DICE_RATE_ANY_LOW:  samplingFrequency = eSF_AnyLow;   break; 
    164         case DICE_RATE_ANY_MID:  samplingFrequency = eSF_AnyMid;   break; 
    165         case DICE_RATE_ANY_HIGH: samplingFrequency = eSF_AnyHigh;  break; 
    166         case DICE_RATE_NONE:     samplingFrequency = eSF_None;     break; 
    167         default:                 samplingFrequency = eSF_DontCare; break; 
    168     } 
    169  
    170     return convertESamplingFrequency(samplingFrequency)
     156        case DICE_RATE_32K:      samplingFrequency = 32000;  break; 
     157        case DICE_RATE_44K1:     samplingFrequency = 44100;  break; 
     158        case DICE_RATE_48K:      samplingFrequency = 48000;  break; 
     159        case DICE_RATE_88K2:     samplingFrequency = 88200;  break; 
     160        case DICE_RATE_96K:      samplingFrequency = 96000;  break; 
     161        case DICE_RATE_176K4:    samplingFrequency = 176400; break; 
     162        case DICE_RATE_192K:     samplingFrequency = 192000; break; 
     163        case DICE_RATE_ANY_LOW:  samplingFrequency = 0;   break; 
     164        case DICE_RATE_ANY_MID:  samplingFrequency = 0;   break; 
     165        case DICE_RATE_ANY_HIGH: samplingFrequency = 0;  break; 
     166        case DICE_RATE_NONE:     samplingFrequency = 0;     break; 
     167        default:                 samplingFrequency = 0; break; 
     168    } 
     169 
     170    return samplingFrequency
    171171} 
    172172 
     
    178178 
    179179bool 
    180 DiceAvDevice::setSamplingFrequency( ESamplingFrequency samplingFrequency ) 
     180DiceAvDevice::setSamplingFrequency( int samplingFrequency ) 
    181181{ 
    182182    debugOutput(DEBUG_LEVEL_VERBOSE, "Setting sample rate: %d\n", 
    183         convertESamplingFrequency(samplingFrequency)); 
     183        (samplingFrequency)); 
    184184 
    185185    bool supported=false; 
     
    188188    switch ( samplingFrequency ) { 
    189189    default: 
    190     case eSF_22050Hz
    191     case eSF_24000Hz
     190    case 22050
     191    case 24000
    192192        supported=false; 
    193193        break; 
    194     case eSF_32000Hz
     194    case 32000
    195195        supported=maskedCheckNotZeroGlobalReg( 
    196196                    DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     
    198198        select=DICE_RATE_32K; 
    199199        break; 
    200     case eSF_44100Hz
     200    case 44100
    201201        supported=maskedCheckNotZeroGlobalReg( 
    202202                    DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     
    204204        select=DICE_RATE_44K1; 
    205205        break; 
    206     case eSF_48000Hz
     206    case 48000
    207207        supported=maskedCheckNotZeroGlobalReg( 
    208208                    DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     
    210210        select=DICE_RATE_48K; 
    211211        break; 
    212     case eSF_88200Hz
     212    case 88200
    213213        supported=maskedCheckNotZeroGlobalReg( 
    214214                    DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     
    216216        select=DICE_RATE_88K2; 
    217217        break; 
    218     case eSF_96000Hz
     218    case 96000
    219219        supported=maskedCheckNotZeroGlobalReg( 
    220220                    DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     
    222222        select=DICE_RATE_96K; 
    223223        break; 
    224     case eSF_176400Hz
     224    case 176400
    225225        supported=maskedCheckNotZeroGlobalReg( 
    226226                    DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     
    228228        select=DICE_RATE_176K4; 
    229229        break; 
    230     case eSF_192000Hz
     230    case 192000
    231231        supported=maskedCheckNotZeroGlobalReg( 
    232232                    DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     
    237237 
    238238    if (!supported) { 
    239         debugWarning("Unsupported sample rate: %d\n", convertESamplingFrequency(samplingFrequency)); 
     239        debugWarning("Unsupported sample rate: %d\n", (samplingFrequency)); 
    240240        return false; 
    241241    } 
  • trunk/libffado/src/dice/dice_avdevice.h

    r516 r554  
    2525#define DICEDEVICE_H 
    2626 
    27 #include "iavdevice.h" 
     27#include "ffadodevice.h" 
    2828 
    2929#include "debugmodule/debugmodule.h" 
     
    5252}; 
    5353 
    54 class DiceAvDevice : public IAvDevice { 
     54class DiceAvDevice : public FFADODevice { 
    5555private: 
    5656    class DiceNotifier; 
     
    6767    virtual void showDevice(); 
    6868 
    69     virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); 
     69    virtual bool setSamplingFrequency( int samplingFrequency ); 
    7070    virtual int getSamplingFrequency( ); 
    7171 
     
    189189        DiceAvDevice *m_dicedevice; 
    190190    }; 
    191  
    192191}; 
    193192