Changeset 1651

Show
Ignore:
Timestamp:
09/03/09 14:08:00 (11 years ago)
Author:
arnonym
Message:

Lets see if this works out: Work for ppalmers.

A new way to get the peakvalues. Getting each value individual is really cpu-heavy. Getting them all toghether should be better.

(My first real code commit to the internals:)

Files:

Legend:

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

    r1630 r1651  
    336336            virtual bool getPeakValues(double &) {return false;}; 
    337337            virtual double getPeakValue(const int source, const int dest); 
     338            virtual Control::CrossbarRouter::PeakValues getPeakValues(); 
    338339 
    339340        private: 
  • trunk/libffado/src/dice/dice_eap.cpp

    r1630 r1651  
    15631563} 
    15641564 
     1565Control::CrossbarRouter::PeakValues 
     1566Device::EAP::Router::getPeakValues() 
     1567{ 
     1568    // To be implemented by ppalmers 
     1569    return PeakValues(); 
     1570} 
     1571 
    15651572void 
    15661573Device::EAP::Router::show() 
  • trunk/libffado/src/libcontrol/CrossbarRouter.h

    r1630 r1651  
    5252    typedef std::vector<int>::iterator IntVectorIterator; 
    5353 
     54    struct PeakValue 
     55    { 
     56        int source; 
     57        int destination; 
     58        double peakvalue; 
     59    }; 
     60    typedef std::vector<PeakValue> PeakValues; 
     61 
    5462    virtual std::string getSourceName(const int) = 0; 
    5563    virtual std::string getDestinationName(const int) = 0; 
     
    8593    virtual double getPeakValue(const int source, const int dest) = 0; 
    8694    virtual bool getPeakValues(double &) = 0; 
     95    virtual PeakValues getPeakValues() = 0; 
    8796 
    8897protected: 
  • trunk/libffado/support/dbus/control-interface.xml

    r1650 r1651  
    292292          <arg type="d" name="value" direction="out"/> 
    293293      </method> 
     294      <method name="getPeakValues"> 
     295          <arg type="a(iid)" name="values" direction="out"/> 
     296      </method> 
    294297  </interface> 
    295298 
  • trunk/libffado/support/dbus/controlserver.cpp

    r1650 r1651  
    942942    return m_Slave.getPeakValue(source, dest); 
    943943} 
     944std::vector< DBus::Struct<int, int, double> > 
     945CrossbarRouter::getPeakValues() 
     946{ 
     947    //return std::vector< DBus::Struct<int, int, double> >(); 
     948    std::vector< DBus::Struct<int, int, double> > out; 
     949    Control::CrossbarRouter::PeakValues values = m_Slave.getPeakValues(); 
     950    for ( unsigned int i=0; i<values.size(); ++i ) { 
     951        DBus::Struct<int, int, double> tmp; 
     952        tmp._1 = values[i].source; 
     953        tmp._2 = values[i].destination; 
     954        tmp._3 = values[i].peakvalue; 
     955        out.push_back(tmp); 
     956    } 
     957    return out; 
     958} 
    944959 
    945960std::vector< DBus::Int32 > 
  • trunk/libffado/support/dbus/controlserver.h

    r1650 r1651  
    355355    DBus::Double getPeakValue(const DBus::Int32 &source, const DBus::Int32 &dest); 
    356356 
     357    std::vector< DBus::Struct<int, int, double> > getPeakValues(); 
     358 
    357359    std::vector< DBus::Int32 > getConnectionMap(); 
    358360    DBus::Int32 setConnectionMap(const std::vector< DBus::Int32 >&);