Ejemplo n.º 1
0
LinkedList getVst2xPluginLocations(CharString currentDirectory) {
  LinkedList locations = newLinkedList();
  CharString locationBuffer;
  const char* programFiles = (!isExecutable64Bit() && isHost64Bit()) ?
    kPlatformWindows32BitProgramFolder : kPlatformWindowsProgramFolder;

  linkedListAppend(locations, currentDirectory);

  locationBuffer = newCharString();
  snprintf(locationBuffer->data, (size_t)(locationBuffer->length), "C:\\VstPlugins");
  linkedListAppend(locations, locationBuffer);

  locationBuffer = newCharString();
  snprintf(locationBuffer->data, (size_t)(locationBuffer->length), "%s\\VstPlugIns", programFiles);
  linkedListAppend(locations, locationBuffer);

  locationBuffer = newCharString();
  snprintf(locationBuffer->data, (size_t)(locationBuffer->length), "%s\\Common Files\\VstPlugIns", programFiles);
  linkedListAppend(locations, locationBuffer);

  locationBuffer = newCharString();
  snprintf(locationBuffer->data, (size_t)(locationBuffer->length), "%s\\Steinberg\\VstPlugIns", programFiles);
  linkedListAppend(locations, locationBuffer);

  return locations;
}
Ejemplo n.º 2
0
static void printWelcomeMessage(int argc, char** argv) {
  CharString stringBuffer = newCharString();
  CharString versionString = buildInfoGetVersionString();
  char* space;
  int i;

  logInfo("%s initialized, build %ld", versionString->data, buildInfoGetDatestamp());
  // Recycle to use for the platform name
  freeCharString(stringBuffer);
  freeCharString(versionString);

  if(isExecutable64Bit()) {
    logWarn("Running in 64-bit mode, this is experimental. Hold on to your hats!");
  }

  // Prevent a bunch of silly work in case the log level isn't debug
  if(isLogLevelAtLeast(LOG_DEBUG)) {
    stringBuffer = getPlatformName();
    logDebug("Host platform is %s (%s)", getShortPlatformName(), stringBuffer->data);
    logDebug("Application is %d-bit", isExecutable64Bit() ? 64 : 32);
    freeCharString(stringBuffer);

    stringBuffer = newCharString();
    for(i = 1; i < argc; i++) {
      space = strchr(argv[i], ' ');
      if(space != NULL) {
        charStringAppendCString(stringBuffer, "\"");
      }
      charStringAppendCString(stringBuffer, argv[i]);
      if(space != NULL) {
        charStringAppendCString(stringBuffer, "\"");
      }
      charStringAppendCString(stringBuffer, " ");
    }
    logDebug("Launched with options: %s", stringBuffer->data);
    freeCharString(stringBuffer);
  }
}
Ejemplo n.º 3
0
static int _testGetShortPlatformName(void) {
  CharString p = newCharStringWithCString(getShortPlatformName());
#if LINUX
  if(isHost64Bit() && isExecutable64Bit()) {
    assertCharStringEquals(p, "Linux-x86_64");
  }
  else {
    assertCharStringEquals(p, "Linux-i686");
  }
#elif MACOSX
  assertCharStringEquals(p, "Mac OS X");
#elif WINDOWS
  if(isHost64Bit() && isExecutable64Bit()) {
    assertCharStringEquals(p, "Windows 64-bit");
  }
  else {
    assertCharStringEquals(p, "Windows 32-bit");
  }
#else
  assertCharStringEquals(p, "Unsupported");
#endif
  freeCharString(p);
  return 0;
}