Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.2KB

  1. /*
  2. * Carla DSSI utils
  3. * Copyright (C) 2013 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifndef CARLA_DSSI_UTILS_HPP_INCLUDED
  18. #define CARLA_DSSI_UTILS_HPP_INCLUDED
  19. #include "CarlaLadspaUtils.hpp"
  20. #include "dssi/dssi.h"
  21. // TODO - put this in a cpp file
  22. //#include <QtCore/QDir>
  23. //#include <QtCore/QFileInfo>
  24. //#include <QtCore/QStringList>
  25. // -----------------------------------------------------------------------
  26. //static inline
  27. const char* find_dssi_ui(const char* const filename, const char* const label);
  28. #if 0
  29. {
  30. CARLA_SAFE_ASSERT_RETURN(filename != nullptr && filename[0] != '\0', nullptr);
  31. CARLA_SAFE_ASSERT_RETURN(label != nullptr && label[0] != '\0', nullptr);
  32. carla_debug("find_dssi_ui(\"%s\", \"%s\")", filename, label);
  33. QString guiFilename;
  34. QString pluginDir(filename);
  35. pluginDir.resize(pluginDir.lastIndexOf("."));
  36. QString checkLabel(label);
  37. QString checkSName(QFileInfo(pluginDir).baseName());
  38. if (! checkLabel.endsWith("_")) checkLabel += "_";
  39. if (! checkSName.endsWith("_")) checkSName += "_";
  40. QStringList guiFiles(QDir(pluginDir).entryList());
  41. foreach (const QString& gui, guiFiles)
  42. {
  43. if (gui.startsWith(checkLabel) || gui.startsWith(checkSName))
  44. {
  45. QFileInfo finalname(pluginDir + QDir::separator() + gui);
  46. guiFilename = finalname.absoluteFilePath();
  47. break;
  48. }
  49. }
  50. if (guiFilename.isEmpty())
  51. return nullptr;
  52. return carla_strdup(guiFilename.toUtf8().constData());
  53. }
  54. #endif
  55. // -----------------------------------------------------------------------
  56. #endif // CARLA_DSSI_UTILS_HPP_INCLUDED