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.

38 lines
1.5KB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla plugin host
  4. # Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com>
  5. #
  6. # This program is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License as
  8. # published by the Free Software Foundation; either version 2 of
  9. # the License, or any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # For a full copy of the GNU General Public License see the doc/GPL.txt file.
  17. # ---------------------------------------------------------------------------------------------------------------------
  18. # Imports (Global)
  19. from PyQt5.QtCore import QSettings
  20. # ---------------------------------------------------------------------------------------------------------------------
  21. # Safer QSettings class, which does not throw if type mismatches
  22. class QSafeSettings(QSettings):
  23. def value(self, key, defaultValue, valueType):
  24. if not isinstance(defaultValue, valueType):
  25. print("QSafeSettings.value() - defaultValue type mismatch for key", key)
  26. try:
  27. return QSettings.value(self, key, defaultValue, valueType)
  28. except:
  29. return defaultValue
  30. # ---------------------------------------------------------------------------------------------------------------------