/[svn]/linuxsampler/trunk/src/plugins/InstrumentEditorFactory.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/plugins/InstrumentEditorFactory.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1602 by schoenebeck, Sat Dec 29 22:02:29 2007 UTC revision 1653 by schoenebeck, Wed Jan 30 01:51:46 2008 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2007 Christian Schoenebeck                              *   *   Copyright (C) 2007, 2008 Christian Schoenebeck                        *
4   *                                                                         *   *                                                                         *
5   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
6   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 175  namespace LinuxSampler { Line 175  namespace LinuxSampler {
175              } while (FindNextFile(hDir, &win32FindData));              } while (FindNextFile(hDir, &win32FindData));
176              if (hDir != INVALID_HANDLE_VALUE) FindClose(hDir);              if (hDir != INVALID_HANDLE_VALUE) FindClose(hDir);
177              #else // POSIX              #else // POSIX
178                            #if defined(__APPLE__)  /*  20071224 Toshi Nagata  */
179                            String Config_plugin_dir = (String)CONFIG_PLUGIN_DIR;
180                            if (Config_plugin_dir.find("~") == 0)
181                                       Config_plugin_dir.replace(0, 1, getenv("HOME"));
182                            DIR* hDir = opendir(Config_plugin_dir.c_str());
183                            #else
184              DIR* hDir = opendir(CONFIG_PLUGIN_DIR);              DIR* hDir = opendir(CONFIG_PLUGIN_DIR);
185                            #endif
186              if (!hDir) {              if (!hDir) {
187                  std::cerr << "Could not open instrument editor plugins directory "                  std::cerr << "Could not open instrument editor plugins directory "
188                            << "(" << CONFIG_PLUGIN_DIR << "): "                            << "(" << CONFIG_PLUGIN_DIR << "): "
# Line 184  namespace LinuxSampler { Line 191  namespace LinuxSampler {
191              }              }
192              for (dirent* pEntry = readdir(hDir); pEntry; pEntry = readdir(hDir)) {              for (dirent* pEntry = readdir(hDir); pEntry; pEntry = readdir(hDir)) {
193                  // dir entry name as full qualified path                  // dir entry name as full qualified path
194                            #if defined(__APPLE__)  /*  20080110 Toshi Nagata  */
195                    const String sPath = Config_plugin_dir + ("/" + String(pEntry->d_name));
196                            #else
197                  const String sPath = CONFIG_PLUGIN_DIR + ("/" + String(pEntry->d_name));                  const String sPath = CONFIG_PLUGIN_DIR + ("/" + String(pEntry->d_name));
198                            #endif
199                  // skip entries that are not regular files                  // skip entries that are not regular files
200                  struct stat entry_stat;                  struct stat entry_stat;
201                  if (lstat(sPath.c_str(), &entry_stat) != 0 ||                  if (lstat(sPath.c_str(), &entry_stat) != 0 ||
# Line 199  namespace LinuxSampler { Line 210  namespace LinuxSampler {
210                  void* pDLL = dlopen(sPath.c_str(), RTLD_NOW);                  void* pDLL = dlopen(sPath.c_str(), RTLD_NOW);
211                  if (pDLL) LoadedDLLs.push_back(pDLL);                  if (pDLL) LoadedDLLs.push_back(pDLL);
212                  else {                  else {
213                      std::cerr << "Failed to load instrument editor plugin: "                      std::cerr << "Failed to load instrument editor plugin: '"
214                                << sPath << std::endl;                                << sPath << "', cause: " << dlerror() << std::endl;
215                  }                  }
216              }              }
217              closedir(hDir);              closedir(hDir);

Legend:
Removed from v.1602  
changed lines
  Added in v.1653

  ViewVC Help
Powered by ViewVC