Changeset 945

Show
Ignore:
Timestamp:
03/16/08 04:28:07 (15 years ago)
Author:
ppalmers
Message:

Add mixer application for the Saffire LE (untested)

Files:

Legend:

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

    r864 r945  
    3939    } 
    4040 
     41    if(getConfigRom().getGuid() < 0x130e0100040000LL) { 
     42        m_isSaffireLE = false; 
     43    } else { 
     44        m_isSaffireLE = true; 
     45    } 
    4146} 
    4247 
     
    5661        return false; 
    5762    } 
    58  
    59     // create control objects for the saffire 
    60     result &= m_MixerContainer->addElement( 
    61         new BinaryControl(*this,  
    62                 FR_SAFFIRE_CMD_ID_SPDIF_SWITCH, 0, 
    63                 "SpdifSwitch", "S/PDIF Switch", "S/PDIF Switch")); 
    64  
    65     // output mute controls 
    66     result &= m_MixerContainer->addElement( 
    67         new BinaryControl(*this,  
    68                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT12, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
    69                 "Out12Mute", "Out1/2 Mute", "Output 1/2 Mute")); 
    70     result &= m_MixerContainer->addElement( 
    71         new BinaryControl(*this,  
    72                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT34, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
    73                 "Out34Mute", "Out3/4 Mute", "Output 3/4 Mute")); 
    74     result &= m_MixerContainer->addElement( 
    75         new BinaryControl(*this,  
    76                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT56, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
    77                 "Out56Mute", "Out5/6 Mute", "Output 5/6 Mute")); 
    78     result &= m_MixerContainer->addElement( 
    79         new BinaryControl(*this,  
    80                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT78, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
    81                 "Out78Mute", "Out7/8 Mute", "Output 7/8 Mute")); 
    82     result &= m_MixerContainer->addElement( 
    83         new BinaryControl(*this,  
    84                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT910, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
    85                 "Out910Mute", "Out9/10 Mute", "Output 9/10 Mute")); 
    86  
    87     // output front panel hw volume control 
    88     result &= m_MixerContainer->addElement( 
    89         new BinaryControl(*this,  
    90                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT12, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_HWCTRL, 
    91                 "Out12HwCtrl", "Out1/2 HwCtrl", "Output 1/2 Front Panel Hardware volume control")); 
    92     result &= m_MixerContainer->addElement( 
    93         new BinaryControl(*this,  
    94                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT34, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_HWCTRL, 
    95                 "Out34HwCtrl", "Out3/4 HwCtrl", "Output 3/4 Front Panel Hardware volume control")); 
    96     result &= m_MixerContainer->addElement( 
    97         new BinaryControl(*this,  
    98                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT56, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_HWCTRL, 
    99                 "Out56HwCtrl", "Out5/6 HwCtrl", "Output 5/6 Front Panel Hardware volume control")); 
    100     result &= m_MixerContainer->addElement( 
    101         new BinaryControl(*this,  
    102                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT78, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_HWCTRL, 
    103                 "Out78HwCtrl", "Out7/8 HwCtrl", "Output 7/8 Front Panel Hardware volume control")); 
    104      
    105     // output level dim 
    106     result &= m_MixerContainer->addElement( 
    107         new BinaryControl(*this,  
    108                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT12, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_DIM, 
    109                 "Out12Dim", "Out1/2 Dim", "Output 1/2 Level Dim")); 
    110  
    111     // output level controls 
    112     result &= m_MixerContainer->addElement( 
    113         new VolumeControlLowRes(*this,  
    114                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT12, 0, 
    115                 "Out12Level", "Out1/2 Level", "Output 1/2 Level")); 
    116     result &= m_MixerContainer->addElement( 
    117         new VolumeControlLowRes(*this,  
    118                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT34, 0, 
    119                 "Out34Level", "Out3/4 Level", "Output 3/4 Level")); 
    120     result &= m_MixerContainer->addElement( 
    121         new VolumeControlLowRes(*this,  
    122                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT56, 0, 
    123                 "Out56Level", "Out5/6 Level", "Output 5/6 Level")); 
    124     result &= m_MixerContainer->addElement( 
    125         new VolumeControlLowRes(*this,  
    126                 FR_SAFFIRE_CMD_ID_BITFIELD_OUT78, 0, 
    127                 "Out78Level", "Out7/8 Level", "Output 7/8 Level")); 
     63     
     64    if(m_isSaffireLE) { 
     65        // create control objects for the saffire LE 
     66        result &= m_MixerContainer->addElement( 
     67            new BinaryControl(*this,  
     68                    FR_SAFFIRELE_CMD_ID_SPDIF_TRANSPARENT, 0, 
     69                    "SpdifTransparent", "S/PDIF Transparent", "S/PDIF Transparent")); 
     70        result &= m_MixerContainer->addElement( 
     71            new BinaryControl(*this,  
     72                    FR_SAFFIRELE_CMD_ID_MIDITHRU, 0, 
     73                    "MidiThru", "MIDI Thru", "MIDI Thru")); 
     74        result &= m_MixerContainer->addElement( 
     75            new BinaryControl(*this,  
     76                    FR_SAFFIRELE_CMD_ID_SAVE_SETTINGS, 0, 
     77                    "SaveSettings", "Save Settings", "Save Settings")); 
     78        result &= m_MixerContainer->addElement( 
     79            new BinaryControl(*this,  
     80                    FR_SAFFIRELE_CMD_ID_HIGH_GAIN_LINE3, 0, 
     81                    "HighGainLine3", "High Gain Line-in 3", "High Gain Line-in 3")); 
     82        result &= m_MixerContainer->addElement( 
     83            new BinaryControl(*this,  
     84                    FR_SAFFIRELE_CMD_ID_HIGH_GAIN_LINE4, 0, 
     85                    "HighGainLine4", "High Gain Line-in 4", "High Gain Line-in 4")); 
     86 
     87        // output mute controls 
     88        result &= m_MixerContainer->addElement( 
     89            new BinaryControl(*this,  
     90                    FR_SAFFIRELE_CMD_ID_BITFIELD_OUT12, FR_SAFFIRELE_CMD_ID_BITFIELD_BIT_MUTE, 
     91                    "Out12Mute", "Out1/2 Mute", "Output 1/2 Mute")); 
     92        result &= m_MixerContainer->addElement( 
     93            new BinaryControl(*this,  
     94                    FR_SAFFIRELE_CMD_ID_BITFIELD_OUT34, FR_SAFFIRELE_CMD_ID_BITFIELD_BIT_MUTE, 
     95                    "Out34Mute", "Out3/4 Mute", "Output 3/4 Mute")); 
     96        result &= m_MixerContainer->addElement( 
     97            new BinaryControl(*this,  
     98                    FR_SAFFIRELE_CMD_ID_BITFIELD_OUT56, FR_SAFFIRELE_CMD_ID_BITFIELD_BIT_MUTE, 
     99                    "Out56Mute", "Out5/6 Mute", "Output 5/6 Mute")); 
     100    } else { 
     101        // create control objects for the saffire 
     102        result &= m_MixerContainer->addElement( 
     103            new BinaryControl(*this,  
     104                    FR_SAFFIRE_CMD_ID_SPDIF_SWITCH, 0, 
     105                    "SpdifSwitch", "S/PDIF Switch", "S/PDIF Switch")); 
     106 
     107        // output mute controls 
     108        result &= m_MixerContainer->addElement( 
     109            new BinaryControl(*this,  
     110                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT12, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
     111                    "Out12Mute", "Out1/2 Mute", "Output 1/2 Mute")); 
     112        result &= m_MixerContainer->addElement( 
     113            new BinaryControl(*this,  
     114                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT34, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
     115                    "Out34Mute", "Out3/4 Mute", "Output 3/4 Mute")); 
     116        result &= m_MixerContainer->addElement( 
     117            new BinaryControl(*this,  
     118                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT56, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
     119                    "Out56Mute", "Out5/6 Mute", "Output 5/6 Mute")); 
     120        result &= m_MixerContainer->addElement( 
     121            new BinaryControl(*this,  
     122                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT78, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
     123                    "Out78Mute", "Out7/8 Mute", "Output 7/8 Mute")); 
     124        result &= m_MixerContainer->addElement( 
     125            new BinaryControl(*this,  
     126                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT910, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE, 
     127                    "Out910Mute", "Out9/10 Mute", "Output 9/10 Mute")); 
     128 
     129        // output front panel hw volume control 
     130        result &= m_MixerContainer->addElement( 
     131            new BinaryControl(*this,  
     132                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT12, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_HWCTRL, 
     133                    "Out12HwCtrl", "Out1/2 HwCtrl", "Output 1/2 Front Panel Hardware volume control")); 
     134        result &= m_MixerContainer->addElement( 
     135            new BinaryControl(*this,  
     136                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT34, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_HWCTRL, 
     137                    "Out34HwCtrl", "Out3/4 HwCtrl", "Output 3/4 Front Panel Hardware volume control")); 
     138        result &= m_MixerContainer->addElement( 
     139            new BinaryControl(*this,  
     140                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT56, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_HWCTRL, 
     141                    "Out56HwCtrl", "Out5/6 HwCtrl", "Output 5/6 Front Panel Hardware volume control")); 
     142        result &= m_MixerContainer->addElement( 
     143            new BinaryControl(*this,  
     144                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT78, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_HWCTRL, 
     145                    "Out78HwCtrl", "Out7/8 HwCtrl", "Output 7/8 Front Panel Hardware volume control")); 
     146 
     147        // output level dim 
     148        result &= m_MixerContainer->addElement( 
     149            new BinaryControl(*this,  
     150                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT12, FR_SAFFIRE_CMD_ID_BITFIELD_BIT_DIM, 
     151                    "Out12Dim", "Out1/2 Dim", "Output 1/2 Level Dim")); 
     152 
     153        // output level controls 
     154        result &= m_MixerContainer->addElement( 
     155            new VolumeControlLowRes(*this,  
     156                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT12, 0, 
     157                    "Out12Level", "Out1/2 Level", "Output 1/2 Level")); 
     158        result &= m_MixerContainer->addElement( 
     159            new VolumeControlLowRes(*this,  
     160                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT34, 0, 
     161                    "Out34Level", "Out3/4 Level", "Output 3/4 Level")); 
     162        result &= m_MixerContainer->addElement( 
     163            new VolumeControlLowRes(*this,  
     164                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT56, 0, 
     165                    "Out56Level", "Out5/6 Level", "Output 5/6 Level")); 
     166        result &= m_MixerContainer->addElement( 
     167            new VolumeControlLowRes(*this,  
     168                    FR_SAFFIRE_CMD_ID_BITFIELD_OUT78, 0, 
     169                    "Out78Level", "Out7/8 Level", "Output 7/8 Level")); 
     170    } 
    128171     
    129172    // matrix mix controls 
    130     result &= m_MixerContainer->addElement( 
    131         new SaffireMatrixMixer(*this, SaffireMatrixMixer::eMMT_InputMix, "InputMix")); 
    132  
    133     result &= m_MixerContainer->addElement( 
    134         new SaffireMatrixMixer(*this, SaffireMatrixMixer::eMMT_PCMix, "PCMix")); 
    135  
     173    if(m_isSaffireLE) { 
     174        result &= m_MixerContainer->addElement( 
     175            new SaffireMatrixMixer(*this, SaffireMatrixMixer::eMMT_LEMix48, "LEMix48")); 
     176     
     177        result &= m_MixerContainer->addElement( 
     178            new SaffireMatrixMixer(*this, SaffireMatrixMixer::eMMT_LEMix96, "LEMix96")); 
     179 
     180        result &= m_MixerContainer->addElement( 
     181            new BinaryControl(*this,  
     182                    FR_SAFFIRELE_CMD_ID_SWAP_OUT4_OUT1_48K, 0, 
     183                    "Swap41_48", "Swap41_48", "Swap41_48")); 
     184        result &= m_MixerContainer->addElement( 
     185            new BinaryControl(*this,  
     186                    FR_SAFFIRELE_CMD_ID_SWAP_OUT4_OUT1_96K, 0, 
     187                    "Swap41_96", "Swap41_96", "Swap41_96")); 
     188 
     189    } else { 
     190        result &= m_MixerContainer->addElement( 
     191            new SaffireMatrixMixer(*this, SaffireMatrixMixer::eMMT_InputMix, "InputMix")); 
     192     
     193        result &= m_MixerContainer->addElement( 
     194            new SaffireMatrixMixer(*this, SaffireMatrixMixer::eMMT_PCMix, "PCMix")); 
     195    } 
    136196 
    137197    if (!result) { 
     
    176236SaffireDevice::showDevice() 
    177237{ 
    178     debugOutput(DEBUG_LEVEL_NORMAL, "This is a BeBoB::Focusrite::SaffireDevice\n"); 
     238    if(m_isSaffireLE) { 
     239        debugOutput(DEBUG_LEVEL_NORMAL, "This is a BeBoB::Focusrite::SaffireDevice (Saffire LE)\n"); 
     240    } else { 
     241        debugOutput(DEBUG_LEVEL_NORMAL, "This is a BeBoB::Focusrite::SaffireDevice (Saffire)\n"); 
     242    } 
    179243    FocusriteDevice::showDevice(); 
    180244} 
     
    340404        setCellInfo(5,9,FR_SAFFIRE_CMD_ID_REV2_TO_OUT10, true); 
    341405 
     406    } else if (m_type == eMMT_LEMix48) { 
     407        addSignalInfo(m_RowInfo, "IN1", "Input 1", "Analog Input 1"); 
     408        addSignalInfo(m_RowInfo, "IN2", "Input 2", "Analog Input 2"); 
     409        addSignalInfo(m_RowInfo, "IN3", "Input 3", "Analog Input 3"); 
     410        addSignalInfo(m_RowInfo, "IN4", "Input 4", "Analog Input 4"); 
     411        addSignalInfo(m_RowInfo, "SPDIFL", "SPDIF L", "S/PDIF Left Input"); 
     412        addSignalInfo(m_RowInfo, "SPDIFR", "SPDIF R", "S/PDIF Right Input"); 
     413 
     414        addSignalInfo(m_RowInfo, "PC1", "PC 1", "PC Channel 1"); 
     415        addSignalInfo(m_RowInfo, "PC2", "PC 2", "PC Channel 2"); 
     416        addSignalInfo(m_RowInfo, "PC3", "PC 3", "PC Channel 3"); 
     417        addSignalInfo(m_RowInfo, "PC4", "PC 4", "PC Channel 4"); 
     418        addSignalInfo(m_RowInfo, "PC5", "PC 5", "PC Channel 5"); 
     419        addSignalInfo(m_RowInfo, "PC6", "PC 6", "PC Channel 6"); 
     420        addSignalInfo(m_RowInfo, "PC7", "PC 7", "PC Channel 7"); 
     421        addSignalInfo(m_RowInfo, "PC8", "PC 8", "PC Channel 8"); 
     422 
     423        addSignalInfo(m_ColInfo, "OUT1", "OUT 1", "Output 1"); 
     424        addSignalInfo(m_ColInfo, "OUT2", "OUT 2", "Output 2"); 
     425        addSignalInfo(m_ColInfo, "OUT3", "OUT 3", "Output 3"); 
     426        addSignalInfo(m_ColInfo, "OUT4", "OUT 4", "Output 4"); 
     427 
     428        // init the cell matrix 
     429        #define FOCUSRITE_SAFFIRELE_48KMIX_NB_COLS 4 
     430        #define FOCUSRITE_SAFFIRELE_48KMIX_NB_ROWS 14 
     431         
     432        std::vector<struct sCellInfo> tmp_cols( FOCUSRITE_SAFFIRELE_48KMIX_NB_COLS ); 
     433        std::vector< std::vector<struct sCellInfo> > tmp_all(FOCUSRITE_SAFFIRELE_48KMIX_NB_ROWS,tmp_cols); 
     434        m_CellInfo = tmp_all; 
     435     
     436        struct sCellInfo c; 
     437        c.row=-1; 
     438        c.col=-1; 
     439        c.valid=false; 
     440        c.address=0; 
     441         
     442        for (int i=0;i<FOCUSRITE_SAFFIRELE_48KMIX_NB_COLS;i++) { 
     443            for (int j=0;j<FOCUSRITE_SAFFIRELE_48KMIX_NB_ROWS;j++) { 
     444                m_CellInfo[i][j]=c; 
     445            } 
     446        } 
     447 
     448        // now set the cells that are valid 
     449        setCellInfo(0,0,FR_SAFFIRELE_CMD_ID_IN1_TO_OUT1, true); 
     450        setCellInfo(0,1,FR_SAFFIRELE_CMD_ID_IN1_TO_OUT2, true); 
     451        setCellInfo(0,2,FR_SAFFIRELE_CMD_ID_IN1_TO_OUT3, true); 
     452        setCellInfo(0,3,FR_SAFFIRELE_CMD_ID_IN1_TO_OUT4, true); 
     453        setCellInfo(1,0,FR_SAFFIRELE_CMD_ID_IN2_TO_OUT1, true); 
     454        setCellInfo(1,1,FR_SAFFIRELE_CMD_ID_IN2_TO_OUT2, true); 
     455        setCellInfo(1,2,FR_SAFFIRELE_CMD_ID_IN2_TO_OUT3, true); 
     456        setCellInfo(1,3,FR_SAFFIRELE_CMD_ID_IN2_TO_OUT4, true); 
     457        setCellInfo(2,0,FR_SAFFIRELE_CMD_ID_IN3_TO_OUT1, true); 
     458        setCellInfo(2,1,FR_SAFFIRELE_CMD_ID_IN3_TO_OUT2, true); 
     459        setCellInfo(2,2,FR_SAFFIRELE_CMD_ID_IN3_TO_OUT3, true); 
     460        setCellInfo(2,3,FR_SAFFIRELE_CMD_ID_IN3_TO_OUT4, true); 
     461        setCellInfo(3,0,FR_SAFFIRELE_CMD_ID_IN4_TO_OUT1, true); 
     462        setCellInfo(3,1,FR_SAFFIRELE_CMD_ID_IN4_TO_OUT2, true); 
     463        setCellInfo(3,2,FR_SAFFIRELE_CMD_ID_IN4_TO_OUT3, true); 
     464        setCellInfo(3,3,FR_SAFFIRELE_CMD_ID_IN4_TO_OUT4, true); 
     465         
     466        setCellInfo(4,0,FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT1, true); 
     467        setCellInfo(4,1,FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT2, true); 
     468        setCellInfo(4,2,FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT3, true); 
     469        setCellInfo(4,3,FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT4, true); 
     470        setCellInfo(5,0,FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT1, true); 
     471        setCellInfo(5,1,FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT2, true); 
     472        setCellInfo(5,2,FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT3, true); 
     473        setCellInfo(5,3,FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT4, true); 
     474        setCellInfo(6,0,FR_SAFFIRELE_CMD_ID_PC1_TO_OUT1, true); 
     475        setCellInfo(6,1,FR_SAFFIRELE_CMD_ID_PC1_TO_OUT2, true); 
     476        setCellInfo(6,2,FR_SAFFIRELE_CMD_ID_PC1_TO_OUT3, true); 
     477        setCellInfo(6,3,FR_SAFFIRELE_CMD_ID_PC1_TO_OUT4, true); 
     478        setCellInfo(7,0,FR_SAFFIRELE_CMD_ID_PC2_TO_OUT1, true); 
     479        setCellInfo(7,1,FR_SAFFIRELE_CMD_ID_PC2_TO_OUT2, true); 
     480        setCellInfo(7,2,FR_SAFFIRELE_CMD_ID_PC2_TO_OUT3, true); 
     481        setCellInfo(7,3,FR_SAFFIRELE_CMD_ID_PC2_TO_OUT4, true); 
     482        setCellInfo(8,0,FR_SAFFIRELE_CMD_ID_PC3_TO_OUT1, true); 
     483        setCellInfo(8,1,FR_SAFFIRELE_CMD_ID_PC3_TO_OUT2, true); 
     484        setCellInfo(8,2,FR_SAFFIRELE_CMD_ID_PC3_TO_OUT3, true); 
     485        setCellInfo(8,3,FR_SAFFIRELE_CMD_ID_PC3_TO_OUT4, true); 
     486        setCellInfo(9,0,FR_SAFFIRELE_CMD_ID_PC4_TO_OUT1, true); 
     487        setCellInfo(9,1,FR_SAFFIRELE_CMD_ID_PC4_TO_OUT2, true); 
     488        setCellInfo(9,2,FR_SAFFIRELE_CMD_ID_PC4_TO_OUT3, true); 
     489        setCellInfo(9,3,FR_SAFFIRELE_CMD_ID_PC4_TO_OUT4, true); 
     490        setCellInfo(10,0,FR_SAFFIRELE_CMD_ID_PC5_TO_OUT1, true); 
     491        setCellInfo(10,1,FR_SAFFIRELE_CMD_ID_PC5_TO_OUT2, true); 
     492        setCellInfo(10,2,FR_SAFFIRELE_CMD_ID_PC5_TO_OUT3, true); 
     493        setCellInfo(10,3,FR_SAFFIRELE_CMD_ID_PC5_TO_OUT4, true); 
     494        setCellInfo(11,0,FR_SAFFIRELE_CMD_ID_PC6_TO_OUT1, true); 
     495        setCellInfo(11,1,FR_SAFFIRELE_CMD_ID_PC6_TO_OUT2, true); 
     496        setCellInfo(11,2,FR_SAFFIRELE_CMD_ID_PC6_TO_OUT3, true); 
     497        setCellInfo(11,3,FR_SAFFIRELE_CMD_ID_PC6_TO_OUT4, true); 
     498        setCellInfo(12,0,FR_SAFFIRELE_CMD_ID_PC7_TO_OUT1, true); 
     499        setCellInfo(12,1,FR_SAFFIRELE_CMD_ID_PC7_TO_OUT2, true); 
     500        setCellInfo(12,2,FR_SAFFIRELE_CMD_ID_PC7_TO_OUT3, true); 
     501        setCellInfo(12,3,FR_SAFFIRELE_CMD_ID_PC7_TO_OUT4, true); 
     502        setCellInfo(13,0,FR_SAFFIRELE_CMD_ID_PC8_TO_OUT1, true); 
     503        setCellInfo(13,1,FR_SAFFIRELE_CMD_ID_PC8_TO_OUT2, true); 
     504        setCellInfo(13,2,FR_SAFFIRELE_CMD_ID_PC8_TO_OUT3, true); 
     505        setCellInfo(13,3,FR_SAFFIRELE_CMD_ID_PC8_TO_OUT4, true); 
     506 
     507    } else if (m_type == eMMT_LEMix96) { 
     508        addSignalInfo(m_RowInfo, "IN1", "Input 1", "Analog Input 1"); 
     509        addSignalInfo(m_RowInfo, "IN2", "Input 2", "Analog Input 2"); 
     510        addSignalInfo(m_RowInfo, "IN3", "Input 3", "Analog Input 3"); 
     511        addSignalInfo(m_RowInfo, "IN4", "Input 4", "Analog Input 4"); 
     512        addSignalInfo(m_RowInfo, "SPDIFL", "SPDIF L", "S/PDIF Left Input"); 
     513        addSignalInfo(m_RowInfo, "SPDIFR", "SPDIF R", "S/PDIF Right Input"); 
     514 
     515        addSignalInfo(m_RowInfo, "PC1", "PC 1", "PC Channel 1"); 
     516        addSignalInfo(m_RowInfo, "PC2", "PC 2", "PC Channel 2"); 
     517        addSignalInfo(m_RowInfo, "PC3", "PC 3", "PC Channel 3"); 
     518        addSignalInfo(m_RowInfo, "PC4", "PC 4", "PC Channel 4"); 
     519        addSignalInfo(m_RowInfo, "PC5", "PC 5", "PC Channel 5"); 
     520        addSignalInfo(m_RowInfo, "PC6", "PC 6", "PC Channel 6"); 
     521        addSignalInfo(m_RowInfo, "PC7", "PC 7", "PC Channel 7"); 
     522        addSignalInfo(m_RowInfo, "PC8", "PC 8", "PC Channel 8"); 
     523        addSignalInfo(m_RowInfo, "RECMIXRETURN", "RECMIXRETURN", "Record mix (mono) return"); 
     524 
     525        addSignalInfo(m_ColInfo, "OUT1", "OUT 1", "Output 1"); 
     526        addSignalInfo(m_ColInfo, "OUT2", "OUT 2", "Output 2"); 
     527        addSignalInfo(m_ColInfo, "OUT3", "OUT 3", "Output 3"); 
     528        addSignalInfo(m_ColInfo, "OUT4", "OUT 4", "Output 4"); 
     529        addSignalInfo(m_ColInfo, "RECMIX", "RECMIX", "Record mix (mono)"); 
     530 
     531        // init the cell matrix 
     532        #define FOCUSRITE_SAFFIRELE_96KMIX_NB_COLS 5 
     533        #define FOCUSRITE_SAFFIRELE_96KMIX_NB_ROWS 15 
     534         
     535        std::vector<struct sCellInfo> tmp_cols( FOCUSRITE_SAFFIRELE_96KMIX_NB_COLS ); 
     536        std::vector< std::vector<struct sCellInfo> > tmp_all(FOCUSRITE_SAFFIRELE_96KMIX_NB_ROWS,tmp_cols); 
     537        m_CellInfo = tmp_all; 
     538     
     539        struct sCellInfo c; 
     540        c.row=-1; 
     541        c.col=-1; 
     542        c.valid=false; 
     543        c.address=0; 
     544         
     545        for (int i=0;i<FOCUSRITE_SAFFIRELE_96KMIX_NB_COLS;i++) { 
     546            for (int j=0;j<FOCUSRITE_SAFFIRELE_96KMIX_NB_ROWS;j++) { 
     547                m_CellInfo[i][j]=c; 
     548            } 
     549        } 
     550 
     551        // now set the cells that are valid 
     552        setCellInfo(0,4,FR_SAFFIRELE_CMD_ID_IN1_TO_RECMIX_96K, true); 
     553        setCellInfo(1,4,FR_SAFFIRELE_CMD_ID_IN2_TO_RECMIX_96K, true); 
     554        setCellInfo(2,4,FR_SAFFIRELE_CMD_ID_IN3_TO_RECMIX_96K, true); 
     555        setCellInfo(3,4,FR_SAFFIRELE_CMD_ID_IN4_TO_RECMIX_96K, true); 
     556        setCellInfo(4,4,FR_SAFFIRELE_CMD_ID_SPDIF1_TO_RECMIX_96K, true); 
     557        setCellInfo(5,4,FR_SAFFIRELE_CMD_ID_SPDIF2_TO_RECMIX_96K, true); 
     558 
     559        setCellInfo(14,0,FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT1_96K, true); 
     560        setCellInfo(14,1,FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT2_96K, true); 
     561        setCellInfo(14,2,FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT3_96K, true); 
     562        setCellInfo(14,3,FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT4_96K, true); 
     563 
     564        setCellInfo(7,0,FR_SAFFIRELE_CMD_ID_PC1_TO_OUT1_96K, true); 
     565        setCellInfo(7,1,FR_SAFFIRELE_CMD_ID_PC1_TO_OUT2_96K, true); 
     566        setCellInfo(7,2,FR_SAFFIRELE_CMD_ID_PC1_TO_OUT3_96K, true); 
     567        setCellInfo(7,3,FR_SAFFIRELE_CMD_ID_PC1_TO_OUT4_96K, true); 
     568        setCellInfo(8,0,FR_SAFFIRELE_CMD_ID_PC2_TO_OUT1_96K, true); 
     569        setCellInfo(8,1,FR_SAFFIRELE_CMD_ID_PC2_TO_OUT2_96K, true); 
     570        setCellInfo(8,2,FR_SAFFIRELE_CMD_ID_PC2_TO_OUT3_96K, true); 
     571        setCellInfo(8,3,FR_SAFFIRELE_CMD_ID_PC2_TO_OUT4_96K, true); 
    342572    } else { 
    343573        debugError("Invalid mixer type\n"); 
     
    347577void SaffireMatrixMixer::show() 
    348578{ 
    349     debugOutput(DEBUG_LEVEL_NORMAL, "Saffire Pro Matrix mixer type %d\n"); 
     579    debugOutput(DEBUG_LEVEL_NORMAL, "Saffire Matrix mixer type %d\n"); 
    350580} 
    351581 
  • trunk/libffado/src/bebob/focusrite/focusrite_saffire.h

    r864 r945  
    3131#include "libcontrol/BasicElements.h" 
    3232#include "libcontrol/MatrixMixer.h" 
     33 
     34// -- Original Saffire -- 
    3335 
    3436// The ID's for the hardware input matrix mixer 
     
    115117#define FR_SAFFIRE_CMD_ID_SPDIF_DETECT    79 
    116118 
     119// -- Saffire LE -- 
     120 
     121// The ID's for the hardware input matrix mixer 
     122#define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT1       0 
     123#define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT2       1 
     124#define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT3       2 
     125#define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT4       3 
     126#define FR_SAFFIRELE_CMD_ID_PC3_TO_OUT1       4 
     127#define FR_SAFFIRELE_CMD_ID_PC3_TO_OUT2       5 
     128#define FR_SAFFIRELE_CMD_ID_PC3_TO_OUT3       6 
     129#define FR_SAFFIRELE_CMD_ID_PC3_TO_OUT4       7 
     130#define FR_SAFFIRELE_CMD_ID_PC5_TO_OUT1       8 
     131#define FR_SAFFIRELE_CMD_ID_PC5_TO_OUT2       9 
     132#define FR_SAFFIRELE_CMD_ID_PC5_TO_OUT3       10 
     133#define FR_SAFFIRELE_CMD_ID_PC5_TO_OUT4       11 
     134#define FR_SAFFIRELE_CMD_ID_PC7_TO_OUT1       12 
     135#define FR_SAFFIRELE_CMD_ID_PC7_TO_OUT2       13 
     136#define FR_SAFFIRELE_CMD_ID_PC7_TO_OUT3       14 
     137#define FR_SAFFIRELE_CMD_ID_PC7_TO_OUT4       15 
     138#define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT1       16 
     139#define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT2       17 
     140#define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT3       18 
     141#define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT4       19 
     142#define FR_SAFFIRELE_CMD_ID_PC4_TO_OUT1       20 
     143#define FR_SAFFIRELE_CMD_ID_PC4_TO_OUT2       21 
     144#define FR_SAFFIRELE_CMD_ID_PC4_TO_OUT3       22 
     145#define FR_SAFFIRELE_CMD_ID_PC4_TO_OUT4       23 
     146#define FR_SAFFIRELE_CMD_ID_PC6_TO_OUT1       24 
     147#define FR_SAFFIRELE_CMD_ID_PC6_TO_OUT2       25 
     148#define FR_SAFFIRELE_CMD_ID_PC6_TO_OUT3       26 
     149#define FR_SAFFIRELE_CMD_ID_PC6_TO_OUT4       27 
     150#define FR_SAFFIRELE_CMD_ID_PC8_TO_OUT1       28 
     151#define FR_SAFFIRELE_CMD_ID_PC8_TO_OUT2       29 
     152#define FR_SAFFIRELE_CMD_ID_PC8_TO_OUT3       30 
     153#define FR_SAFFIRELE_CMD_ID_PC8_TO_OUT4       31 
     154 
     155#define FR_SAFFIRELE_CMD_ID_IN1_TO_OUT1       32 
     156#define FR_SAFFIRELE_CMD_ID_IN1_TO_OUT2       33 
     157#define FR_SAFFIRELE_CMD_ID_IN1_TO_OUT3       34 
     158#define FR_SAFFIRELE_CMD_ID_IN1_TO_OUT4       35 
     159#define FR_SAFFIRELE_CMD_ID_IN3_TO_OUT1       36 
     160#define FR_SAFFIRELE_CMD_ID_IN3_TO_OUT2       37 
     161#define FR_SAFFIRELE_CMD_ID_IN3_TO_OUT3       38 
     162#define FR_SAFFIRELE_CMD_ID_IN3_TO_OUT4       39 
     163#define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT1    40 
     164#define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT2    41 
     165#define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT3    42 
     166#define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT4    43 
     167#define FR_SAFFIRELE_CMD_ID_IN2_TO_OUT1       44 
     168#define FR_SAFFIRELE_CMD_ID_IN2_TO_OUT2       45 
     169#define FR_SAFFIRELE_CMD_ID_IN2_TO_OUT3       46 
     170#define FR_SAFFIRELE_CMD_ID_IN2_TO_OUT4       47 
     171#define FR_SAFFIRELE_CMD_ID_IN4_TO_OUT1       48 
     172#define FR_SAFFIRELE_CMD_ID_IN4_TO_OUT2       49 
     173#define FR_SAFFIRELE_CMD_ID_IN4_TO_OUT3       50 
     174#define FR_SAFFIRELE_CMD_ID_IN4_TO_OUT4       51 
     175#define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT1    52 
     176#define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT2    53 
     177#define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT3    54 
     178#define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT4    55 
     179 
     180#define FR_SAFFIRELE_CMD_ID_SWAP_OUT4_OUT1_48K   64 
     181 
     182// 96kHz controls 
     183#define FR_SAFFIRELE_CMD_ID_IN1_TO_RECMIX_96K        66 
     184#define FR_SAFFIRELE_CMD_ID_IN3_TO_RECMIX_96K        67 
     185#define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_RECMIX_96K     68 
     186#define FR_SAFFIRELE_CMD_ID_IN2_TO_RECMIX_96K        69 
     187#define FR_SAFFIRELE_CMD_ID_IN4_TO_RECMIX_96K        70 
     188#define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_RECMIX_96K     71 
     189 
     190#define FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT1_96K       72 
     191#define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT1_96K          73 
     192#define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT1_96K          74 
     193#define FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT3_96K       75 
     194#define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT3_96K          76 
     195#define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT3_96K          77 
     196#define FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT2_96K       78 
     197#define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT2_96K          79 
     198#define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT2_96K          80 
     199#define FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT4_96K       81 
     200#define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT4_96K          82 
     201#define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT4_96K          83 
     202 
     203#define FR_SAFFIRELE_CMD_ID_SWAP_OUT4_OUT1_96K   84 
     204 
     205// metering 
     206#define FR_SAFFIRELE_CMD_ID_METERING_IN1      90 
     207#define FR_SAFFIRELE_CMD_ID_METERING_IN3      91 
     208#define FR_SAFFIRELE_CMD_ID_METERING_SPDIF1   92 
     209#define FR_SAFFIRELE_CMD_ID_METERING_IN2      93 
     210#define FR_SAFFIRELE_CMD_ID_METERING_IN4      94 
     211#define FR_SAFFIRELE_CMD_ID_METERING_SPDIF2   95 
     212 
     213#define FR_SAFFIRELE_CMD_ID_METERING_OUT1      96 
     214#define FR_SAFFIRELE_CMD_ID_METERING_OUT3      97 
     215#define FR_SAFFIRELE_CMD_ID_METERING_OUT5      98 
     216#define FR_SAFFIRELE_CMD_ID_METERING_OUT7      99 
     217#define FR_SAFFIRELE_CMD_ID_METERING_OUT2      100 
     218#define FR_SAFFIRELE_CMD_ID_METERING_OUT4      101 
     219#define FR_SAFFIRELE_CMD_ID_METERING_OUT6      102 
     220#define FR_SAFFIRELE_CMD_ID_METERING_OUT8      103 
     221 
     222#define FR_SAFFIRELE_CMD_ID_METERING_PC1       104 
     223#define FR_SAFFIRELE_CMD_ID_METERING_PC3       105 
     224#define FR_SAFFIRELE_CMD_ID_METERING_PC2       106 
     225#define FR_SAFFIRELE_CMD_ID_METERING_PC4       107 
     226 
     227// other stuff 
     228#define FR_SAFFIRELE_CMD_ID_HIGH_GAIN_LINE3   85 
     229#define FR_SAFFIRELE_CMD_ID_HIGH_GAIN_LINE4   86 
     230 
     231#define FR_SAFFIRELE_CMD_ID_BITFIELD_OUT12      87 
     232#define FR_SAFFIRELE_CMD_ID_BITFIELD_OUT34      88 
     233#define FR_SAFFIRELE_CMD_ID_BITFIELD_OUT56      89 
     234 
     235#define FR_SAFFIRELE_CMD_ID_BITFIELD_BIT_MUTE      25 
     236#define FR_SAFFIRELE_CMD_ID_BITFIELD_BIT_HWCTRL    26 
     237 
     238#define FR_SAFFIRELE_CMD_ID_EXT_CLOCK_LOCK       108 
     239#define FR_SAFFIRELE_CMD_ID_AUDIO_ON             109 
     240#define FR_SAFFIRELE_CMD_ID_SAVE_SETTINGS        110 
     241#define FR_SAFFIRELE_CMD_ID_MIDITHRU             111 
     242#define FR_SAFFIRELE_CMD_ID_SPDIF_TRANSPARENT    112 
     243 
     244 
    117245namespace BeBoB { 
    118246namespace Focusrite { 
     
    125253    enum eMatrixMixerType { 
    126254        eMMT_InputMix, 
    127         eMMT_PCMix 
     255        eMMT_PCMix, 
     256        eMMT_LEMix48, 
     257        eMMT_LEMix96, 
    128258    }; 
    129      
    130259public: 
    131260    SaffireMatrixMixer(SaffireDevice& parent, enum eMatrixMixerType type); 
     
    153282private: 
    154283    Control::Container *m_MixerContainer; 
     284    bool m_isSaffireLE; 
    155285}; 
    156286 
  • trunk/libffado/support/mixer/ffadomixer.in

    r933 r945  
    3636from mixer_saffirepro import * 
    3737from mixer_saffire import * 
     38from mixer_saffirele import * 
    3839from mixer_af2 import * 
    3940from mixer_bcoaudio5 import * 
     
    211212        print "Found device %d: %s" % (idx, path) 
    212213         
    213         cfgrom=ConfigRomInterface(server, basepath+'/DeviceManager/'+path) 
    214         vendorId=cfgrom.getVendorId() 
    215         modelId=cfgrom.getModelId() 
    216          
    217         print "Found (%X, %X) %s %s" % (vendorId, modelId, cfgrom.getVendorName() , cfgrom.getModelName()) 
     214        cfgrom = ConfigRomInterface(server, basepath+'/DeviceManager/'+path) 
     215        vendorId = cfgrom.getVendorId() 
     216        modelId = cfgrom.getModelId() 
     217        GUID = cfgrom.getGUID() 
     218        print " Found (%X, %X, %X) %s %s" % (GUID, vendorId, modelId, cfgrom.getVendorName(), cfgrom.getModelName()) 
    218219         
    219220        thisdev=(vendorId, modelId); 
    220221         
    221222        for dev in SupportedDevices: 
    222             if dev[0]==thisdev: 
    223                 print dev[1] 
    224                 exec('forms.append('+dev[1]+'())') 
    225                 forms[idx].hw=ControlInterface(server, basepath+'/DeviceManager/'+path) 
     223            if dev[0] == thisdev: 
     224                mixerapp = dev[1] 
     225                 
     226                # hack for the focusrite devices 
     227                # Saffire:        0x130e010001???? 
     228                # SaffireLE:    0x130e010004???? 
     229                if thisdev == (0x00130e, 0x00000000): 
     230                    if GUID < 0x130e0100040000: 
     231                        mixerapp = "SaffireMixer" 
     232                    else: 
     233                        mixerapp = "SaffireLEMixer" 
     234 
     235                print mixerapp 
     236                exec('forms.append('+mixerapp+'())') 
     237                forms[idx].hw = ControlInterface(server, basepath+'/DeviceManager/'+path) 
    226238                forms[idx].initValues() 
    227239                forms[idx].show() 
  • trunk/libffado/support/mixer/SConscript

    r864 r945  
    3030        e = env.Clone() 
    3131 
    32         e['MIXERAPPS'] = [ 'phase24', 'phase88', 'saffirepro', 'saffire', 'af2', 'bcoaudio5', 'edirolfa66', 'mackie_generic' ] 
     32        e['MIXERAPPS'] = [ 'phase24', 'phase88', 'saffirepro', 'saffire', 
     33                           'saffirele', 'af2', 'bcoaudio5', 'edirolfa66', 
     34                           'mackie_generic' ] 
    3335        # 
    3436        # For the ffadomixer.in