| 2942 | } |
| 2943 | |
| 2944 | void ControlLayoutElement::Setup(MidiController* owner, MidiMessageType type, int control, ControlDrawType drawType, float incrementAmount, bool is14Bit, int offVal, int onVal, bool scaleOutput, ControlType connectionType, float x, float y, float w, float h) |
| 2945 | { |
| 2946 | assert(incrementAmount == 0 || type == kMidiMessage_Control); //only control type can be incremental |
| 2947 | |
| 2948 | mActive = true; |
| 2949 | mType = type; |
| 2950 | mControl = control; |
| 2951 | mDrawType = drawType; |
| 2952 | mIncrementAmount = incrementAmount; |
| 2953 | m14BitMode = is14Bit; |
| 2954 | mOffVal = offVal; |
| 2955 | mOnVal = onVal; |
| 2956 | mScaleOutput = scaleOutput; |
| 2957 | mConnectionType = connectionType; |
| 2958 | mPosition.set(x, y); |
| 2959 | mDimensions.set(w, h); |
| 2960 | mLastValue = 0; |
| 2961 | mLastActivityTime = -9999; |
| 2962 | |
| 2963 | if (mControlCable == nullptr) |
| 2964 | { |
| 2965 | mControlCable = new PatchCableSource(owner, kConnectionType_UIControl); |
| 2966 | owner->AddPatchCableSource(mControlCable); |
| 2967 | ofColor color = mControlCable->GetColor(); |
| 2968 | color.a *= .25f; |
| 2969 | mControlCable->SetColor(color); |
| 2970 | } |
| 2971 | } |
no test coverage detected