diff --git a/.vscode/launch.json b/.vscode/launch.json index 98ec492..89fa735 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -212,7 +212,11 @@ // Resolved by CMake Tools: "program": "${command:cmake.launchTargetPath}", - "args": [ "--no-profile", "-w", "TooB NAM"], + "args": [ + "--no-profile", "-w", + // "TooB NAM" + "--preset-file", "/tmp/namPreset.preset" + ], "stopAtEntry": false, "cwd": "${workspaceFolder}", diff --git a/docs/.well-known/funding-manifest-urls b/docs/.well-known/funding-manifest-urls new file mode 100644 index 0000000..a212e0f --- /dev/null +++ b/docs/.well-known/funding-manifest-urls @@ -0,0 +1,4 @@ +https://rerdavies.github.io/pipedal/funding.json +https://github.com/rerdavies/ToobAmp +https://github.com/rerdavies/pipedal +https://github.com/sponsors/rerdavies \ No newline at end of file diff --git a/docs/funding.json b/docs/funding.json new file mode 100644 index 0000000..7d354e7 --- /dev/null +++ b/docs/funding.json @@ -0,0 +1,83 @@ +{ + "version": "v1.0.0", + "entity": { + "type": "individual", + "role": "maintainer", + "name": "Robin E. R. Davies", + "email": "rerdavies@gmail.com", + "phone": "1-613-857-8382", + "description": "I'm a developer, and jazz musician, interested in developing Raspbery Pi software for use in live performance.\n\nPiPedal started as a pandemic project, to see if I could build what I wanted to use when I perform. It has since grown into something beautiful and true, so I would like to make it available for everyone.", + "webpageUrl": { + "url": "https://github.com/rerdavies", + "wellKnown": "https://github.com/rerdavies/pipedal/blob/master/docs/.well-known/funding-manifest-urls" + } + }, + "projects": [{ + "guid": "com-twoplay-pipedal", + "name": "The PiPedal Project", + "description": "PiPedal is a guitar stomp box that runs on a Raspberry Pi (Raspberry Pi 4 or later). PiPedal is controlled remotely via a web application, or using the Android PiPedal Remote app.\n\nPipedal's user interface has been specifically designed with Phone and Tablet user interfaces in mind. Clip your phone or tablet onto a microphone stand, plugin your Raspberry Pi, and you're set to play!\n\nPiPedal started as Pandemic Project. I spent two years developing PiPedal full time during the pandemic. I would very much like to continue working on it full time, but I need your help to do so.", + "webpageUrl": { + "url": "https://rerdavies.github.io/pipedal/", + "wellKnown": "https://rerdavies.github.io/pipedal/.well-known/funding-manifest-urls" + }, + "repositoryUrl": { + "url": "https://github.com/rerdavies/pipedal", + "wellKnown": "https://github.com/rerdavies/pipedal/blob/master/docs/.well-known/funding-manifest-urls" + }, + "licenses": ["spdx:MIT"], + "tags": ["audio", "effects-pedal", "guitar", "raspberry-pi", "lv2-plugin"] + }], + "funding": { + "channels": [ + { + "guid": "mybank", + "type": "bank", + "address": "", + "description": "Will accept direct bank transfers. Please e-mail me for details." + }, + { + "guid": "github-sponsors", + "type": "payment-provider", + "address": "https://github.com/sponsors/rerdavies", + "description": "Pay with your debit/credit card through through GitHub Sponsors, or set up a monthly payment play.." + } + ], + "plans": [ + { + "guid": "hosting-monthly", + "status": "active", + "name": "Hosting support", + "description": "This will cover the monthly server hosting costs for the projects.", + "amount": 60, + "currency": "USD", + "frequency": "monthly", + "channels": ["mybank","github-sponsors"] + }, + { + "guid": "developer-time", + "status": "active", + "name": "Developer compensation", + "description": "This will cover the cost of one developer working full-time on the projects.", + "amount": 2000, + "currency": "USD", + "frequency": "monthly", + "channels": ["mybank","github-sponsors"] + }, + { + "guid": "angel-plan", + "status": "active", + "name": "Goodwill plan", + "description": "Pay anything you wish to show your goodwill for the project.", + "amount": 0, + "currency": "USD", + "frequency": "one-time", + "channels": ["mybank", "github-sponsors"] + } + ], + "history": [ + {"year": 2022, "income": 0, "expenses": 0, "taxes": 0, "currency": "USD", "description": ""}, + {"year": 2023, "income": 0, "expenses": 0, "taxes": 0, "currency": "USD", "description": ""}, + {"year": 2024, "income": 47.00, "expenses": 0, "taxes": 0, "currency": "USD", "description": ""} + ] + } +} \ No newline at end of file diff --git a/src/profilePluginMain.cpp b/src/profilePluginMain.cpp index d3a012c..7c04c20 100644 --- a/src/profilePluginMain.cpp +++ b/src/profilePluginMain.cpp @@ -101,6 +101,7 @@ void profilePlugin(const ProfileOptions &profileOptions) /*** Initialize the model */ PiPedalModel model; + Lv2Log::log_level(LogLevel::Error); fs::path doc_root = "/etc/pipedal/config"; PiPedalConfiguration configuration; try @@ -156,13 +157,18 @@ void profilePlugin(const ProfileOptions &profileOptions) try { json_reader reader(f); - Pedalboard pedalboard; - reader.read(&pedalboard); - model.SetPedalboard(-1, pedalboard); + BankFile bankFile; + reader.read(&bankFile); + if (bankFile.presets().size() != 1) + { + throw new std::runtime_error(SS("Invalid preset file. Expection one preset, but " << bankFile.presets().size() << " presets were found.")); + } + Pedalboard pedalboard = (bankFile.presets()[0]->preset()); + model.SetPedalboard(-1,pedalboard); } catch (const std::exception &e) { - throw std::runtime_error(SS("Invalid file format: " << profileOptions.presetFileName << ".")); + throw std::runtime_error(SS("Invalid file format: " << profileOptions.presetFileName << ". " << e.what() )); } } else @@ -271,7 +277,14 @@ int main(int argc, char **argv) commandLineParser.Parse(argc, (const char **)argv); - if (commandLineParser.Arguments().size() != 1 || help) + bool argumentError = false; + if (commandLineParser.Arguments().size() == 1 && presetFileName.length() == 0) + { + cerr << "Error: You must supply either a preset name, or a preset file name" << endl; + argumentError = true; + } + + if (argumentError || help) { cout << "profilePlugin - Generate profiling data for LV2 Plugins" << endl; cout << "Copyright (c) 2024 Robin E. R. Davies" << endl; @@ -299,7 +312,7 @@ int main(int argc, char **argv) return help ? EXIT_SUCCESS : EXIT_FAILURE; } - if (commandLineParser.Arguments().size() == 1) + if (commandLineParser.Arguments().size() != 0) { profileOptions.presetName = commandLineParser.Arguments()[0]; }