Changeset 1502

Show
Ignore:
Timestamp:
12/07/08 08:04:10 (12 years ago)
Author:
ppalmers
Message:

add chunk missing in merge

Files:

Legend:

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

    r1498 r1502  
    3636#include "libstreaming/motu/MotuPort.h" 
    3737 
    38 #include "libutil/DelayLockedLoop.h" 
    3938#include "libutil/Time.h" 
    4039#include "libutil/Configuration.h" 
     
    510509 
    511510bool 
    512 MotuDevice::buildMixer() { 
     511MotuDevice::buildMixerAudioControls(void) { 
     512 
    513513    bool result = true; 
    514514    MotuMatrixMixer *fader_mmixer = NULL; 
     
    520520    unsigned int bus, ch, i; 
    521521 
    522     destroyMixer(); 
    523  
    524     // create the mixer object container 
    525     m_MixerContainer = new Control::Container(this, "Mixer"); 
    526     if (!m_MixerContainer) { 
    527         debugError("Could not create mixer container...\n"); 
    528         return false; 
     522    if (DevicesProperty[m_motu_model-1].mixer == NULL) { 
     523        debugOutput(DEBUG_LEVEL_WARNING, "No mixer controls defined for model %d\n", m_motu_model); 
     524        result = false; 
    529525    } else { 
    530526        buses = DevicesProperty[m_motu_model-1].mixer->mixer_buses; 
     
    539535        } 
    540536    } 
    541  
    542537    if (result == false) { 
    543538        return true; 
    544539    } 
    545540 
    546     /* Create the matrix mixers and populate them */ 
     541    /* Create the top-level matrix mixers */ 
    547542    fader_mmixer = new ChannelFaderMatrixMixer(*this, "fader"); 
    548543    result &= m_MixerContainer->addElement(fader_mmixer); 
     
    555550        MOTU_CTRL_MASK_MUTE_VALUE, MOTU_CTRL_MASK_MUTE_SETENABLE); 
    556551    result &= m_MixerContainer->addElement(mute_mmixer); 
    557     buses = DevicesProperty[m_motu_model-1].mixer->mixer_buses; 
     552 
    558553    for (bus=0; bus<DevicesProperty[m_motu_model-1].mixer->n_mixer_buses; bus++) { 
    559554        fader_mmixer->addRowInfo(buses[bus].name, 0, buses[bus].address); 
     
    562557        mute_mmixer->addRowInfo(buses[bus].name, 0, buses[bus].address); 
    563558    } 
    564     channels = DevicesProperty[m_motu_model-1].mixer->mixer_channels; 
     559 
    565560    for (ch=0; ch<DevicesProperty[m_motu_model-1].mixer->n_mixer_channels; ch++) { 
    566561        uint32_t flags = channels[ch].flags; 
     
    575570        flags &= ~(MOTU_CTRL_CHANNEL_FADER|MOTU_CTRL_CHANNEL_PAN|MOTU_CTRL_CHANNEL_SOLO|MOTU_CTRL_CHANNEL_MUTE); 
    576571        if (flags) { 
    577             debugOutput(DEBUG_LEVEL_VERBOSE, "Control %s: unknown flag bits 0x%08x\n", channels[ch].name, flags); 
     572            debugOutput(DEBUG_LEVEL_WARNING, "Control %s: unknown flag bits 0x%08x\n", channels[ch].name, flags); 
    578573        } 
    579574    } 
     
    583578    for (i=0; i<DevicesProperty[m_motu_model-1].mixer->n_mixer_ctrls; i++) { 
    584579        const struct MixerCtrl *ctrl = &DevicesProperty[m_motu_model-1].mixer->mixer_ctrl[i]; 
    585         unsigned int type = ctrl->type
     580        unsigned int type
    586581        char name[100]; 
    587582        char label[100]; 
     583 
     584        if (ctrl == NULL) { 
     585            debugOutput(DEBUG_LEVEL_WARNING, "NULL control at index %d for model %d\n", i, m_motu_model); 
     586            continue; 
     587        } 
     588        type = ctrl->type; 
    588589        if (type & MOTU_CTRL_CHANNEL_FADER) { 
    589590            snprintf(name, 100, "%s%s", ctrl->name, "fader"); 
     
    723724 
    724725        if (type) { 
    725             debugOutput(DEBUG_LEVEL_VERBOSE, "Unknown mixer control type flag bits 0x%08x\n", ctrl->type); 
    726         } 
    727     } 
     726            debugOutput(DEBUG_LEVEL_WARNING, "Unknown mixer control type flag bits 0x%08x\n", ctrl->type); 
     727        } 
     728    } 
     729    return result; 
     730
     731 
     732bool 
     733MotuDevice::buildMixer() { 
     734    bool result = true; 
     735    debugOutput(DEBUG_LEVEL_VERBOSE, "Building a MOTU mixer...\n"); 
     736 
     737    destroyMixer(); 
     738         
     739    // create the mixer object container 
     740    m_MixerContainer = new Control::Container(this, "Mixer"); 
     741    if (!m_MixerContainer) { 
     742        debugError("Could not create mixer container...\n"); 
     743        return false; 
     744    } 
     745 
     746    // Create and populate the top-level matrix mixers 
     747    result = buildMixerAudioControls(); 
    728748 
    729749    /* Now add some general device information controls.  These may yet 
  • trunk/libffado/src/motu/motu_avdevice.h

    r1498 r1502  
    240240 
    241241private: 
     242    bool buildMixerAudioControls(void); 
    242243    bool addPort(Streaming::StreamProcessor *s_processor, 
    243244        char *name,