Solving issue 2341: "Pipette and flat curves - no line colors"
This commit is contained in:
@@ -23,14 +23,43 @@ class CurveEditor;
|
||||
|
||||
class CurveListener {
|
||||
|
||||
private:
|
||||
bool multi;
|
||||
private:
|
||||
bool multi;
|
||||
public:
|
||||
CurveListener() : multi(false) {}
|
||||
virtual ~CurveListener() {}
|
||||
virtual void curveChanged () {}
|
||||
virtual void curveChanged (CurveEditor* ce) {}
|
||||
void setMulti(bool value) { multi = value; }
|
||||
bool isMulti() { return multi; }
|
||||
CurveListener() : multi(false) {}
|
||||
|
||||
/** @brief Blend pipette values from its different channels into a single value
|
||||
If the buffer has more than one channel and one channel, this method will blend them together.
|
||||
@param chan1 first channel's value
|
||||
@param chan2 second channel's value
|
||||
@param chan3 third channel's value
|
||||
@return the blended value */
|
||||
virtual float blendPipetteValues(float chan1, float chan2, float chan3) {
|
||||
float retVal = 0.f;
|
||||
int n = 0;
|
||||
if (chan1 != -1.f) {
|
||||
retVal += chan1;
|
||||
++n;
|
||||
}
|
||||
if (chan2 != -1.f) {
|
||||
retVal += chan2;
|
||||
++n;
|
||||
}
|
||||
if (chan3 != -1.f) {
|
||||
retVal += chan3;
|
||||
++n;
|
||||
}
|
||||
if (n>1)
|
||||
retVal /= n;
|
||||
else if (!n)
|
||||
retVal = -1.f;
|
||||
return retVal;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user