Merge pull request #233 from rerdavies/dev

v.1.3.60
This commit is contained in:
Robin Davies
2024-10-21 08:56:25 -04:00
committed by GitHub
15 changed files with 180 additions and 24 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.16.0)
project(pipedal
VERSION 1.3.59
VERSION 1.3.60
DESCRIPTION "PiPedal Guitar Effect Pedal For Raspberry Pi"
HOMEPAGE_URL "https://rerdavies.github.io/pipedal"
)
set (DISPLAY_VERSION "PiPedal v1.3.59-Release")
set (DISPLAY_VERSION "PiPedal v1.3.60-Release")
set (PACKAGE_ARCHITECTURE "arm64")
set (CMAKE_INSTALL_PREFIX "/usr/")
+2 -2
View File
@@ -6,13 +6,13 @@
<a href="https://rerdavies.github.io/pipedal/LicensePiPedal.html"><img src="https://img.shields.io/badge/MIT-MIT?label=license&color=%23808080"/></a>
<a href="https://github.com/rerdavies/pipedal/actions"><img src="https://img.shields.io/github/actions/workflow/status/rerdavies/pipedal/cmake.yml?branch=main"/></a>
Download:&nbsp;<a href='https://rerdavies.github.io/pipedal/download.html'>v1.3.59</a>
Download:&nbsp;<a href='https://rerdavies.github.io/pipedal/download.html'>v1.3.60</a>
Website:&nbsp;[https://rerdavies.github.io/pipedal](https://rerdavies.github.io/pipedal).
Documentation:&nbsp;[https://rerdavies.github.io/pipedal/Documentation.html](https://rerdavies.github.io/pipedal/Documentation.html).
&nbsp;
#### NEW version 1.3.59 Release, providing [snapshots](https://rerdavies.github.io/pipedal/Snaphots.html), and a new Performance View. See the [release notes](https://rerdavies.github.io/pipedal/ReleaseNotes) for details.
#### NEW version 1.3.60 Release, providing [snapshots](https://rerdavies.github.io/pipedal/Snaphots.html), and a new Performance View. See the [release notes](https://rerdavies.github.io/pipedal/ReleaseNotes) for details.
&nbsp;
+3 -3
View File
@@ -13,17 +13,17 @@ page_icon: img/Install4.jpg
Download the most recent Debian (.deb) package for your platform:
- [Raspberry Pi OS bookworm (64-bit) v1.3.59](https://github.com/rerdavies/pipedal/releases/download/)
- [Raspberry Pi OS bookworm (64-bit) v1.3.60](https://github.com/rerdavies/pipedal/releases/download/)
- [Ubuntu/Raspberry Pi OS bullseyeye (64-bit) v1.2.31](https://github.com/rerdavies/pipedal/releases/download/v1.1.31/pipedal_1.1.31_arm64.deb)
Version 1.3.59 has not yet been tested on Ubuntu or Raspberry Pi OS bullseye. On these platforms, we recommend that you use version 1.1.31.
Version 1.3.60 has not yet been tested on Ubuntu or Raspberry Pi OS bullseye. On these platforms, we recommend that you use version 1.1.31.
Install the package by running
```
sudo apt update
cd ~/Downloads
sudo apt-get install pipedal_1.3.59_arm64.deb
sudo apt-get install pipedal_1.3.60_arm64.deb
```
Adjust accordingly if you have downloaded v1.1.31.
+6
View File
@@ -1,5 +1,11 @@
# Release Notes
## PiPedal 1.3.60 Release
Bug fixes:
- Uploading of preset and bank files now work properly.
- Uploaded plugin presets are merged with existing presets, instead of overwriting existing presets.
## PiPedal 1.3.59 Release
20% performance improvement when using Toob Neural Amp Modeller with large Wavenet models.
+2 -2
View File
@@ -4,7 +4,7 @@
Download the most recent Debian (.deb) package for your platform:
- <a href="https://github.com/rerdavies/pipedal/releases/download/v1.3.59/pipedal_1.3.59_arm64.deb">Raspberry Pi OS Bookworm (64-bit) v1.3.59</a>
- <a href="https://github.com/rerdavies/pipedal/releases/download/v1.3.60/pipedal_1.3.60_arm64.deb">Raspberry Pi OS Bookworm (64-bit) v1.3.60</a>
Install the package by running
@@ -12,7 +12,7 @@ Install the package by running
```
sudo apt update
cd ~/Downloads
sudo apt-get install ./pipedal_1.3.59_arm64.deb
sudo apt-get install ./pipedal_1.3.60_arm64.deb
```
Follow the instructions in [_Configuring PiPedal After Installation_](https://rerdavies.github.io/pipedal/Configuring.html) to complete the installation.
+2 -2
View File
@@ -1,7 +1,7 @@
<img src="GithubBanner.png" width="100%"/>
<a href="Installing.html"><i>v1.3.59</i></a>
<a href="Installing.html"><i>v1.3.60</i></a>
&nbsp;
@@ -9,7 +9,7 @@ To download PiPedal, click [here](download.md).
To view PiPedal documentation, click [here](Documentation.md).
#### NEW version 1.3.59 Release. See the [release notes](https://rerdavies.github.io/pipedal/ReleaseNotes) for details.
#### NEW version 1.3.60 Release. See the [release notes](https://rerdavies.github.io/pipedal/ReleaseNotes) for details.
&nbsp;
+3 -3
View File
@@ -354,7 +354,7 @@ const PluginPresetsDialog = withStyles(styles, { withTheme: true })(
let pluginUri = this.getPluginUri();
let plugin = this.model.getUiPlugin(pluginUri);
if (plugin) {
title = "Presets - " + plugin.name;
title = "Plugin Presets - " + plugin.name;
}
@@ -440,7 +440,7 @@ const PluginPresetsDialog = withStyles(styles, { withTheme: true })(
<DownloadIcon className={classes.listIcon} />
</ListItemIcon>
<ListItemText>
Download presets
Download plugin presets
</ListItemText>
</MenuItem>
@@ -449,7 +449,7 @@ const PluginPresetsDialog = withStyles(styles, { withTheme: true })(
<UploadIcon className={classes.listIcon} />
</ListItemIcon>
<ListItemText>
Upload presets
Upload plugin presets
</ListItemText>
</MenuItem>
+14 -3
View File
@@ -35,6 +35,7 @@ import ResizeResponsiveComponent from './ResizeResponsiveComponent';
import { TransitionProps } from '@mui/material/transitions';
import Fade from '@mui/material/Fade';
import Slide from '@mui/material/Slide';
import SnapshotPanel from './SnapshotPanel';
const styles = {
@@ -45,7 +46,7 @@ const styles = {
};
const Transition = React.forwardRef(function Transition(
const FadeTransition = React.forwardRef(function Transition(
props: TransitionProps & {
children: React.ReactElement<any, any>;
},
@@ -55,6 +56,17 @@ const Transition = React.forwardRef(function Transition(
});
const SlideTransition = React.forwardRef(function Transition(
props: TransitionProps & {
children: React.ReactElement<any, any>;
},
ref: React.Ref<unknown>,
) {
return <Slide direction="up" ref={ref} {...props} />;
});
export interface SnapshotDialogProps {
open: boolean,
@@ -100,11 +112,10 @@ export default class SnapshotDialog extends ResizeResponsiveComponent<SnapshotDi
render() {
return (
<DialogEx fullWidth={true} tag="shapshot" open={this.props.open} onClose={() => this.props.onOk()} fullScreen={this.state.fullScreen}
TransitionComponent={Transition} keepMounted
TransitionComponent={this.state.fullScreen? SlideTransition: FadeTransition} keepMounted
style={{ userSelect: "none", }}
PaperProps={{
style: {
maxWidth: '1000px'
},
}}
+1 -1
View File
@@ -844,7 +844,7 @@ void PiPedalModel::UploadPluginPresets(const PluginPresets &pluginPresets)
throw PiPedalException("Invalid plugin presets.");
}
std::lock_guard<std::recursive_mutex> guard{mutex};
storage.SavePluginPresets(pluginPresets.pluginUri_, pluginPresets);
storage.MergePluginPresets(pluginPresets.pluginUri_, pluginPresets);
FirePluginPresetsChanged(pluginPresets.pluginUri_);
}
int64_t PiPedalModel::UploadPreset(const BankFile &bankFile, int64_t uploadAfter)
+71
View File
@@ -2,6 +2,77 @@
using namespace pipedal;
static std::string GetUnversionedLabel(const std::string label)
{
size_t pos = label.length();
if (pos != 0 && label.at(pos-1) == ')')
{
--pos;
while (true)
{
if (pos == 0)
{
return label; // not versioned. return the original.
}
--pos;
char c = label[pos];
if (c >= '0' && c <= '9')
{
continue; // eat the number.
}
else if (c == '(')
{
return label.substr(0,pos);
} else {
return label; // failure. return the unmodified original
}
}
}
return label;
}
bool PluginPreset::equals(const PluginPreset&other) const
{
// everything EXCEPT instanceId (since preset may be from another PluginPresets collection)
return label_ == other.label_ &&
lilvPresetUri_ == other.lilvPresetUri_ &&
controlValues_ == other.controlValues_ &&
state_ == other.state_;
}
void PluginPresets::MergePreset(const PluginPreset&preset)
{
int existingPresetIndex = Find(preset.label_);
if (existingPresetIndex != -1)
{
if (this->presets_[existingPresetIndex].equals(preset))
{
// an exact duplicate. discard the new preset.
return;
}
std::string baseLabel = GetUnversionedLabel(preset.label_);
for (int i = 1; i < 1000; ++i)
{
std::string newLabel = SS(baseLabel << "(" << i << ")");
if (Find(newLabel) == -1)
{
PluginPreset versionedPreset = preset;
versionedPreset.label_ = newLabel;
MergePreset(versionedPreset);
return;
}
}
// A thousand duplicates?! Heck. just add a duplicate label. :-/
}
this->presets_.push_back(preset);
this->presets_.back().instanceId_ = this->nextInstanceId_++;
}
JSON_MAP_BEGIN(PluginUiPreset)
JSON_MAP_REFERENCE(PluginUiPreset,label)
JSON_MAP_REFERENCE(PluginUiPreset,instanceId)
+5
View File
@@ -111,6 +111,8 @@ public:
return preset;
}
bool equals(const PluginPreset&other) const;
uint64_t instanceId_;
std::string label_;
std::string lilvPresetUri_;
@@ -158,6 +160,9 @@ public:
return -1;
}
void MergePreset(const PluginPreset&preset);
DECLARE_JSON_MAP(PluginPresets);
};
+5 -5
View File
@@ -214,17 +214,17 @@ public:
{
this->pluginUploadDirectory = model.GetPluginUploadDirectory();
zipFile = ZipFileReader::Create(path);
auto s = zipFile->GetFileInputStream("pluginPresets.json");
auto s = zipFile->GetFileInputStream("bankFile.json");
json_reader reader(s);
reader.read(&pluginPresets);
reader.read(&bankFile);
}
void LoadPluginPresetFile(PiPedalModel &model, const std::filesystem::path &path)
{
this->pluginUploadDirectory = model.GetPluginUploadDirectory();
zipFile = ZipFileReader::Create(path);
auto s = zipFile->GetFileInputStream("bankFile.json");
auto s = zipFile->GetFileInputStream("pluginPresets.json");
json_reader reader(s);
reader.read(&bankFile);
reader.read(&pluginPresets);
}
virtual ~PresetBundleReaderImpl() noexcept;
@@ -296,7 +296,7 @@ PresetBundleReader::ptr PresetBundleReader::LoadPresetsFile(PiPedalModel &model,
PresetBundleReader::ptr PresetBundleReader::LoadPluginPresetsFile(PiPedalModel &model, const std::filesystem::path &filePath)
{
std::unique_ptr<PresetBundleReaderImpl> result = std::make_unique<PresetBundleReaderImpl>();
result->LoadPluginPresetsFile(model, filePath);
result->LoadPluginPresetFile(model, filePath);
return result;
}
+61
View File
@@ -1107,6 +1107,67 @@ std::filesystem::path Storage::GetPluginPresetPath(const std::string &pluginUri)
}
throw PiPedalArgumentException("Plugin preset file not found.");
}
void Storage::MergePluginPresets(const std::string &pluginUri, const PluginPresets &presets)
{
std::string name;
std::filesystem::path path;
bool presetAdded = false;
PluginPresets existingPresets;
if (!HasPluginPresets(pluginUri))
{
name = SS(pluginPresetIndex.nextInstanceId_ << ".json");
path = GetPluginPresetsDirectory() / name;
presetAdded = true;
}
else
{
path = GetPluginPresetPath(pluginUri);
try {
std::ifstream f(path);
if (f.is_open())
{
json_reader reader(f);
reader.read(&existingPresets);
}
} catch (const std::exception &e)
{
Lv2Log::error(SS("Storage::MergePluginPresets: Can't reading existing plugin presets." << e.what()));
}
}
for (const PluginPreset &preset: presets.presets_)
{
existingPresets.MergePreset(preset);
}
auto tempPath = path.string() + ".$$$";
{
pipedal::ofstream_synced os;
os.open(tempPath, std::ios_base::trunc);
if (os.fail())
{
throw PiPedalException(SS("Can't write to " << path));
}
json_writer writer(os, true);
writer.write(existingPresets);
}
if (std::filesystem::exists(path))
{
std::filesystem::remove(path);
}
std::filesystem::rename(tempPath, path);
if (presetAdded)
{
pluginPresetIndex.entries_.push_back(
PluginPresetIndexEntry(
pluginUri, name));
pluginPresetIndex.nextInstanceId_++;
this->pluginPresetIndexChanged = true;
SavePluginPresetIndex();
}
}
void Storage::SavePluginPresets(const std::string &pluginUri, const PluginPresets &presets)
{
std::string name;
+1
View File
@@ -187,6 +187,7 @@ private:
public:
bool HasPluginPresets(const std::string&pluginUri) const;
void SavePluginPresets(const std::string&pluginUri, const PluginPresets&presets);
void MergePluginPresets(const std::string&pluginUri, const PluginPresets&presets);
PluginPresets GetPluginPresets(const std::string&pluginUri) const;
const PluginPresetIndex& GetPluginPresetIndex();
+2 -1
View File
@@ -37,7 +37,7 @@
#define OLD_PRESET_EXTENSION ".piPreset"
#define PRESET_EXTENSION ".piPreset"
#define OLD_BANK_EXTENSION ".piBank"
#define BANK_EXTENSION ".piBankBundle"
#define BANK_EXTENSION ".piBank"
#define PLUGIN_PRESETS_EXTENSION ".piPluginPresets"
static const std::filesystem::path WEB_TEMP_DIR{"/var/pipedal/web_temp"};
@@ -598,6 +598,7 @@ public:
}
catch (const std::exception &e)
{
Lv2Log::error(SS("Error uploading file: " << e.what()) );
if (strcmp(e.what(), "Not found") == 0)
{
ec = boost::system::errc::make_error_code(boost::system::errc::no_such_file_or_directory);