fix C2440 in Visual Studio (uniform initialization of juce::String)

This commit is contained in:
Birch-san 2019-07-31 23:16:31 +01:00
parent c05d784412
commit 9e723c7636
No known key found for this signature in database
GPG Key ID: 726D53FF6A26AB9D
4 changed files with 5 additions and 5 deletions

View File

@ -65,7 +65,7 @@ void FilePicker::valueTreePropertyChanged(ValueTree& treeWhosePropertyHasChanged
if (treeWhosePropertyHasChanged.getType() == StringRef("soundFont")) { if (treeWhosePropertyHasChanged.getType() == StringRef("soundFont")) {
// if (&treeWhosePropertyHasChanged == &valueTree) { // if (&treeWhosePropertyHasChanged == &valueTree) {
if (property == StringRef("path")) { if (property == StringRef("path")) {
String soundFontPath{treeWhosePropertyHasChanged.getProperty("path", "")}; String soundFontPath = treeWhosePropertyHasChanged.getProperty("path", "");
DEBUG_PRINT(soundFontPath); DEBUG_PRINT(soundFontPath);
setDisplayedFilePath(soundFontPath); setDisplayedFilePath(soundFontPath);
// if (soundFontPath.isNotEmpty()) { // if (soundFontPath.isNotEmpty()) {

View File

@ -75,7 +75,7 @@ void FluidSynthModel::initialise() {
fluid_synth_set_sample_rate(synth.get(), currentSampleRate); fluid_synth_set_sample_rate(synth.get(), currentSampleRate);
ValueTree soundFont{valueTreeState.state.getChildWithName("soundFont")}; ValueTree soundFont{valueTreeState.state.getChildWithName("soundFont")};
String path{soundFont.getProperty("path", "")}; String path = soundFont.getProperty("path", "");
loadFont(path); loadFont(path);
// I can't hear a damned thing // I can't hear a damned thing
@ -225,7 +225,7 @@ void FluidSynthModel::valueTreePropertyChanged(ValueTree& treeWhosePropertyHasCh
const Identifier& property) { const Identifier& property) {
if (treeWhosePropertyHasChanged.getType() == StringRef("soundFont")) { if (treeWhosePropertyHasChanged.getType() == StringRef("soundFont")) {
if (property == StringRef("path")) { if (property == StringRef("path")) {
String soundFontPath{treeWhosePropertyHasChanged.getProperty("path", "")}; String soundFontPath = treeWhosePropertyHasChanged.getProperty("path", "");
if (soundFontPath.isNotEmpty()) { if (soundFontPath.isNotEmpty()) {
unloadAndLoadFont(soundFontPath); unloadAndLoadFont(soundFontPath);
} }

View File

@ -239,7 +239,7 @@ void JuicySFAudioProcessor::getStateInformation (MemoryBlock& destData)
ValueTree tree{valueTreeState.state.getChildWithName("soundFont")}; ValueTree tree{valueTreeState.state.getChildWithName("soundFont")};
XmlElement* newElement{xml.createNewChildElement("soundFont")}; XmlElement* newElement{xml.createNewChildElement("soundFont")};
{ {
String value{tree.getProperty("path", "")}; String value = tree.getProperty("path", "");
newElement->setAttribute("path", value); newElement->setAttribute("path", value);
} }
} }

View File

@ -80,7 +80,7 @@ void TableComponent::loadModelFrom(ValueTree& banks) {
for(int presetIx{0}; presetIx<bankChildren; presetIx++) { for(int presetIx{0}; presetIx<bankChildren; presetIx++) {
ValueTree preset{bank.getChild(presetIx)}; ValueTree preset{bank.getChild(presetIx)};
int presetNum{preset.getProperty("num")}; int presetNum{preset.getProperty("num")};
String presetName{preset.getProperty("name")}; String presetName = preset.getProperty("name");
TableRow row{presetNum, move(presetName)}; TableRow row{presetNum, move(presetName)};
banksToPresets.emplace(bankNum, move(row)); banksToPresets.emplace(bankNum, move(row));
} }