Changeset 1600

Show
Ignore:
Timestamp:
07/19/09 04:48:15 (15 years ago)
Author:
jwoithe
Message:

RME: put setting control type defines in a more intelligent place. Add a separate type to denote an unset type field.
RME: Export a "model" info control to report the model via dbus (to be used by ffadomixer). Handle unknown control types in set/get methods.

Files:

Legend:

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

    r1599 r1600  
    2626 
    2727namespace Rme { 
    28  
    29 #define RME_CTRL_PHANTOM_SW            0x00 
    30 #define RME_CTRL_SPDIF_INPUT_MODE      0x01 
    31 #define RME_CTRL_SPDIF_OUTPUT_OPTIONS  0x02 
    32 #define RME_CTRL_CLOCK_MODE            0x03 
    33 #define RME_CTRL_SYNC_REF              0x04 
    34 #define RME_CTRL_DEV_OPTIONS           0x05 
    35 #define RME_CTRL_LIMIT_BANDWIDTH       0x06 
    36 #define RME_CTRL_INPUT_LEVEL           0x07 
    37 #define RME_CTRL_OUTPUT_LEVEL          0x08 
    38 #define RME_CTRL_INSTRUMENT_OPTIONS    0x09 
    39 #define RME_CTRL_WCLK_SINGLE_SPEED     0x0a 
    40 #define RME_CTRL_PHONES_LEVEL          0x0b 
    41 #define RME_CTRL_INPUT0_OPTIONS        0x0c 
    42 #define RME_CTRL_INPUT1_OPTIONS        0x0d 
    43 #define RME_CTRL_INPUT2_OPTIONS        0x0e 
    4428 
    4529RmeSettingsCtrl::RmeSettingsCtrl(Device &parent, unsigned int type,  
     
    7458 
    7559    switch (m_type) { 
     60        case RME_CTRL_NONE: 
     61            debugOutput(DEBUG_LEVEL_ERROR, "control has no type set\n"); 
     62            err = 1; 
     63            break; 
    7664        case RME_CTRL_PHANTOM_SW: 
    7765            // Lowest 16 bits are phantom status bits (max 16 channels).  
     
    10189            } 
    10290            break; 
     91 
     92        // All RME_CTRL_INFO_* controls are read-only.  Warn on attempts to 
     93        // set these. 
     94        case RME_CTRL_INFO_MODEL: 
     95            debugOutput(DEBUG_LEVEL_ERROR, "Attempt to set readonly info control 0x%08x\n", m_type); 
     96            err = 1; 
     97            break; 
     98 
     99        default: 
     100            debugOutput(DEBUG_LEVEL_ERROR, "Unknown control type 0x%08x\n", m_type); 
     101            err = 1; 
    103102    } 
    104103 
     
    110109 
    111110    switch (m_type) { 
     111        case RME_CTRL_NONE: 
     112            debugOutput(DEBUG_LEVEL_ERROR, "control has no type set\n"); 
     113            break; 
     114 
    112115        case RME_CTRL_PHANTOM_SW: 
    113116            return m_value; 
    114117            break; 
     118 
     119        case RME_CTRL_INFO_MODEL: 
     120            return m_parent.getRmeModel(); 
     121            break; 
     122 
     123        default: 
     124            debugOutput(DEBUG_LEVEL_ERROR, "Unknown control type 0x%08x\n", m_type); 
    115125    } 
     126 
    116127    return 0; 
    117128} 
  • trunk/libffado/src/rme/fireface_settings_ctrls.h

    r1598 r1600  
    2929namespace Rme { 
    3030 
     31#define RME_CTRL_NONE                  0x0000 
     32#define RME_CTRL_PHANTOM_SW            0x0001 
     33#define RME_CTRL_SPDIF_INPUT_MODE      0x0002 
     34#define RME_CTRL_SPDIF_OUTPUT_OPTIONS  0x0003 
     35#define RME_CTRL_CLOCK_MODE            0x0004 
     36#define RME_CTRL_SYNC_REF              0x0005 
     37#define RME_CTRL_DEV_OPTIONS           0x0006 
     38#define RME_CTRL_LIMIT_BANDWIDTH       0x0007 
     39#define RME_CTRL_INPUT_LEVEL           0x0008 
     40#define RME_CTRL_OUTPUT_LEVEL          0x0009 
     41#define RME_CTRL_INSTRUMENT_OPTIONS    0x000a 
     42#define RME_CTRL_WCLK_SINGLE_SPEED     0x000b 
     43#define RME_CTRL_PHONES_LEVEL          0x000c 
     44#define RME_CTRL_INPUT0_OPTIONS        0x000d 
     45#define RME_CTRL_INPUT1_OPTIONS        0x000e 
     46#define RME_CTRL_INPUT2_OPTIONS        0x000f 
     47 
     48#define RME_CTRL_INFO_MODEL            0x0100 
     49 
    3150class Device; 
    3251 
  • trunk/libffado/src/rme/rme_avdevice.h

    r1599 r1600  
    9292    signed int setPhantom(unsigned int channel, unsigned int status); 
    9393 
     94    /* General information functions */ 
     95    signed int getRmeModel(void) { return m_rme_model; } 
     96 
    9497protected: 
    9598    enum ERmeModel m_rme_model;