Move methods to cpp file
This commit is contained in:
parent
85875d96f4
commit
cf17390293
@ -641,6 +641,24 @@ void WaveformComponent::mouseMove(const MouseEvent & e)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Range<double> WaveformComponent::getTimeSelection()
|
||||||
|
{
|
||||||
|
if (m_time_sel_start >= 0.0 && m_time_sel_end>m_time_sel_start + 0.001)
|
||||||
|
return { m_time_sel_start, m_time_sel_end };
|
||||||
|
return { 0.0, 1.0 };
|
||||||
|
}
|
||||||
|
|
||||||
|
void WaveformComponent::setTimeSelection(Range<double> rng)
|
||||||
|
{
|
||||||
|
if (m_lock_timesel_set == true)
|
||||||
|
return;
|
||||||
|
if (rng.isEmpty())
|
||||||
|
rng = { -1.0,1.0 };
|
||||||
|
m_time_sel_start = rng.getStart();
|
||||||
|
m_time_sel_end = rng.getEnd();
|
||||||
|
repaint();
|
||||||
|
}
|
||||||
|
|
||||||
int WaveformComponent::getTimeSelectionEdge(int x, int y)
|
int WaveformComponent::getTimeSelectionEdge(int x, int y)
|
||||||
{
|
{
|
||||||
int xcorleft = (int)jmap<double>(m_time_sel_start, m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth());
|
int xcorleft = (int)jmap<double>(m_time_sel_start, m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth());
|
||||||
@ -744,6 +762,13 @@ void SpectralChainEditor::paint(Graphics & g)
|
|||||||
drawBox(g, m_cur_index, m_drag_x, 0, box_w - 30, box_h);
|
drawBox(g, m_cur_index, m_drag_x, 0, box_w - 30, box_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SpectralChainEditor::setSource(StretchAudioSource * src)
|
||||||
|
{
|
||||||
|
m_src = src;
|
||||||
|
m_order = m_src->getSpectrumProcessOrder();
|
||||||
|
repaint();
|
||||||
|
}
|
||||||
|
|
||||||
void SpectralChainEditor::mouseDown(const MouseEvent & ev)
|
void SpectralChainEditor::mouseDown(const MouseEvent & ev)
|
||||||
{
|
{
|
||||||
m_did_drag = false;
|
m_did_drag = false;
|
||||||
@ -918,3 +943,21 @@ void ParameterComponent::updateComponent()
|
|||||||
m_togglebut->setToggleState(*boolpar, dontSendNotification);
|
m_togglebut->setToggleState(*boolpar, dontSendNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MySlider::MySlider(NormalisableRange<float>* range) : m_range(range)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
double MySlider::proportionOfLengthToValue(double x)
|
||||||
|
{
|
||||||
|
if (m_range)
|
||||||
|
return m_range->convertFrom0to1(x);
|
||||||
|
return Slider::proportionOfLengthToValue(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
double MySlider::valueToProportionOfLength(double x)
|
||||||
|
{
|
||||||
|
if (m_range)
|
||||||
|
return m_range->convertTo0to1(x);
|
||||||
|
return Slider::valueToProportionOfLength(x);
|
||||||
|
}
|
||||||
|
@ -44,21 +44,9 @@ class MySlider : public Slider
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MySlider() {}
|
MySlider() {}
|
||||||
MySlider(NormalisableRange<float>* range) : m_range(range)
|
MySlider(NormalisableRange<float>* range);
|
||||||
{
|
double proportionOfLengthToValue(double x) override;
|
||||||
}
|
double valueToProportionOfLength(double x) override;
|
||||||
double proportionOfLengthToValue(double x) override
|
|
||||||
{
|
|
||||||
if (m_range)
|
|
||||||
return m_range->convertFrom0to1(x);
|
|
||||||
return Slider::proportionOfLengthToValue(x);
|
|
||||||
}
|
|
||||||
double valueToProportionOfLength(double x) override
|
|
||||||
{
|
|
||||||
if (m_range)
|
|
||||||
return m_range->convertTo0to1(x);
|
|
||||||
return Slider::valueToProportionOfLength(x);
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
NormalisableRange<float>* m_range = nullptr;
|
NormalisableRange<float>* m_range = nullptr;
|
||||||
};
|
};
|
||||||
@ -112,22 +100,8 @@ public:
|
|||||||
void mouseUp(const MouseEvent& e) override;
|
void mouseUp(const MouseEvent& e) override;
|
||||||
void mouseDrag(const MouseEvent& e) override;
|
void mouseDrag(const MouseEvent& e) override;
|
||||||
void mouseMove(const MouseEvent& e) override;
|
void mouseMove(const MouseEvent& e) override;
|
||||||
Range<double> getTimeSelection()
|
Range<double> getTimeSelection();
|
||||||
{
|
void setTimeSelection(Range<double> rng);
|
||||||
if (m_time_sel_start >= 0.0 && m_time_sel_end>m_time_sel_start + 0.001)
|
|
||||||
return { m_time_sel_start, m_time_sel_end };
|
|
||||||
return { 0.0, 1.0 };
|
|
||||||
}
|
|
||||||
void setTimeSelection(Range<double> rng)
|
|
||||||
{
|
|
||||||
if (m_lock_timesel_set == true)
|
|
||||||
return;
|
|
||||||
if (rng.isEmpty())
|
|
||||||
rng = { -1.0,1.0 };
|
|
||||||
m_time_sel_start = rng.getStart();
|
|
||||||
m_time_sel_end = rng.getEnd();
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
void setFileCachedRange(std::pair<Range<double>, Range<double>> rng);
|
void setFileCachedRange(std::pair<Range<double>, Range<double>> rng);
|
||||||
void setTimerEnabled(bool b);
|
void setTimerEnabled(bool b);
|
||||||
void setViewRange(Range<double> rng);
|
void setViewRange(Range<double> rng);
|
||||||
@ -162,12 +136,7 @@ class SpectralChainEditor : public Component
|
|||||||
public:
|
public:
|
||||||
SpectralChainEditor() {}
|
SpectralChainEditor() {}
|
||||||
void paint(Graphics& g) override;
|
void paint(Graphics& g) override;
|
||||||
void setSource(StretchAudioSource* src)
|
void setSource(StretchAudioSource* src);
|
||||||
{
|
|
||||||
m_src = src;
|
|
||||||
m_order = m_src->getSpectrumProcessOrder();
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
void mouseDown(const MouseEvent& ev) override;
|
void mouseDown(const MouseEvent& ev) override;
|
||||||
void mouseDrag(const MouseEvent& ev) override;
|
void mouseDrag(const MouseEvent& ev) override;
|
||||||
void mouseUp(const MouseEvent& ev) override;
|
void mouseUp(const MouseEvent& ev) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user