Show
Ignore:
Timestamp:
08/29/07 01:28:06 (17 years ago)
Author:
ppalmers
Message:

- First attempt at mixer control (still disfunctional)
- moved vendor specific code in bebob/*

Files:

Legend:

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

    r560 r581  
    7575 
    7676DeviceManager::DeviceManager() 
    77     : OscNode("devicemanager") 
     77    : Control::Container("devicemanager") 
    7878    , m_1394Service( 0 ) 
    79     , m_oscServer( NULL ) 
    8079{ 
    8180    addOption(Util::OptionContainer::Option("slaveMode",false)); 
     
    8584DeviceManager::~DeviceManager() 
    8685{ 
    87     if (m_oscServer) { 
    88         m_oscServer->stop(); 
    89         delete m_oscServer; 
    90     } 
    91  
    9286    for ( FFADODeviceVectorIterator it = m_avDevices.begin(); 
    9387          it != m_avDevices.end(); 
     
    107101 
    108102    if (m_1394Service) m_1394Service->setVerboseLevel(l); 
    109     if (m_oscServer) m_oscServer->setVerboseLevel(l); 
    110     OscNode::setVerboseLevel(l); 
     103    Control::Element::setVerboseLevel(l); 
    111104 
    112105    for ( FFADODeviceVectorIterator it = m_avDevices.begin(); 
     
    121114DeviceManager::show() { 
    122115    debugOutput(DEBUG_LEVEL_NORMAL, "===== Device Manager =====\n"); 
     116    Control::Element::show(); 
     117     
    123118    if (m_1394Service) debugOutput(DEBUG_LEVEL_NORMAL, "1394 port: %d\n", m_1394Service->getPort()); 
    124119 
     
    150145    } 
    151146 
    152 //     m_oscServer = new OSC::OscServer("17820"); 
    153 //  
    154 //     if (!m_oscServer) { 
    155 //         debugFatal("failed to create osc server\n"); 
    156 //         delete m_1394Service; 
    157 //         m_1394Service = 0; 
    158 //         return false; 
    159 //     } 
    160 //  
    161 //     if (!m_oscServer->init()) { 
    162 //         debugFatal("failed to init osc server\n"); 
    163 //         delete m_oscServer; 
    164 //         m_oscServer = NULL; 
    165 //         delete m_1394Service; 
    166 //         m_1394Service = 0; 
    167 //         return false; 
    168 //     } 
    169 //  
    170 //     if (!m_oscServer->registerAtRootNode(this)) { 
    171 //         debugFatal("failed to register devicemanager at server\n"); 
    172 //         delete m_oscServer; 
    173 //         m_oscServer = NULL; 
    174 //         delete m_1394Service; 
    175 //         m_1394Service = 0; 
    176 //         return false; 
    177 //     } 
    178 //  
    179 //     if (!m_oscServer->start()) { 
    180 //         debugFatal("failed to start osc server\n"); 
    181 //         delete m_oscServer; 
    182 //         m_oscServer = NULL; 
    183 //         delete m_1394Service; 
    184 //         m_1394Service = 0; 
    185 //         return false; 
    186 //     } 
    187  
    188147    setVerboseLevel(getDebugLevel()); 
    189148    return true; 
     
    208167          ++it ) 
    209168    { 
    210         if (!removeChildOscNode(*it)) { 
    211             debugWarning("failed to unregister AvDevice from OSC server\n"); 
     169        if (!deleteElement(*it)) { 
     170            debugWarning("failed to remove AvDevice from Control::Container\n"); 
    212171        } 
    213172        delete *it; 
     
    281240                m_avDevices.push_back( avDevice ); 
    282241 
    283                 if (!addChildOscNode(avDevice)) { 
    284                     debugWarning("failed to register AvDevice at OSC server\n"); 
     242                if (!addElement(avDevice)) { 
     243                    debugWarning("failed to add AvDevice to Control::Container\n"); 
    285244                } 
    286245                 
  • trunk/libffado/src/devicemanager.h

    r560 r581  
    3232 
    3333#include "libutil/OptionContainer.h" 
    34 #include "libosc/OscServer.h" 
    35 #include "libosc/OscNode.h" 
     34// #include "libosc/OscServer.h" 
     35// #include "libosc/OscNode.h" 
     36#include "libcontrol/BasicElements.h" 
    3637 
    3738#include <glibmm/ustring.h> 
     
    5051class DeviceManager 
    5152    : public Util::OptionContainer, 
    52       public OSC::OscNode 
     53      public Control::Container 
    5354{ 
    5455public: 
     
    7374    void show(); 
    7475 
     76    // the Control::Container functions 
     77    virtual std::string getName()  
     78        {return "DeviceManager";}; 
     79    virtual bool setName( std::string n ) 
     80        { return false;}; 
     81 
    7582protected: 
    7683    FFADODevice* getDriverForDevice( std::auto_ptr<ConfigRom>( configRom ), 
     
    8289    FFADODeviceVector  m_avDevices; 
    8390 
    84     OSC::OscServer*  m_oscServer; 
     91//     OSC::OscServer*  m_oscServer; 
    8592 
    8693// debug stuff 
  • trunk/libffado/src/ffadodevice.cpp

    r560 r581  
    3838                    Ieee1394Service& ieee1394service, 
    3939                    int nodeId ) 
    40     : OscNode() 
     40    : Control::Container() 
    4141    , m_pConfigRom( configRom ) 
    4242    , m_p1394Service( &ieee1394service ) 
     
    4747    std::ostringstream nodestr; 
    4848    nodestr << "node" << nodeId; 
    49     setOscBase(nodestr.str()); 
     49//     setOscBase(nodestr.str()); 
    5050    ConfigRom& c = getConfigRom(); 
    5151 
    52     addChildOscNode(&c); 
     52//     addChildOscNode(&c); 
     53
     54 
     55std::string 
     56FFADODevice::getName() 
     57
     58    return getConfigRom().getGuidString(); 
    5359} 
    5460 
     
    8793 
    8894    retval=setOption("id",idstr.str()); 
    89     if (retval) { 
     95/*    if (retval) { 
    9096        setOscBase(idstr.str()); 
    91     } 
     97    }*/ 
    9298    return retval; 
    9399} 
  • trunk/libffado/src/ffadodevice.h

    r560 r581  
    2727 
    2828#include "libutil/OptionContainer.h" 
    29 #include "libosc/OscNode.h" 
     29#include "libcontrol/BasicElements.h" 
    3030 
    3131class ConfigRom; 
     
    4545class FFADODevice 
    4646    : public Util::OptionContainer, 
    47       public OSC::OscNode 
     47      public Control::Container 
    4848{ 
    4949public: 
     
    288288    int getNodeId() { return m_nodeId;}; 
    289289 
     290    // the Control::Container functions 
     291    virtual std::string getName(); 
     292    virtual bool setName( std::string n ) 
     293        { return false; }; 
     294 
     295 
    290296protected: 
    291297    std::auto_ptr<ConfigRom>( m_pConfigRom ); 
  • trunk/libffado/src/libcontrol/BasicElements.cpp

    r575 r581  
    2626namespace Control { 
    2727 
    28 Contignous::Contignous() 
     28Continuous::Continuous() 
    2929: Element() 
    3030, m_Value( 0.0 ) 
     
    3232} 
    3333 
    34 Contignous::Contignous(std::string n) 
     34Continuous::Continuous(std::string n) 
    3535: Element(n) 
    3636, m_Value( 0.0 ) 
     
    3939 
    4040void 
    41 Contignous::show() 
     41Continuous::show() 
    4242{ 
    43     debugOutput( DEBUG_LEVEL_NORMAL, "Contignous Element %s, value=%lf\n", 
     43    debugOutput( DEBUG_LEVEL_NORMAL, "Continuous Element %s, value=%lf\n", 
    4444        getName().c_str(), m_Value); 
    4545} 
    4646 
    4747bool 
    48 Contignous::setValue(double v) 
     48Continuous::setValue(double v) 
    4949{ 
    5050    debugOutput( DEBUG_LEVEL_VERBOSE, "%s setValue(%lf)\n", 
     
    5656 
    5757double 
    58 Contignous::getValue() 
     58Continuous::getValue() 
    5959{ 
    6060    debugOutput( DEBUG_LEVEL_VERBOSE, "%s getValue()=%lf\n", 
     
    6464} 
    6565 
     66//// --- 
     67 
     68Discrete::Discrete() 
     69: Element() 
     70, m_Value( 0 ) 
     71{ 
     72} 
     73 
     74Discrete::Discrete(std::string n) 
     75: Element(n) 
     76, m_Value( 0 ) 
     77{ 
     78} 
     79 
     80void 
     81Discrete::show() 
     82{ 
     83    debugOutput( DEBUG_LEVEL_NORMAL, "Discrete Element %s, value=%d\n", 
     84        getName().c_str(), m_Value); 
     85} 
     86 
     87bool 
     88Discrete::setValue(int v) 
     89{ 
     90    debugOutput( DEBUG_LEVEL_VERBOSE, "%s setValue(%d)\n", 
     91        getName().c_str(), v); 
     92     
     93    m_Value=v; 
     94    return true; 
     95} 
     96 
     97int 
     98Discrete::getValue() 
     99{ 
     100    debugOutput( DEBUG_LEVEL_VERBOSE, "%s getValue()=%d\n", 
     101        getName().c_str(), m_Value); 
     102     
     103    return m_Value; 
     104} 
     105 
    66106} // namespace Control 
  • trunk/libffado/src/libcontrol/BasicElements.h

    r575 r581  
    3737@brief Base class for contignous control elements 
    3838*/ 
    39 class Contignous 
     39class Continuous 
    4040: public Element 
    4141{ 
    4242public: 
    43     Contignous(); 
    44     Contignous(std::string n); 
    45     virtual ~Contignous() {}; 
     43    Continuous(); 
     44    Continuous(std::string n); 
     45    virtual ~Continuous() {}; 
    4646     
    4747    virtual bool setValue(double v); 
     
    5454}; 
    5555 
     56/*! 
     57@brief Base class for discrete control elements 
     58*/ 
     59class Discrete 
     60: public Element 
     61{ 
     62public: 
     63    Discrete(); 
     64    Discrete(std::string n); 
     65    virtual ~Discrete() {}; 
     66     
     67    virtual bool setValue(int v); 
     68    virtual int getValue(); 
     69 
     70    virtual void show(); 
     71 
     72private: 
     73    int m_Value; 
     74}; 
     75 
    5676}; // namespace Control 
    5777 
  • trunk/libffado/src/libcontrol/Element.cpp

    r575 r581  
    3838 
    3939Element::Element() 
    40 : m_id(GlobalElementCounter++) 
     40: m_Name ( "NoName" ) 
     41, m_Label ( "No Label" ) 
     42, m_Description ( "No Description" ) 
     43, m_id(GlobalElementCounter++) 
    4144{ 
    4245} 
     
    4447Element::Element(std::string n) 
    4548: m_Name( n ) 
     49, m_Label ( "No Label" ) 
     50, m_Description ( "No Description" ) 
    4651, m_id(GlobalElementCounter++) 
    4752{ 
  • trunk/libffado/src/libcontrol/Element.h

    r575 r581  
    4848        { m_Name=n; return true;}; 
    4949 
     50    virtual std::string getLabel() {return m_Label;}; 
     51    virtual bool setLabel( std::string n ) 
     52        { m_Label=n; return true;}; 
     53 
     54    virtual std::string getDescription() {return m_Description;}; 
     55    virtual bool setDescription( std::string n ) 
     56        { m_Description=n; return true;}; 
     57 
    5058    uint64_t getId() 
    5159        {return m_id;}; 
     
    6068private: 
    6169    std::string m_Name; 
     70    std::string m_Label; 
     71    std::string m_Description; 
     72     
    6273    uint64_t m_id; 
    6374 
     
    89100    virtual bool addElement(Element *e); 
    90101    virtual bool deleteElement(Element *e); 
    91     virtual bool clear() 
     102    virtual bool clearElements() 
    92103        {m_Children.clear(); return true;}; 
    93104 
  • trunk/libffado/src/SConscript

    r575 r581  
    8080        bebob/bebob_dl_mgr.cpp \ 
    8181        bebob/bebob_functionblock.cpp \ 
    82         bebob/GenericMixer.cpp \ 
    83         bebob/vendorspecific/focusrite.cpp \ 
    84         bebob/vendorspecific/terratec.cpp \ 
     82        bebob/bebob_mixer.cpp \ 
     83        bebob/focusrite/focusrite.cpp \ 
     84        bebob/terratec/terratec.cpp \ 
    8585        maudio/maudio_avdevice.cpp \ 
    8686' )