Changeset 1321

Show
Ignore:
Timestamp:
09/19/08 11:48:42 (12 years ago)
Author:
wagi
Message:

Implement getMinimum and getMaximum for the generic mixer.
This makes the input volume fader working for the FA-101.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/src/bebob/bebob_avdevice.cpp

    r1299 r1321  
    298298 
    299299bool 
    300 AvDevice::setFeatureFBVolumeValue(int id, int channel, int v) { 
     300AvDevice::setFeatureFBVolumeCurrent(int id, int channel, int v) { 
    301301 
    302302    FunctionBlockCmd fbCmd( get1394Service(), 
     
    330330 
    331331int 
    332 AvDevice::getFeatureFBVolumeValue(int id, int channel) { 
     332AvDevice::getFeatureFBVolumeValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute)  
     333
    333334    FunctionBlockCmd fbCmd( get1394Service(), 
    334335                            FunctionBlockCmd::eFBT_Feature, 
    335336                            id, 
    336                             FunctionBlockCmd::eCA_Current ); 
     337                            controlAttribute); 
    337338    fbCmd.setNodeId( getNodeId() ); 
    338339    fbCmd.setSubunitId( 0x00 ); 
     
    360361     
    361362    return volume; 
     363} 
     364 
     365int  
     366AvDevice::getFeatureFBVolumeMinimum(int id, int channel) 
     367{ 
     368    return getFeatureFBVolumeValue(id, channel, AVC::FunctionBlockCmd::eCA_Minimum); 
     369} 
     370 
     371int  
     372AvDevice::getFeatureFBVolumeMaximum(int id, int channel) 
     373{ 
     374    return getFeatureFBVolumeValue(id, channel, AVC::FunctionBlockCmd::eCA_Maximum); 
     375} 
     376 
     377int  
     378AvDevice::getFeatureFBVolumeCurrent(int id, int channel) 
     379{ 
     380    return getFeatureFBVolumeValue(id, channel, AVC::FunctionBlockCmd::eCA_Current);    
    362381} 
    363382 
  • branches/libffado-2.0/src/bebob/bebob_avdevice.h

    r1299 r1321  
    3737#include "libavc/general/avc_subunit.h" 
    3838#include "libavc/general/avc_plug.h" 
     39#include "libavc/audiosubunit/avc_function_block.h" 
    3940 
    4041#include "bebob/bebob_avplug.h" 
     
    8485    virtual int getSelectorFBValue(int id); 
    8586    virtual bool setSelectorFBValue(int id, int v); 
    86     virtual int getFeatureFBVolumeValue(int id, int channel); 
    87     virtual bool setFeatureFBVolumeValue(int id, int channel, int v); 
     87    virtual int getFeatureFBVolumeMinimum(int id, int channel); 
     88    virtual int getFeatureFBVolumeMaximum(int id, int channel); 
     89    virtual int getFeatureFBVolumeCurrent(int id, int channel); 
     90    virtual bool setFeatureFBVolumeCurrent(int id, int channel, int v); 
    8891 
    8992    virtual void showDevice(); 
     
    9497    virtual bool buildMixer(); 
    9598    virtual bool destroyMixer(); 
     99 
     100    virtual int getFeatureFBVolumeValue(int id, int channel, AVC::FunctionBlockCmd::EControlAttribute controlAttribute); 
    96101 
    97102public: 
  • branches/libffado-2.0/src/bebob/bebob_mixer.cpp

    r1158 r1321  
    227227    debugOutput(DEBUG_LEVEL_NORMAL,"Set feature volume %d to %d...\n", 
    228228        m_Slave.getId(), volume); 
    229     return m_Parent.getParent().setFeatureFBVolumeValue(m_Slave.getId(), idx, volume); 
     229    return m_Parent.getParent().setFeatureFBVolumeCurrent(m_Slave.getId(), idx, volume); 
    230230} 
    231231 
     
    242242        m_Slave.getId()); 
    243243 
    244     return m_Parent.getParent().getFeatureFBVolumeValue(m_Slave.getId(), idx); 
     244    return m_Parent.getParent().getFeatureFBVolumeCurrent(m_Slave.getId(), idx); 
     245
     246 
     247double 
     248MixerFBFeature::getMinimum() 
     249
     250    debugOutput(DEBUG_LEVEL_NORMAL,"Get feature minimum volume %d...\n", 
     251        m_Slave.getId()); 
     252 
     253    return m_Parent.getParent().getFeatureFBVolumeMinimum(m_Slave.getId(), 0); 
     254
     255 
     256double 
     257MixerFBFeature::getMaximum() 
     258
     259    debugOutput(DEBUG_LEVEL_NORMAL,"Get feature maximum volume %d...\n", 
     260        m_Slave.getId()); 
     261 
     262    return m_Parent.getParent().getFeatureFBVolumeMaximum(m_Slave.getId(), 0); 
    245263} 
    246264 
  • branches/libffado-2.0/src/bebob/bebob_mixer.h

    r1158 r1321  
    7979    virtual bool setValue(int idx, double v); 
    8080    virtual double getValue(int idx); 
    81     virtual double getMinimum() {return 0.0;}
    82     virtual double getMaximum() {return 0.0;}
     81    virtual double getMinimum()
     82    virtual double getMaximum()
    8383 
    8484private: 
     
    100100        {return getValue();}; 
    101101 
    102     virtual double getMinimum() {return 0.0;}; 
    103     virtual double getMaximum() {return 0.0;}; 
     102    virtual double getMinimum() {return -32768;}; 
     103    virtual double getMaximum() {return 0;}; 
    104104 
    105105private: 
  • branches/libffado-2.0/src/fireworks/fireworks_control.h

    r1284 r1321  
    9696        {return getValue();}; 
    9797 
    98     virtual double getMinimum() {return 0.0;}; 
    99     virtual double getMaximum() {return 0.0;}; 
     98    virtual double getMinimum() {return -100.0;}; 
     99    virtual double getMaximum() {return 10.0;}; 
    100100 
    101101protected: 
  • branches/libffado-2.0/support/dbus/controlserver.cpp

    r1297 r1321  
    466466Continuous::getMinimum() 
    467467{ 
    468     debugOutput( DEBUG_LEVEL_VERBOSE, "getMinimum() TODO: Return a real device-value...\n" ); 
    469     return -100.0; 
     468    double val = m_Slave.getMinimum(); 
     469    debugOutput( DEBUG_LEVEL_VERBOSE, "getMinimum() => %lf\n", val ); 
     470    return val; 
    470471} 
    471472 
     
    473474Continuous::getMaximum() 
    474475{ 
    475     debugOutput( DEBUG_LEVEL_VERBOSE, "getMaximum() TODO: Return a real device-value...\n" ); 
    476     return 10.0; 
     476    double val = m_Slave.getMaximum(); 
     477    debugOutput( DEBUG_LEVEL_VERBOSE, "getMaximum() => %lf\n", val ); 
     478    return val; 
    477479} 
    478480