Browse Source

Introjucer: added a setting for JucePlugin_AUMainType. Added a method InputStream::getNumBytesRemaining()

tags/2021-05-28
jules 13 years ago
parent
commit
70133a94eb
6 changed files with 42 additions and 7 deletions
  1. +12
    -1
      extras/Introjucer/Source/Project/jucer_AudioPluginModule.h
  2. +3
    -0
      extras/Introjucer/Source/Project/jucer_ProjectType.cpp
  3. +7
    -3
      modules/juce_core/files/juce_File.cpp
  4. +1
    -1
      modules/juce_core/misc/juce_Result.h
  5. +10
    -0
      modules/juce_core/streams/juce_InputStream.cpp
  6. +9
    -2
      modules/juce_core/streams/juce_InputStream.h

+ 12
- 1
extras/Introjucer/Source/Project/jucer_AudioPluginModule.h View File

@@ -48,6 +48,7 @@ namespace
Value getPluginEditorNeedsKeyFocus (Project& project) { return project.getProjectValue ("pluginEditorRequiresKeys"); }
Value getPluginAUExportPrefix (Project& project) { return project.getProjectValue ("pluginAUExportPrefix"); }
Value getPluginAUCocoaViewClassName (Project& project) { return project.getProjectValue ("pluginAUViewClass"); }
Value getPluginAUMainType (Project& project) { return project.getProjectValue ("pluginAUMainType"); }
Value getPluginRTASCategory (Project& project) { return project.getProjectValue ("pluginRTASCategory"); }
String getPluginRTASCategoryCode (Project& project)
@@ -62,6 +63,16 @@ namespace
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)
{
StringArray configs;
@@ -108,7 +119,7 @@ namespace
flags.set ("JucePlugin_VersionString", project.getVersionString().quoted());
flags.set ("JucePlugin_VSTUniqueID", "JucePlugin_PluginCode");
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_AUExportPrefix", getPluginAUExportPrefix (project).toString());
flags.set ("JucePlugin_AUExportPrefixQuoted", getPluginAUExportPrefix (project).toString().quoted());


+ 3
- 0
extras/Introjucer/Source/Project/jucer_ProjectType.cpp View File

@@ -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 "
"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),
"(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, "


+ 7
- 3
modules/juce_core/files/juce_File.cpp View File

@@ -388,9 +388,13 @@ File File::getChildFile (String relativePath) const
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);
if (lastSlash >= 0)
@@ -403,7 +407,7 @@ File File::getChildFile (String relativePath) const
break;
}
}
else if (relativePath[1] == separator)
else if (secondChar == separator)
{
relativePath = relativePath.substring (2);
}


+ 1
- 1
modules/juce_core/misc/juce_Result.h View File

@@ -110,7 +110,7 @@ public:
private:
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
operator int() const;


+ 10
- 0
modules/juce_core/streams/juce_InputStream.cpp View File

@@ -23,6 +23,16 @@
==============================================================================
*/
int64 InputStream::getNumBytesRemaining()
{
int64 len = getTotalLength();
if (len >= 0)
len -= getPosition();
return len;
}
char InputStream::readByte()
{
char temp = 0;


+ 9
- 2
modules/juce_core/streams/juce_InputStream.h View File

@@ -50,11 +50,18 @@ public:
Note that this is the number of bytes available from the start of the
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;
//==============================================================================
/** 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. */
virtual bool isExhausted() = 0;


Loading…
Cancel
Save