Factory Prest Assets

This commit is contained in:
Robin E.R. Davies
2026-05-31 02:46:12 -04:00
parent 68d195f9fb
commit 779f3c80ad
16 changed files with 60 additions and 45 deletions
View File
+2 -2
View File
@@ -67,8 +67,8 @@ install (
) )
install ( install (
DIRECTORY ${PROJECT_SOURCE_DIR}/default_presets DIRECTORY ${PROJECT_SOURCE_DIR}/default_presets/presets
DESTINATION /etc/pipedal/config DESTINATION /etc/pipedal/config/default_presets/presets
) )
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
@@ -2,17 +2,13 @@
export SRC_ZIP="V3 Factory Presets.piBank" export SRC_ZIP="V3 Factory Presets.piBank"
export DST_ZIP="Factory Presets.piBank" export DST_ZIP="Factory Presets.piBank"
rm "presets/$DST_ZIP" rm "presets/$DST_ZIP"
cd presets
rm -rf temp_folder rm -rf temp_folder
echo Unpacking "$SRC_ZIP" echo Unpacking "$SRC_ZIP"
unzip "$SRC_ZIP" -d ./temp_folder unzip "$SRC_ZIP" -d ./temp_folder
cd temp_folder cd temp_folder
cp -r ../Factory_Presets_Extra/* ./ cp -r ../Factory_Presets_Extra/* ./
echo Repacking "../$DST_ZIP" echo Repacking "../presets/$DST_ZIP"
zip -r9 "../$DST_ZIP" . zip -r9 "../presets/$DST_ZIP" .
cd .. cd ..
rm -rf temp_folder rm -rf temp_folder
cd ..
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
{"selectedBank": 1,"nextInstanceId": 1,"entries": [{"instanceId": 1,"name": "Default Bank"}]}
+6
View File
@@ -317,6 +317,12 @@ namespace pipedal
bank.name(name); bank.name(name);
bank.instanceId(++nextInstanceId_); bank.instanceId(++nextInstanceId_);
if (afterId == -2)
{
entries_.insert(entries_.begin(), bank);
return bank.instanceId();
}
for (size_t i = 0; i < this->entries_.size(); ++i) for (size_t i = 0; i < this->entries_.size(); ++i)
{ {
if (entries_[i].instanceId() == afterId) if (entries_[i].instanceId() == afterId)
+33 -27
View File
@@ -179,38 +179,44 @@ static fs::path GetTone3000ThumbnailFile(const fs::path& thumbnailDirectory, con
return {}; return {};
} }
int64_t ImportBankFile(PiPedalModel &model, const std::filesystem::path& filePath,uint64_t uploadAfter = -1) namespace pipedal::implementation {
{
BankFile bankFile; int64_t ImportBankFile(PiPedalModel &model, const std::filesystem::path& filePath,uint64_t uploadAfter = -1)
{
BankFile bankFile;
if (filePath.empty()) if (filePath.empty())
{ {
throw std::runtime_error("Unexpected."); throw std::runtime_error("Unexpected.");
}
if (IsZipFile(filePath))
{
auto presetReader = PresetBundleReader::LoadPresetsFile(model, filePath);
presetReader->ExtractMediaFiles();
std::stringstream ss(presetReader->GetPresetJson());
json_reader reader(ss);
reader.read(&bankFile);
}
else
{
std::ifstream f {filePath};
if (!f.is_open()) {
throw std::runtime_error(SS("Unable to open file " << filePath));
} }
// legacy json format, no zip, no media files. if (IsZipFile(filePath))
json_reader reader(f); {
reader.read(&bankFile); auto presetReader = PresetBundleReader::LoadPresetsFile(model, filePath);
} presetReader->ExtractMediaFiles();
uint64_t instanceId = model.UploadBank(bankFile, uploadAfter);
return instanceId; std::stringstream ss(presetReader->GetPresetJson());
json_reader reader(ss);
reader.read(&bankFile);
}
else
{
std::ifstream f {filePath};
if (!f.is_open()) {
throw std::runtime_error(SS("Unable to open file " << filePath));
}
// legacy json format, no zip, no media files.
json_reader reader(f);
reader.read(&bankFile);
}
uint64_t instanceId = model.UploadBank(bankFile, uploadAfter);
return instanceId;
}
} }
using namespace pipedal::implementation;
class DownloadIntercept : public RequestHandler class DownloadIntercept : public RequestHandler
{ {
PiPedalModel* model; PiPedalModel* model;
+16 -8
View File
@@ -161,8 +161,11 @@ const pedalboardStyles = (theme: Theme) => createStyles({
marginBottom: (CELL_HEIGHT - FRAME_SIZE) / 2, marginBottom: (CELL_HEIGHT - FRAME_SIZE) / 2,
width: FRAME_SIZE, width: FRAME_SIZE,
height: FRAME_SIZE, height: FRAME_SIZE,
border: isDarkMode() ? "1pt #555 solid" : "1pt #666 solid", borderColor: "#777",
borderRadius: 6 borderWidth: 2,
borderStyle: "solid",
padding: 1,
borderRadius: 8
}), }),
selectedIconFrame: css({ selectedIconFrame: css({
@@ -178,8 +181,12 @@ const pedalboardStyles = (theme: Theme) => createStyles({
marginBottom: (CELL_HEIGHT - FRAME_SIZE) / 2, marginBottom: (CELL_HEIGHT - FRAME_SIZE) / 2,
width: FRAME_SIZE, width: FRAME_SIZE,
height: FRAME_SIZE, height: FRAME_SIZE,
border: isDarkMode() ? "1pt #FFF solid" : "1pt #333 solid", borderColor: theme.palette.primary.main,
borderRadius: 6 borderWidth: "2.0px",
borderStyle: "solid",
overflow: "hidden",
borderRadius: 8,
boxShadow: "0 0 6px 0px " + theme.palette.primary.main + "C0"
}), }),
borderlessIconFrame: css({ borderlessIconFrame: css({
@@ -194,8 +201,9 @@ const pedalboardStyles = (theme: Theme) => createStyles({
marginBottom: (CELL_HEIGHT - FRAME_SIZE) / 2, marginBottom: (CELL_HEIGHT - FRAME_SIZE) / 2,
width: FRAME_SIZE, width: FRAME_SIZE,
height: FRAME_SIZE, height: FRAME_SIZE,
border: "0pt #666 solid", border: "0px #666 solid",
borderRadius: 6 borderRadius: 8,
overflow: "hidden",
}), }),
pedalIcon: css({ pedalIcon: css({
@@ -1042,7 +1050,7 @@ const PedalboardView =
onDoubleClick={(e: SyntheticEvent) => { this.onItemDoubleClick(e, instanceId); }} onDoubleClick={(e: SyntheticEvent) => { this.onItemDoubleClick(e, instanceId); }}
onContextMenu={(e: SyntheticEvent) => { this.onItemLongClick(e, instanceId); }} onContextMenu={(e: SyntheticEvent) => { this.onItemLongClick(e, instanceId); }}
> >
<SelectHoverBackground selected={instanceId === this.props.selectedId} showHover={true} borderRadius={6} <SelectHoverBackground selected={instanceId === this.props.selectedId} showHover={true}
clipChildren={true} clipChildren={true}
> >
<Draggable draggable={draggable && (this.props.enableStructureEditing)} getScrollContainer={() => this.getScrollContainer()} <Draggable draggable={draggable && (this.props.enableStructureEditing)} getScrollContainer={() => this.getScrollContainer()}
@@ -1050,7 +1058,7 @@ const PedalboardView =
style={{ opacity: enabled ? 0.99 : 0.3 }} style={{ opacity: enabled ? 0.99 : 0.3 }}
> >
<div id="childIcon" style={{ position: "relative" }} > <div id="childIcon" style={{ position: "relative", display: "flex", justifyContent: "center", alignItems: "center" }} >
<PluginIcon pluginType={iconType} <PluginIcon pluginType={iconType}
size={24} size={24}
color={getIconColor(iconColor)} color={getIconColor(iconColor)}