| @@ -253,6 +253,7 @@ OBJECTS := \ | |||
| $(OBJDIR)/juce_SVGParser_b79416c5.o \ | |||
| $(OBJDIR)/juce_DropShadowEffect_da52d75.o \ | |||
| $(OBJDIR)/juce_GlowEffect_c0959893.o \ | |||
| $(OBJDIR)/juce_CustomTypeface_b93a3eff.o \ | |||
| $(OBJDIR)/juce_Font_fa88db26.o \ | |||
| $(OBJDIR)/juce_GlyphArrangement_f0797295.o \ | |||
| $(OBJDIR)/juce_TextLayout_d18f700e.o \ | |||
| @@ -1455,6 +1456,11 @@ $(OBJDIR)/juce_GlowEffect_c0959893.o: ../../src/gui/graphics/effects/juce_GlowEf | |||
| @echo "Compiling juce_GlowEffect.cpp" | |||
| @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" | |||
| $(OBJDIR)/juce_CustomTypeface_b93a3eff.o: ../../src/gui/graphics/fonts/juce_CustomTypeface.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling juce_CustomTypeface.cpp" | |||
| @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" | |||
| $(OBJDIR)/juce_Font_fa88db26.o: ../../src/gui/graphics/fonts/juce_Font.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling juce_Font.cpp" | |||
| @@ -222,6 +222,7 @@ | |||
| 645AF66C048A4815F5A8ECDD = { isa = PBXBuildFile; fileRef = 2BFC199D03DEEC329D6A7CB1; }; | |||
| 38EFE824E76B3BB99824C265 = { isa = PBXBuildFile; fileRef = 32EA297812F1C88B42099501; }; | |||
| E23C5C51305DC7CE30E4DAB7 = { isa = PBXBuildFile; fileRef = CB649686575473223C859482; }; | |||
| 60E1742796432D042C59B9B3 = { isa = PBXBuildFile; fileRef = BA17B023595ECD8166A231D1; }; | |||
| B92F53BABB6A9AC8348B001E = { isa = PBXBuildFile; fileRef = 78068AA59A5DCFCCAAEA79D0; }; | |||
| EBC3AA015D24C62FA0307F51 = { isa = PBXBuildFile; fileRef = 61D06B694603F608CDA0703B; }; | |||
| 803FFCA3DAC0C004A80143B4 = { isa = PBXBuildFile; fileRef = 91CB423DBC5F3CBEDD9CF2EF; }; | |||
| @@ -859,6 +860,8 @@ | |||
| CB649686575473223C859482 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_GlowEffect.cpp; path = ../../src/gui/graphics/effects/juce_GlowEffect.cpp; sourceTree = SOURCE_ROOT; }; | |||
| FD1FA4ABB4226372235643E4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_GlowEffect.h; path = ../../src/gui/graphics/effects/juce_GlowEffect.h; sourceTree = SOURCE_ROOT; }; | |||
| 18DB9BD10F140F132A3279C3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ImageEffectFilter.h; path = ../../src/gui/graphics/effects/juce_ImageEffectFilter.h; sourceTree = SOURCE_ROOT; }; | |||
| BA17B023595ECD8166A231D1 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_CustomTypeface.cpp; path = ../../src/gui/graphics/fonts/juce_CustomTypeface.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 6B4E90767D784246EC4E1944 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_CustomTypeface.h; path = ../../src/gui/graphics/fonts/juce_CustomTypeface.h; sourceTree = SOURCE_ROOT; }; | |||
| 78068AA59A5DCFCCAAEA79D0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Font.cpp; path = ../../src/gui/graphics/fonts/juce_Font.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 0401EA0E883CCAAAC6960A27 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_Font.h; path = ../../src/gui/graphics/fonts/juce_Font.h; sourceTree = SOURCE_ROOT; }; | |||
| 61D06B694603F608CDA0703B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_GlyphArrangement.cpp; path = ../../src/gui/graphics/fonts/juce_GlyphArrangement.cpp; sourceTree = SOURCE_ROOT; }; | |||
| @@ -1663,6 +1666,8 @@ | |||
| FD1FA4ABB4226372235643E4, | |||
| 18DB9BD10F140F132A3279C3 ); name = effects; sourceTree = "<group>"; }; | |||
| 58FE42C578BFFD1F8F545B39 = { isa = PBXGroup; children = ( | |||
| BA17B023595ECD8166A231D1, | |||
| 6B4E90767D784246EC4E1944, | |||
| 78068AA59A5DCFCCAAEA79D0, | |||
| 0401EA0E883CCAAAC6960A27, | |||
| 61D06B694603F608CDA0703B, | |||
| @@ -2260,6 +2265,7 @@ | |||
| 645AF66C048A4815F5A8ECDD, | |||
| 38EFE824E76B3BB99824C265, | |||
| E23C5C51305DC7CE30E4DAB7, | |||
| 60E1742796432D042C59B9B3, | |||
| B92F53BABB6A9AC8348B001E, | |||
| EBC3AA015D24C62FA0307F51, | |||
| 803FFCA3DAC0C004A80143B4, | |||
| @@ -736,6 +736,8 @@ | |||
| <File RelativePath="..\..\src\gui\graphics\effects\juce_ImageEffectFilter.h"/> | |||
| </Filter> | |||
| <Filter Name="fonts"> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_CustomTypeface.cpp"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_CustomTypeface.h"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_Font.cpp"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_Font.h"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_GlyphArrangement.cpp"/> | |||
| @@ -736,6 +736,8 @@ | |||
| <File RelativePath="..\..\src\gui\graphics\effects\juce_ImageEffectFilter.h"/> | |||
| </Filter> | |||
| <Filter Name="fonts"> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_CustomTypeface.cpp"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_CustomTypeface.h"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_Font.cpp"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_Font.h"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_GlyphArrangement.cpp"/> | |||
| @@ -738,6 +738,8 @@ | |||
| <File RelativePath="..\..\src\gui\graphics\effects\juce_ImageEffectFilter.h"/> | |||
| </Filter> | |||
| <Filter Name="fonts"> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_CustomTypeface.cpp"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_CustomTypeface.h"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_Font.cpp"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_Font.h"/> | |||
| <File RelativePath="..\..\src\gui\graphics\fonts\juce_GlyphArrangement.cpp"/> | |||
| @@ -336,6 +336,7 @@ | |||
| <ClCompile Include="..\..\src\gui\graphics\drawables\juce_SVGParser.cpp"/> | |||
| <ClCompile Include="..\..\src\gui\graphics\effects\juce_DropShadowEffect.cpp"/> | |||
| <ClCompile Include="..\..\src\gui\graphics\effects\juce_GlowEffect.cpp"/> | |||
| <ClCompile Include="..\..\src\gui\graphics\fonts\juce_CustomTypeface.cpp"/> | |||
| <ClCompile Include="..\..\src\gui\graphics\fonts\juce_Font.cpp"/> | |||
| <ClCompile Include="..\..\src\gui\graphics\fonts\juce_GlyphArrangement.cpp"/> | |||
| <ClCompile Include="..\..\src\gui\graphics\fonts\juce_TextLayout.cpp"/> | |||
| @@ -722,6 +723,7 @@ | |||
| <ClInclude Include="..\..\src\gui\graphics\effects\juce_DropShadowEffect.h"/> | |||
| <ClInclude Include="..\..\src\gui\graphics\effects\juce_GlowEffect.h"/> | |||
| <ClInclude Include="..\..\src\gui\graphics\effects\juce_ImageEffectFilter.h"/> | |||
| <ClInclude Include="..\..\src\gui\graphics\fonts\juce_CustomTypeface.h"/> | |||
| <ClInclude Include="..\..\src\gui\graphics\fonts\juce_Font.h"/> | |||
| <ClInclude Include="..\..\src\gui\graphics\fonts\juce_GlyphArrangement.h"/> | |||
| <ClInclude Include="..\..\src\gui\graphics\fonts\juce_TextLayout.h"/> | |||
| @@ -865,6 +865,9 @@ | |||
| <ClCompile Include="..\..\src\gui\graphics\effects\juce_GlowEffect.cpp"> | |||
| <Filter>Juce\Source\gui\graphics\effects</Filter> | |||
| </ClCompile> | |||
| <ClCompile Include="..\..\src\gui\graphics\fonts\juce_CustomTypeface.cpp"> | |||
| <Filter>Juce\Source\gui\graphics\fonts</Filter> | |||
| </ClCompile> | |||
| <ClCompile Include="..\..\src\gui\graphics\fonts\juce_Font.cpp"> | |||
| <Filter>Juce\Source\gui\graphics\fonts</Filter> | |||
| </ClCompile> | |||
| @@ -2097,6 +2100,9 @@ | |||
| <ClInclude Include="..\..\src\gui\graphics\effects\juce_ImageEffectFilter.h"> | |||
| <Filter>Juce\Source\gui\graphics\effects</Filter> | |||
| </ClInclude> | |||
| <ClInclude Include="..\..\src\gui\graphics\fonts\juce_CustomTypeface.h"> | |||
| <Filter>Juce\Source\gui\graphics\fonts</Filter> | |||
| </ClInclude> | |||
| <ClInclude Include="..\..\src\gui\graphics\fonts\juce_Font.h"> | |||
| <Filter>Juce\Source\gui\graphics\fonts</Filter> | |||
| </ClInclude> | |||
| @@ -222,6 +222,7 @@ | |||
| 645AF66C048A4815F5A8ECDD = { isa = PBXBuildFile; fileRef = 2BFC199D03DEEC329D6A7CB1; }; | |||
| 38EFE824E76B3BB99824C265 = { isa = PBXBuildFile; fileRef = 32EA297812F1C88B42099501; }; | |||
| E23C5C51305DC7CE30E4DAB7 = { isa = PBXBuildFile; fileRef = CB649686575473223C859482; }; | |||
| 60E1742796432D042C59B9B3 = { isa = PBXBuildFile; fileRef = BA17B023595ECD8166A231D1; }; | |||
| B92F53BABB6A9AC8348B001E = { isa = PBXBuildFile; fileRef = 78068AA59A5DCFCCAAEA79D0; }; | |||
| EBC3AA015D24C62FA0307F51 = { isa = PBXBuildFile; fileRef = 61D06B694603F608CDA0703B; }; | |||
| 803FFCA3DAC0C004A80143B4 = { isa = PBXBuildFile; fileRef = 91CB423DBC5F3CBEDD9CF2EF; }; | |||
| @@ -859,6 +860,8 @@ | |||
| CB649686575473223C859482 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_GlowEffect.cpp; path = ../../src/gui/graphics/effects/juce_GlowEffect.cpp; sourceTree = SOURCE_ROOT; }; | |||
| FD1FA4ABB4226372235643E4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_GlowEffect.h; path = ../../src/gui/graphics/effects/juce_GlowEffect.h; sourceTree = SOURCE_ROOT; }; | |||
| 18DB9BD10F140F132A3279C3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ImageEffectFilter.h; path = ../../src/gui/graphics/effects/juce_ImageEffectFilter.h; sourceTree = SOURCE_ROOT; }; | |||
| BA17B023595ECD8166A231D1 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_CustomTypeface.cpp; path = ../../src/gui/graphics/fonts/juce_CustomTypeface.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 6B4E90767D784246EC4E1944 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_CustomTypeface.h; path = ../../src/gui/graphics/fonts/juce_CustomTypeface.h; sourceTree = SOURCE_ROOT; }; | |||
| 78068AA59A5DCFCCAAEA79D0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Font.cpp; path = ../../src/gui/graphics/fonts/juce_Font.cpp; sourceTree = SOURCE_ROOT; }; | |||
| 0401EA0E883CCAAAC6960A27 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_Font.h; path = ../../src/gui/graphics/fonts/juce_Font.h; sourceTree = SOURCE_ROOT; }; | |||
| 61D06B694603F608CDA0703B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_GlyphArrangement.cpp; path = ../../src/gui/graphics/fonts/juce_GlyphArrangement.cpp; sourceTree = SOURCE_ROOT; }; | |||
| @@ -1663,6 +1666,8 @@ | |||
| FD1FA4ABB4226372235643E4, | |||
| 18DB9BD10F140F132A3279C3 ); name = effects; sourceTree = "<group>"; }; | |||
| 58FE42C578BFFD1F8F545B39 = { isa = PBXGroup; children = ( | |||
| BA17B023595ECD8166A231D1, | |||
| 6B4E90767D784246EC4E1944, | |||
| 78068AA59A5DCFCCAAEA79D0, | |||
| 0401EA0E883CCAAAC6960A27, | |||
| 61D06B694603F608CDA0703B, | |||
| @@ -2264,6 +2269,7 @@ | |||
| 645AF66C048A4815F5A8ECDD, | |||
| 38EFE824E76B3BB99824C265, | |||
| E23C5C51305DC7CE30E4DAB7, | |||
| 60E1742796432D042C59B9B3, | |||
| B92F53BABB6A9AC8348B001E, | |||
| EBC3AA015D24C62FA0307F51, | |||
| 803FFCA3DAC0C004A80143B4, | |||
| @@ -1092,6 +1092,10 @@ | |||
| file="src/gui/graphics/effects/juce_ImageEffectFilter.h"/> | |||
| </GROUP> | |||
| <GROUP id="nw92NleR1" name="fonts"> | |||
| <FILE id="BQmnc2" name="juce_CustomTypeface.cpp" compile="1" resource="0" | |||
| file="src/gui/graphics/fonts/juce_CustomTypeface.cpp"/> | |||
| <FILE id="qq3mPn" name="juce_CustomTypeface.h" compile="0" resource="0" | |||
| file="src/gui/graphics/fonts/juce_CustomTypeface.h"/> | |||
| <FILE id="2zj67pVi" name="juce_Font.cpp" compile="1" resource="0" file="src/gui/graphics/fonts/juce_Font.cpp"/> | |||
| <FILE id="Ln7yTYyJY" name="juce_Font.h" compile="0" resource="0" file="src/gui/graphics/fonts/juce_Font.h"/> | |||
| <FILE id="rVpLDxysZ" name="juce_GlyphArrangement.cpp" compile="1" resource="0" | |||
| @@ -365,6 +365,7 @@ | |||
| #include "../src/gui/graphics/fonts/juce_GlyphArrangement.cpp" | |||
| #include "../src/gui/graphics/fonts/juce_TextLayout.cpp" | |||
| #include "../src/gui/graphics/fonts/juce_Typeface.cpp" | |||
| #include "../src/gui/graphics/fonts/juce_CustomTypeface.cpp" | |||
| #include "../src/gui/graphics/geometry/juce_AffineTransform.cpp" | |||
| #include "../src/gui/graphics/geometry/juce_Path.cpp" | |||
| #include "../src/gui/graphics/geometry/juce_PathIterator.cpp" | |||
| @@ -360,7 +360,7 @@ void ProjectTreeViewBase::itemDropped (const DragAndDropTarget::SourceDetails& d | |||
| moveSelectedItemsTo (selectedNodes, insertIndex); | |||
| if (oldOpenness != nullptr) | |||
| tree->restoreOpennessState (*oldOpenness); | |||
| tree->restoreOpennessState (*oldOpenness, false); | |||
| } | |||
| } | |||
| @@ -154,7 +154,7 @@ const String ApplicationCommandManager::getDescriptionOfCommand (const CommandID | |||
| : String::empty; | |||
| } | |||
| const StringArray ApplicationCommandManager::getCommandCategories() const | |||
| StringArray ApplicationCommandManager::getCommandCategories() const | |||
| { | |||
| StringArray s; | |||
| @@ -194,7 +194,7 @@ public: | |||
| @see getCommandsInCategory() | |||
| */ | |||
| const StringArray getCommandCategories() const; | |||
| StringArray getCommandCategories() const; | |||
| /** Returns a list of all the command UIDs in a particular category. | |||
| @@ -30,55 +30,57 @@ BEGIN_JUCE_NAMESPACE | |||
| #include "juce_AudioThumbnail.h" | |||
| #include "juce_AudioThumbnailCache.h" | |||
| #include "../../events/juce_MessageManager.h" | |||
| #include "../../io/streams/juce_BufferedInputStream.h" | |||
| //============================================================================== | |||
| struct AudioThumbnail::MinMaxValue | |||
| { | |||
| char minValue; | |||
| char maxValue; | |||
| MinMaxValue() noexcept : minValue (0), maxValue (0) | |||
| MinMaxValue() noexcept | |||
| { | |||
| values[0] = 0; | |||
| values[1] = 0; | |||
| } | |||
| inline void set (const char newMin, const char newMax) noexcept | |||
| { | |||
| minValue = newMin; | |||
| maxValue = newMax; | |||
| values[0] = newMin; | |||
| values[1] = newMax; | |||
| } | |||
| inline char getMinValue() const noexcept { return values[0]; } | |||
| inline char getMaxValue() const noexcept { return values[1]; } | |||
| inline void setFloat (const float newMin, const float newMax) noexcept | |||
| { | |||
| minValue = (char) jlimit (-128, 127, roundFloatToInt (newMin * 127.0f)); | |||
| maxValue = (char) jlimit (-128, 127, roundFloatToInt (newMax * 127.0f)); | |||
| values[0] = (char) jlimit (-128, 127, roundFloatToInt (newMin * 127.0f)); | |||
| values[1] = (char) jlimit (-128, 127, roundFloatToInt (newMax * 127.0f)); | |||
| if (maxValue == minValue) | |||
| maxValue = (char) jmin (127, maxValue + 1); | |||
| if (values[0] == values[1]) | |||
| { | |||
| if (values[1] == 127) | |||
| values[0]--; | |||
| else | |||
| values[1]++; | |||
| } | |||
| } | |||
| inline bool isNonZero() const noexcept | |||
| { | |||
| return maxValue > minValue; | |||
| return values[1] > values[0]; | |||
| } | |||
| inline int getPeak() const noexcept | |||
| { | |||
| return jmax (std::abs ((int) minValue), | |||
| std::abs ((int) maxValue)); | |||
| return jmax (std::abs ((int) values[0]), | |||
| std::abs ((int) values[1])); | |||
| } | |||
| inline void read (InputStream& input) | |||
| { | |||
| minValue = input.readByte(); | |||
| maxValue = input.readByte(); | |||
| } | |||
| inline void read (InputStream& input) { input.read (values, 2); } | |||
| inline void write (OutputStream& output) { output.write (values, 2); } | |||
| inline void write (OutputStream& output) | |||
| { | |||
| output.writeByte (minValue); | |||
| output.writeByte (maxValue); | |||
| } | |||
| private: | |||
| char values[2]; | |||
| }; | |||
| //============================================================================== | |||
| @@ -294,8 +296,8 @@ public: | |||
| { | |||
| const MinMaxValue& v = data.getReference (startSample); | |||
| if (v.minValue < mn) mn = v.minValue; | |||
| if (v.maxValue > mx) mx = v.maxValue; | |||
| if (v.getMinValue() < mn) mn = v.getMinValue(); | |||
| if (v.getMaxValue() > mx) mx = v.getMaxValue(); | |||
| ++startSample; | |||
| } | |||
| @@ -397,8 +399,8 @@ public: | |||
| for (int w = clip.getWidth(); --w >= 0;) | |||
| { | |||
| if (cacheData->isNonZero()) | |||
| g.drawVerticalLine (x, jmax (midY - cacheData->maxValue * vscale - 0.3f, topY), | |||
| jmin (midY - cacheData->minValue * vscale + 0.3f, bottomY)); | |||
| g.drawVerticalLine (x, jmax (midY - cacheData->getMaxValue() * vscale - 0.3f, topY), | |||
| jmin (midY - cacheData->getMinValue() * vscale + 0.3f, bottomY)); | |||
| ++x; | |||
| ++cacheData; | |||
| @@ -568,10 +570,12 @@ void AudioThumbnail::createChannels (const int length) | |||
| } | |||
| //============================================================================== | |||
| void AudioThumbnail::loadFrom (InputStream& input) | |||
| void AudioThumbnail::loadFrom (InputStream& rawInput) | |||
| { | |||
| clear(); | |||
| BufferedInputStream input (rawInput, 4096); | |||
| if (input.readByte() != 'j' || input.readByte() != 'a' || input.readByte() != 't' || input.readByte() != 'm') | |||
| return; | |||
| @@ -581,7 +585,7 @@ void AudioThumbnail::loadFrom (InputStream& input) | |||
| int32 numThumbnailSamples = input.readInt(); // Number of samples in the thumbnail data. | |||
| numChannels = input.readInt(); // Number of audio channels. | |||
| sampleRate = input.readInt(); // Source sample rate. | |||
| input.skipNextBytes (16); // reserved area | |||
| input.skipNextBytes (16); // (reserved) | |||
| createChannels (numThumbnailSamples); | |||
| @@ -762,8 +766,8 @@ void AudioThumbnail::getApproximateMinMax (const double startTime, const double | |||
| data->getMinMax (jmax (0, firstThumbIndex), lastThumbIndex, result); | |||
| } | |||
| minValue = result.minValue / 128.0f; | |||
| maxValue = result.maxValue / 128.0f; | |||
| minValue = result.getMinValue() / 128.0f; | |||
| maxValue = result.getMaxValue() / 128.0f; | |||
| } | |||
| void AudioThumbnail::drawChannel (Graphics& g, const Rectangle<int>& area, double startTime, | |||
| @@ -48,12 +48,12 @@ const char* const WavAudioFormat::bwavOriginationTime = "bwav origination time" | |||
| const char* const WavAudioFormat::bwavTimeReference = "bwav time reference"; | |||
| const char* const WavAudioFormat::bwavCodingHistory = "bwav coding history"; | |||
| const StringPairArray WavAudioFormat::createBWAVMetadata (const String& description, | |||
| const String& originator, | |||
| const String& originatorRef, | |||
| const Time& date, | |||
| const int64 timeReferenceSamples, | |||
| const String& codingHistory) | |||
| StringPairArray WavAudioFormat::createBWAVMetadata (const String& description, | |||
| const String& originator, | |||
| const String& originatorRef, | |||
| const Time& date, | |||
| const int64 timeReferenceSamples, | |||
| const String& codingHistory) | |||
| { | |||
| StringPairArray m; | |||
| @@ -111,12 +111,12 @@ public: | |||
| This just makes it easier than using the property names directly, and it | |||
| fills out the time and date in the right format. | |||
| */ | |||
| static const StringPairArray createBWAVMetadata (const String& description, | |||
| const String& originator, | |||
| const String& originatorRef, | |||
| const Time& dateAndTime, | |||
| const int64 timeReferenceSamples, | |||
| const String& codingHistory); | |||
| static StringPairArray createBWAVMetadata (const String& description, | |||
| const String& originator, | |||
| const String& originatorRef, | |||
| const Time& dateAndTime, | |||
| const int64 timeReferenceSamples, | |||
| const String& codingHistory); | |||
| //============================================================================== | |||
| const Array <int> getPossibleSampleRates(); | |||
| @@ -28,10 +28,6 @@ | |||
| BEGIN_JUCE_NAMESPACE | |||
| #include "juce_AudioDeviceManager.h" | |||
| #include "../../gui/components/juce_Desktop.h" | |||
| #include "../../text/juce_LocalisedStrings.h" | |||
| #include "../dsp/juce_AudioSampleBuffer.h" | |||
| #include "../../core/juce_SystemStats.h" | |||
| //============================================================================== | |||
| @@ -816,7 +812,7 @@ void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName) | |||
| { | |||
| if (defaultMidiOutputName != deviceName) | |||
| { | |||
| SortedSet <AudioIODeviceCallback*> oldCallbacks; | |||
| Array <AudioIODeviceCallback*> oldCallbacks; | |||
| { | |||
| const ScopedLock sl (audioCallbackLock); | |||
| @@ -30,8 +30,9 @@ | |||
| #include "../midi/juce_MidiInput.h" | |||
| #include "../midi/juce_MidiOutput.h" | |||
| #include "../../text/juce_XmlElement.h" | |||
| #include "../../gui/components/controls/juce_ComboBox.h" | |||
| #include "../../events/juce_ChangeBroadcaster.h" | |||
| #include "../dsp/juce_AudioSampleBuffer.h" | |||
| #include "../../containers/juce_OwnedArray.h" | |||
| //============================================================================== | |||
| @@ -450,7 +451,7 @@ private: | |||
| AudioDeviceSetup currentSetup; | |||
| ScopedPointer <AudioIODevice> currentAudioDevice; | |||
| SortedSet <AudioIODeviceCallback*> callbacks; | |||
| Array <AudioIODeviceCallback*> callbacks; | |||
| int numInputChansNeeded, numOutputChansNeeded; | |||
| String currentDeviceType; | |||
| BigInteger inputChannels, outputChannels; | |||
| @@ -28,7 +28,6 @@ | |||
| #include "../../text/juce_StringArray.h" | |||
| #include "../../maths/juce_BigInteger.h" | |||
| #include "../../containers/juce_OwnedArray.h" | |||
| class AudioIODevice; | |||
| @@ -28,7 +28,7 @@ | |||
| #include "juce_AudioIODevice.h" | |||
| class AudioDeviceManager; | |||
| class Component; | |||
| //============================================================================== | |||
| /** | |||
| @@ -168,14 +168,10 @@ namespace MidiFileHelpers | |||
| { | |||
| const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); | |||
| if (diff > 0) | |||
| return 1; | |||
| else if (diff < 0) | |||
| return -1; | |||
| else if (first->message.isNoteOff() && second->message.isNoteOn()) | |||
| return -1; | |||
| else if (first->message.isNoteOn() && second->message.isNoteOff()) | |||
| return 1; | |||
| if (diff > 0) return 1; | |||
| if (diff < 0) return -1; | |||
| if (first->message.isNoteOff() && second->message.isNoteOn()) return -1; | |||
| if (first->message.isNoteOn() && second->message.isNoteOff()) return 1; | |||
| return 0; | |||
| } | |||
| @@ -397,7 +393,6 @@ bool MidiFile::writeTo (OutputStream& out) | |||
| writeTrack (out, i); | |||
| out.flush(); | |||
| return true; | |||
| } | |||
| @@ -443,7 +438,7 @@ void MidiFile::writeTrack (OutputStream& mainOut, const int trackNum) | |||
| mainOut.writeIntBigEndian ((int) ByteOrder::bigEndianInt ("MTrk")); | |||
| mainOut.writeIntBigEndian ((int) out.getDataSize()); | |||
| mainOut.write (out.getData(), (int) out.getDataSize()); | |||
| mainOut << out; | |||
| } | |||
| END_JUCE_NAMESPACE | |||
| @@ -387,9 +387,9 @@ int MidiMessage::getAfterTouchValue() const noexcept | |||
| return data[2]; | |||
| } | |||
| const MidiMessage MidiMessage::aftertouchChange (const int channel, | |||
| const int noteNum, | |||
| const int aftertouchValue) noexcept | |||
| MidiMessage MidiMessage::aftertouchChange (const int channel, | |||
| const int noteNum, | |||
| const int aftertouchValue) noexcept | |||
| { | |||
| jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
| jassert (isPositiveAndBelow (noteNum, (int) 128)); | |||
| @@ -411,8 +411,7 @@ int MidiMessage::getChannelPressureValue() const noexcept | |||
| return data[1]; | |||
| } | |||
| const MidiMessage MidiMessage::channelPressureChange (const int channel, | |||
| const int pressure) noexcept | |||
| MidiMessage MidiMessage::channelPressureChange (const int channel, const int pressure) noexcept | |||
| { | |||
| jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
| jassert (isPositiveAndBelow (pressure, (int) 128)); | |||
| @@ -441,8 +440,7 @@ int MidiMessage::getProgramChangeNumber() const noexcept | |||
| return data[1]; | |||
| } | |||
| const MidiMessage MidiMessage::programChange (const int channel, | |||
| const int programNumber) noexcept | |||
| MidiMessage MidiMessage::programChange (const int channel, const int programNumber) noexcept | |||
| { | |||
| jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
| @@ -460,8 +458,7 @@ int MidiMessage::getPitchWheelValue() const noexcept | |||
| return data[1] | (data[2] << 7); | |||
| } | |||
| const MidiMessage MidiMessage::pitchWheel (const int channel, | |||
| const int position) noexcept | |||
| MidiMessage MidiMessage::pitchWheel (const int channel, const int position) noexcept | |||
| { | |||
| jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
| jassert (isPositiveAndBelow (position, (int) 0x4000)); | |||
| @@ -492,7 +489,7 @@ int MidiMessage::getControllerValue() const noexcept | |||
| return data[2]; | |||
| } | |||
| const MidiMessage MidiMessage::controllerEvent (const int channel, const int controllerType, const int value) noexcept | |||
| MidiMessage MidiMessage::controllerEvent (const int channel, const int controllerType, const int value) noexcept | |||
| { | |||
| // the channel must be between 1 and 16 inclusive | |||
| jassert (channel > 0 && channel <= 16); | |||
| @@ -501,12 +498,12 @@ const MidiMessage MidiMessage::controllerEvent (const int channel, const int con | |||
| controllerType & 127, value & 127); | |||
| } | |||
| const MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const float velocity) noexcept | |||
| MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const float velocity) noexcept | |||
| { | |||
| return noteOn (channel, noteNumber, (uint8) (velocity * 127.0f)); | |||
| } | |||
| const MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const uint8 velocity) noexcept | |||
| MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const uint8 velocity) noexcept | |||
| { | |||
| jassert (channel > 0 && channel <= 16); | |||
| jassert (isPositiveAndBelow (noteNumber, (int) 128)); | |||
| @@ -515,7 +512,7 @@ const MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, | |||
| noteNumber & 127, MidiHelpers::validVelocity (velocity)); | |||
| } | |||
| const MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, uint8 velocity) noexcept | |||
| MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, uint8 velocity) noexcept | |||
| { | |||
| jassert (channel > 0 && channel <= 16); | |||
| jassert (isPositiveAndBelow (noteNumber, (int) 128)); | |||
| @@ -524,7 +521,7 @@ const MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, | |||
| noteNumber & 127, MidiHelpers::validVelocity (velocity)); | |||
| } | |||
| const MidiMessage MidiMessage::allNotesOff (const int channel) noexcept | |||
| MidiMessage MidiMessage::allNotesOff (const int channel) noexcept | |||
| { | |||
| return controllerEvent (channel, 123, 0); | |||
| } | |||
| @@ -534,7 +531,7 @@ bool MidiMessage::isAllNotesOff() const noexcept | |||
| return (data[0] & 0xf0) == 0xb0 && data[1] == 123; | |||
| } | |||
| const MidiMessage MidiMessage::allSoundOff (const int channel) noexcept | |||
| MidiMessage MidiMessage::allSoundOff (const int channel) noexcept | |||
| { | |||
| return controllerEvent (channel, 120, 0); | |||
| } | |||
| @@ -544,12 +541,12 @@ bool MidiMessage::isAllSoundOff() const noexcept | |||
| return (data[0] & 0xf0) == 0xb0 && data[1] == 120; | |||
| } | |||
| const MidiMessage MidiMessage::allControllersOff (const int channel) noexcept | |||
| MidiMessage MidiMessage::allControllersOff (const int channel) noexcept | |||
| { | |||
| return controllerEvent (channel, 121, 0); | |||
| } | |||
| const MidiMessage MidiMessage::masterVolume (const float volume) | |||
| MidiMessage MidiMessage::masterVolume (const float volume) | |||
| { | |||
| const int vol = jlimit (0, 0x3fff, roundToInt (volume * 0x4000)); | |||
| @@ -567,7 +564,7 @@ bool MidiMessage::isSysEx() const noexcept | |||
| return *data == 0xf0; | |||
| } | |||
| const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const int dataSize) | |||
| MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const int dataSize) | |||
| { | |||
| HeapBlock<uint8> m (dataSize + 2); | |||
| @@ -627,7 +624,7 @@ bool MidiMessage::isTextMetaEvent() const noexcept | |||
| return t > 0 && t < 16; | |||
| } | |||
| const String MidiMessage::getTextFromTextMetaEvent() const | |||
| String MidiMessage::getTextFromTextMetaEvent() const | |||
| { | |||
| return String (reinterpret_cast <const char*> (getMetaEventData()), getMetaEventLength()); | |||
| } | |||
| @@ -682,7 +679,7 @@ double MidiMessage::getTempoMetaEventTickLength (const short timeFormat) const n | |||
| } | |||
| } | |||
| const MidiMessage MidiMessage::tempoMetaEvent (int microsecondsPerQuarterNote) noexcept | |||
| MidiMessage MidiMessage::tempoMetaEvent (int microsecondsPerQuarterNote) noexcept | |||
| { | |||
| const uint8 d[] = { 0xff, 81, 3, | |||
| (uint8) (microsecondsPerQuarterNote >> 16), | |||
| @@ -712,7 +709,7 @@ void MidiMessage::getTimeSignatureInfo (int& numerator, int& denominator) const | |||
| } | |||
| } | |||
| const MidiMessage MidiMessage::timeSignatureMetaEvent (const int numerator, const int denominator) | |||
| MidiMessage MidiMessage::timeSignatureMetaEvent (const int numerator, const int denominator) | |||
| { | |||
| int n = 1; | |||
| int powerOfTwo = 0; | |||
| @@ -729,7 +726,7 @@ const MidiMessage MidiMessage::timeSignatureMetaEvent (const int numerator, cons | |||
| return MidiMessage (d, 7, 0.0); | |||
| } | |||
| const MidiMessage MidiMessage::midiChannelMetaEvent (const int channel) noexcept | |||
| MidiMessage MidiMessage::midiChannelMetaEvent (const int channel) noexcept | |||
| { | |||
| const uint8 d[] = { 0xff, 0x20, 0x01, (uint8) jlimit (0, 0xff, channel - 1) }; | |||
| @@ -746,7 +743,7 @@ int MidiMessage::getKeySignatureNumberOfSharpsOrFlats() const noexcept | |||
| return (int) *getMetaEventData(); | |||
| } | |||
| const MidiMessage MidiMessage::endOfTrack() noexcept | |||
| MidiMessage MidiMessage::endOfTrack() noexcept | |||
| { | |||
| return MidiMessage (0xff, 0x2f, 0, 0.0); | |||
| } | |||
| @@ -755,30 +752,30 @@ const MidiMessage MidiMessage::endOfTrack() noexcept | |||
| bool MidiMessage::isSongPositionPointer() const noexcept { return *data == 0xf2; } | |||
| int MidiMessage::getSongPositionPointerMidiBeat() const noexcept { return data[1] | (data[2] << 7); } | |||
| const MidiMessage MidiMessage::songPositionPointer (const int positionInMidiBeats) noexcept | |||
| MidiMessage MidiMessage::songPositionPointer (const int positionInMidiBeats) noexcept | |||
| { | |||
| return MidiMessage (0xf2, | |||
| positionInMidiBeats & 127, | |||
| (positionInMidiBeats >> 7) & 127); | |||
| } | |||
| bool MidiMessage::isMidiStart() const noexcept { return *data == 0xfa; } | |||
| const MidiMessage MidiMessage::midiStart() noexcept { return MidiMessage (0xfa); } | |||
| bool MidiMessage::isMidiStart() const noexcept { return *data == 0xfa; } | |||
| MidiMessage MidiMessage::midiStart() noexcept { return MidiMessage (0xfa); } | |||
| bool MidiMessage::isMidiContinue() const noexcept { return *data == 0xfb; } | |||
| const MidiMessage MidiMessage::midiContinue() noexcept { return MidiMessage (0xfb); } | |||
| bool MidiMessage::isMidiContinue() const noexcept { return *data == 0xfb; } | |||
| MidiMessage MidiMessage::midiContinue() noexcept { return MidiMessage (0xfb); } | |||
| bool MidiMessage::isMidiStop() const noexcept { return *data == 0xfc; } | |||
| const MidiMessage MidiMessage::midiStop() noexcept { return MidiMessage (0xfc); } | |||
| bool MidiMessage::isMidiStop() const noexcept { return *data == 0xfc; } | |||
| MidiMessage MidiMessage::midiStop() noexcept { return MidiMessage (0xfc); } | |||
| bool MidiMessage::isMidiClock() const noexcept { return *data == 0xf8; } | |||
| const MidiMessage MidiMessage::midiClock() noexcept { return MidiMessage (0xf8); } | |||
| bool MidiMessage::isMidiClock() const noexcept { return *data == 0xf8; } | |||
| MidiMessage MidiMessage::midiClock() noexcept { return MidiMessage (0xf8); } | |||
| bool MidiMessage::isQuarterFrame() const noexcept { return *data == 0xf1; } | |||
| int MidiMessage::getQuarterFrameSequenceNumber() const noexcept { return ((int) data[1]) >> 4; } | |||
| int MidiMessage::getQuarterFrameValue() const noexcept { return ((int) data[1]) & 0x0f; } | |||
| const MidiMessage MidiMessage::quarterFrame (const int sequenceNumber, const int value) noexcept | |||
| MidiMessage MidiMessage::quarterFrame (const int sequenceNumber, const int value) noexcept | |||
| { | |||
| return MidiMessage (0xf1, (sequenceNumber << 4) | value); | |||
| } | |||
| @@ -804,9 +801,9 @@ void MidiMessage::getFullFrameParameters (int& hours, int& minutes, int& seconds | |||
| frames = data[8]; | |||
| } | |||
| const MidiMessage MidiMessage::fullFrame (const int hours, const int minutes, | |||
| const int seconds, const int frames, | |||
| MidiMessage::SmpteTimecodeType timecodeType) | |||
| MidiMessage MidiMessage::fullFrame (const int hours, const int minutes, | |||
| const int seconds, const int frames, | |||
| MidiMessage::SmpteTimecodeType timecodeType) | |||
| { | |||
| const uint8 d[] = { 0xf0, 0x7f, 0x7f, 0x01, 0x01, | |||
| (uint8) ((hours & 0x01f) | (timecodeType << 5)), | |||
| @@ -833,7 +830,7 @@ MidiMessage::MidiMachineControlCommand MidiMessage::getMidiMachineControlCommand | |||
| return (MidiMachineControlCommand) data[4]; | |||
| } | |||
| const MidiMessage MidiMessage::midiMachineControlCommand (MidiMessage::MidiMachineControlCommand command) | |||
| MidiMessage MidiMessage::midiMachineControlCommand (MidiMessage::MidiMachineControlCommand command) | |||
| { | |||
| const uint8 d[] = { 0xf0, 0x7f, 0, 6, (uint8) command, 0xf7 }; | |||
| @@ -862,7 +859,7 @@ bool MidiMessage::isMidiMachineControlGoto (int& hours, int& minutes, int& secon | |||
| return false; | |||
| } | |||
| const MidiMessage MidiMessage::midiMachineControlGoto (int hours, int minutes, int seconds, int frames) | |||
| MidiMessage MidiMessage::midiMachineControlGoto (int hours, int minutes, int seconds, int frames) | |||
| { | |||
| const uint8 d[] = { 0xf0, 0x7f, 0, 6, 0x44, 6, 1, | |||
| (uint8) hours, | |||
| @@ -875,7 +872,7 @@ const MidiMessage MidiMessage::midiMachineControlGoto (int hours, int minutes, i | |||
| } | |||
| //============================================================================== | |||
| const String MidiMessage::getMidiNoteName (int note, bool useSharps, bool includeOctaveNumber, int octaveNumForMiddleC) | |||
| String MidiMessage::getMidiNoteName (int note, bool useSharps, bool includeOctaveNumber, int octaveNumForMiddleC) | |||
| { | |||
| static const char* const sharpNoteNames[] = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" }; | |||
| static const char* const flatNoteNames[] = { "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B" }; | |||
| @@ -900,7 +897,7 @@ const double MidiMessage::getMidiNoteInHertz (int noteNumber, const double frequ | |||
| return frequencyOfA * pow (2.0, noteNumber / 12.0); | |||
| } | |||
| const String MidiMessage::getGMInstrumentName (const int n) | |||
| String MidiMessage::getGMInstrumentName (const int n) | |||
| { | |||
| const char* names[] = | |||
| { | |||
| @@ -932,7 +929,7 @@ const String MidiMessage::getGMInstrumentName (const int n) | |||
| return isPositiveAndBelow (n, (int) 128) ? names[n] : (const char*) 0; | |||
| } | |||
| const String MidiMessage::getGMInstrumentBankName (const int n) | |||
| String MidiMessage::getGMInstrumentBankName (const int n) | |||
| { | |||
| const char* names[] = | |||
| { | |||
| @@ -945,7 +942,7 @@ const String MidiMessage::getGMInstrumentBankName (const int n) | |||
| return isPositiveAndBelow (n, (int) 16) ? names[n] : (const char*) 0; | |||
| } | |||
| const String MidiMessage::getRhythmInstrumentName (const int n) | |||
| String MidiMessage::getRhythmInstrumentName (const int n) | |||
| { | |||
| const char* names[] = | |||
| { | |||
| @@ -963,7 +960,7 @@ const String MidiMessage::getRhythmInstrumentName (const int n) | |||
| return (n >= 35 && n <= 81) ? names [n - 35] : (const char*) nullptr; | |||
| } | |||
| const String MidiMessage::getControllerName (const int n) | |||
| String MidiMessage::getControllerName (const int n) | |||
| { | |||
| const char* names[] = | |||
| { | |||
| @@ -219,7 +219,7 @@ public: | |||
| @param velocity in the range 0 to 1.0 | |||
| @see isNoteOn | |||
| */ | |||
| static const MidiMessage noteOn (int channel, int noteNumber, float velocity) noexcept; | |||
| static MidiMessage noteOn (int channel, int noteNumber, float velocity) noexcept; | |||
| /** Creates a key-down message (using an integer velocity). | |||
| @@ -228,7 +228,7 @@ public: | |||
| @param velocity in the range 0 to 127 | |||
| @see isNoteOn | |||
| */ | |||
| static const MidiMessage noteOn (int channel, int noteNumber, uint8 velocity) noexcept; | |||
| static MidiMessage noteOn (int channel, int noteNumber, uint8 velocity) noexcept; | |||
| /** Returns true if this message is a 'key-up' event. | |||
| @@ -246,7 +246,7 @@ public: | |||
| @param velocity in the range 0 to 127 | |||
| @see isNoteOff | |||
| */ | |||
| static const MidiMessage noteOff (int channel, int noteNumber, uint8 velocity = 0) noexcept; | |||
| static MidiMessage noteOff (int channel, int noteNumber, uint8 velocity = 0) noexcept; | |||
| /** Returns true if this message is a 'key-down' or 'key-up' event. | |||
| @@ -343,7 +343,7 @@ public: | |||
| @param programNumber the midi program number, 0 to 127 | |||
| @see isProgramChange, getGMInstrumentName | |||
| */ | |||
| static const MidiMessage programChange (int channel, int programNumber) noexcept; | |||
| static MidiMessage programChange (int channel, int programNumber) noexcept; | |||
| //============================================================================== | |||
| /** Returns true if the message is a pitch-wheel move. | |||
| @@ -368,7 +368,7 @@ public: | |||
| @param position the wheel position, in the range 0 to 16383 | |||
| @see isPitchWheel | |||
| */ | |||
| static const MidiMessage pitchWheel (int channel, int position) noexcept; | |||
| static MidiMessage pitchWheel (int channel, int position) noexcept; | |||
| //============================================================================== | |||
| /** Returns true if the message is an aftertouch event. | |||
| @@ -397,9 +397,9 @@ public: | |||
| @param aftertouchAmount the amount of aftertouch, 0 to 127 | |||
| @see isAftertouch | |||
| */ | |||
| static const MidiMessage aftertouchChange (int channel, | |||
| int noteNumber, | |||
| int aftertouchAmount) noexcept; | |||
| static MidiMessage aftertouchChange (int channel, | |||
| int noteNumber, | |||
| int aftertouchAmount) noexcept; | |||
| /** Returns true if the message is a channel-pressure change event. | |||
| @@ -424,7 +424,7 @@ public: | |||
| @param pressure the pressure, 0 to 127 | |||
| @see isChannelPressure | |||
| */ | |||
| static const MidiMessage channelPressureChange (int channel, int pressure) noexcept; | |||
| static MidiMessage channelPressureChange (int channel, int pressure) noexcept; | |||
| //============================================================================== | |||
| /** Returns true if this is a midi controller message. | |||
| @@ -465,9 +465,9 @@ public: | |||
| @param value the controller value | |||
| @see isController | |||
| */ | |||
| static const MidiMessage controllerEvent (int channel, | |||
| int controllerType, | |||
| int value) noexcept; | |||
| static MidiMessage controllerEvent (int channel, | |||
| int controllerType, | |||
| int value) noexcept; | |||
| /** Checks whether this message is an all-notes-off message. | |||
| @@ -486,20 +486,20 @@ public: | |||
| @param channel the midi channel, in the range 1 to 16 | |||
| @see isAllNotesOff | |||
| */ | |||
| static const MidiMessage allNotesOff (int channel) noexcept; | |||
| static MidiMessage allNotesOff (int channel) noexcept; | |||
| /** Creates an all-sound-off message. | |||
| @param channel the midi channel, in the range 1 to 16 | |||
| @see isAllSoundOff | |||
| */ | |||
| static const MidiMessage allSoundOff (int channel) noexcept; | |||
| static MidiMessage allSoundOff (int channel) noexcept; | |||
| /** Creates an all-controllers-off message. | |||
| @param channel the midi channel, in the range 1 to 16 | |||
| */ | |||
| static const MidiMessage allControllersOff (int channel) noexcept; | |||
| static MidiMessage allControllersOff (int channel) noexcept; | |||
| //============================================================================== | |||
| /** Returns true if this event is a meta-event. | |||
| @@ -545,7 +545,7 @@ public: | |||
| @see isEndOfTrackMetaEvent | |||
| */ | |||
| static const MidiMessage endOfTrack() noexcept; | |||
| static MidiMessage endOfTrack() noexcept; | |||
| /** Returns true if this is an 'track name' meta-event. | |||
| @@ -563,7 +563,7 @@ public: | |||
| @see isTextMetaEvent | |||
| */ | |||
| const String getTextFromTextMetaEvent() const; | |||
| String getTextFromTextMetaEvent() const; | |||
| //============================================================================== | |||
| /** Returns true if this is a 'tempo' meta-event. | |||
| @@ -590,7 +590,7 @@ public: | |||
| @see isTempoMetaEvent | |||
| */ | |||
| static const MidiMessage tempoMetaEvent (int microsecondsPerQuarterNote) noexcept; | |||
| static MidiMessage tempoMetaEvent (int microsecondsPerQuarterNote) noexcept; | |||
| //============================================================================== | |||
| /** Returns true if this is a 'time-signature' meta-event. | |||
| @@ -609,7 +609,7 @@ public: | |||
| @see isTimeSignatureMetaEvent | |||
| */ | |||
| static const MidiMessage timeSignatureMetaEvent (int numerator, int denominator); | |||
| static MidiMessage timeSignatureMetaEvent (int numerator, int denominator); | |||
| //============================================================================== | |||
| /** Returns true if this is a 'key-signature' meta-event. | |||
| @@ -646,7 +646,7 @@ public: | |||
| @param channel the midi channel, in the range 1 to 16 | |||
| @see isMidiChannelMetaEvent | |||
| */ | |||
| static const MidiMessage midiChannelMetaEvent (int channel) noexcept; | |||
| static MidiMessage midiChannelMetaEvent (int channel) noexcept; | |||
| //============================================================================== | |||
| /** Returns true if this is an active-sense message. */ | |||
| @@ -660,7 +660,7 @@ public: | |||
| bool isMidiStart() const noexcept; | |||
| /** Creates a midi start event. */ | |||
| static const MidiMessage midiStart() noexcept; | |||
| static MidiMessage midiStart() noexcept; | |||
| /** Returns true if this is a midi continue event. | |||
| @@ -669,7 +669,7 @@ public: | |||
| bool isMidiContinue() const noexcept; | |||
| /** Creates a midi continue event. */ | |||
| static const MidiMessage midiContinue() noexcept; | |||
| static MidiMessage midiContinue() noexcept; | |||
| /** Returns true if this is a midi stop event. | |||
| @@ -678,7 +678,7 @@ public: | |||
| bool isMidiStop() const noexcept; | |||
| /** Creates a midi stop event. */ | |||
| static const MidiMessage midiStop() noexcept; | |||
| static MidiMessage midiStop() noexcept; | |||
| /** Returns true if this is a midi clock event. | |||
| @@ -687,7 +687,7 @@ public: | |||
| bool isMidiClock() const noexcept; | |||
| /** Creates a midi clock event. */ | |||
| static const MidiMessage midiClock() noexcept; | |||
| static MidiMessage midiClock() noexcept; | |||
| /** Returns true if this is a song-position-pointer message. | |||
| @@ -709,7 +709,7 @@ public: | |||
| @see isSongPositionPointer, getSongPositionPointerMidiBeat | |||
| */ | |||
| static const MidiMessage songPositionPointer (int positionInMidiBeats) noexcept; | |||
| static MidiMessage songPositionPointer (int positionInMidiBeats) noexcept; | |||
| //============================================================================== | |||
| /** Returns true if this is a quarter-frame midi timecode message. | |||
| @@ -738,7 +738,7 @@ public: | |||
| @param sequenceNumber a value 0 to 7 for the upper nybble of the message's data byte | |||
| @param value a value 0 to 15 for the lower nybble of the message's data byte | |||
| */ | |||
| static const MidiMessage quarterFrame (int sequenceNumber, int value) noexcept; | |||
| static MidiMessage quarterFrame (int sequenceNumber, int value) noexcept; | |||
| /** SMPTE timecode types. | |||
| @@ -769,11 +769,11 @@ public: | |||
| /** Creates a full-frame MTC message. | |||
| */ | |||
| static const MidiMessage fullFrame (int hours, | |||
| int minutes, | |||
| int seconds, | |||
| int frames, | |||
| SmpteTimecodeType timecodeType); | |||
| static MidiMessage fullFrame (int hours, | |||
| int minutes, | |||
| int seconds, | |||
| int frames, | |||
| SmpteTimecodeType timecodeType); | |||
| //============================================================================== | |||
| /** Types of MMC command. | |||
| @@ -807,7 +807,7 @@ public: | |||
| /** Creates an MMC message. | |||
| */ | |||
| static const MidiMessage midiMachineControlCommand (MidiMachineControlCommand command); | |||
| static MidiMessage midiMachineControlCommand (MidiMachineControlCommand command); | |||
| /** Checks whether this is an MMC "goto" message. | |||
| @@ -826,25 +826,25 @@ public: | |||
| @see isMidiMachineControlGoto | |||
| */ | |||
| static const MidiMessage midiMachineControlGoto (int hours, | |||
| int minutes, | |||
| int seconds, | |||
| int frames); | |||
| static MidiMessage midiMachineControlGoto (int hours, | |||
| int minutes, | |||
| int seconds, | |||
| int frames); | |||
| //============================================================================== | |||
| /** Creates a master-volume change message. | |||
| @param volume the volume, 0 to 1.0 | |||
| */ | |||
| static const MidiMessage masterVolume (float volume); | |||
| static MidiMessage masterVolume (float volume); | |||
| //============================================================================== | |||
| /** Creates a system-exclusive message. | |||
| The data passed in is wrapped with header and tail bytes of 0xf0 and 0xf7. | |||
| */ | |||
| static const MidiMessage createSysExMessage (const uint8* sysexData, | |||
| int dataSize); | |||
| static MidiMessage createSysExMessage (const uint8* sysexData, | |||
| int dataSize); | |||
| //============================================================================== | |||
| @@ -878,10 +878,10 @@ public: | |||
| @see getMidiNoteInHertz | |||
| */ | |||
| static const String getMidiNoteName (int noteNumber, | |||
| bool useSharps, | |||
| bool includeOctaveNumber, | |||
| int octaveNumForMiddleC); | |||
| static String getMidiNoteName (int noteNumber, | |||
| bool useSharps, | |||
| bool includeOctaveNumber, | |||
| int octaveNumForMiddleC); | |||
| /** Returns the frequency of a midi note number. | |||
| @@ -895,25 +895,25 @@ public: | |||
| @param midiInstrumentNumber the program number 0 to 127 | |||
| @see getProgramChangeNumber | |||
| */ | |||
| static const String getGMInstrumentName (int midiInstrumentNumber); | |||
| static String getGMInstrumentName (int midiInstrumentNumber); | |||
| /** Returns the name of a bank of GM instruments. | |||
| @param midiBankNumber the bank, 0 to 15 | |||
| */ | |||
| static const String getGMInstrumentBankName (int midiBankNumber); | |||
| static String getGMInstrumentBankName (int midiBankNumber); | |||
| /** Returns the standard name of a channel 10 percussion sound. | |||
| @param midiNoteNumber the key number, 35 to 81 | |||
| */ | |||
| static const String getRhythmInstrumentName (int midiNoteNumber); | |||
| static String getRhythmInstrumentName (int midiNoteNumber); | |||
| /** Returns the name of a controller type number. | |||
| @see getControllerNumber | |||
| */ | |||
| static const String getControllerName (int controllerNumber); | |||
| static String getControllerName (int controllerNumber); | |||
| private: | |||
| //============================================================================== | |||
| @@ -29,6 +29,7 @@ | |||
| #include "juce_MidiInput.h" | |||
| #include "juce_MidiKeyboardState.h" | |||
| //============================================================================== | |||
| /** | |||
| Collects incoming realtime MIDI messages and turns them into blocks suitable for | |||
| @@ -111,7 +111,7 @@ bool PluginDirectoryScanner::skipNextFile() | |||
| return nextIndex < filesOrIdentifiersToScan.size(); | |||
| } | |||
| const StringArray PluginDirectoryScanner::getDeadMansPedalFile() | |||
| StringArray PluginDirectoryScanner::getDeadMansPedalFile() | |||
| { | |||
| StringArray lines; | |||
| @@ -115,7 +115,7 @@ private: | |||
| int nextIndex; | |||
| float progress; | |||
| const StringArray getDeadMansPedalFile(); | |||
| StringArray getDeadMansPedalFile(); | |||
| void setDeadMansPedalFile (const StringArray& newContents); | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginDirectoryScanner); | |||
| @@ -402,8 +402,9 @@ void Synthesiser::handleSostenutoPedal (int midiChannel, bool isDown) | |||
| } | |||
| } | |||
| void Synthesiser::handleSoftPedal (int midiChannel, bool isDown) | |||
| void Synthesiser::handleSoftPedal (int midiChannel, bool /*isDown*/) | |||
| { | |||
| (void) midiChannel; | |||
| jassert (midiChannel > 0 && midiChannel <= 16); | |||
| } | |||
| @@ -69,7 +69,7 @@ const var DynamicObject::invokeMethod (const Identifier& methodName, | |||
| const var* parameters, | |||
| int numParameters) | |||
| { | |||
| return properties [methodName].invoke (var (this), parameters, numParameters); | |||
| return properties [methodName].invokeMethod (this, parameters, numParameters); | |||
| } | |||
| void DynamicObject::setMethod (const Identifier& name, | |||
| @@ -43,7 +43,7 @@ public: | |||
| /** Generates a simple hash from an integer. */ | |||
| static int generateHash (const int key, const int upperLimit) noexcept { return std::abs (key) % upperLimit; } | |||
| /** Generates a simple hash from a string. */ | |||
| static int generateHash (const String& key, const int upperLimit) noexcept { return key.hashCode() % upperLimit; } | |||
| static int generateHash (const String& key, const int upperLimit) noexcept { return (int) (((uint32) key.hashCode()) % upperLimit); } | |||
| /** Generates a simple hash from a variant. */ | |||
| static int generateHash (const var& key, const int upperLimit) noexcept { return generateHash (key.toString(), upperLimit); } | |||
| }; | |||
| @@ -121,7 +121,7 @@ const var& NamedValueSet::operator[] (const Identifier& name) const | |||
| return var::null; | |||
| } | |||
| const var NamedValueSet::getWithDefault (const Identifier& name, const var& defaultReturnValue) const | |||
| var NamedValueSet::getWithDefault (const Identifier& name, const var& defaultReturnValue) const | |||
| { | |||
| const var* const v = getVarPointer (name); | |||
| return v != nullptr ? *v : defaultReturnValue; | |||
| @@ -195,7 +195,7 @@ const Identifier NamedValueSet::getName (const int index) const | |||
| return v->name; | |||
| } | |||
| const var NamedValueSet::getValueAt (const int index) const | |||
| var NamedValueSet::getValueAt (const int index) const | |||
| { | |||
| const NamedValue* const v = values[index]; | |||
| jassert (v != nullptr); | |||
| @@ -68,7 +68,7 @@ public: | |||
| /** Tries to return the named value, but if no such value is found, this will | |||
| instead return the supplied default value. | |||
| */ | |||
| const var getWithDefault (const Identifier& name, const var& defaultReturnValue) const; | |||
| var getWithDefault (const Identifier& name, const var& defaultReturnValue) const; | |||
| /** Changes or adds a named value. | |||
| @returns true if a value was changed or added; false if the | |||
| @@ -93,7 +93,7 @@ public: | |||
| /** Returns the value of the item at a given index. | |||
| The index must be between 0 and size() - 1. | |||
| */ | |||
| const var getValueAt (int index) const; | |||
| var getValueAt (int index) const; | |||
| /** Removes all values. */ | |||
| void clear(); | |||
| @@ -71,8 +71,8 @@ void PropertySet::clear() | |||
| } | |||
| } | |||
| const String PropertySet::getValue (const String& keyName, | |||
| const String& defaultValue) const noexcept | |||
| String PropertySet::getValue (const String& keyName, | |||
| const String& defaultValue) const noexcept | |||
| { | |||
| const ScopedLock sl (lock); | |||
| @@ -73,8 +73,8 @@ public: | |||
| @param keyName the name of the property to retrieve | |||
| @param defaultReturnValue a value to return if the named property doesn't actually exist | |||
| */ | |||
| const String getValue (const String& keyName, | |||
| const String& defaultReturnValue = String::empty) const noexcept; | |||
| String getValue (const String& keyName, | |||
| const String& defaultReturnValue = String::empty) const noexcept; | |||
| /** Returns one of the properties as an integer. | |||
| @@ -133,12 +133,12 @@ Value::~Value() | |||
| } | |||
| //============================================================================== | |||
| const var Value::getValue() const | |||
| var Value::getValue() const | |||
| { | |||
| return value->getValue(); | |||
| } | |||
| Value::operator const var() const | |||
| Value::operator var() const | |||
| { | |||
| return getValue(); | |||
| } | |||
| @@ -148,7 +148,7 @@ void Value::setValue (const var& newValue) | |||
| value->setValue (newValue); | |||
| } | |||
| const String Value::toString() const | |||
| String Value::toString() const | |||
| { | |||
| return value->getValue().toString(); | |||
| } | |||
| @@ -71,16 +71,16 @@ public: | |||
| //============================================================================== | |||
| /** Returns the current value. */ | |||
| const var getValue() const; | |||
| var getValue() const; | |||
| /** Returns the current value. */ | |||
| operator const var() const; | |||
| operator var() const; | |||
| /** Returns the value as a string. | |||
| This is alternative to writing things like "myValue.getValue().toString()". | |||
| */ | |||
| const String toString() const; | |||
| String toString() const; | |||
| /** Sets the current value. | |||
| @@ -643,7 +643,7 @@ bool ValueTree::hasType (const Identifier& typeName) const | |||
| return object != nullptr && object->type == typeName; | |||
| } | |||
| const Identifier ValueTree::getType() const | |||
| Identifier ValueTree::getType() const | |||
| { | |||
| return object != nullptr ? object->type : Identifier(); | |||
| } | |||
| @@ -672,7 +672,7 @@ const var& ValueTree::getProperty (const Identifier& name) const | |||
| return object == nullptr ? var::null : object->getProperty (name); | |||
| } | |||
| const var ValueTree::getProperty (const Identifier& name, const var& defaultReturnValue) const | |||
| var ValueTree::getProperty (const Identifier& name, const var& defaultReturnValue) const | |||
| { | |||
| return object == nullptr ? defaultReturnValue : object->getProperty (name, defaultReturnValue); | |||
| } | |||
| @@ -707,7 +707,7 @@ int ValueTree::getNumProperties() const | |||
| return object == nullptr ? 0 : object->properties.size(); | |||
| } | |||
| const Identifier ValueTree::getPropertyName (const int index) const | |||
| Identifier ValueTree::getPropertyName (const int index) const | |||
| { | |||
| return object == nullptr ? Identifier() | |||
| : object->properties.getName (index); | |||
| @@ -133,7 +133,7 @@ public: | |||
| The type is specified when the ValueTree is created. | |||
| @see hasType | |||
| */ | |||
| const Identifier getType() const; | |||
| Identifier getType() const; | |||
| /** Returns true if the node has this type. | |||
| The comparison is case-sensitive. | |||
| @@ -153,7 +153,7 @@ public: | |||
| You can also use operator[] and getProperty to get a property. | |||
| @see var, getProperty, setProperty, hasProperty | |||
| */ | |||
| const var getProperty (const Identifier& name, const var& defaultReturnValue) const; | |||
| var getProperty (const Identifier& name, const var& defaultReturnValue) const; | |||
| /** Returns the value of a named property. | |||
| If no such property has been set, this will return a void variant. This is the same as | |||
| @@ -192,7 +192,7 @@ public: | |||
| /** Returns the identifier of the property with a given index. | |||
| @see getNumProperties | |||
| */ | |||
| const Identifier getPropertyName (int index) const; | |||
| Identifier getPropertyName (int index) const; | |||
| /** Returns a Value object that can be used to control and respond to one of the tree's properties. | |||
| @@ -51,18 +51,18 @@ public: | |||
| virtual int toInt (const ValueUnion&) const noexcept { return 0; } | |||
| virtual int64 toInt64 (const ValueUnion&) const noexcept { return 0; } | |||
| virtual double toDouble (const ValueUnion&) const noexcept { return 0; } | |||
| virtual const String toString (const ValueUnion&) const { return String::empty; } | |||
| virtual String toString (const ValueUnion&) const { return String::empty; } | |||
| virtual bool toBool (const ValueUnion&) const noexcept { return false; } | |||
| virtual ReferenceCountedObject* toObject (const ValueUnion&) const noexcept { return nullptr; } | |||
| virtual bool isVoid() const noexcept { return false; } | |||
| virtual bool isInt() const noexcept { return false; } | |||
| virtual bool isInt64() const noexcept { return false; } | |||
| virtual bool isBool() const noexcept { return false; } | |||
| virtual bool isDouble() const noexcept { return false; } | |||
| virtual bool isString() const noexcept { return false; } | |||
| virtual bool isObject() const noexcept { return false; } | |||
| virtual bool isMethod() const noexcept { return false; } | |||
| virtual bool isVoid() const noexcept { return false; } | |||
| virtual bool isInt() const noexcept { return false; } | |||
| virtual bool isInt64() const noexcept { return false; } | |||
| virtual bool isBool() const noexcept { return false; } | |||
| virtual bool isDouble() const noexcept { return false; } | |||
| virtual bool isString() const noexcept { return false; } | |||
| virtual bool isObject() const noexcept { return false; } | |||
| virtual bool isMethod() const noexcept { return false; } | |||
| virtual void cleanUp (ValueUnion&) const noexcept {} | |||
| virtual void createCopy (ValueUnion& dest, const ValueUnion& source) const { dest = source; } | |||
| @@ -92,7 +92,7 @@ public: | |||
| int toInt (const ValueUnion& data) const noexcept { return data.intValue; }; | |||
| int64 toInt64 (const ValueUnion& data) const noexcept { return (int64) data.intValue; }; | |||
| double toDouble (const ValueUnion& data) const noexcept { return (double) data.intValue; } | |||
| const String toString (const ValueUnion& data) const { return String (data.intValue); } | |||
| String toString (const ValueUnion& data) const { return String (data.intValue); } | |||
| bool toBool (const ValueUnion& data) const noexcept { return data.intValue != 0; } | |||
| bool isInt() const noexcept { return true; } | |||
| @@ -119,7 +119,7 @@ public: | |||
| int toInt (const ValueUnion& data) const noexcept { return (int) data.int64Value; }; | |||
| int64 toInt64 (const ValueUnion& data) const noexcept { return data.int64Value; }; | |||
| double toDouble (const ValueUnion& data) const noexcept { return (double) data.int64Value; } | |||
| const String toString (const ValueUnion& data) const { return String (data.int64Value); } | |||
| String toString (const ValueUnion& data) const { return String (data.int64Value); } | |||
| bool toBool (const ValueUnion& data) const noexcept { return data.int64Value != 0; } | |||
| bool isInt64() const noexcept { return true; } | |||
| @@ -146,7 +146,7 @@ public: | |||
| int toInt (const ValueUnion& data) const noexcept { return (int) data.doubleValue; }; | |||
| int64 toInt64 (const ValueUnion& data) const noexcept { return (int64) data.doubleValue; }; | |||
| double toDouble (const ValueUnion& data) const noexcept { return data.doubleValue; } | |||
| const String toString (const ValueUnion& data) const { return String (data.doubleValue); } | |||
| String toString (const ValueUnion& data) const { return String (data.doubleValue); } | |||
| bool toBool (const ValueUnion& data) const noexcept { return data.doubleValue != 0; } | |||
| bool isDouble() const noexcept { return true; } | |||
| @@ -173,7 +173,7 @@ public: | |||
| int toInt (const ValueUnion& data) const noexcept { return data.boolValue ? 1 : 0; }; | |||
| int64 toInt64 (const ValueUnion& data) const noexcept { return data.boolValue ? 1 : 0; }; | |||
| double toDouble (const ValueUnion& data) const noexcept { return data.boolValue ? 1.0 : 0.0; } | |||
| const String toString (const ValueUnion& data) const { return String::charToString (data.boolValue ? '1' : '0'); } | |||
| String toString (const ValueUnion& data) const { return String::charToString (data.boolValue ? '1' : '0'); } | |||
| bool toBool (const ValueUnion& data) const noexcept { return data.boolValue; } | |||
| bool isBool() const noexcept { return true; } | |||
| @@ -196,32 +196,37 @@ public: | |||
| VariantType_String() noexcept {} | |||
| static const VariantType_String instance; | |||
| void cleanUp (ValueUnion& data) const noexcept { delete data.stringValue; } | |||
| void createCopy (ValueUnion& dest, const ValueUnion& source) const { dest.stringValue = new String (*source.stringValue); } | |||
| void cleanUp (ValueUnion& data) const noexcept { getString (data)-> ~String(); } | |||
| void createCopy (ValueUnion& dest, const ValueUnion& source) const { new (dest.stringValue) String (*getString (source)); } | |||
| int toInt (const ValueUnion& data) const noexcept { return data.stringValue->getIntValue(); }; | |||
| int64 toInt64 (const ValueUnion& data) const noexcept { return data.stringValue->getLargeIntValue(); }; | |||
| double toDouble (const ValueUnion& data) const noexcept { return data.stringValue->getDoubleValue(); } | |||
| const String toString (const ValueUnion& data) const { return *data.stringValue; } | |||
| bool toBool (const ValueUnion& data) const noexcept { return data.stringValue->getIntValue() != 0 | |||
| || data.stringValue->trim().equalsIgnoreCase ("true") | |||
| || data.stringValue->trim().equalsIgnoreCase ("yes"); } | |||
| bool isString() const noexcept { return true; } | |||
| int toInt (const ValueUnion& data) const noexcept { return getString (data)->getIntValue(); }; | |||
| int64 toInt64 (const ValueUnion& data) const noexcept { return getString (data)->getLargeIntValue(); }; | |||
| double toDouble (const ValueUnion& data) const noexcept { return getString (data)->getDoubleValue(); } | |||
| String toString (const ValueUnion& data) const { return *getString (data); } | |||
| bool toBool (const ValueUnion& data) const noexcept { return getString (data)->getIntValue() != 0 | |||
| || getString (data)->trim().equalsIgnoreCase ("true") | |||
| || getString (data)->trim().equalsIgnoreCase ("yes"); } | |||
| bool equals (const ValueUnion& data, const ValueUnion& otherData, const VariantType& otherType) const noexcept | |||
| { | |||
| return otherType.toString (otherData) == *data.stringValue; | |||
| return otherType.toString (otherData) == *getString (data); | |||
| } | |||
| void writeToStream (const ValueUnion& data, OutputStream& output) const | |||
| { | |||
| const int len = data.stringValue->getNumBytesAsUTF8() + 1; | |||
| const String* const s = getString (data); | |||
| const int len = s->getNumBytesAsUTF8() + 1; | |||
| HeapBlock<char> temp (len); | |||
| s->copyToUTF8 (temp, len); | |||
| output.writeCompressedInt (len + 1); | |||
| output.writeByte (varMarker_String); | |||
| HeapBlock<char> temp (len); | |||
| data.stringValue->copyToUTF8 (temp, len); | |||
| output.write (temp, len); | |||
| } | |||
| private: | |||
| static inline const String* getString (const ValueUnion& data) noexcept { return reinterpret_cast <const String*> (data.stringValue); } | |||
| static inline String* getString (ValueUnion& data) noexcept { return reinterpret_cast <String*> (data.stringValue); } | |||
| }; | |||
| //============================================================================== | |||
| @@ -234,7 +239,7 @@ public: | |||
| void cleanUp (ValueUnion& data) const noexcept { if (data.objectValue != nullptr) data.objectValue->decReferenceCount(); } | |||
| void createCopy (ValueUnion& dest, const ValueUnion& source) const { dest.objectValue = source.objectValue; if (dest.objectValue != nullptr) dest.objectValue->incReferenceCount(); } | |||
| const String toString (const ValueUnion& data) const { return "Object 0x" + String::toHexString ((int) (pointer_sized_int) data.objectValue); } | |||
| String toString (const ValueUnion& data) const { return "Object 0x" + String::toHexString ((int) (pointer_sized_int) data.objectValue); } | |||
| bool toBool (const ValueUnion& data) const noexcept { return data.objectValue != 0; } | |||
| ReferenceCountedObject* toObject (const ValueUnion& data) const noexcept { return data.objectValue; } | |||
| bool isObject() const noexcept { return true; } | |||
| @@ -258,7 +263,7 @@ public: | |||
| VariantType_Method() noexcept {} | |||
| static const VariantType_Method instance; | |||
| const String toString (const ValueUnion&) const { return "Method"; } | |||
| String toString (const ValueUnion&) const { return "Method"; } | |||
| bool toBool (const ValueUnion& data) const noexcept { return data.methodValue != 0; } | |||
| bool isMethod() const noexcept { return true; } | |||
| @@ -325,17 +330,17 @@ var::var (const double value_) noexcept : type (&VariantType_Double::instance) | |||
| var::var (const String& value_) : type (&VariantType_String::instance) | |||
| { | |||
| value.stringValue = new String (value_); | |||
| new (value.stringValue) String (value_); | |||
| } | |||
| var::var (const char* const value_) : type (&VariantType_String::instance) | |||
| { | |||
| value.stringValue = new String (value_); | |||
| new (value.stringValue) String (value_); | |||
| } | |||
| var::var (const wchar_t* const value_) : type (&VariantType_String::instance) | |||
| { | |||
| value.stringValue = new String (value_); | |||
| new (value.stringValue) String (value_); | |||
| } | |||
| var::var (ReferenceCountedObject* const object) : type (&VariantType_Object::instance) | |||
| @@ -352,22 +357,22 @@ var::var (MethodFunction method_) noexcept : type (&VariantType_Method::instance | |||
| } | |||
| //============================================================================== | |||
| bool var::isVoid() const noexcept { return type->isVoid(); } | |||
| bool var::isInt() const noexcept { return type->isInt(); } | |||
| bool var::isInt64() const noexcept { return type->isInt64(); } | |||
| bool var::isBool() const noexcept { return type->isBool(); } | |||
| bool var::isDouble() const noexcept { return type->isDouble(); } | |||
| bool var::isString() const noexcept { return type->isString(); } | |||
| bool var::isObject() const noexcept { return type->isObject(); } | |||
| bool var::isMethod() const noexcept { return type->isMethod(); } | |||
| bool var::isVoid() const noexcept { return type->isVoid(); } | |||
| bool var::isInt() const noexcept { return type->isInt(); } | |||
| bool var::isInt64() const noexcept { return type->isInt64(); } | |||
| bool var::isBool() const noexcept { return type->isBool(); } | |||
| bool var::isDouble() const noexcept { return type->isDouble(); } | |||
| bool var::isString() const noexcept { return type->isString(); } | |||
| bool var::isObject() const noexcept { return type->isObject(); } | |||
| bool var::isMethod() const noexcept { return type->isMethod(); } | |||
| var::operator int() const noexcept { return type->toInt (value); } | |||
| var::operator int64() const noexcept { return type->toInt64 (value); } | |||
| var::operator bool() const noexcept { return type->toBool (value); } | |||
| var::operator float() const noexcept { return (float) type->toDouble (value); } | |||
| var::operator double() const noexcept { return type->toDouble (value); } | |||
| const String var::toString() const { return type->toString (value); } | |||
| var::operator const String() const { return type->toString (value); } | |||
| String var::toString() const { return type->toString (value); } | |||
| var::operator String() const { return type->toString (value); } | |||
| ReferenceCountedObject* var::getObject() const noexcept { return type->toObject (value); } | |||
| DynamicObject* var::getDynamicObject() const noexcept { return dynamic_cast <DynamicObject*> (getObject()); } | |||
| @@ -414,7 +419,7 @@ void var::writeToStream (OutputStream& output) const | |||
| type->writeToStream (value, output); | |||
| } | |||
| const var var::readFromStream (InputStream& input) | |||
| var var::readFromStream (InputStream& input) | |||
| { | |||
| const int numBytes = input.readCompressedInt(); | |||
| @@ -441,60 +446,57 @@ const var var::readFromStream (InputStream& input) | |||
| return var::null; | |||
| } | |||
| const var var::operator[] (const Identifier& propertyName) const | |||
| var var::operator[] (const Identifier& propertyName) const | |||
| { | |||
| DynamicObject* const o = getDynamicObject(); | |||
| return o != nullptr ? o->getProperty (propertyName) : var::null; | |||
| } | |||
| const var var::invoke (const Identifier& method, const var* arguments, int numArguments) const | |||
| var var::invoke (const Identifier& method, const var* arguments, int numArguments) const | |||
| { | |||
| DynamicObject* const o = getDynamicObject(); | |||
| return o != nullptr ? o->invokeMethod (method, arguments, numArguments) : var::null; | |||
| } | |||
| const var var::invoke (const var& targetObject, const var* arguments, int numArguments) const | |||
| var var::invokeMethod (DynamicObject* const target, const var* const arguments, const int numArguments) const | |||
| { | |||
| if (isMethod()) | |||
| { | |||
| DynamicObject* const target = targetObject.getDynamicObject(); | |||
| jassert (target != nullptr); | |||
| if (target != nullptr) | |||
| return (target->*(value.methodValue)) (arguments, numArguments); | |||
| } | |||
| if (isMethod()) | |||
| return (target->*(value.methodValue)) (arguments, numArguments); | |||
| return var::null; | |||
| } | |||
| const var var::call (const Identifier& method) const | |||
| var var::call (const Identifier& method) const | |||
| { | |||
| return invoke (method, nullptr, 0); | |||
| } | |||
| const var var::call (const Identifier& method, const var& arg1) const | |||
| var var::call (const Identifier& method, const var& arg1) const | |||
| { | |||
| return invoke (method, &arg1, 1); | |||
| } | |||
| const var var::call (const Identifier& method, const var& arg1, const var& arg2) const | |||
| var var::call (const Identifier& method, const var& arg1, const var& arg2) const | |||
| { | |||
| var args[] = { arg1, arg2 }; | |||
| return invoke (method, args, 2); | |||
| } | |||
| const var var::call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3) | |||
| var var::call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3) | |||
| { | |||
| var args[] = { arg1, arg2, arg3 }; | |||
| return invoke (method, args, 3); | |||
| } | |||
| const var var::call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const | |||
| var var::call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const | |||
| { | |||
| var args[] = { arg1, arg2, arg3, arg4 }; | |||
| return invoke (method, args, 4); | |||
| } | |||
| const var var::call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const | |||
| var var::call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const | |||
| { | |||
| var args[] = { arg1, arg2, arg3, arg4, arg5 }; | |||
| return invoke (method, args, 5); | |||
| @@ -91,8 +91,8 @@ public: | |||
| operator bool() const noexcept; | |||
| operator float() const noexcept; | |||
| operator double() const noexcept; | |||
| operator const String() const; | |||
| const String toString() const; | |||
| operator String() const; | |||
| String toString() const; | |||
| ReferenceCountedObject* getObject() const noexcept; | |||
| DynamicObject* getDynamicObject() const noexcept; | |||
| @@ -115,32 +115,27 @@ public: | |||
| The data in the stream must have been written using writeToStream(), or this | |||
| will have unpredictable results. | |||
| */ | |||
| static const var readFromStream (InputStream& input); | |||
| static var readFromStream (InputStream& input); | |||
| //============================================================================== | |||
| /** If this variant is an object, this returns one of its properties. */ | |||
| const var operator[] (const Identifier& propertyName) const; | |||
| var operator[] (const Identifier& propertyName) const; | |||
| //============================================================================== | |||
| /** If this variant is an object, this invokes one of its methods with no arguments. */ | |||
| const var call (const Identifier& method) const; | |||
| var call (const Identifier& method) const; | |||
| /** If this variant is an object, this invokes one of its methods with one argument. */ | |||
| const var call (const Identifier& method, const var& arg1) const; | |||
| var call (const Identifier& method, const var& arg1) const; | |||
| /** If this variant is an object, this invokes one of its methods with 2 arguments. */ | |||
| const var call (const Identifier& method, const var& arg1, const var& arg2) const; | |||
| var call (const Identifier& method, const var& arg1, const var& arg2) const; | |||
| /** If this variant is an object, this invokes one of its methods with 3 arguments. */ | |||
| const var call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3); | |||
| var call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3); | |||
| /** If this variant is an object, this invokes one of its methods with 4 arguments. */ | |||
| const var call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const; | |||
| var call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const; | |||
| /** If this variant is an object, this invokes one of its methods with 5 arguments. */ | |||
| const var call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const; | |||
| var call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const; | |||
| /** If this variant is an object, this invokes one of its methods with a list of arguments. */ | |||
| const var invoke (const Identifier& method, const var* arguments, int numArguments) const; | |||
| //============================================================================== | |||
| /** If this variant is a method pointer, this invokes it on a target object. */ | |||
| const var invoke (const var& targetObject, const var* arguments, int numArguments) const; | |||
| var invoke (const Identifier& method, const var* arguments, int numArguments) const; | |||
| //============================================================================== | |||
| /** Returns true if this var has the same value as the one supplied. | |||
| @@ -156,27 +151,18 @@ public: | |||
| */ | |||
| bool equalsWithSameType (const var& other) const noexcept; | |||
| private: | |||
| class VariantType; | |||
| friend class VariantType; | |||
| class VariantType_Void; | |||
| friend class VariantType_Void; | |||
| class VariantType_Int; | |||
| friend class VariantType_Int; | |||
| class VariantType_Int64; | |||
| friend class VariantType_Int64; | |||
| class VariantType_Double; | |||
| friend class VariantType_Double; | |||
| class VariantType_Float; | |||
| friend class VariantType_Float; | |||
| class VariantType_Bool; | |||
| friend class VariantType_Bool; | |||
| class VariantType_String; | |||
| friend class VariantType_String; | |||
| class VariantType_Object; | |||
| friend class VariantType_Object; | |||
| class VariantType_Method; | |||
| friend class VariantType_Method; | |||
| //============================================================================== | |||
| class VariantType; friend class VariantType; | |||
| class VariantType_Void; friend class VariantType_Void; | |||
| class VariantType_Int; friend class VariantType_Int; | |||
| class VariantType_Int64; friend class VariantType_Int64; | |||
| class VariantType_Double; friend class VariantType_Double; | |||
| class VariantType_Bool; friend class VariantType_Bool; | |||
| class VariantType_String; friend class VariantType_String; | |||
| class VariantType_Object; friend class VariantType_Object; | |||
| class VariantType_Method; friend class VariantType_Method; | |||
| union ValueUnion | |||
| { | |||
| @@ -184,13 +170,16 @@ private: | |||
| int64 int64Value; | |||
| bool boolValue; | |||
| double doubleValue; | |||
| String* stringValue; | |||
| char stringValue [sizeof (String)]; | |||
| ReferenceCountedObject* objectValue; | |||
| MethodFunction methodValue; | |||
| }; | |||
| const VariantType* type; | |||
| ValueUnion value; | |||
| friend class DynamicObject; | |||
| var invokeMethod (DynamicObject*, const var*, int) const; | |||
| }; | |||
| /** Compares the values of two var objects, using the var::equals() comparison. */ | |||
| @@ -67,7 +67,7 @@ public: | |||
| //============================================================================== | |||
| void logMessage (const String& message); | |||
| const File getLogFile() const { return logFile; } | |||
| File getLogFile() const { return logFile; } | |||
| //============================================================================== | |||
| /** Helper function to create a log file in the correct place for this platform. | |||
| @@ -28,6 +28,7 @@ | |||
| BEGIN_JUCE_NAMESPACE | |||
| #include "juce_PlatformUtilities.h" | |||
| #include "../utilities/juce_DeletedAtShutdown.h" | |||
| #if ! JUCE_ONLY_BUILD_CORE_LIBRARY | |||
| #include "../events/juce_MessageManager.h" | |||
| @@ -62,7 +62,7 @@ double RelativeTime::inDays() const noexcept { return seconds / (60.0 * 6 | |||
| double RelativeTime::inWeeks() const noexcept { return seconds / (60.0 * 60.0 * 24.0 * 7.0); } | |||
| //============================================================================== | |||
| const String RelativeTime::getDescription (const String& returnValueForZeroTime) const | |||
| String RelativeTime::getDescription (const String& returnValueForZeroTime) const | |||
| { | |||
| if (seconds < 0.001 && seconds > -0.001) | |||
| return returnValueForZeroTime; | |||
| @@ -172,8 +172,8 @@ bool operator< (const RelativeTime& t1, const RelativeTime& t2) noexcept { retu | |||
| bool operator>= (const RelativeTime& t1, const RelativeTime& t2) noexcept { return t1.inSeconds() >= t2.inSeconds(); } | |||
| bool operator<= (const RelativeTime& t1, const RelativeTime& t2) noexcept { return t1.inSeconds() <= t2.inSeconds(); } | |||
| const RelativeTime operator+ (const RelativeTime& t1, const RelativeTime& t2) noexcept { RelativeTime t (t1); return t += t2; } | |||
| const RelativeTime operator- (const RelativeTime& t1, const RelativeTime& t2) noexcept { RelativeTime t (t1); return t -= t2; } | |||
| RelativeTime operator+ (const RelativeTime& t1, const RelativeTime& t2) noexcept { RelativeTime t (t1); return t += t2; } | |||
| RelativeTime operator- (const RelativeTime& t1, const RelativeTime& t2) noexcept { RelativeTime t (t1); return t -= t2; } | |||
| END_JUCE_NAMESPACE | |||
| @@ -134,7 +134,7 @@ public: | |||
| @see inMilliseconds, inSeconds, inMinutes, inHours, inDays, inWeeks | |||
| */ | |||
| const String getDescription (const String& returnValueForZeroTime = "0") const; | |||
| String getDescription (const String& returnValueForZeroTime = "0") const; | |||
| //============================================================================== | |||
| @@ -169,9 +169,9 @@ bool operator<= (const RelativeTime& t1, const RelativeTime& t2) noexcept; | |||
| //============================================================================== | |||
| /** Adds two RelativeTimes together. */ | |||
| const RelativeTime operator+ (const RelativeTime& t1, const RelativeTime& t2) noexcept; | |||
| RelativeTime operator+ (const RelativeTime& t1, const RelativeTime& t2) noexcept; | |||
| /** Subtracts two RelativeTimes. */ | |||
| const RelativeTime operator- (const RelativeTime& t1, const RelativeTime& t2) noexcept; | |||
| RelativeTime operator- (const RelativeTime& t1, const RelativeTime& t2) noexcept; | |||
| @@ -57,17 +57,17 @@ bool Result::operator!= (const Result& other) const noexcept | |||
| return errorMessage != other.errorMessage; | |||
| } | |||
| const Result Result::ok() noexcept | |||
| Result Result::ok() noexcept | |||
| { | |||
| return Result (String::empty); | |||
| } | |||
| const Result Result::fail (const String& errorMessage) noexcept | |||
| Result Result::fail (const String& errorMessage) noexcept | |||
| { | |||
| return Result (errorMessage.isEmpty() ? "Unknown Error" : errorMessage); | |||
| } | |||
| const String Result::getErrorMessage() const noexcept | |||
| const String& Result::getErrorMessage() const noexcept | |||
| { | |||
| return errorMessage; | |||
| } | |||
| @@ -36,7 +36,7 @@ | |||
| E.g. | |||
| @code | |||
| const Result myOperation() | |||
| Result myOperation() | |||
| { | |||
| if (doSomeKindOfFoobar()) | |||
| return Result::ok(); | |||
| @@ -62,13 +62,13 @@ class Result | |||
| public: | |||
| //============================================================================== | |||
| /** Creates and returns a 'successful' result. */ | |||
| static const Result ok() noexcept; | |||
| static Result ok() noexcept; | |||
| /** Creates a 'failure' result. | |||
| If you pass a blank error message in here, a default "Unknown Error" message | |||
| will be used instead. | |||
| */ | |||
| static const Result fail (const String& errorMessage) noexcept; | |||
| static Result fail (const String& errorMessage) noexcept; | |||
| //============================================================================== | |||
| /** Returns true if this result indicates a success. */ | |||
| @@ -93,7 +93,7 @@ public: | |||
| /** Returns the error message that was set when this result was created. | |||
| For a successful result, this will be an empty string; | |||
| */ | |||
| const String getErrorMessage() const noexcept; | |||
| const String& getErrorMessage() const noexcept; | |||
| //============================================================================== | |||
| Result (const Result& other); | |||
| @@ -33,7 +33,7 @@ | |||
| */ | |||
| #define JUCE_MAJOR_VERSION 1 | |||
| #define JUCE_MINOR_VERSION 53 | |||
| #define JUCE_BUILDNUMBER 94 | |||
| #define JUCE_BUILDNUMBER 95 | |||
| /** Current Juce version number. | |||
| @@ -320,16 +320,16 @@ int64 Time::secondsToHighResolutionTicks (const double seconds) noexcept | |||
| //============================================================================== | |||
| const Time JUCE_CALLTYPE Time::getCurrentTime() noexcept | |||
| Time JUCE_CALLTYPE Time::getCurrentTime() noexcept | |||
| { | |||
| return Time (currentTimeMillis()); | |||
| } | |||
| //============================================================================== | |||
| const String Time::toString (const bool includeDate, | |||
| const bool includeTime, | |||
| const bool includeSeconds, | |||
| const bool use24HourClock) const noexcept | |||
| String Time::toString (const bool includeDate, | |||
| const bool includeTime, | |||
| const bool includeSeconds, | |||
| const bool use24HourClock) const noexcept | |||
| { | |||
| String result; | |||
| @@ -363,7 +363,7 @@ const String Time::toString (const bool includeDate, | |||
| return result.trimEnd(); | |||
| } | |||
| const String Time::formatted (const String& format) const | |||
| String Time::formatted (const String& format) const | |||
| { | |||
| int bufferSize = 128; | |||
| HeapBlock<juce_wchar> buffer (128); | |||
| @@ -411,7 +411,7 @@ bool Time::isDaylightSavingTime() const noexcept | |||
| return TimeHelpers::millisToLocal (millisSinceEpoch).tm_isdst != 0; | |||
| } | |||
| const String Time::getTimeZone() const noexcept | |||
| String Time::getTimeZone() const noexcept | |||
| { | |||
| String zone[2]; | |||
| @@ -451,17 +451,17 @@ const String Time::getTimeZone() const noexcept | |||
| return zone[0].substring (0, 3); | |||
| } | |||
| const String Time::getMonthName (const bool threeLetterVersion) const | |||
| String Time::getMonthName (const bool threeLetterVersion) const | |||
| { | |||
| return getMonthName (getMonth(), threeLetterVersion); | |||
| } | |||
| const String Time::getWeekdayName (const bool threeLetterVersion) const | |||
| String Time::getWeekdayName (const bool threeLetterVersion) const | |||
| { | |||
| return getWeekdayName (getDayOfWeek(), threeLetterVersion); | |||
| } | |||
| const String Time::getMonthName (int monthNumber, const bool threeLetterVersion) | |||
| String Time::getMonthName (int monthNumber, const bool threeLetterVersion) | |||
| { | |||
| const char* const shortMonthNames[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; | |||
| const char* const longMonthNames[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; | |||
| @@ -472,7 +472,7 @@ const String Time::getMonthName (int monthNumber, const bool threeLetterVersion) | |||
| : longMonthNames [monthNumber]); | |||
| } | |||
| const String Time::getWeekdayName (int day, const bool threeLetterVersion) | |||
| String Time::getWeekdayName (int day, const bool threeLetterVersion) | |||
| { | |||
| const char* const shortDayNames[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; | |||
| const char* const longDayNames[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; | |||
| @@ -487,9 +487,9 @@ const String Time::getWeekdayName (int day, const bool threeLetterVersion) | |||
| Time& Time::operator+= (const RelativeTime& delta) { millisSinceEpoch += delta.inMilliseconds(); return *this; } | |||
| Time& Time::operator-= (const RelativeTime& delta) { millisSinceEpoch -= delta.inMilliseconds(); return *this; } | |||
| const Time operator+ (const Time& time, const RelativeTime& delta) { Time t (time); return t += delta; } | |||
| const Time operator- (const Time& time, const RelativeTime& delta) { Time t (time); return t -= delta; } | |||
| const Time operator+ (const RelativeTime& delta, const Time& time) { Time t (time); return t += delta; } | |||
| Time operator+ (const Time& time, const RelativeTime& delta) { Time t (time); return t += delta; } | |||
| Time operator- (const Time& time, const RelativeTime& delta) { Time t (time); return t -= delta; } | |||
| Time operator+ (const RelativeTime& delta, const Time& time) { Time t (time); return t += delta; } | |||
| const RelativeTime operator- (const Time& time1, const Time& time2) { return RelativeTime::milliseconds (time1.toMilliseconds() - time2.toMilliseconds()); } | |||
| bool operator== (const Time& time1, const Time& time2) { return time1.toMilliseconds() == time2.toMilliseconds(); } | |||
| @@ -100,7 +100,7 @@ public: | |||
| @see currentTimeMillis | |||
| */ | |||
| static const Time JUCE_CALLTYPE getCurrentTime() noexcept; | |||
| static Time JUCE_CALLTYPE getCurrentTime() noexcept; | |||
| /** Returns the time as a number of milliseconds. | |||
| @@ -129,7 +129,7 @@ public: | |||
| it'll return the long form, e.g. "January" | |||
| @see getMonth | |||
| */ | |||
| const String getMonthName (bool threeLetterVersion) const; | |||
| String getMonthName (bool threeLetterVersion) const; | |||
| /** Returns the day of the month. | |||
| @@ -148,7 +148,7 @@ public: | |||
| @param threeLetterVersion if true, it'll return a 3-letter abbreviation, e.g. "Tue"; if | |||
| false, it'll return the full version, e.g. "Tuesday". | |||
| */ | |||
| const String getWeekdayName (bool threeLetterVersion) const; | |||
| String getWeekdayName (bool threeLetterVersion) const; | |||
| /** Returns the number of hours since midnight. | |||
| @@ -194,7 +194,7 @@ public: | |||
| bool isDaylightSavingTime() const noexcept; | |||
| /** Returns a 3-character string to indicate the local timezone. */ | |||
| const String getTimeZone() const noexcept; | |||
| String getTimeZone() const noexcept; | |||
| //============================================================================== | |||
| /** Quick way of getting a string version of a date and time. | |||
| @@ -209,10 +209,10 @@ public: | |||
| hour notation. | |||
| @see formatted | |||
| */ | |||
| const String toString (bool includeDate, | |||
| bool includeTime, | |||
| bool includeSeconds = true, | |||
| bool use24HourClock = false) const noexcept; | |||
| String toString (bool includeDate, | |||
| bool includeTime, | |||
| bool includeSeconds = true, | |||
| bool use24HourClock = false) const noexcept; | |||
| /** Converts this date/time to a string with a user-defined format. | |||
| @@ -245,7 +245,7 @@ public: | |||
| @see toString | |||
| */ | |||
| const String formatted (const String& format) const; | |||
| String formatted (const String& format) const; | |||
| //============================================================================== | |||
| /** Adds a RelativeTime to this time. */ | |||
| @@ -268,8 +268,8 @@ public: | |||
| @param threeLetterVersion if true, it'll return a 3-letter abbreviation, e.g. "Tue"; if | |||
| false, it'll return the full version, e.g. "Tuesday". | |||
| */ | |||
| static const String getWeekdayName (int dayNumber, | |||
| bool threeLetterVersion); | |||
| static String getWeekdayName (int dayNumber, | |||
| bool threeLetterVersion); | |||
| /** Returns the name of one of the months. | |||
| @@ -277,8 +277,8 @@ public: | |||
| @param threeLetterVersion if true, it'll be a 3-letter abbreviation, e.g. "Jan"; if false | |||
| it'll return the long form, e.g. "January" | |||
| */ | |||
| static const String getMonthName (int monthNumber, | |||
| bool threeLetterVersion); | |||
| static String getMonthName (int monthNumber, | |||
| bool threeLetterVersion); | |||
| //============================================================================== | |||
| // Static methods for getting system timers directly.. | |||
| @@ -374,12 +374,12 @@ private: | |||
| //============================================================================== | |||
| /** Adds a RelativeTime to a Time. */ | |||
| JUCE_API const Time operator+ (const Time& time, const RelativeTime& delta); | |||
| JUCE_API Time operator+ (const Time& time, const RelativeTime& delta); | |||
| /** Adds a RelativeTime to a Time. */ | |||
| JUCE_API const Time operator+ (const RelativeTime& delta, const Time& time); | |||
| JUCE_API Time operator+ (const RelativeTime& delta, const Time& time); | |||
| /** Subtracts a RelativeTime from a Time. */ | |||
| JUCE_API const Time operator- (const Time& time, const RelativeTime& delta); | |||
| JUCE_API Time operator- (const Time& time, const RelativeTime& delta); | |||
| /** Returns the relative time difference between two times. */ | |||
| JUCE_API const RelativeTime operator- (const Time& time1, const Time& time2); | |||
| @@ -103,7 +103,7 @@ bool Uuid::isNull() const noexcept | |||
| } | |||
| //============================================================================== | |||
| const String Uuid::toString() const | |||
| String Uuid::toString() const | |||
| { | |||
| return String::toHexString (value.asBytes, sizeof (value.asBytes), 0); | |||
| } | |||
| @@ -73,7 +73,7 @@ public: | |||
| @returns a 32 character hex string. | |||
| */ | |||
| const String toString() const; | |||
| String toString() const; | |||
| /** Creates an ID from an encoded string version. | |||
| @@ -29,7 +29,6 @@ BEGIN_JUCE_NAMESPACE | |||
| #include "juce_MD5.h" | |||
| #include "../io/files/juce_FileInputStream.h" | |||
| #include "../memory/juce_ScopedPointer.h" | |||
| //============================================================================== | |||
| @@ -111,10 +110,10 @@ MD5::MD5 (InputStream& input, int64 numBytesToRead) | |||
| MD5::MD5 (const File& file) | |||
| { | |||
| const ScopedPointer <FileInputStream> fin (file.createInputStream()); | |||
| FileInputStream fin (file); | |||
| if (fin != nullptr) | |||
| processStream (*fin, -1); | |||
| if (fin.getStatus().wasOk()) | |||
| processStream (fin, -1); | |||
| else | |||
| zerostruct (result); | |||
| } | |||
| @@ -288,12 +287,12 @@ void MD5::ProcessContext::transform (const void* const bufferToTransform) | |||
| } | |||
| //============================================================================== | |||
| const MemoryBlock MD5::getRawChecksumData() const | |||
| MemoryBlock MD5::getRawChecksumData() const | |||
| { | |||
| return MemoryBlock (result, sizeof (result)); | |||
| } | |||
| const String MD5::toHexString() const | |||
| String MD5::toHexString() const | |||
| { | |||
| return String::toHexString (result, sizeof (result), 0); | |||
| } | |||
| @@ -86,10 +86,10 @@ public: | |||
| //============================================================================== | |||
| /** Returns the checksum as a 16-byte block of data. */ | |||
| const MemoryBlock getRawChecksumData() const; | |||
| MemoryBlock getRawChecksumData() const; | |||
| /** Returns the checksum as a 32-digit hex string. */ | |||
| const String toHexString() const; | |||
| String toHexString() const; | |||
| //============================================================================== | |||
| @@ -117,7 +117,7 @@ private: | |||
| void finish (void* result); | |||
| }; | |||
| void processStream (InputStream& input, int64 numBytesToRead); | |||
| void processStream (InputStream&, int64 numBytesToRead); | |||
| JUCE_LEAK_DETECTOR (MD5); | |||
| }; | |||
| @@ -159,10 +159,10 @@ namespace PrimesHelpers | |||
| } | |||
| //============================================================================== | |||
| const BigInteger Primes::createProbablePrime (const int bitLength, | |||
| const int certainty, | |||
| const int* randomSeeds, | |||
| int numRandomSeeds) | |||
| BigInteger Primes::createProbablePrime (const int bitLength, | |||
| const int certainty, | |||
| const int* randomSeeds, | |||
| int numRandomSeeds) | |||
| { | |||
| using namespace PrimesHelpers; | |||
| int defaultSeeds [16]; | |||
| @@ -50,10 +50,10 @@ public: | |||
| which to seed the random number generation, improving the security of the | |||
| keys generated. | |||
| */ | |||
| static const BigInteger createProbablePrime (int bitLength, | |||
| int certainty, | |||
| const int* randomSeeds = 0, | |||
| int numRandomSeeds = 0); | |||
| static BigInteger createProbablePrime (int bitLength, | |||
| int certainty, | |||
| const int* randomSeeds = 0, | |||
| int numRandomSeeds = 0); | |||
| /** Tests a number to see if it's prime. | |||
| @@ -64,7 +64,7 @@ bool RSAKey::operator!= (const RSAKey& other) const noexcept | |||
| return ! operator== (other); | |||
| } | |||
| const String RSAKey::toString() const | |||
| String RSAKey::toString() const | |||
| { | |||
| return part1.toString (16) + "," + part2.toString (16); | |||
| } | |||
| @@ -96,7 +96,7 @@ bool RSAKey::applyToValue (BigInteger& value) const | |||
| return true; | |||
| } | |||
| const BigInteger RSAKey::findBestCommonDivisor (const BigInteger& p, const BigInteger& q) | |||
| BigInteger RSAKey::findBestCommonDivisor (const BigInteger& p, const BigInteger& q) | |||
| { | |||
| // try 3, 5, 9, 17, etc first because these only contain 2 bits and so | |||
| // are fast to divide + multiply | |||
| @@ -63,7 +63,7 @@ public: | |||
| This can be reloaded using the constructor that takes a string. | |||
| */ | |||
| const String toString() const; | |||
| String toString() const; | |||
| //============================================================================== | |||
| /** Encodes or decodes a value. | |||
| @@ -108,7 +108,7 @@ protected: | |||
| private: | |||
| //============================================================================== | |||
| static const BigInteger findBestCommonDivisor (const BigInteger& p, const BigInteger& q); | |||
| static BigInteger findBestCommonDivisor (const BigInteger& p, const BigInteger& q); | |||
| JUCE_LEAK_DETECTOR (RSAKey); | |||
| }; | |||
| @@ -29,6 +29,7 @@ BEGIN_JUCE_NAMESPACE | |||
| #include "juce_InterprocessConnection.h" | |||
| #include "../memory/juce_ScopedPointer.h" | |||
| #include "../memory/juce_MemoryBlock.h" | |||
| //============================================================================== | |||
| @@ -32,6 +32,7 @@ | |||
| #include "../io/files/juce_NamedPipe.h" | |||
| #include "../memory/juce_ScopedPointer.h" | |||
| class InterprocessConnectionServer; | |||
| class MemoryBlock; | |||
| //============================================================================== | |||
| @@ -36,7 +36,7 @@ Message::Message() noexcept | |||
| intParameter2 (0), | |||
| intParameter3 (0), | |||
| pointerParameter (nullptr), | |||
| messageRecipient (0) | |||
| messageRecipient (nullptr) | |||
| { | |||
| } | |||
| @@ -48,7 +48,7 @@ Message::Message (const int intParameter1_, | |||
| intParameter2 (intParameter2_), | |||
| intParameter3 (intParameter3_), | |||
| pointerParameter (pointerParameter_), | |||
| messageRecipient (0) | |||
| messageRecipient (nullptr) | |||
| { | |||
| } | |||
| @@ -28,6 +28,7 @@ | |||
| BEGIN_JUCE_NAMESPACE | |||
| #include "juce_MessageManager.h" | |||
| #include "juce_MessageListener.h" | |||
| //============================================================================== | |||
| @@ -31,9 +31,10 @@ BEGIN_JUCE_NAMESPACE | |||
| #include "juce_ActionBroadcaster.h" | |||
| #include "../application/juce_Application.h" | |||
| #include "../gui/components/juce_Component.h" | |||
| #include "../threads/juce_Thread.h" | |||
| #include "../threads/juce_ThreadPool.h" | |||
| #include "../core/juce_Time.h" | |||
| //============================================================================== | |||
| MessageManager* MessageManager::instance = nullptr; | |||
| @@ -26,15 +26,15 @@ | |||
| #ifndef __JUCE_MESSAGEMANAGER_JUCEHEADER__ | |||
| #define __JUCE_MESSAGEMANAGER_JUCEHEADER__ | |||
| #include "../utilities/juce_DeletedAtShutdown.h" | |||
| #include "../containers/juce_SortedSet.h" | |||
| #include "../memory/juce_ScopedPointer.h" | |||
| #include "../threads/juce_Thread.h" | |||
| #include "../threads/juce_ThreadPool.h" | |||
| #include "juce_ActionBroadcaster.h" | |||
| #include "juce_CallbackMessage.h" | |||
| class Component; | |||
| class MessageManagerLock; | |||
| class ThreadPoolJob; | |||
| class ActionListener; | |||
| class ActionBroadcaster; | |||
| //============================================================================== | |||
| @@ -28,13 +28,12 @@ | |||
| BEGIN_JUCE_NAMESPACE | |||
| #include "juce_Timer.h" | |||
| #include "juce_MessageManager.h" | |||
| #include "juce_AsyncUpdater.h" | |||
| #include "../containers/juce_SortedSet.h" | |||
| #include "../application/juce_Application.h" | |||
| #include "../utilities/juce_DeletedAtShutdown.h" | |||
| #include "../core/juce_Time.h" | |||
| #include "../threads/juce_Thread.h" | |||
| #include "../threads/juce_SpinLock.h" | |||
| //============================================================================== | |||
| @@ -64,7 +64,7 @@ void HyperlinkButton::setURL (const URL& newURL) noexcept | |||
| setTooltip (newURL.toString (false)); | |||
| } | |||
| const Font HyperlinkButton::getFontToUse() const | |||
| Font HyperlinkButton::getFontToUse() const | |||
| { | |||
| Font f (font); | |||
| @@ -110,7 +110,7 @@ private: | |||
| bool resizeFont; | |||
| Justification justification; | |||
| const Font getFontToUse() const; | |||
| Font getFontToUse() const; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HyperlinkButton); | |||
| }; | |||
| @@ -90,7 +90,7 @@ void ImageButton::setImages (const bool resizeButtonNowToFitThisImage, | |||
| repaint(); | |||
| } | |||
| const Image ImageButton::getCurrentImage() const | |||
| Image ImageButton::getCurrentImage() const | |||
| { | |||
| if (isDown() || getToggleState()) | |||
| return getDownImage(); | |||
| @@ -101,18 +101,18 @@ const Image ImageButton::getCurrentImage() const | |||
| return getNormalImage(); | |||
| } | |||
| const Image ImageButton::getNormalImage() const | |||
| Image ImageButton::getNormalImage() const | |||
| { | |||
| return normalImage; | |||
| } | |||
| const Image ImageButton::getOverImage() const | |||
| Image ImageButton::getOverImage() const | |||
| { | |||
| return overImage.isValid() ? overImage | |||
| : normalImage; | |||
| } | |||
| const Image ImageButton::getDownImage() const | |||
| Image ImageButton::getDownImage() const | |||
| { | |||
| return downImage.isValid() ? downImage | |||
| : getOverImage(); | |||
| @@ -111,21 +111,21 @@ public: | |||
| float hitTestAlphaThreshold = 0.0f); | |||
| /** Returns the currently set 'normal' image. */ | |||
| const Image getNormalImage() const; | |||
| Image getNormalImage() const; | |||
| /** Returns the image that's drawn when the mouse is over the button. | |||
| If a valid 'over' image has been set, this will return it; otherwise it'll | |||
| just return the normal image. | |||
| */ | |||
| const Image getOverImage() const; | |||
| Image getOverImage() const; | |||
| /** Returns the image that's drawn when the button is held down. | |||
| If a valid 'down' image has been set, this will return it; otherwise it'll | |||
| return the 'over' image or normal image, depending on what's available. | |||
| */ | |||
| const Image getDownImage() const; | |||
| Image getDownImage() const; | |||
| protected: | |||
| //============================================================================== | |||
| @@ -145,7 +145,7 @@ private: | |||
| float normalOpacity, overOpacity, downOpacity; | |||
| Colour normalOverlay, overOverlay, downOverlay; | |||
| const Image getCurrentImage() const; | |||
| Image getCurrentImage() const; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ImageButton); | |||
| }; | |||
| @@ -222,7 +222,7 @@ int ComboBox::getNumItems() const noexcept | |||
| return n; | |||
| } | |||
| const String ComboBox::getItemText (const int index) const | |||
| String ComboBox::getItemText (const int index) const | |||
| { | |||
| const ItemInfo* const item = getItemForIndex (index); | |||
| @@ -315,7 +315,7 @@ void ComboBox::valueChanged (Value&) | |||
| } | |||
| //============================================================================== | |||
| const String ComboBox::getText() const | |||
| String ComboBox::getText() const | |||
| { | |||
| return label->getText(); | |||
| } | |||
| @@ -365,7 +365,7 @@ void ComboBox::setTextWhenNothingSelected (const String& newMessage) | |||
| } | |||
| } | |||
| const String ComboBox::getTextWhenNothingSelected() const | |||
| String ComboBox::getTextWhenNothingSelected() const | |||
| { | |||
| return textWhenNothingSelected; | |||
| } | |||
| @@ -375,7 +375,7 @@ void ComboBox::setTextWhenNoChoicesAvailable (const String& newMessage) | |||
| noChoicesMessage = newMessage; | |||
| } | |||
| const String ComboBox::getTextWhenNoChoicesAvailable() const | |||
| String ComboBox::getTextWhenNoChoicesAvailable() const | |||
| { | |||
| return noChoicesMessage; | |||
| } | |||
| @@ -156,12 +156,10 @@ public: | |||
| int getNumItems() const noexcept; | |||
| /** Returns the text for one of the items in the list. | |||
| Note that this doesn't include headers or separators. | |||
| @param index the item's index from 0 to (getNumItems() - 1) | |||
| */ | |||
| const String getItemText (int index) const; | |||
| String getItemText (int index) const; | |||
| /** Returns the ID for one of the items in the list. | |||
| @@ -238,7 +236,7 @@ public: | |||
| @see setText, getSelectedId, getSelectedItemIndex | |||
| */ | |||
| const String getText() const; | |||
| String getText() const; | |||
| /** Sets the contents of the combo-box's text field. | |||
| @@ -300,7 +298,7 @@ public: | |||
| @see setTextWhenNothingSelected | |||
| */ | |||
| const String getTextWhenNothingSelected() const; | |||
| String getTextWhenNothingSelected() const; | |||
| /** Sets the message to show when there are no items in the list, and the user clicks | |||
| @@ -314,7 +312,7 @@ public: | |||
| /** Returns the text shown when no items have been added to the list. | |||
| @see setTextWhenNoChoicesAvailable | |||
| */ | |||
| const String getTextWhenNoChoicesAvailable() const; | |||
| String getTextWhenNoChoicesAvailable() const; | |||
| //============================================================================== | |||
| /** Gives the ComboBox a tooltip. */ | |||
| @@ -69,7 +69,7 @@ void ImageComponent::setImagePlacement (const RectanglePlacement& newPlacement) | |||
| } | |||
| } | |||
| const Image ImageComponent::getImage() const | |||
| const Image& ImageComponent::getImage() const | |||
| { | |||
| return image; | |||
| } | |||
| @@ -56,7 +56,7 @@ public: | |||
| const RectanglePlacement& placementToUse); | |||
| /** Returns the current image. */ | |||
| const Image getImage() const; | |||
| const Image& getImage() const; | |||
| /** Sets the method of positioning that will be used to fit the image within the component's bounds. | |||
| By default the positioning is centred, and will fit the image inside the component's bounds | |||
| @@ -51,7 +51,7 @@ struct TextAtom | |||
| bool isWhitespace() const { return CharacterFunctions::isWhitespace (atomText[0]); } | |||
| bool isNewLine() const { return atomText[0] == '\r' || atomText[0] == '\n'; } | |||
| const String getText (const juce_wchar passwordCharacter) const | |||
| String getText (const juce_wchar passwordCharacter) const | |||
| { | |||
| if (passwordCharacter == 0) | |||
| return atomText; | |||
| @@ -60,7 +60,7 @@ struct TextAtom | |||
| atomText.length()); | |||
| } | |||
| const String getTrimmedText (const juce_wchar passwordCharacter) const | |||
| String getTrimmedText (const juce_wchar passwordCharacter) const | |||
| { | |||
| if (passwordCharacter == 0) | |||
| return atomText.substring (0, numChars); | |||
| @@ -1128,7 +1128,7 @@ void TextEditor::setSelectAllWhenFocused (const bool b) | |||
| } | |||
| //============================================================================== | |||
| const Font TextEditor::getFont() const | |||
| const Font& TextEditor::getFont() const | |||
| { | |||
| return currentFont; | |||
| } | |||
| @@ -2458,7 +2458,7 @@ void TextEditor::remove (const Range<int>& range, | |||
| } | |||
| //============================================================================== | |||
| const String TextEditor::getText() const | |||
| String TextEditor::getText() const | |||
| { | |||
| MemoryOutputStream mo; | |||
| mo.preallocate (getTotalNumChars()); | |||
| @@ -2498,7 +2498,7 @@ const String TextEditor::getTextInRange (const Range<int>& range) const | |||
| return mo.toString(); | |||
| } | |||
| const String TextEditor::getHighlightedText() const | |||
| String TextEditor::getHighlightedText() const | |||
| { | |||
| return getTextInRange (selection); | |||
| } | |||
| @@ -254,7 +254,7 @@ public: | |||
| @see setFont | |||
| */ | |||
| const Font getFont() const; | |||
| const Font& getFont() const; | |||
| //============================================================================== | |||
| /** If set to true, focusing on the editor will highlight all its text. | |||
| @@ -336,7 +336,7 @@ public: | |||
| //============================================================================== | |||
| /** Returns the entire contents of the editor. */ | |||
| const String getText() const; | |||
| String getText() const; | |||
| /** Returns a section of the contents of the editor. */ | |||
| const String getTextInRange (const Range<int>& textRange) const; | |||
| @@ -444,7 +444,7 @@ public: | |||
| const Range<int> getHighlightedRegion() const { return selection; } | |||
| /** Returns the section of text that is currently selected. */ | |||
| const String getHighlightedText() const; | |||
| String getHighlightedText() const; | |||
| /** Finds the index of the character at a given position. | |||
| @@ -626,6 +626,17 @@ TreeViewItem* TreeView::findItemFromIdentifierString (const String& identifierSt | |||
| } | |||
| //============================================================================== | |||
| static void addAllSelectedItemIds (TreeViewItem* item, XmlElement& parent) | |||
| { | |||
| if (item->isSelected()) | |||
| parent.createNewChildElement ("SELECTED")->setAttribute ("id", item->getItemIdentifierString()); | |||
| const int numSubItems = item->getNumSubItems(); | |||
| for (int i = 0; i < numSubItems; ++i) | |||
| addAllSelectedItemIds (item->getSubItem(i), parent); | |||
| } | |||
| XmlElement* TreeView::getOpennessState (const bool alsoIncludeScrollPosition) const | |||
| { | |||
| XmlElement* e = nullptr; | |||
| @@ -634,14 +645,19 @@ XmlElement* TreeView::getOpennessState (const bool alsoIncludeScrollPosition) co | |||
| { | |||
| e = rootItem->getOpennessState(); | |||
| if (e != nullptr && alsoIncludeScrollPosition) | |||
| e->setAttribute ("scrollPos", viewport->getViewPositionY()); | |||
| if (e != nullptr) | |||
| { | |||
| if (alsoIncludeScrollPosition) | |||
| e->setAttribute ("scrollPos", viewport->getViewPositionY()); | |||
| addAllSelectedItemIds (rootItem, *e); | |||
| } | |||
| } | |||
| return e; | |||
| } | |||
| void TreeView::restoreOpennessState (const XmlElement& newState) | |||
| void TreeView::restoreOpennessState (const XmlElement& newState, const bool restoreStoredSelection) | |||
| { | |||
| if (rootItem != nullptr) | |||
| { | |||
| @@ -650,6 +666,19 @@ void TreeView::restoreOpennessState (const XmlElement& newState) | |||
| if (newState.hasAttribute ("scrollPos")) | |||
| viewport->setViewPosition (viewport->getViewPositionX(), | |||
| newState.getIntAttribute ("scrollPos")); | |||
| if (restoreStoredSelection) | |||
| { | |||
| clearSelectedItems(); | |||
| forEachXmlChildElementWithTagName (newState, e, "SELECTED") | |||
| { | |||
| TreeViewItem* const item = rootItem->findItemFromIdentifierString (e->getStringAttribute ("id")); | |||
| if (item != nullptr) | |||
| item->setSelected (true, false); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -1702,7 +1731,7 @@ TreeViewItem* TreeViewItem::getNextVisibleItem (const bool recurse) const noexce | |||
| return nullptr; | |||
| } | |||
| const String TreeViewItem::getItemIdentifierString() const | |||
| String TreeViewItem::getItemIdentifierString() const | |||
| { | |||
| String s; | |||
| @@ -1723,7 +1752,7 @@ TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifi | |||
| { | |||
| const String remainingPath (identifierString.substring (thisId.length() + 1)); | |||
| bool wasOpen = isOpen(); | |||
| const bool wasOpen = isOpen(); | |||
| setOpen (true); | |||
| for (int i = subItems.size(); --i >= 0;) | |||
| @@ -455,7 +455,7 @@ public: | |||
| item and all its parents, so these must all be correctly implemented for it to work. | |||
| @see TreeView::findItemFromIdentifierString, getUniqueName | |||
| */ | |||
| const String getItemIdentifierString() const; | |||
| String getItemIdentifierString() const; | |||
| //============================================================================== | |||
| /** | |||
| @@ -510,8 +510,8 @@ private: | |||
| void updatePositions (int newY); | |||
| int getIndentX() const noexcept; | |||
| void setOwnerView (TreeView* newOwner) noexcept; | |||
| void paintRecursively (Graphics& g, int width); | |||
| void setOwnerView (TreeView*) noexcept; | |||
| void paintRecursively (Graphics&, int width); | |||
| TreeViewItem* getTopLevelItem() noexcept; | |||
| TreeViewItem* findItemRecursively (int y) noexcept; | |||
| TreeViewItem* getDeepestOpenParentItem() noexcept; | |||
| @@ -521,7 +521,7 @@ private: | |||
| int countSelectedItemsRecursively (int depth) const noexcept; | |||
| TreeViewItem* getSelectedItemWithIndex (int index) noexcept; | |||
| TreeViewItem* getNextVisibleItem (bool recurse) const noexcept; | |||
| TreeViewItem* findItemFromIdentifierString (const String& identifierString); | |||
| TreeViewItem* findItemFromIdentifierString (const String&); | |||
| #if JUCE_CATCH_DEPRECATED_CODE_MISUSE | |||
| // The parameters for these methods have changed - please update your code! | |||
| @@ -734,9 +734,13 @@ public: | |||
| the getOpennessState() method. If any of the nodes named in the original | |||
| XML aren't present in this tree, they will be ignored. | |||
| If restoreStoredSelection is true, it will also try to re-select any items that | |||
| were selected in the stored state. | |||
| @see getOpennessState | |||
| */ | |||
| void restoreOpennessState (const XmlElement& newState); | |||
| void restoreOpennessState (const XmlElement& newState, | |||
| bool restoreStoredSelection); | |||
| //============================================================================== | |||
| /** A set of colour IDs to use to change the colour of various aspects of the treeview. | |||
| @@ -141,7 +141,7 @@ bool DirectoryContentsList::getFileInfo (const int index, | |||
| return false; | |||
| } | |||
| const File DirectoryContentsList::getFile (const int index) const | |||
| File DirectoryContentsList::getFile (const int index) const | |||
| { | |||
| const ScopedLock sl (fileListLock); | |||
| const FileInfo* const info = files [index]; | |||
| @@ -175,7 +175,7 @@ public: | |||
| return value will be File::nonexistent | |||
| @see getNumFiles, getFileInfo | |||
| */ | |||
| const File getFile (int index) const; | |||
| File getFile (int index) const; | |||
| /** Returns the file filter being used. | |||
| @@ -158,7 +158,7 @@ int FileBrowserComponent::getNumSelectedFiles() const noexcept | |||
| return chosenFiles.size(); | |||
| } | |||
| const File FileBrowserComponent::getSelectedFile (int index) const noexcept | |||
| File FileBrowserComponent::getSelectedFile (int index) const noexcept | |||
| { | |||
| if ((flags & canSelectDirectories) != 0 && filenameBox.getText().isEmpty()) | |||
| return currentRoot; | |||
| @@ -177,7 +177,7 @@ bool FileBrowserComponent::currentFileIsValid() const | |||
| return getSelectedFile (0).exists(); | |||
| } | |||
| const File FileBrowserComponent::getHighlightedFile() const noexcept | |||
| File FileBrowserComponent::getHighlightedFile() const noexcept | |||
| { | |||
| return fileListComponent->getSelectedFile (0); | |||
| } | |||
| @@ -209,7 +209,7 @@ bool FileBrowserComponent::isFileOrDirSuitable (const File& f) const | |||
| } | |||
| //============================================================================== | |||
| const File FileBrowserComponent::getRoot() const | |||
| const File& FileBrowserComponent::getRoot() const | |||
| { | |||
| return currentRoot; | |||
| } | |||
| @@ -111,7 +111,7 @@ public: | |||
| to get - see getNumSelectedFiles() to find out how many files were chosen. | |||
| @see getHighlightedFile | |||
| */ | |||
| const File getSelectedFile (int index) const noexcept; | |||
| File getSelectedFile (int index) const noexcept; | |||
| /** Deselects any files that are currently selected. | |||
| */ | |||
| @@ -132,11 +132,11 @@ public: | |||
| this will only return one of them. | |||
| @see getSelectedFile | |||
| */ | |||
| const File getHighlightedFile() const noexcept; | |||
| File getHighlightedFile() const noexcept; | |||
| //============================================================================== | |||
| /** Returns the directory whose contents are currently being shown in the listbox. */ | |||
| const File getRoot() const; | |||
| const File& getRoot() const; | |||
| /** Changes the directory that's being shown in the listbox. */ | |||
| void setRoot (const File& newRootDirectory); | |||
| @@ -155,7 +155,7 @@ bool FileChooser::showDialog (const bool selectsDirectories, | |||
| } | |||
| #endif | |||
| const File FileChooser::getResult() const | |||
| File FileChooser::getResult() const | |||
| { | |||
| // if you've used a multiple-file select, you should use the getResults() method | |||
| // to retrieve all the files that were chosen. | |||
| @@ -157,7 +157,7 @@ public: | |||
| @see getResults | |||
| */ | |||
| const File getResult() const; | |||
| File getResult() const; | |||
| /** Returns a list of all the files that were chosen during the last call to a | |||
| browse method. | |||
| @@ -32,7 +32,7 @@ BEGIN_JUCE_NAMESPACE | |||
| #include "../../graphics/imaging/juce_ImageCache.h" | |||
| #include "../../../events/juce_AsyncUpdater.h" | |||
| const Image juce_createIconForFile (const File& file); | |||
| Image juce_createIconForFile (const File& file); | |||
| //============================================================================== | |||
| @@ -32,7 +32,7 @@ BEGIN_JUCE_NAMESPACE | |||
| #include "../../graphics/imaging/juce_ImageCache.h" | |||
| #include "../../../events/juce_AsyncUpdater.h" | |||
| const Image juce_createIconForFile (const File& file); | |||
| Image juce_createIconForFile (const File& file); | |||
| //============================================================================== | |||
| @@ -161,7 +161,7 @@ void FilenameComponent::fileDragExit (const StringArray&) | |||
| } | |||
| //============================================================================== | |||
| const File FilenameComponent::getCurrentFile() const | |||
| File FilenameComponent::getCurrentFile() const | |||
| { | |||
| File f (filenameBox.getText()); | |||
| @@ -197,7 +197,7 @@ void FilenameComponent::setFilenameIsEditable (const bool shouldBeEditable) | |||
| filenameBox.setEditableText (shouldBeEditable); | |||
| } | |||
| const StringArray FilenameComponent::getRecentlyUsedFilenames() const | |||
| StringArray FilenameComponent::getRecentlyUsedFilenames() const | |||
| { | |||
| StringArray names; | |||
| @@ -109,7 +109,7 @@ public: | |||
| //============================================================================== | |||
| /** Returns the currently displayed filename. */ | |||
| const File getCurrentFile() const; | |||
| File getCurrentFile() const; | |||
| /** Changes the current filename. | |||
| @@ -140,7 +140,7 @@ public: | |||
| @see setRecentlyUsedFilenames | |||
| */ | |||
| const StringArray getRecentlyUsedFilenames() const; | |||
| StringArray getRecentlyUsedFilenames() const; | |||
| /** Sets all the entries on the recent files list. | |||
| @@ -935,25 +935,25 @@ int Component::getParentHeight() const noexcept | |||
| int Component::getScreenX() const { return getScreenPosition().getX(); } | |||
| int Component::getScreenY() const { return getScreenPosition().getY(); } | |||
| const Point<int> Component::getScreenPosition() const { return localPointToGlobal (Point<int>()); } | |||
| const Rectangle<int> Component::getScreenBounds() const { return localAreaToGlobal (getLocalBounds()); } | |||
| Point<int> Component::getScreenPosition() const { return localPointToGlobal (Point<int>()); } | |||
| Rectangle<int> Component::getScreenBounds() const { return localAreaToGlobal (getLocalBounds()); } | |||
| const Point<int> Component::getLocalPoint (const Component* source, const Point<int>& point) const | |||
| Point<int> Component::getLocalPoint (const Component* source, const Point<int>& point) const | |||
| { | |||
| return ComponentHelpers::convertCoordinate (this, source, point); | |||
| } | |||
| const Rectangle<int> Component::getLocalArea (const Component* source, const Rectangle<int>& area) const | |||
| Rectangle<int> Component::getLocalArea (const Component* source, const Rectangle<int>& area) const | |||
| { | |||
| return ComponentHelpers::convertCoordinate (this, source, area); | |||
| } | |||
| const Point<int> Component::localPointToGlobal (const Point<int>& point) const | |||
| Point<int> Component::localPointToGlobal (const Point<int>& point) const | |||
| { | |||
| return ComponentHelpers::convertCoordinate (nullptr, this, point); | |||
| } | |||
| const Rectangle<int> Component::localAreaToGlobal (const Rectangle<int>& area) const | |||
| Rectangle<int> Component::localAreaToGlobal (const Rectangle<int>& area) const | |||
| { | |||
| return ComponentHelpers::convertCoordinate (nullptr, this, area); | |||
| } | |||
| @@ -1225,7 +1225,7 @@ void Component::setTransform (const AffineTransform& newTransform) | |||
| } | |||
| } | |||
| const AffineTransform Component::getTransform() const | |||
| AffineTransform Component::getTransform() const | |||
| { | |||
| return affineTransform != nullptr ? *affineTransform : AffineTransform::identity; | |||
| } | |||
| @@ -1954,8 +1954,8 @@ void Component::setPaintingIsUnclipped (const bool shouldPaintWithoutClipping) n | |||
| } | |||
| //============================================================================== | |||
| const Image Component::createComponentSnapshot (const Rectangle<int>& areaToGrab, | |||
| const bool clipImageToComponentBounds) | |||
| Image Component::createComponentSnapshot (const Rectangle<int>& areaToGrab, | |||
| const bool clipImageToComponentBounds) | |||
| { | |||
| Rectangle<int> r (areaToGrab); | |||
| @@ -2113,12 +2113,12 @@ void Component::setPositioner (Positioner* newPositioner) | |||
| } | |||
| //============================================================================== | |||
| const Rectangle<int> Component::getLocalBounds() const noexcept | |||
| Rectangle<int> Component::getLocalBounds() const noexcept | |||
| { | |||
| return Rectangle<int> (getWidth(), getHeight()); | |||
| } | |||
| const Rectangle<int> Component::getBoundsInParent() const noexcept | |||
| Rectangle<int> Component::getBoundsInParent() const noexcept | |||
| { | |||
| return affineTransform == nullptr ? bounds | |||
| : bounds.toFloat().transformed (*affineTransform).getSmallestIntegerContainer(); | |||
| @@ -2969,13 +2969,13 @@ bool JUCE_CALLTYPE Component::isMouseButtonDownAnywhere() noexcept | |||
| return ModifierKeys::getCurrentModifiers().isAnyMouseButtonDown(); | |||
| } | |||
| const Point<int> Component::getMouseXYRelative() const | |||
| Point<int> Component::getMouseXYRelative() const | |||
| { | |||
| return getLocalPoint (nullptr, Desktop::getMousePosition()); | |||
| } | |||
| //============================================================================== | |||
| const Rectangle<int> Component::getParentMonitorArea() const | |||
| Rectangle<int> Component::getParentMonitorArea() const | |||
| { | |||
| return Desktop::getInstance().getMonitorAreaContaining (getScreenBounds().getCentre()); | |||
| } | |||
| @@ -305,7 +305,7 @@ public: | |||
| int getRight() const noexcept { return bounds.getRight(); } | |||
| /** Returns the component's top-left position as a Point. */ | |||
| const Point<int> getPosition() const noexcept { return bounds.getPosition(); } | |||
| Point<int> getPosition() const noexcept { return bounds.getPosition(); } | |||
| /** Returns the y coordinate of the bottom edge of this component. | |||
| This is a distance in pixels from the top edge of the component's parent. | |||
| @@ -329,7 +329,7 @@ public: | |||
| This is like getBounds(), but returns the rectangle in local coordinates, In practice, it'll | |||
| return a rectangle with position (0, 0), and the same size as this component. | |||
| */ | |||
| const Rectangle<int> getLocalBounds() const noexcept; | |||
| Rectangle<int> getLocalBounds() const noexcept; | |||
| /** Returns the area of this component's parent which this component covers. | |||
| @@ -338,7 +338,7 @@ public: | |||
| the smallest rectangle that fully covers the component's transformed bounding box. | |||
| If this component has no parent, the return value will simply be the same as getBounds(). | |||
| */ | |||
| const Rectangle<int> getBoundsInParent() const noexcept; | |||
| Rectangle<int> getBoundsInParent() const noexcept; | |||
| /** Returns the region of this component that's not obscured by other, opaque components. | |||
| @@ -365,12 +365,12 @@ public: | |||
| /** Returns the position of this component's top-left corner relative to the screen's top-left. | |||
| @see getScreenBounds | |||
| */ | |||
| const Point<int> getScreenPosition() const; | |||
| Point<int> getScreenPosition() const; | |||
| /** Returns the bounds of this component, relative to the screen's top-left. | |||
| @see getScreenPosition | |||
| */ | |||
| const Rectangle<int> getScreenBounds() const; | |||
| Rectangle<int> getScreenBounds() const; | |||
| /** Converts a point to be relative to this component's coordinate space. | |||
| @@ -378,8 +378,8 @@ public: | |||
| component. If the sourceComponent parameter is null, the source point is assumed to be a global | |||
| screen coordinate. | |||
| */ | |||
| const Point<int> getLocalPoint (const Component* sourceComponent, | |||
| const Point<int>& pointRelativeToSourceComponent) const; | |||
| Point<int> getLocalPoint (const Component* sourceComponent, | |||
| const Point<int>& pointRelativeToSourceComponent) const; | |||
| /** Converts a rectangle to be relative to this component's coordinate space. | |||
| @@ -391,13 +391,13 @@ public: | |||
| may not actually be rectanglular when converted to the target space, so in that situation this will return | |||
| the smallest rectangle that fully contains the transformed area. | |||
| */ | |||
| const Rectangle<int> getLocalArea (const Component* sourceComponent, | |||
| const Rectangle<int>& areaRelativeToSourceComponent) const; | |||
| Rectangle<int> getLocalArea (const Component* sourceComponent, | |||
| const Rectangle<int>& areaRelativeToSourceComponent) const; | |||
| /** Converts a point relative to this component's top-left into a screen coordinate. | |||
| @see getLocalPoint, localAreaToGlobal | |||
| */ | |||
| const Point<int> localPointToGlobal (const Point<int>& localPoint) const; | |||
| Point<int> localPointToGlobal (const Point<int>& localPoint) const; | |||
| /** Converts a rectangle from this component's coordinate space to a screen coordinate. | |||
| @@ -406,7 +406,7 @@ public: | |||
| the smallest rectangle that fully contains the transformed area. | |||
| @see getLocalPoint, localPointToGlobal | |||
| */ | |||
| const Rectangle<int> localAreaToGlobal (const Rectangle<int>& localArea) const; | |||
| Rectangle<int> localAreaToGlobal (const Rectangle<int>& localArea) const; | |||
| //============================================================================== | |||
| /** Moves the component to a new position. | |||
| @@ -621,7 +621,7 @@ public: | |||
| For more details about transforms, see setTransform(). | |||
| @see setTransform | |||
| */ | |||
| const AffineTransform getTransform() const; | |||
| AffineTransform getTransform() const; | |||
| /** Returns true if a non-identity transform is being applied to this component. | |||
| For more details about transforms, see setTransform(). | |||
| @@ -662,7 +662,7 @@ public: | |||
| monitors, it will return the area of the monitor that contains the component's | |||
| centre. | |||
| */ | |||
| const Rectangle<int> getParentMonitorArea() const; | |||
| Rectangle<int> getParentMonitorArea() const; | |||
| //============================================================================== | |||
| /** Returns the number of child components that this component contains. | |||
| @@ -1022,8 +1022,8 @@ public: | |||
| @see paintEntireComponent | |||
| */ | |||
| const Image createComponentSnapshot (const Rectangle<int>& areaToGrab, | |||
| bool clipImageToComponentBounds = true); | |||
| Image createComponentSnapshot (const Rectangle<int>& areaToGrab, | |||
| bool clipImageToComponentBounds = true); | |||
| /** Draws this component and all its subcomponents onto the specified graphics | |||
| context. | |||
| @@ -1792,7 +1792,7 @@ public: | |||
| /** Returns the mouse's current position, relative to this component. | |||
| The return value is relative to the component's top-left corner. | |||
| */ | |||
| const Point<int> getMouseXYRelative() const; | |||
| Point<int> getMouseXYRelative() const; | |||
| //============================================================================== | |||
| /** Called when this component's size has been changed. | |||
| @@ -27,7 +27,6 @@ | |||
| #define __JUCE_DESKTOP_JUCEHEADER__ | |||
| #include "juce_Component.h" | |||
| #include "../../core/juce_Time.h" | |||
| #include "../../utilities/juce_DeletedAtShutdown.h" | |||
| #include "../../events/juce_Timer.h" | |||
| #include "../../events/juce_AsyncUpdater.h" | |||
| @@ -227,7 +227,7 @@ const KeyPress KeyPress::createFromDescription (const String& desc) | |||
| return KeyPress (key, ModifierKeys (modifiers), 0); | |||
| } | |||
| const String KeyPress::getTextDescription() const | |||
| String KeyPress::getTextDescription() const | |||
| { | |||
| String desc; | |||
| @@ -277,7 +277,7 @@ const String KeyPress::getTextDescription() const | |||
| return desc; | |||
| } | |||
| const String KeyPress::getTextDescriptionWithIcons() const | |||
| String KeyPress::getTextDescriptionWithIcons() const | |||
| { | |||
| #if JUCE_MAC | |||
| return getTextDescription().replace ("shift + ", String::charToString (0x21e7)) | |||
| @@ -146,14 +146,14 @@ public: | |||
| To store a keypress in a file, use this method, along with createFromDescription() | |||
| to retrieve it later. | |||
| */ | |||
| const String getTextDescription() const; | |||
| String getTextDescription() const; | |||
| /** Creates a textual description of the key combination, using unicode icon symbols if possible. | |||
| On OSX, this uses the Apple symbols for command, option, shift, etc, instead of the textual | |||
| modifier key descriptions that are returned by getTextDescription() | |||
| */ | |||
| const String getTextDescriptionWithIcons() const; | |||
| String getTextDescriptionWithIcons() const; | |||
| //============================================================================== | |||
| /** Checks whether the user is currently holding down the keys that make up this | |||
| @@ -278,7 +278,7 @@ const String TabbedButtonBar::getCurrentTabName() const | |||
| return tab == nullptr ? String::empty : tab->name; | |||
| } | |||
| const StringArray TabbedButtonBar::getTabNames() const | |||
| StringArray TabbedButtonBar::getTabNames() const | |||
| { | |||
| StringArray names; | |||
| @@ -183,7 +183,7 @@ public: | |||
| int getNumTabs() const; | |||
| /** Returns a list of all the tab names in the bar. */ | |||
| const StringArray getTabNames() const; | |||
| StringArray getTabNames() const; | |||
| /** Changes the currently selected tab. | |||
| @@ -188,7 +188,7 @@ int TabbedComponent::getNumTabs() const | |||
| return tabs->getNumTabs(); | |||
| } | |||
| const StringArray TabbedComponent::getTabNames() const | |||
| StringArray TabbedComponent::getTabNames() const | |||
| { | |||
| return tabs->getTabNames(); | |||
| } | |||
| @@ -128,7 +128,7 @@ public: | |||
| int getNumTabs() const; | |||
| /** Returns a list of all the tab names in the bar. */ | |||
| const StringArray getTabNames() const; | |||
| StringArray getTabNames() const; | |||
| /** Returns the content component that was added for the given index. | |||
| @@ -61,7 +61,7 @@ MouseEvent::~MouseEvent() noexcept | |||
| } | |||
| //============================================================================== | |||
| const MouseEvent MouseEvent::getEventRelativeTo (Component* const otherComponent) const noexcept | |||
| MouseEvent MouseEvent::getEventRelativeTo (Component* const otherComponent) const noexcept | |||
| { | |||
| if (otherComponent == nullptr) | |||
| { | |||
| @@ -75,7 +75,7 @@ const MouseEvent MouseEvent::getEventRelativeTo (Component* const otherComponent | |||
| mouseDownTime, numberOfClicks, wasMovedSinceMouseDown); | |||
| } | |||
| const MouseEvent MouseEvent::withNewPosition (const Point<int>& newPosition) const noexcept | |||
| MouseEvent MouseEvent::withNewPosition (const Point<int>& newPosition) const noexcept | |||
| { | |||
| return MouseEvent (source, newPosition, mods, eventComponent, originalComponent, | |||
| eventTime, mouseDownPos, mouseDownTime, | |||
| @@ -284,13 +284,13 @@ public: | |||
| The x and y positions of the event that is returned will have been | |||
| adjusted to be relative to the new component. | |||
| */ | |||
| const MouseEvent getEventRelativeTo (Component* otherComponent) const noexcept; | |||
| MouseEvent getEventRelativeTo (Component* otherComponent) const noexcept; | |||
| /** Creates a copy of this event with a different position. | |||
| All other members of the event object are the same, but the x and y are | |||
| replaced with these new values. | |||
| */ | |||
| const MouseEvent withNewPosition (const Point<int>& newPosition) const noexcept; | |||
| MouseEvent withNewPosition (const Point<int>& newPosition) const noexcept; | |||
| //============================================================================== | |||
| /** Changes the application-wide setting for the double-click time limit. | |||
| @@ -160,7 +160,7 @@ bool RelativeCoordinate::isDynamic() const | |||
| return term.usesAnySymbols(); | |||
| } | |||
| const String RelativeCoordinate::toString() const | |||
| String RelativeCoordinate::toString() const | |||
| { | |||
| return term.toString(); | |||
| } | |||
| @@ -102,7 +102,7 @@ public: | |||
| /** Returns a string which represents this coordinate. | |||
| For details of the string syntax, see the constructor notes. | |||
| */ | |||
| const String toString() const; | |||
| String toString() const; | |||
| //============================================================================== | |||
| /** A set of static strings that are commonly used by the RelativeCoordinate class. | |||