bool ControlParameter::operator==(const ControlParameter &control) { return m_type == control.getType() && m_controllerValue == control.getControllerValue() && m_min == control.getMin() && m_max == control.getMax(); }
void MidiDevice::removeControlFromInstrument(const ControlParameter &con) { InstrumentList insList = getAllInstruments(); InstrumentList::iterator iIt = insList.begin(); for(; iIt != insList.end(); ++iIt) { (*iIt)->removeStaticController(con.getControllerValue()); } }
ControlParameter::ControlParameter(const ControlParameter &control): XmlExportable(), m_name(control.getName()), m_type(control.getType()), m_description(control.getDescription()), m_min(control.getMin()), m_max(control.getMax()), m_default(control.getDefault()), m_controllerValue(control.getControllerValue()), m_colourIndex(control.getColourIndex()), m_ipbPosition(control.getIPBPosition()) { }
void MidiDevice::addControlToInstrument(const ControlParameter &con) { if (!isVisibleControlParameter(con)) { return; } // Run through all of this devices instruments and add default controls and // values to them. InstrumentList insList = getAllInstruments(); InstrumentList::iterator iIt = insList.begin(); for(; iIt != insList.end(); ++iIt) { MidiByte conNumber = con.getControllerValue(); MidiByte conValue = con.getDefault(); (*iIt)->setControllerValue(conNumber, conValue); } }
// Check to see if passed ControlParameter is unique. Either the // type must be unique or in the case of Controller::EventType the // ControllerValue must be unique. // // Controllers (Control type) // // bool MidiDevice::isUniqueControlParameter(const ControlParameter &con) const { return findControlParameter(con.getType(), con.getControllerValue()) == 0; }