Changeset 1502
- Timestamp:
- 12/07/08 08:04:10 (12 years ago)
- Files:
-
- trunk/libffado/src/motu/motu_avdevice.cpp (modified) (9 diffs)
- trunk/libffado/src/motu/motu_avdevice.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/motu/motu_avdevice.cpp
r1498 r1502 36 36 #include "libstreaming/motu/MotuPort.h" 37 37 38 #include "libutil/DelayLockedLoop.h"39 38 #include "libutil/Time.h" 40 39 #include "libutil/Configuration.h" … … 510 509 511 510 bool 512 MotuDevice::buildMixer() { 511 MotuDevice::buildMixerAudioControls(void) { 512 513 513 bool result = true; 514 514 MotuMatrixMixer *fader_mmixer = NULL; … … 520 520 unsigned int bus, ch, i; 521 521 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; 529 525 } else { 530 526 buses = DevicesProperty[m_motu_model-1].mixer->mixer_buses; … … 539 535 } 540 536 } 541 542 537 if (result == false) { 543 538 return true; 544 539 } 545 540 546 /* Create the matrix mixers and populate them*/541 /* Create the top-level matrix mixers */ 547 542 fader_mmixer = new ChannelFaderMatrixMixer(*this, "fader"); 548 543 result &= m_MixerContainer->addElement(fader_mmixer); … … 555 550 MOTU_CTRL_MASK_MUTE_VALUE, MOTU_CTRL_MASK_MUTE_SETENABLE); 556 551 result &= m_MixerContainer->addElement(mute_mmixer); 557 buses = DevicesProperty[m_motu_model-1].mixer->mixer_buses; 552 558 553 for (bus=0; bus<DevicesProperty[m_motu_model-1].mixer->n_mixer_buses; bus++) { 559 554 fader_mmixer->addRowInfo(buses[bus].name, 0, buses[bus].address); … … 562 557 mute_mmixer->addRowInfo(buses[bus].name, 0, buses[bus].address); 563 558 } 564 channels = DevicesProperty[m_motu_model-1].mixer->mixer_channels; 559 565 560 for (ch=0; ch<DevicesProperty[m_motu_model-1].mixer->n_mixer_channels; ch++) { 566 561 uint32_t flags = channels[ch].flags; … … 575 570 flags &= ~(MOTU_CTRL_CHANNEL_FADER|MOTU_CTRL_CHANNEL_PAN|MOTU_CTRL_CHANNEL_SOLO|MOTU_CTRL_CHANNEL_MUTE); 576 571 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); 578 573 } 579 574 } … … 583 578 for (i=0; i<DevicesProperty[m_motu_model-1].mixer->n_mixer_ctrls; i++) { 584 579 const struct MixerCtrl *ctrl = &DevicesProperty[m_motu_model-1].mixer->mixer_ctrl[i]; 585 unsigned int type = ctrl->type;580 unsigned int type; 586 581 char name[100]; 587 582 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; 588 589 if (type & MOTU_CTRL_CHANNEL_FADER) { 589 590 snprintf(name, 100, "%s%s", ctrl->name, "fader"); … … 723 724 724 725 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 732 bool 733 MotuDevice::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(); 728 748 729 749 /* Now add some general device information controls. These may yet trunk/libffado/src/motu/motu_avdevice.h
r1498 r1502 240 240 241 241 private: 242 bool buildMixerAudioControls(void); 242 243 bool addPort(Streaming::StreamProcessor *s_processor, 243 244 char *name,