Skip to content

Commit

Permalink
CMidiLearnOverlay -> juce::Drawable
Browse files Browse the repository at this point in the history
Don't even need a class for this one!
Addresses surge-synthesizer#4587
  • Loading branch information
baconpaul committed May 25, 2021
1 parent ccd2453 commit 153f958
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 60 deletions.
40 changes: 0 additions & 40 deletions src/gui/CMidiLearnOverlay.h

This file was deleted.

23 changes: 5 additions & 18 deletions src/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#include <codecvt>
#include "MSEGEditor.h"
#include "version.h"
#include "CMidiLearnOverlay.h"
#include "ModernOscillator.h"
#include "libMTSClient.h"

Expand Down Expand Up @@ -8329,33 +8328,21 @@ void SurgeGUIEditor::showAboutScreen(int devModeGrid)
void SurgeGUIEditor::hideAboutScreen()
{
frame->juceComponent()->removeChildComponent(aboutScreen.get());
/*
if (aboutbox)
{
aboutbox->setVisible(false);
removeFromFrame.push_back(aboutbox);
aboutbox = nullptr;
}
*/
}

void SurgeGUIEditor::showMidiLearnOverlay(const VSTGUI::CRect &r)
{
if (midiLearnOverlay)
hideMidiLearnOverlay();

midiLearnOverlay = new CMidiLearnOverlay(r, bitmapStore);
midiLearnOverlay->setVisible(true);
getFrame()->addView(midiLearnOverlay);
midiLearnOverlay = bitmapStore->getDrawable(IDB_MIDI_LEARN)->createCopy();
midiLearnOverlay->setInterceptsMouseClicks(false, false);
midiLearnOverlay->setBounds(r.asJuceIntRect());
getFrame()->juceComponent()->addAndMakeVisible(midiLearnOverlay.get());
}

void SurgeGUIEditor::hideMidiLearnOverlay()
{
if (midiLearnOverlay)
{
midiLearnOverlay->setVisible(false);
removeFromFrame.push_back(midiLearnOverlay);
midiLearnOverlay = nullptr;
getFrame()->juceComponent()->removeChildComponent(midiLearnOverlay.get());
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/SurgeGUIEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class SurgeSynthEditor;
class CSurgeSlider;
class CModulationSourceButton;
class CAboutBox;
class CMidiLearnOverlay;

namespace Surge
{
Expand Down Expand Up @@ -435,7 +434,8 @@ class SurgeGUIEditor : public EditorType,
*statusZoom = nullptr;
std::unique_ptr<Surge::Widgets::AboutScreen> aboutScreen;

CMidiLearnOverlay *midiLearnOverlay = nullptr;
std::unique_ptr<juce::Drawable> midiLearnOverlay;

VSTGUI::CTextEdit *patchName = nullptr;
VSTGUI::CTextEdit *patchCategory = nullptr;
VSTGUI::CTextEdit *patchCreator = nullptr;
Expand Down

0 comments on commit 153f958

Please sign in to comment.