| @@ -48,6 +48,7 @@ namespace | |||||
| Value getPluginEditorNeedsKeyFocus (Project& project) { return project.getProjectValue ("pluginEditorRequiresKeys"); } | Value getPluginEditorNeedsKeyFocus (Project& project) { return project.getProjectValue ("pluginEditorRequiresKeys"); } | ||||
| Value getPluginAUExportPrefix (Project& project) { return project.getProjectValue ("pluginAUExportPrefix"); } | Value getPluginAUExportPrefix (Project& project) { return project.getProjectValue ("pluginAUExportPrefix"); } | ||||
| Value getPluginAUCocoaViewClassName (Project& project) { return project.getProjectValue ("pluginAUViewClass"); } | Value getPluginAUCocoaViewClassName (Project& project) { return project.getProjectValue ("pluginAUViewClass"); } | ||||
| Value getPluginAUMainType (Project& project) { return project.getProjectValue ("pluginAUMainType"); } | |||||
| Value getPluginRTASCategory (Project& project) { return project.getProjectValue ("pluginRTASCategory"); } | Value getPluginRTASCategory (Project& project) { return project.getProjectValue ("pluginRTASCategory"); } | ||||
| String getPluginRTASCategoryCode (Project& project) | String getPluginRTASCategoryCode (Project& project) | ||||
| @@ -62,6 +63,16 @@ namespace | |||||
| return s; | return s; | ||||
| } | } | ||||
| String getAUMainTypeString (Project& project) | |||||
| { | |||||
| String s (getPluginAUMainType (project).toString()); | |||||
| if (s.isEmpty()) | |||||
| s = static_cast <bool> (getPluginIsSynth (project).getValue()) ? "kAudioUnitType_MusicDevice" | |||||
| : "kAudioUnitType_Effect"; | |||||
| return s; | |||||
| } | |||||
| int countMaxPluginChannels (const String& configString, bool isInput) | int countMaxPluginChannels (const String& configString, bool isInput) | ||||
| { | { | ||||
| StringArray configs; | StringArray configs; | ||||
| @@ -108,7 +119,7 @@ namespace | |||||
| flags.set ("JucePlugin_VersionString", project.getVersionString().quoted()); | flags.set ("JucePlugin_VersionString", project.getVersionString().quoted()); | ||||
| flags.set ("JucePlugin_VSTUniqueID", "JucePlugin_PluginCode"); | flags.set ("JucePlugin_VSTUniqueID", "JucePlugin_PluginCode"); | ||||
| flags.set ("JucePlugin_VSTCategory", static_cast <bool> (getPluginIsSynth (project).getValue()) ? "kPlugCategSynth" : "kPlugCategEffect"); | flags.set ("JucePlugin_VSTCategory", static_cast <bool> (getPluginIsSynth (project).getValue()) ? "kPlugCategSynth" : "kPlugCategEffect"); | ||||
| flags.set ("JucePlugin_AUMainType", static_cast <bool> (getPluginIsSynth (project).getValue()) ? "kAudioUnitType_MusicDevice" : "kAudioUnitType_Effect"); | |||||
| flags.set ("JucePlugin_AUMainType", getAUMainTypeString (project)); | |||||
| flags.set ("JucePlugin_AUSubType", "JucePlugin_PluginCode"); | flags.set ("JucePlugin_AUSubType", "JucePlugin_PluginCode"); | ||||
| flags.set ("JucePlugin_AUExportPrefix", getPluginAUExportPrefix (project).toString()); | flags.set ("JucePlugin_AUExportPrefix", getPluginAUExportPrefix (project).toString()); | ||||
| flags.set ("JucePlugin_AUExportPrefixQuoted", getPluginAUExportPrefix (project).toString().quoted()); | flags.set ("JucePlugin_AUExportPrefixQuoted", getPluginAUExportPrefix (project).toString().quoted()); | ||||
| @@ -253,6 +253,9 @@ public: | |||||
| "In an AU, this is the name of Cocoa class that creates the UI. Some hosts bizarrely display the class-name, so you might want to make it reflect your plugin. But the name must be " | "In an AU, this is the name of Cocoa class that creates the UI. Some hosts bizarrely display the class-name, so you might want to make it reflect your plugin. But the name must be " | ||||
| "UNIQUE to this exact version of your plugin, to avoid objective-C linkage mix-ups that happen when different plugins containing the same class-name are loaded simultaneously."); | "UNIQUE to this exact version of your plugin, to avoid objective-C linkage mix-ups that happen when different plugins containing the same class-name are loaded simultaneously."); | ||||
| props.add (new TextPropertyComponent (getPluginAUMainType (project), "Plugin AU Main Type", 128, false), | |||||
| "In an AU, this is the value that is set as JucePlugin_AUMainType. Leave it blank unless you want to use a custom value."); | |||||
| props.add (new TextPropertyComponent (getPluginRTASCategory (project), "Plugin RTAS Category", 64, false), | props.add (new TextPropertyComponent (getPluginRTASCategory (project), "Plugin RTAS Category", 64, false), | ||||
| "(Leave this blank if your plugin is a synth). This is one of the RTAS categories from FicPluginEnums.h, such as: ePlugInCategory_None, ePlugInCategory_EQ, ePlugInCategory_Dynamics, " | "(Leave this blank if your plugin is a synth). This is one of the RTAS categories from FicPluginEnums.h, such as: ePlugInCategory_None, ePlugInCategory_EQ, ePlugInCategory_Dynamics, " | ||||
| "ePlugInCategory_PitchShift, ePlugInCategory_Reverb, ePlugInCategory_Delay, " | "ePlugInCategory_PitchShift, ePlugInCategory_Reverb, ePlugInCategory_Delay, " | ||||
| @@ -388,9 +388,13 @@ File File::getChildFile (String relativePath) const | |||||
| while (relativePath[0] == '.') | while (relativePath[0] == '.') | ||||
| { | { | ||||
| if (relativePath[1] == '.') | |||||
| const juce_wchar secondChar = relativePath[1]; | |||||
| if (secondChar == '.') | |||||
| { | { | ||||
| if (relativePath[2] == 0 || relativePath[2] == separator) | |||||
| const juce_wchar thirdChar = relativePath[2]; | |||||
| if (thirdChar == 0 || thirdChar == separator) | |||||
| { | { | ||||
| const int lastSlash = path.lastIndexOfChar (separator); | const int lastSlash = path.lastIndexOfChar (separator); | ||||
| if (lastSlash >= 0) | if (lastSlash >= 0) | ||||
| @@ -403,7 +407,7 @@ File File::getChildFile (String relativePath) const | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| else if (relativePath[1] == separator) | |||||
| else if (secondChar == separator) | |||||
| { | { | ||||
| relativePath = relativePath.substring (2); | relativePath = relativePath.substring (2); | ||||
| } | } | ||||
| @@ -110,7 +110,7 @@ public: | |||||
| private: | private: | ||||
| String errorMessage; | String errorMessage; | ||||
| explicit Result (const String& errorMessage) noexcept; | |||||
| explicit Result (const String&) noexcept; | |||||
| // These casts are private to prevent people trying to use the Result object in numeric contexts | // These casts are private to prevent people trying to use the Result object in numeric contexts | ||||
| operator int() const; | operator int() const; | ||||
| @@ -23,6 +23,16 @@ | |||||
| ============================================================================== | ============================================================================== | ||||
| */ | */ | ||||
| int64 InputStream::getNumBytesRemaining() | |||||
| { | |||||
| int64 len = getTotalLength(); | |||||
| if (len >= 0) | |||||
| len -= getPosition(); | |||||
| return len; | |||||
| } | |||||
| char InputStream::readByte() | char InputStream::readByte() | ||||
| { | { | ||||
| char temp = 0; | char temp = 0; | ||||
| @@ -50,11 +50,18 @@ public: | |||||
| Note that this is the number of bytes available from the start of the | Note that this is the number of bytes available from the start of the | ||||
| stream, not from the current position. | stream, not from the current position. | ||||
| If the size of the stream isn't actually known, this may return -1. | |||||
| If the size of the stream isn't actually known, this will return -1. | |||||
| @see getNumBytesRemaining | |||||
| */ | */ | ||||
| virtual int64 getTotalLength() = 0; | virtual int64 getTotalLength() = 0; | ||||
| //============================================================================== | |||||
| /** Returns the number of bytes available for reading, or a negative value if | |||||
| the remaining length is not known. | |||||
| @see getTotalLength | |||||
| */ | |||||
| int64 getNumBytesRemaining(); | |||||
| /** Returns true if the stream has no more data to read. */ | /** Returns true if the stream has no more data to read. */ | ||||
| virtual bool isExhausted() = 0; | virtual bool isExhausted() = 0; | ||||