Changeset 451

Show
Ignore:
Timestamp:
04/08/07 08:56:32 (16 years ago)
Author:
ppalmers
Message:

- First attempt at a OSC controlled mixer. The level of

abstraction is very low, meaning that you have to know
how the function blocks work. It however allows control
applications to be written and to experiment with them.

- This version only does Selector function blocks.

The following message switches the phase88 input to the

  • front (or is is back?)
    /devicemanager/dev0/GenericMixer set selector 10 0
  • back (or is it front?)
    /devicemanager/dev0/GenericMixer set selector 10 1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/bebob/bebob_avdevice.cpp

    r445 r451  
    2424#include "bebob/bebob_avdevice.h" 
    2525#include "bebob/bebob_avdevice_subunit.h" 
     26#include "bebob/GenericMixer.h" 
    2627 
    2728#include "libieee1394/configrom.h" 
     
    7273    , m_activeSyncInfo( 0 ) 
    7374    , m_model ( NULL ) 
     75    , m_Mixer ( NULL ) 
    7476{ 
    7577    debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::AvDevice (NodeID %d)\n", 
     
    8082AvDevice::~AvDevice() 
    8183{ 
     84    if(m_Mixer != NULL) { 
     85        if (!removeChildOscNode(m_Mixer)) { 
     86            debugWarning("failed to unregister mixer from OSC namespace\n"); 
     87        } 
     88        delete m_Mixer; 
     89    } 
    8290 
    8391    for ( AvDeviceSubunitVector::iterator it = m_subunits.begin(); 
     
    184192    } 
    185193 
     194    // create a GenericMixer and add it as an OSC child node 
     195    //  remove if already there 
     196    if(m_Mixer != NULL) { 
     197        if (!removeChildOscNode(m_Mixer)) { 
     198            debugWarning("failed to unregister mixer from OSC namespace\n"); 
     199        } 
     200        delete m_Mixer; 
     201    } 
     202     
     203    //  create the mixer & register it 
     204    if(getAudioSubunit(0) == NULL) { 
     205        debugWarning("Could not find audio subunit, mixer not available.\n"); 
     206        m_Mixer = NULL; 
     207    } else { 
     208        m_Mixer = new GenericMixer(*m_p1394Service , *this); 
     209        if (!addChildOscNode(m_Mixer)) { 
     210            debugWarning("failed to register mixer in OSC namespace\n"); 
     211        } 
     212    } 
    186213    return true; 
    187214} 
  • trunk/libffado/src/bebob/bebob_avdevice.h

    r445 r451  
    3333#include "bebob/bebob_avplug.h" 
    3434#include "bebob/bebob_avdevice_subunit.h" 
     35#include "bebob/GenericMixer.h" 
    3536 
    3637#include "libstreaming/AmdtpStreamProcessor.h" 
     
    120121                                  Util::IODeserialize& deser, 
    121122                  Ieee1394Service& ieee1394Service ); 
     123    AvDeviceSubunitAudio* getAudioSubunit( subunit_id_t subunitId ) 
     124        { return dynamic_cast<AvDeviceSubunitAudio*>( 
     125                   getSubunit( AVC1394_SUBUNIT_AUDIO , subunitId ));}; 
     126 
    122127protected: 
    123128 
     
    177182    SyncInfo*                 m_activeSyncInfo; 
    178183    struct VendorModelEntry*  m_model; 
     184    GenericMixer*             m_Mixer; 
    179185 
    180186    // streaming stuff 
  • trunk/libffado/src/bebob/bebob_avdevice_subunit.cpp

    r445 r451  
    270270BeBoB::AvDeviceSubunitAudio::discover() 
    271271{ 
     272    debugOutput(DEBUG_LEVEL_NORMAL, "Discovering Audio Subunit...\n"); 
     273     
    272274    if ( !AvDeviceSubunit::discover() ) { 
    273275        return false; 
     
    285287BeBoB::AvDeviceSubunitAudio::discoverConnections() 
    286288{ 
     289    debugOutput(DEBUG_LEVEL_NORMAL, "Discovering connections...\n"); 
    287290    if ( !AvDeviceSubunit::discoverConnections() ) { 
    288291        return false; 
     
    313316BeBoB::AvDeviceSubunitAudio::discoverFunctionBlocks() 
    314317{ 
     318    debugOutput( DEBUG_LEVEL_NORMAL, 
     319                 "Discovering function blocks...\n"); 
     320 
    315321    if ( !discoverFunctionBlocksDo( 
    316322             ExtendedSubunitInfoCmd::eFBT_AudioSubunitSelector) ) 
     
    337343        return false; 
    338344    } 
     345 
     346    // print a function block list 
     347#ifdef DEBUG 
     348    if (getDebugLevel() >= DEBUG_LEVEL_NORMAL) { 
     349     
     350        for ( FunctionBlockVector::iterator it = m_functions.begin(); 
     351            it != m_functions.end(); 
     352            ++it ) 
     353        { 
     354            debugOutput(DEBUG_LEVEL_NORMAL, "%20s FB, type 0x%X, id=%d\n", 
     355                (*it)->getName(), 
     356                (*it)->getType(), 
     357                (*it)->getId()); 
     358        } 
     359    } 
     360#endif 
    339361 
    340362    return true; 
  • trunk/libffado/src/bebob/bebob_avdevice_subunit.h

    r445 r451  
    112112    virtual const char* getName(); 
    113113 
    114  
     114    FunctionBlockVector getFunctionBlocks() { return m_functions; }; 
     115     
    115116protected: 
    116117    bool discoverFunctionBlocks(); 
  • trunk/libffado/src/bebob/bebob_functionblock.cpp

    r445 r451  
    8080BeBoB::FunctionBlock::discover() 
    8181{ 
    82     debugOutput( DEBUG_LEVEL_VERBOSE
     82    debugOutput( DEBUG_LEVEL_NORMAL
    8383                 "discover function block %s (nr of input plugs = %d, " 
    8484                 "nr of output plugs = %d)\n", 
  • trunk/libffado/src/bebob/bebob_functionblock.h

    r445 r451  
    3737public: 
    3838    enum EFunctionBlockType { 
    39         eFBT_AllFunctinBlockType    = 0xff, 
     39        eFBT_AllFunctionBlockType   = 0xff, 
    4040        eFBT_AudioSubunitSelector   = 0x80, 
    4141        eFBT_AudioSubunitFeature    = 0x81, 
     
    6666 
    6767    virtual const char* getName() = 0; 
     68     
     69    function_block_type_t getType() {return m_type;}; 
     70    function_block_type_t getSubtype() {return m_subtype;}; 
     71    function_block_id_t getId() {return m_id;}; 
    6872 
    6973    bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 
  • trunk/libffado/src/Makefile.am

    r445 r451  
    5252        bebob/bebob_avdevice_subunit.h bebob/bebob_avplug.h bebob/bebob_dl_bcd.h bebob/bebob_dl_codes.h \ 
    5353        bebob/bebob_dl_mgr.h bebob/bebob_functionblock.h bounce/bounce_avdevice.h bounce/bounce_slave_avdevice.h \ 
     54        bebob/GenericMixer.h \ 
    5455        maudio/maudio_avdevice.h motu/motu_avdevice.h rme/rme_avdevice.h \ 
    5556        metrichalo/mh_avdevice.h dice/dice_avdevice.h \ 
     
    133134            bebob/bebob_dl_mgr.cpp \ 
    134135            bebob/bebob_functionblock.cpp \ 
     136            bebob/GenericMixer.cpp \ 
    135137            maudio/maudio_avdevice.cpp 
    136138