Browse Source

Make it compatible with C++14

tags/2021-03-15
Jean Pierre Cimalando 1 year ago
parent
commit
908441782c
7 changed files with 1824 additions and 13 deletions
  1. +1
    -4
      ports/swankyamp/meson.build
  2. +2
    -2
      ports/swankyamp/source/PluginProcessor.h
  3. +3
    -3
      ports/swankyamp/source/PresetManager.cpp
  4. +3
    -3
      ports/swankyamp/source/PresetManager.h
  5. +1
    -1
      ports/swankyamp/source/dsp/FaustImpl.h
  6. +23
    -0
      ports/swankyamp/thirdparty/optional-lite/LICENSE.txt
  7. +1791
    -0
      ports/swankyamp/thirdparty/optional-lite/include/nonstd/optional.hpp

+ 1
- 4
ports/swankyamp/meson.build View File

@@ -1,11 +1,8 @@
###############################################################################

plugin_extra_build_flags = [
'-std=gnu++17',
]

plugin_extra_include_dirs = include_directories([
'source',
'thirdparty/optional-lite/include',
])

plugin_srcs = files([


+ 2
- 2
ports/swankyamp/source/PluginProcessor.h View File

@@ -82,9 +82,9 @@ public:
"idPowerAmpSag", "idPowerAmpSagRatio",
};

std::atomic<bool> notifyStateChanged = false;
std::atomic<bool> notifyStateChanged { false };
const int burnInLength = 1024;
std::atomic<int> numBurnIn = burnInLength;
std::atomic<int> numBurnIn { burnInLength };

void setAmpParameters();



+ 3
- 3
ports/swankyamp/source/PresetManager.cpp View File

@@ -60,7 +60,7 @@ std::pair<int, String> extractNumAndName(const String& name)
}

StateEntry::StateEntry(
const String& name, File file, std::optional<size_t> stateIdx) :
const String& name, File file, nonstd::optional<size_t> stateIdx) :
name(name), file(file), stateIdx(stateIdx)
{
}
@@ -143,7 +143,7 @@ void PresetManager::addStateEntry(
else
{
stateEntryIdx[name] = stateEntries.size();
stateEntries.push_back(StateEntry(name, file, std::nullopt));
stateEntries.push_back(StateEntry(name, file, nonstd::nullopt));
}
}

@@ -467,7 +467,7 @@ void PresetManager::comboBoxChanged()
// cn only happen if name exists
const StateEntry& currentEntry = stateEntries[stateEntryIdx[name]];

if (currentEntry.stateIdx != std::nullopt)
if (currentEntry.stateIdx != nonstd::nullopt)
{
// load the state for this entry
setState(states[*currentEntry.stateIdx]);


+ 3
- 3
ports/swankyamp/source/PresetManager.h View File

@@ -19,19 +19,19 @@
#pragma once

#include <JuceHeader.h>
#include <optional>
#include <nonstd/optional.hpp>
#include <unordered_map>

#include "PluginProcessor.h"

struct StateEntry
{
StateEntry(const String& name, File file, std::optional<size_t> stateIdx);
StateEntry(const String& name, File file, nonstd::optional<size_t> stateIdx);
StateEntry() {}

String name;
File file;
std::optional<size_t> stateIdx = std::nullopt;
nonstd::optional<size_t> stateIdx = nonstd::nullopt;
};

/** Connects a value tree state to a combo box and preset directory. */


+ 1
- 1
ports/swankyamp/source/dsp/FaustImpl.h View File

@@ -61,7 +61,7 @@ public:
FAUSTFLOAT)
{
if (zone == nullptr) return;
parameterMap.insert_or_assign(label, zone);
parameterMap[label] = zone;
}
virtual void
addHorizontalBargraph(const char*, FAUSTFLOAT*, FAUSTFLOAT, FAUSTFLOAT){};


+ 23
- 0
ports/swankyamp/thirdparty/optional-lite/LICENSE.txt View File

@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

+ 1791
- 0
ports/swankyamp/thirdparty/optional-lite/include/nonstd/optional.hpp
File diff suppressed because it is too large
View File


Loading…
Cancel
Save