-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Files and Data structures in place for missing resolution (#1376)
* Files and Data structures in place for missing resolution 1. Add missing resolution headers, workitem objects, streaming, messages, and ui screen 2. Implement a version of that which sends a structured readonly list of missing workitems to the UI on startup 3. Implement a screen which does a read only render of that structure Still no "resolve" button. That's next, but maybe not today * fix a few missing headers the unitu build masked
- Loading branch information
Showing
19 changed files
with
457 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* Shortcircuit XT - a Surge Synth Team product | ||
* | ||
* A fully featured creative sampler, available as a standalone | ||
* and plugin for multiple platforms. | ||
* | ||
* Copyright 2019 - 2024, Various authors, as described in the github | ||
* transaction log. | ||
* | ||
* ShortcircuitXT is released under the Gnu General Public Licence | ||
* V3 or later (GPL-3.0-or-later). The license is found in the file | ||
* "LICENSE" in the root of this repository or at | ||
* https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* | ||
* Individual sections of code which comprises ShortcircuitXT in this | ||
* repository may also be used under an MIT license. Please see the | ||
* section "Licensing" in "README.md" for details. | ||
* | ||
* ShortcircuitXT is inspired by, and shares code with, the | ||
* commercial product Shortcircuit 1 and 2, released by VemberTech | ||
* in the mid 2000s. The code for Shortcircuit 2 was opensourced in | ||
* 2020 at the outset of this project. | ||
* | ||
* All source for ShortcircuitXT is available at | ||
* https://github.com/surge-synthesizer/shortcircuit-xt | ||
*/ | ||
|
||
#include "MissingResolutionScreen.h" | ||
#include "app/SCXTEditor.h" | ||
|
||
#include <sst/jucegui/components/NamedPanel.h> | ||
#include <sst/jucegui/components/TextPushButton.h> | ||
|
||
namespace scxt::ui::app::missing_resolution | ||
{ | ||
|
||
struct Contents : juce::Component, HasEditor | ||
{ | ||
MissingResolutionScreen *parent{nullptr}; | ||
std::unique_ptr<sst::jucegui::components::TextPushButton> okButton; | ||
Contents(MissingResolutionScreen *p, SCXTEditor *e) : parent(p), HasEditor(e) | ||
{ | ||
okButton = std::make_unique<sst::jucegui::components::TextPushButton>(); | ||
okButton->setLabel("OK"); | ||
okButton->setOnCallback([w = juce::Component::SafePointer(parent)]() { | ||
if (!w) | ||
return; | ||
w->setVisible(false); | ||
}); | ||
addAndMakeVisible(*okButton); | ||
} | ||
|
||
void resized() override | ||
{ | ||
auto b = getLocalBounds(); | ||
b = b.withTrimmedTop(b.getHeight() - 22).withTrimmedLeft(b.getWidth() - 100); | ||
okButton->setBounds(b); | ||
} | ||
void paint(juce::Graphics &g) override | ||
{ | ||
int bxH = 40; | ||
auto bx = getLocalBounds().reduced(2, 2).withHeight(bxH); | ||
for (const auto &i : parent->workItems) | ||
{ | ||
auto bd = bx.reduced(2, 2); | ||
g.setFont(editor->themeApplier.interBoldFor(14)); | ||
g.setColour(editor->themeColor(theme::ColorMap::generic_content_high)); | ||
g.drawText(i.path.u8string(), bd, juce::Justification::topLeft); | ||
|
||
g.setFont(editor->themeApplier.interMediumFor(12)); | ||
g.setColour(editor->themeColor(theme::ColorMap::generic_content_medium)); | ||
g.drawText(i.md5sum, bd, juce::Justification::bottomLeft); | ||
|
||
g.setColour(editor->themeColor(theme::ColorMap::generic_content_low)); | ||
g.drawRect(bx, 1); | ||
|
||
bx = bx.translated(0, bxH + 4); | ||
} | ||
} | ||
}; | ||
|
||
MissingResolutionScreen::MissingResolutionScreen(SCXTEditor *e) : HasEditor(e) | ||
{ | ||
auto ct = std::make_unique<sst::jucegui::components::NamedPanel>("Missing Sample Resolution"); | ||
addAndMakeVisible(*ct); | ||
|
||
auto contents = std::make_unique<Contents>(this, e); | ||
ct->setContentAreaComponent(std::move(contents)); | ||
contentsArea = std::move(ct); | ||
} | ||
|
||
void MissingResolutionScreen::resized() | ||
{ | ||
contentsArea->setBounds(getLocalBounds().reduced(100, 80)); | ||
} | ||
|
||
} // namespace scxt::ui::app::missing_resolution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Shortcircuit XT - a Surge Synth Team product | ||
* | ||
* A fully featured creative sampler, available as a standalone | ||
* and plugin for multiple platforms. | ||
* | ||
* Copyright 2019 - 2024, Various authors, as described in the github | ||
* transaction log. | ||
* | ||
* ShortcircuitXT is released under the Gnu General Public Licence | ||
* V3 or later (GPL-3.0-or-later). The license is found in the file | ||
* "LICENSE" in the root of this repository or at | ||
* https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* | ||
* Individual sections of code which comprises ShortcircuitXT in this | ||
* repository may also be used under an MIT license. Please see the | ||
* section "Licensing" in "README.md" for details. | ||
* | ||
* ShortcircuitXT is inspired by, and shares code with, the | ||
* commercial product Shortcircuit 1 and 2, released by VemberTech | ||
* in the mid 2000s. The code for Shortcircuit 2 was opensourced in | ||
* 2020 at the outset of this project. | ||
* | ||
* All source for ShortcircuitXT is available at | ||
* https://github.com/surge-synthesizer/shortcircuit-xt | ||
*/ | ||
|
||
#ifndef SCXT_SRC_UI_APP_MISSING_RESOLUTION_MISSINGRESOLUTIONSCREEN_H | ||
#define SCXT_SRC_UI_APP_MISSING_RESOLUTION_MISSINGRESOLUTIONSCREEN_H | ||
|
||
#include "app/HasEditor.h" | ||
#include <juce_gui_basics/juce_gui_basics.h> | ||
#include <vector> | ||
#include "engine/missing_resolution.h" | ||
|
||
namespace scxt::ui::app::missing_resolution | ||
{ | ||
|
||
struct MissingResolutionScreen : juce::Component, HasEditor | ||
{ | ||
std::unique_ptr<juce::Component> contentsArea; | ||
MissingResolutionScreen(SCXTEditor *e); | ||
|
||
void paint(juce::Graphics &g) override | ||
{ | ||
g.fillAll(juce::Colour(0x90, 0x90, 0x90).withAlpha(0.3f)); | ||
} | ||
|
||
void resized() override; | ||
void mouseUp(const juce::MouseEvent &) override { setVisible(false); } | ||
|
||
void setWorkItemList(const std::vector<engine::MissingResolutionWorkItem> &l) | ||
{ | ||
workItems = l; | ||
repaint(); | ||
} | ||
|
||
std::vector<engine::MissingResolutionWorkItem> workItems; | ||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MissingResolutionScreen); | ||
}; | ||
} // namespace scxt::ui::app::missing_resolution | ||
#endif // MISSINGRESOLUTIONSCREEN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.