Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part details starts coming together and some UI fixes #1147

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src-ui/components/HeaderRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,14 @@ HeaderRegion::HeaderRegion(SCXTEditor *e) : HasEditor(e)
});
addAndMakeVisible(*scMenu);

auto comingSoon = []() {
juce::AlertWindow::showMessageBoxAsync(juce::AlertWindow::InfoIcon, "Coming Soon",
"This feature is not yet implemented", "OK");
};

undoButton = std::make_unique<jcmp::TextPushButton>();
undoButton->setLabel("Undo");
undoButton->setOnCallback(comingSoon);
undoButton->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*undoButton);

redoButton = std::make_unique<jcmp::TextPushButton>();
redoButton->setLabel("Redo");
redoButton->setOnCallback(comingSoon);
redoButton->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*redoButton);

tuningButton = std::make_unique<jcmp::TextPushButton>();
Expand All @@ -138,7 +133,7 @@ HeaderRegion::HeaderRegion(SCXTEditor *e) : HasEditor(e)
addAndMakeVisible(*zoomButton);

chipButton = std::make_unique<jcmp::GlyphButton>(jcmp::GlyphPainter::MEMORY);
chipButton->setOnCallback(comingSoon);
chipButton->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*chipButton);

saveAsButton = std::make_unique<jcmp::GlyphButton>(jcmp::GlyphPainter::SAVE);
Expand Down
8 changes: 8 additions & 0 deletions src-ui/components/SCXTEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,12 @@ void SCXTEditor::setTabSelection(const std::string &k, const std::string &t)
otherTabSelection[k] = t;
sendToSerialization(messaging::client::UpdateOtherTabSelection({k, t}));
}

std::function<void()> SCXTEditor::makeComingSoon(const std::string &feature) const
{
return [f = feature]() {
juce::AlertWindow::showMessageBoxAsync(juce::AlertWindow::InfoIcon, "Coming Soon",
f + " is not yet implemented", "OK");
};
}
} // namespace scxt::ui
5 changes: 5 additions & 0 deletions src-ui/components/SCXTEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ struct SCXTEditor : sst::jucegui::components::WindowPanel, juce::DragAndDropCont
void onSelectedPart(const int16_t);
int16_t getSelectedPart() const;

void onPartConfiguration(const scxt::messaging::client::partConfigurationPayload_t &);
std::array<scxt::engine::Part::PartConfiguration, scxt::numParts> partConfigurations;

selection::SelectionManager::otherTabSelection_t otherTabSelection;
void onOtherTabSelection(const scxt::selection::SelectionManager::otherTabSelection_t &p);
std::string queryTabSelection(const std::string &k);
Expand Down Expand Up @@ -263,6 +266,8 @@ struct SCXTEditor : sst::jucegui::components::WindowPanel, juce::DragAndDropCont
std::queue<std::string> callbackQueue;
engine::Engine::EngineStatusMessage engineStatus;

std::function<void()> makeComingSoon(const std::string &feature = "This feature") const;

/*
* Items to deal with the shared memory reads
*/
Expand Down
13 changes: 13 additions & 0 deletions src-ui/components/SCXTEditorResponseHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,17 @@ void SCXTEditor::onOtherTabSelection(
multiScreen->onOtherTabSelection();
}
}

void SCXTEditor::onPartConfiguration(
const scxt::messaging::client::partConfigurationPayload_t &payload)
{
const auto &[pt, c] = payload;
assert(pt >= 0 && pt < scxt::numParts);
partConfigurations[pt] = c;
// When I have active show/hide i will need to rewrite this i bet
if (playScreen && playScreen->partSidebars[pt])
playScreen->partSidebars[pt]->resetFromEditorCache();
if (multiScreen && multiScreen->parts)
multiScreen->parts->partConfigurationChanged(pt);
}
} // namespace scxt::ui
14 changes: 8 additions & 6 deletions src-ui/components/browser/BrowserPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ struct DriveListBoxModel : juce::ListBoxModel
jcmp::Label::Styles::labelfont));

// TODO: Style all of these
auto textColor = juce::Colour(190, 190, 190);
auto textColor =
browserPane->editor->themeColor(theme::ColorMap::generic_content_medium);
auto fillColor = juce::Colour(0, 0, 0).withAlpha(0.f);

if (rowIsSelected)
{
fillColor = juce::Colour(0x40, 0x20, 0x00);
textColor = textColor.brighter(0.4);
fillColor = browserPane->editor->themeColor(theme::ColorMap::bg_3);
textColor = browserPane->editor->themeColor(theme::ColorMap::generic_content_high);
}
g.setColour(fillColor);
g.fillRect(0, 0, width, height);
Expand Down Expand Up @@ -398,13 +399,14 @@ struct DriveFSListBoxRow : public juce::Component
jcmp::Label::Styles::labelfont));

// TODO: Style all of these
auto textColor = juce::Colour(190, 190, 190);
auto textColor =
browserPane->editor->themeColor(theme::ColorMap::generic_content_medium);
auto fillColor = juce::Colour(0, 0, 0).withAlpha(0.f);

if (isSelected)
{
fillColor = juce::Colour(0x40, 0x20, 0x00);
textColor = textColor.brighter(0.4);
fillColor = browserPane->editor->themeColor(theme::ColorMap::bg_3);
textColor = browserPane->editor->themeColor(theme::ColorMap::generic_content_high);
}
g.setColour(fillColor);
g.fillRect(0, 0, width, height);
Expand Down
15 changes: 10 additions & 5 deletions src-ui/components/multi/LFOPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ struct CurveLFOPane : juce::Component, HasEditor
// parent->selectedTab);
// angleK = std::make_unique<jcmp::Knob>();
// angleK->setSource(fakeModel->getDummySourceFor('knb2'));
angleK = connectors::makeConnectedToDummy<jcmp::Knob>('angl');
angleK = connectors::makeConnectedToDummy<jcmp::Knob>('angl', "Angle", 0, true,
editor->makeComingSoon("Angle"));
addAndMakeVisible(*angleK);
makeLabel(angleL, "Angle");

Expand Down Expand Up @@ -578,16 +579,20 @@ struct ENVLFOPane : juce::Component, HasEditor
makeO(ms.envLfoStorage.sustain, sustainA, sustainS, sustainL);
makeO(ms.envLfoStorage.release, releaseA, releaseS, releaseL);

factorK = connectors::makeConnectedToDummy<jcmp::Knob>('fact');
factorK = connectors::makeConnectedToDummy<jcmp::Knob>('fact', "Factor", 0.5, false,
editor->makeComingSoon("Factor"));
addAndMakeVisible(*factorK);
makeLabel(factorL, "Factor");
curveA = connectors::makeConnectedToDummy<jcmp::Knob>('crva');
curveA = connectors::makeConnectedToDummy<jcmp::Knob>(
'crva', "Curve A", 0.5, false, editor->makeComingSoon("Curve Attack"));
addAndMakeVisible(*curveA);
makeLabel(curveAL, "Curve A");
curveD = connectors::makeConnectedToDummy<jcmp::Knob>('crvd');
curveD = connectors::makeConnectedToDummy<jcmp::Knob>(
'crvd', "Curve D", 0.5, false, editor->makeComingSoon("Curve Decay"));
addAndMakeVisible(*curveD);
makeLabel(curveDL, "Curve D");
curveR = connectors::makeConnectedToDummy<jcmp::Knob>('crvr');
curveR = connectors::makeConnectedToDummy<jcmp::Knob>(
'crvr', "Curve R", 0.5, false, editor->makeComingSoon("Curve Release"));
addAndMakeVisible(*curveR);
makeLabel(curveRL, "Curve R");
}
Expand Down
23 changes: 9 additions & 14 deletions src-ui/components/multi/MappingPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,47 +181,42 @@ struct MappingZoneHeader : HasEditor, juce::Component

MappingZoneHeader(SCXTEditor *ed) : HasEditor(ed)
{
auto comingSoon = []() {
juce::AlertWindow::showMessageBoxAsync(juce::AlertWindow::InfoIcon, "Coming Soon",
"This feature is not yet implemented", "OK");
};

autoMap = std::make_unique<jcmp::TextPushButton>();
autoMap->setLabel("AUTO-MAP");
autoMap->setOnCallback(comingSoon);
autoMap->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*autoMap);

midiButton = std::make_unique<jcmp::GlyphButton>(jcmp::GlyphPainter::GlyphType::MIDI);
midiButton->setOnCallback(comingSoon);
midiButton->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*midiButton);

midiUDButton = std::make_unique<jcmp::GlyphButton>(
jcmp::GlyphPainter::GlyphType::MIDI, jcmp::GlyphPainter::GlyphType::UP_DOWN, 16);
midiUDButton->setOnCallback(comingSoon);
midiUDButton->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*midiUDButton);

midiLRButton = std::make_unique<jcmp::GlyphButton>(
jcmp::GlyphPainter::GlyphType::MIDI, jcmp::GlyphPainter::GlyphType::LEFT_RIGHT, 16);
midiLRButton->setOnCallback(comingSoon);
midiLRButton->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*midiLRButton);

fixOverlap = std::make_unique<jcmp::TextPushButton>();
fixOverlap->setLabel("FIX OVERLAP");
fixOverlap->setOnCallback(comingSoon);
fixOverlap->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*fixOverlap);

fadeOverlap = std::make_unique<jcmp::TextPushButton>();
fadeOverlap->setLabel("FADE OVERLAP");
fadeOverlap->setOnCallback(comingSoon);
fadeOverlap->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*fadeOverlap);

zoneSolo = std::make_unique<jcmp::TextPushButton>();
zoneSolo->setLabel("ZONE SOLO");
zoneSolo->setOnCallback(comingSoon);
zoneSolo->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*zoneSolo);

lockButton = std::make_unique<jcmp::GlyphButton>(jcmp::GlyphPainter::GlyphType::LOCK);
lockButton->setOnCallback(comingSoon);
lockButton->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*lockButton);

fileLabel = std::make_unique<jcmp::Label>();
Expand All @@ -230,7 +225,7 @@ struct MappingZoneHeader : HasEditor, juce::Component

fileMenu = std::make_unique<jcmp::MenuButton>();
fileMenu->setLabel("sample-name-to-come.wav");
fileMenu->setOnCallback(comingSoon);
fileMenu->setOnCallback(editor->makeComingSoon());
addAndMakeVisible(*fileMenu);
}

Expand Down
5 changes: 5 additions & 0 deletions src-ui/components/multi/PartGroupSidebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,9 @@ void PartGroupSidebar::setSelectedTab(int t)
(t == 0 ? "part" : (t == 1 ? "group" : "zone")));
repaint();
}

void PartGroupSidebar::partConfigurationChanged(int i)
{
partSidebar->parts[i]->resetFromEditorCache();
}
} // namespace scxt::ui::multi
2 changes: 2 additions & 0 deletions src-ui/components/multi/PartGroupSidebar.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ struct PartGroupSidebar : sst::jucegui::components::NamedPanel, HasEditor
std::unique_ptr<GroupSidebar> groupSidebar;
std::unique_ptr<PartSidebar> partSidebar;

void partConfigurationChanged(int i);

void resized() override;
};
} // namespace scxt::ui::multi
Expand Down
Loading
Loading