Skip to content

Commit

Permalink
- refactored snippet browser to use C++ for logic
Browse files Browse the repository at this point in the history
- added sort by most recent to snippet browser
  • Loading branch information
christoph-hart committed Jul 31, 2024
1 parent 6920e4a commit 2983bf8
Show file tree
Hide file tree
Showing 7 changed files with 837 additions and 178 deletions.
80 changes: 1 addition & 79 deletions hi_backend/backend/BackendApplicationCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3077,85 +3077,7 @@ void BackendCommandTarget::Actions::showExampleBrowser(BackendRootWindow* bpe)

namespace multipage
{

#define MULTIPAGE_BIND_CPP(className, methodName) state->bindCallback(#methodName, BIND_MEMBER_FUNCTION_1(className::methodName));

struct EncodedDialogBase: public Component,
public QuasiModalComponent
{
void writeState(const Identifier& id, const var& value)
{
state->globalState.getDynamicObject()->setProperty(id, value);
}

var readState(const Identifier& id) const
{
return state->globalState[id];
}

virtual void bindCallbacks() = 0;

void loadFrom(const String& d)
{
MemoryBlock mb;
mb.fromBase64Encoding(d);
MemoryInputStream mis(mb, false);
MonolithData md(&mis);

state = new State(var());
addAndMakeVisible(dialog = md.create(*state));

dialog->setFinishCallback([this]()
{
findParentComponentOfClass<ModalBaseWindow>()->clearModalComponent();
});

bindCallbacks();

setSize(dialog->getWidth(), dialog->getHeight());

dialog->showFirstPage();
}

void setElementProperty(const String& listId, const Identifier& id, const var& newValue)
{
if(auto pb = dialog->findPageBaseForID(listId))
{
pb->getInfoObject().getDynamicObject()->setProperty(id, newValue);
pb->updateInfoProperty(id);
}
}

void resized() override
{
dialog->setBounds(getLocalBounds());
}

void navigate(int pageIndex, bool shouldSubmit)
{
SafeAsyncCall::call<EncodedDialogBase>(*this, [pageIndex, shouldSubmit](EncodedDialogBase& db)
{
if(shouldSubmit)
{
db.state->currentPageIndex = pageIndex-1;
db.dialog->navigate(true);
}
else
{
db.state->currentPageIndex = pageIndex;
db.dialog->refreshCurrentPage();
}
});
}

protected:

ScopedPointer<State> state;
ScopedPointer<Dialog> dialog;

JUCE_DECLARE_WEAK_REFERENCEABLE(EncodedDialogBase);
};


struct CleanDspNetworkFiles: public EncodedDialogBase,
public ControlledObject
{
Expand Down
81 changes: 81 additions & 0 deletions hi_backend/backend/BackendComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,88 @@ class CachedViewport : public Component,

};

namespace multipage
{

#define MULTIPAGE_BIND_CPP(className, methodName) state->bindCallback(#methodName, BIND_MEMBER_FUNCTION_1(className::methodName));

struct EncodedDialogBase: public Component,
public QuasiModalComponent
{
void writeState(const Identifier& id, const var& value)
{
state->globalState.getDynamicObject()->setProperty(id, value);
}

var readState(const Identifier& id) const
{
return state->globalState[id];
}

virtual void bindCallbacks() = 0;

void loadFrom(const String& d)
{
MemoryBlock mb;
mb.fromBase64Encoding(d);
MemoryInputStream mis(mb, false);
MonolithData md(&mis);

state = new State(var());
addAndMakeVisible(dialog = md.create(*state));

dialog->setFinishCallback([this]()
{
findParentComponentOfClass<ModalBaseWindow>()->clearModalComponent();
});

bindCallbacks();

setSize(dialog->getWidth(), dialog->getHeight());

dialog->showFirstPage();
}

void setElementProperty(const String& listId, const Identifier& id, const var& newValue)
{
if(auto pb = dialog->findPageBaseForID(listId))
{
pb->getInfoObject().getDynamicObject()->setProperty(id, newValue);
pb->updateInfoProperty(id);
}
}

void resized() override
{
dialog->setBounds(getLocalBounds());
}

void navigate(int pageIndex, bool shouldSubmit)
{
SafeAsyncCall::call<EncodedDialogBase>(*this, [pageIndex, shouldSubmit](EncodedDialogBase& db)
{
if(shouldSubmit)
{
db.state->currentPageIndex = pageIndex-1;
db.dialog->navigate(true);
}
else
{
db.state->currentPageIndex = pageIndex;
db.dialog->refreshCurrentPage();
}
});
}

protected:

ScopedPointer<State> state;
ScopedPointer<Dialog> dialog;

JUCE_DECLARE_WEAK_REFERENCEABLE(EncodedDialogBase);
};

} // namespace multipage
} // namespace hise

#endif // BACKENDCOMPONENTS_H_INCLUDED
41 changes: 0 additions & 41 deletions hi_backend/backend/dialog_library/broadcaster_resultpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,7 @@ namespace multipage {
namespace library {
using namespace juce;

inline var SnippetBrowser::loadSnippet(const var::NativeFunctionArgs& args)
{
if(args.numArguments != 2)
return var();

auto snippet = args.arguments[0].toString();
auto category = args.arguments[1].toString();

auto am = bpe->getBackendProcessor()->getAssetManager();
am->initialise();
BackendCommandTarget::Actions::loadSnippet(bpe, snippet);
auto root = bpe->getRootFloatingTile();



auto catIndex = SnippetBrowserHelpers::getCategoryNames().indexOf(category);

if(catIndex != -1)
{
auto c = (SnippetBrowserHelpers::Category)catIndex;
auto foldState = hise::SnippetBrowserHelpers::getFoldConfiguration(c);

root->forEach<FloatingTileContent>([&](FloatingTileContent* t)
{
auto s = t->getParentShell()->getLayoutData().getKeyPressId();

if(s.isValid() && foldState.find(s) != foldState.end())
{
auto x = foldState[s];
t->getParentShell()->setFolded(x);
}

return false;
});

bpe->currentCategory = c;
}

bpe->setCurrentlyActiveProcessor();

return var();
}


var BroadcasterWizard::checkSelection(const var::NativeFunctionArgs& args)
Expand Down
52 changes: 52 additions & 0 deletions hi_backend/backend/dialog_library/dialog_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,57 @@ namespace hise {
namespace multipage {
namespace library {
using namespace juce;

struct SnippetBrowser: public EncodedDialogBase
{
SnippetBrowser(BackendRootWindow* bpe_):
EncodedDialogBase(),
bpe(bpe_)
{
auto c = "6937.jNB..DvF........nT6K8CFYy060.n5AEJyKPhFXv6fjCyBQa4cjIJDy.JJGtdsNsb3UgYwPYwJj817aica6IoIRD.....iHE7xFCjx.iLf12Ql8lnJLI0R.MhfpfqA83NDrPiKZGfKf3uUQlYhX8ZVZe2xjzXXYPwwzHpk+lLjntwRMmA4m3P3aq1XB1oDMGn5HhrI7dfhUS79o2LpdD2osLNuC6DQvIRMhS197yr0pIpLmWJZbWUbBDCSN2PRbsDcfvgEPrStU8tMqZQ+ZwHAPKNxQXUOXHgrI0EEcZ8v8ZDoTottffRta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dHDfubLVUHtY2uqBw6ZAfFULR9ErrofCQi9rs2PsKWCb0jfHggLdo.qvECr720fnABM1+IMtHhq4hGE.x66bKm6uIsCzWtwzBRmkBhxZgkCaaMerFzw+CuxXqJhGoukBS6VaN1eoaZvaEpKECz0NftJ1PaTuWdX..YaoxlfBegijVTkeCgV8ZoxbQnMisoh+kauIp9CcJJtORDiXh8DH8OSZpi8W+xyLfWWffo8Gkbc9oQ6qnwT4GpDkcCjBnRFg41.Bl8JB46L6DZ.zfwuvtIsBXP6m+c5lLs3M2eCGy9XMr7CT5H..foi...rNB...";

loadFrom(c);
}

BackendRootWindow* bpe;

void bindCallbacks() override
{
MULTIPAGE_BIND_CPP(SnippetBrowser, rebuildTable);
MULTIPAGE_BIND_CPP(SnippetBrowser, clearFilter);
MULTIPAGE_BIND_CPP(SnippetBrowser, onTable);
MULTIPAGE_BIND_CPP(SnippetBrowser, showItem);
MULTIPAGE_BIND_CPP(SnippetBrowser, saveSnippet);
MULTIPAGE_BIND_CPP(SnippetBrowser, updatePreview);
MULTIPAGE_BIND_CPP(SnippetBrowser, initAddPage);
}

bool initialised = false;

var rebuildTable(const var::NativeFunctionArgs& args);

var clearFilter(const var::NativeFunctionArgs& args);

var onTable(const var::NativeFunctionArgs& args);

var loadSnippet(const var::NativeFunctionArgs& args);

var showItem(const var::NativeFunctionArgs& args);

var saveSnippet(const var::NativeFunctionArgs& args);

var initAddPage(const var::NativeFunctionArgs& args);

var updatePreview(const var::NativeFunctionArgs& args);

Array<var> parsedData;
var currentlyLoadedData;
};



#if 0

struct SnippetBrowser: public HardcodedDialogWithState
{
SnippetBrowser(BackendRootWindow* brw):
Expand All @@ -64,6 +115,7 @@ struct SnippetBrowser: public HardcodedDialogWithState
Dialog* createDialog(State& state) override;

};
#endif


} // namespace library
Expand Down
Loading

0 comments on commit 2983bf8

Please sign in to comment.