Skip to content

Commit

Permalink
BKStackedSlider in DirectPopUp, working but not visible
Browse files Browse the repository at this point in the history
  • Loading branch information
dantrueman committed Oct 26, 2024
1 parent 1180320 commit 3e84f69
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
3 changes: 2 additions & 1 deletion source/interface/BKSliders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ void BKStackedSlider::mouseDown (const juce::MouseEvent &event)

void BKStackedSlider::mouseDrag(const juce::MouseEvent& e)
{
//DBG("BKStacked Slider: mouseDrag");
if(!mouseJustDown)
{
juce::Slider* currentSlider = dataSliders.operator[](clickedSlider);
Expand All @@ -290,11 +291,11 @@ void BKStackedSlider::mouseDrag(const juce::MouseEvent& e)
}
else {
currentSlider->setValue(topSlider->getValue(), juce::sendNotification);
DBG("slider val = " + juce::String(topSlider->getValue()));
}
}
}
else mouseJustDown = false;

}

void BKStackedSlider::mouseUp(const juce::MouseEvent& e)
Expand Down
5 changes: 5 additions & 0 deletions source/interface/Preparations/DirectPreparation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ DirectPreparation::DirectPopup::DirectPopup(DirectProcessor& _proc, OpenGlWrappe
// view.init_();

transpositionSlider = std::make_unique<OpenGlTranspositionSlider>();
addAndMakeVisible(*transpositionSlider);
transpositionSlider->setValue(1., juce::dontSendNotification);
transpositionSlider->setColour(juce::Slider::ColourIds::backgroundColourId , juce::Colours::red);

/*********************************************************************************************/
}
Expand Down Expand Up @@ -236,6 +239,8 @@ void DirectPreparation::DirectPopup::resized() {
// blendronicSendSlider->redoImage();

transpositionSlider->setBounds(column1, row1, sliderWidth, sliderHeight);
transpositionSlider->setBounds(0, 30, 400, 200);
transpositionSlider->redoImage();

redoImage();
SynthSection::resized();
Expand Down
27 changes: 14 additions & 13 deletions source/interface/Preparations/DirectPreparation.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ class OpenGlTranspositionSlider : public OpenGlAutoImageComponent<BKStackedSlide
public:
OpenGlTranspositionSlider(const juce::ValueTree& v) :
OpenGlAutoImageComponent<BKStackedSlider>(
"Transpositions", // slider name
0., // min
10., // max
0., // default min
10., // default max
1., // default val
0.001)
"Transpositions", // slider name
-12, // min
12, // max
-12, // default min
12, // default max
0, // default val
0.01) // increment
//-12, 12, -12, 12, 0, 0.01
{ // increment
image_component_ = std::make_shared<OpenGlImageComponent>();
setLookAndFeel(DefaultLookAndFeel::instance());
Expand All @@ -36,12 +37,12 @@ class OpenGlTranspositionSlider : public OpenGlAutoImageComponent<BKStackedSlide
OpenGlTranspositionSlider() :
OpenGlAutoImageComponent<BKStackedSlider>(
"Transpositions", // slider name
0., // min
10., // max
0., // default min
10., // default max
1., // default val
0.001)
-12, // min
12, // max
-12, // default min
12, // default max
0, // default val
0.01) // increment
{ // increment
image_component_ = std::make_shared<OpenGlImageComponent>();
setLookAndFeel(DefaultLookAndFeel::instance());
Expand Down

0 comments on commit 3e84f69

Please sign in to comment.