4 : m_drawBackground(drawBackground), m_drawMarqueeBackground(drawMarqueeBackground), m_useEndPoint(useEndPoint)
19 float transaprencyCoef = 0.1f;
20 float markerLineWidth = 1.f;
22 int width = getWidth();
23 int height = getHeight();
29 if (drawSelectionStart >= width)
30 drawSelectionStart = width - 2;
35 g.fillAll(Colour(109, 109, 109));
39 g.setColour(Colours::red);
40 drawZoomedLine(g, {float(drawSelectionStart), 0.f, float(drawSelectionStart), float(height)},
45 g.setColour(Colours::green);
46 drawZoomedLine(g, {float(drawSelectionEnd), 0.f, float(drawSelectionEnd), float(height)},
49 if (drawSelectionStart < drawSelectionEnd)
51 g.setColour(Colour::fromFloatRGBA(1.0f, 1.0f, 1.0f, transaprencyCoef));
52 Rectangle<int> zoomedRect =
53 Rectangle<int>(drawSelectionStart, 0, drawSelectionEnd - drawSelectionStart, height);
59 g.setColour(Colour::fromFloatRGBA(1.0f, 0.0f, 0.0f, transaprencyCoef));
60 Rectangle<int> zoomedRect =
61 Rectangle<int>(drawSelectionEnd, 0, drawSelectionStart - drawSelectionEnd, height);
71 if (drawSelectionStart >= width)
72 drawSelectionStart = width - 2;
75 g.fillAll(Colour(109, 109, 109));
79 g.setColour(Colours::red);
80 drawZoomedLine(g, {float(drawSelectionStart), 0.f, float(drawSelectionStart), float(height)},
87 g.fillAll(Colour(109, 109, 109));
94 float newValue = percentage;
95 if (
m_dragging ==
true && nonModulatedPercentage != -1.0f)
97 newValue = nonModulatedPercentage;
99 newValue = jlimit<float>(0.f, 1.f, newValue);
112 percentage = jlimit<float>(0.f, 1.f, percentage);
156 int width = getWidth();
163 if (modifiers.isShiftDown())
173 auto width = float(getWidth());
174 auto x = float(event.x);
176 int mx =
static_cast<int>((x - zc * width) * zf + zc * width);
179 if (isEnabled() ==
true)
182 Range<int> constraintRangeA(0, getWidth() -
m_lineWidth);
183 leftMarqueeRange = constraintRangeA.constrainRange(leftMarqueeRange);
186 rightMarqueeRange = constraintRangeA.constrainRange(rightMarqueeRange);
188 if (leftMarqueeRange.contains(mx))
193 else if (rightMarqueeRange.contains(mx))
199 if (leftMarqueeRange.contains(mx) && rightMarqueeRange.contains(mx))
217 if (isEnabled() ==
true)
221 auto width = float(getWidth());
222 auto x = float(event.x);
224 int mx =
static_cast<int>((x - zc * width) * zf + zc * width);
270 if (isEnabled() ==
true)
Definition AreaSelectionComp.h:15
virtual void sampleAreaChanged(AreaSelectionComp *areaSelectionComp, float startPos, float endPos)=0
int m_selectionStart
Definition AreaSelectionComp.h:62
bool m_leftBarWasSelected
Definition AreaSelectionComp.h:75
~AreaSelectionComp() override
Definition AreaSelectionComp.cpp:8
void modifierKeysChanged(const ModifierKeys &modifiers) override
Definition AreaSelectionComp.cpp:161
void setStartPointInPercentage(float percentage, float nonModulatedPercentage=-1)
Definition AreaSelectionComp.cpp:91
ListenerList< Listener > m_listeners
Definition AreaSelectionComp.h:46
bool m_shiftDragging
Definition AreaSelectionComp.h:55
void setEndPointInPercentage(float percentage)
Definition AreaSelectionComp.cpp:110
float m_endPosPercentage
Definition AreaSelectionComp.h:66
AreaSelectionComp(bool drawBackground, bool drawMarqueeBackground, bool useEndPoint)
Definition AreaSelectionComp.cpp:3
int m_grabAreaWidth
Definition AreaSelectionComp.h:59
float getStartPosInPercentage()
Definition AreaSelectionComp.cpp:127
float getEndPosInPercentage()
Definition AreaSelectionComp.cpp:133
int m_selectionEnd
Definition AreaSelectionComp.h:63
int m_minSelectionWidth
Definition AreaSelectionComp.h:73
void addListener(Listener *Listener)
Definition AreaSelectionComp.cpp:10
const int m_lineWidth
Definition AreaSelectionComp.h:70
bool m_shiftKeyPressed
Definition AreaSelectionComp.h:54
bool m_drawBackground
Definition AreaSelectionComp.h:50
void setWaveformMode(WaveformMode mode)
Definition AreaSelectionComp.cpp:282
bool m_rightBarWasSelected
Definition AreaSelectionComp.h:76
bool m_useEndPoint
Definition AreaSelectionComp.h:52
WaveformMode m_waveformMode
Definition AreaSelectionComp.h:79
void mouseDown(const MouseEvent &event) override
Definition AreaSelectionComp.cpp:169
void toggleAreaOrControl(bool toggleState)
Definition AreaSelectionComp.cpp:139
void removeListener(Listener *Listener)
Definition AreaSelectionComp.cpp:12
void mouseUp(const MouseEvent &event) override
Definition AreaSelectionComp.cpp:268
WaveformMode
Definition AreaSelectionComp.h:7
void determineMinSelectionWidth(float sampleRate, float numSamples)
Definition AreaSelectionComp.cpp:154
bool m_dragging
Definition AreaSelectionComp.h:77
void mouseDrag(const MouseEvent &event) override
Definition AreaSelectionComp.cpp:215
void paint(Graphics &g) override
Definition AreaSelectionComp.cpp:14
int m_selectionWidth
Definition AreaSelectionComp.h:61
bool inAreaSelectMode
Definition AreaSelectionComp.h:56
float m_startPosPercentage
Definition AreaSelectionComp.h:65
void drawZoomedLine(Graphics &g, const Line< float > &line, float thickness) const
Definition ZoomableComponent.cpp:46
void drawZoomedRect(Graphics &g, const Rectangle< float > &rect) const
Definition ZoomableComponent.cpp:24
float getHorizontalZoomFactor() const
Definition ZoomableComponent.h:36
float getHorizontalZoomCenter() const
Definition ZoomableComponent.h:37
Definition AirAbsorptionFilter.cpp:2