Browse Source

Moved dependency path key strings into better location (DependencyPath utility class)

tags/2021-05-28
Timur Doumler 9 years ago
parent
commit
d9cd459032
6 changed files with 41 additions and 39 deletions
  1. +24
    -30
      extras/Introjucer/Source/Application/jucer_GlobalPreferences.cpp
  2. +0
    -3
      extras/Introjucer/Source/Application/jucer_GlobalPreferences.h
  3. +2
    -2
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_Android.h
  4. +3
    -3
      extras/Introjucer/Source/Project/jucer_AudioPluginModule.h
  5. +7
    -0
      extras/Introjucer/Source/Project/jucer_DependencyPathPropertyComponent.cpp
  6. +5
    -1
      extras/Introjucer/Source/Project/jucer_DependencyPathPropertyComponent.h

+ 24
- 30
extras/Introjucer/Source/Application/jucer_GlobalPreferences.cpp View File

@@ -12,13 +12,7 @@
#include "jucer_GlobalPreferences.h"
//==============================================================================
const String PathSettingsTab::vst2KeyName = "vst2Path";
const String PathSettingsTab::vst3KeyName = "vst3Path";
const String PathSettingsTab::rtasKeyName = "rtasPath";
const String PathSettingsTab::aaxKeyName = "aaxPath";
const String PathSettingsTab::androidSdkKeyName = "androidSdkPath";
const String PathSettingsTab::androidNdkKeyName = "androidNdkPath";
//==============================================================================
class AppearanceSettingsTab : public GlobalPreferencesTab,
@@ -47,16 +41,16 @@ PathSettingsTab::PathSettingsTab (DependencyPathOS os)
{
const int maxChars = 1024;
vst2PathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (vst2KeyName, os), "VST SDK", maxChars, false));
vst3PathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (vst3KeyName, os), "VST3 SDK", maxChars, false));
vst2PathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (DependencyPath::vst2KeyName, os), "VST SDK", maxChars, false));
vst3PathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (DependencyPath::vst3KeyName, os), "VST3 SDK", maxChars, false));
#if ! JUCE_LINUX
rtasPathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (rtasKeyName, os), "RTAS SDK", maxChars, false));
aaxPathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (aaxKeyName, os), "AAX SDK", maxChars, false));
rtasPathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (DependencyPath::rtasKeyName, os), "RTAS SDK", maxChars, false));
aaxPathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (DependencyPath::aaxKeyName, os), "AAX SDK", maxChars, false));
#endif
androidSdkPathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (androidSdkKeyName, os), "Android SDK", maxChars, false));
androidNdkPathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (androidNdkKeyName, os), "Android NDK", maxChars, false));
androidSdkPathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (DependencyPath::androidSdkKeyName, os), "Android SDK", maxChars, false));
androidNdkPathComponent = pathComponents.add (new TextPropertyComponent (getPathByKey (DependencyPath::androidNdkKeyName, os), "Android NDK", maxChars, false));
for (TextPropertyComponent** component = pathComponents.begin(); component != pathComponents.end(); ++component)
{
@@ -80,12 +74,12 @@ void PathSettingsTab::textPropertyComponentChanged (TextPropertyComponent* textP
String PathSettingsTab::getKeyForPropertyComponent (TextPropertyComponent* component) const
{
if (component == vst2PathComponent) return vst2KeyName;
if (component == vst3PathComponent) return vst3KeyName;
if (component == rtasPathComponent) return rtasKeyName;
if (component == aaxPathComponent) return aaxKeyName;
if (component == androidSdkPathComponent) return androidSdkKeyName;
if (component == androidNdkPathComponent) return androidNdkKeyName;
if (component == vst2PathComponent) return DependencyPath::vst2KeyName;
if (component == vst3PathComponent) return DependencyPath::vst3KeyName;
if (component == rtasPathComponent) return DependencyPath::rtasKeyName;
if (component == aaxPathComponent) return DependencyPath::aaxKeyName;
if (component == androidSdkPathComponent) return DependencyPath::androidSdkKeyName;
if (component == androidNdkPathComponent) return DependencyPath::androidNdkKeyName;
// this property component does not have a key associated to it!
jassertfalse;
@@ -128,11 +122,11 @@ Value& PathSettingsTab::getPathByKey (const String& key, DependencyPathOS os)
//==============================================================================
String PathSettingsTab::getFallbackPathByKey (const String& key, DependencyPathOS os)
{
if (key == vst2KeyName || key == vst3KeyName)
if (key == DependencyPath::vst2KeyName || key == DependencyPath::vst3KeyName)
return os == DependencyPath::windows ? "c:\\SDKs\\VST3 SDK"
: "~/SDKs/VST3 SDK";
if (key == rtasKeyName)
if (key == DependencyPath::rtasKeyName)
{
if (os == DependencyPath::windows) return "c:\\SDKs\\PT_80_SDK";
if (os == DependencyPath::osx) return "~/SDKs/PT_80_SDK";
@@ -142,7 +136,7 @@ String PathSettingsTab::getFallbackPathByKey (const String& key, DependencyPathO
return String();
}
if (key == aaxKeyName)
if (key == DependencyPath::aaxKeyName)
{
if (os == DependencyPath::windows) return "c:\\SDKs\\AAX";
if (os == DependencyPath::osx) return "~/SDKs/AAX" ;
@@ -152,11 +146,11 @@ String PathSettingsTab::getFallbackPathByKey (const String& key, DependencyPathO
return String();
}
if (key == androidSdkKeyName)
if (key == DependencyPath::androidSdkKeyName)
return os == DependencyPath::windows ? "c:\\SDKs\\android-sdk"
: "~/Library/Android/sdk";
if (key == androidNdkKeyName)
if (key == DependencyPath::androidNdkKeyName)
return os == DependencyPath::windows ? "c:\\SDKs\\android-ndk"
: "~/Library/Android/ndk";
@@ -170,23 +164,23 @@ bool PathSettingsTab::checkPathByKey (const String& key, const String& path)
{
String fileToCheckFor;
if (key == vst2KeyName)
if (key == DependencyPath::vst2KeyName)
{
fileToCheckFor = "public.sdk/source/vst2.x/audioeffectx.h";
}
else if (key == vst3KeyName)
else if (key == DependencyPath::vst3KeyName)
{
fileToCheckFor = "base/source/baseiids.cpp";
}
else if (key == rtasKeyName)
else if (key == DependencyPath::rtasKeyName)
{
fileToCheckFor = "AlturaPorts/TDMPlugIns/PlugInLibrary/EffectClasses/CEffectProcessMIDI.cpp";
}
else if (key == aaxKeyName)
else if (key == DependencyPath::aaxKeyName)
{
fileToCheckFor = "Interfaces/AAX_Exports.cpp";
}
else if (key == androidSdkKeyName)
else if (key == DependencyPath::androidSdkKeyName)
{
#if JUCE_WINDOWS
fileToCheckFor = "platform-tools/adb.exe";
@@ -194,7 +188,7 @@ bool PathSettingsTab::checkPathByKey (const String& key, const String& path)
fileToCheckFor = "platform-tools/adb";
#endif
}
else if (key == androidNdkKeyName)
else if (key == DependencyPath::androidNdkKeyName)
{
#if JUCE_WINDOWS
fileToCheckFor = "ndk-depends.exe";


+ 0
- 3
extras/Introjucer/Source/Application/jucer_GlobalPreferences.h View File

@@ -47,9 +47,6 @@ public:
static String getFallbackPathByKey (const String& key, DependencyPathOS);
static bool checkPathByKey (const String& key, const String& path);
const static String vst2KeyName, vst3KeyName, rtasKeyName, aaxKeyName,
androidSdkKeyName, androidNdkKeyName;
private:
void textPropertyComponentChanged (TextPropertyComponent*) override;


+ 2
- 2
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_Android.h View File

@@ -83,10 +83,10 @@ public:
props.add (new TextPropertyComponent (getVersionCodeValue(), "Android Version Code", 32, false),
"An integer value that represents the version of the application code, relative to other versions.");
props.add (new DependencyPathPropertyComponent (getSDKPathValue(), "Android SDK Path", PathSettingsTab::androidSdkKeyName),
props.add (new DependencyPathPropertyComponent (getSDKPathValue(), "Android SDK Path", DependencyPath::androidSdkKeyName),
"The path to the Android SDK folder on the target build machine");
props.add (new DependencyPathPropertyComponent (getNDKPathValue(), "Android NDK Path", PathSettingsTab::androidNdkKeyName),
props.add (new DependencyPathPropertyComponent (getNDKPathValue(), "Android NDK Path", DependencyPath::androidNdkKeyName),
"The path to the Android NDK folder on the target build machine");
props.add (new TextPropertyComponent (getMinimumSDKVersionValue(), "Minimum SDK version", 32, false),


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

@@ -266,7 +266,7 @@ namespace VSTHelpers
props.add (new DependencyPathPropertyComponent (getVSTFolder (exporter, isVST3),
vstFormat + " Folder",
isVST3 ? PathSettingsTab::vst3KeyName : PathSettingsTab::vst2KeyName,
isVST3 ? DependencyPath::vst3KeyName : DependencyPath::vst2KeyName,
getDependencyPathOS (exporter)),
"If you're building a " + vstFormat + ", this must be the folder containing the " + vstFormat + " SDK. This should be an absolute path.");
}
@@ -476,7 +476,7 @@ namespace RTASHelpers
props.add (new DependencyPathPropertyComponent (getRTASFolder (exporter),
"RTAS Folder",
PathSettingsTab::rtasKeyName,
DependencyPath::rtasKeyName,
getDependencyPathOS (exporter)),
"If you're building an RTAS, this must be the folder containing the RTAS SDK. This should be an absolute path.");
}
@@ -663,7 +663,7 @@ namespace AAXHelpers
props.add (new DependencyPathPropertyComponent (getAAXFolder (exporter),
"AAX SDK Folder",
PathSettingsTab::aaxKeyName,
DependencyPath::aaxKeyName,
getDependencyPathOS (exporter)),
"If you're building an AAX, this must be the folder containing the AAX SDK. This should be an absolute path.");
}


+ 7
- 0
extras/Introjucer/Source/Project/jucer_DependencyPathPropertyComponent.cpp View File

@@ -12,6 +12,13 @@
#include "jucer_DependencyPathPropertyComponent.h"
#include "../Application/jucer_GlobalPreferences.h"
//==============================================================================
const String DependencyPath::vst2KeyName = "vst2Path";
const String DependencyPath::vst3KeyName = "vst3Path";
const String DependencyPath::rtasKeyName = "rtasPath";
const String DependencyPath::aaxKeyName = "aaxPath";
const String DependencyPath::androidSdkKeyName = "androidSdkPath";
const String DependencyPath::androidNdkKeyName = "androidNdkPath";
//==============================================================================
DependencyPathPropertyComponent::DependencyPathPropertyComponent (const Value& value,


+ 5
- 1
extras/Introjucer/Source/Project/jucer_DependencyPathPropertyComponent.h View File

@@ -12,8 +12,9 @@
#define JUCER_DEPENDENCYPATHPROPERTYCOMPONENT_H_INCLUDED
//==============================================================================
namespace DependencyPath
class DependencyPath
{
public:
enum OS
{
windows = 0,
@@ -34,6 +35,9 @@ namespace DependencyPath
return DependencyPath::unknown;
#endif
}
const static String vst2KeyName, vst3KeyName, rtasKeyName, aaxKeyName,
androidSdkKeyName, androidNdkKeyName;
};
typedef DependencyPath::OS DependencyPathOS;


Loading…
Cancel
Save