MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Setup

Method Setup

Source/MidiController.cpp:2944–2971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2942}
2943
2944void 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}

Callers 1

LoadControllerLayoutMethod · 0.45

Calls 4

AddPatchCableSourceMethod · 0.80
setMethod · 0.45
GetColorMethod · 0.45
SetColorMethod · 0.45

Tested by

no test coverage detected