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.

68 lines
2.0KB

  1. /*
  2. ==============================================================================
  3. This file is part of the Water library.
  4. Copyright (c) 2015 ROLI Ltd.
  5. Copyright (C) 2018 Filipe Coelho <falktx@falktx.com>
  6. Permission is granted to use this software under the terms of either:
  7. a) the GPL v2 (or any later version)
  8. b) the Affero GPL v3
  9. Details of these licenses can be found at: www.gnu.org/licenses
  10. Water is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ==============================================================================
  14. */
  15. #include "AudioFormat.h"
  16. #include "../files/File.h"
  17. namespace water {
  18. AudioFormat::AudioFormat (String name, StringArray extensions)
  19. : formatName (name), fileExtensions (extensions)
  20. {
  21. }
  22. AudioFormat::AudioFormat (StringRef name, StringRef extensions)
  23. : formatName (name.text), fileExtensions (StringArray::fromTokens (extensions, false))
  24. {
  25. }
  26. AudioFormat::~AudioFormat()
  27. {
  28. }
  29. bool AudioFormat::canHandleFile (const File& f)
  30. {
  31. for (int i = 0; i < fileExtensions.size(); ++i)
  32. if (f.hasFileExtension (fileExtensions[i]))
  33. return true;
  34. return false;
  35. }
  36. const String& AudioFormat::getFormatName() const { return formatName; }
  37. const StringArray& AudioFormat::getFileExtensions() const { return fileExtensions; }
  38. bool AudioFormat::isCompressed() { return false; }
  39. StringArray AudioFormat::getQualityOptions() { return StringArray(); }
  40. #if 0
  41. MemoryMappedAudioFormatReader* AudioFormat::createMemoryMappedReader (const File&)
  42. {
  43. return nullptr;
  44. }
  45. MemoryMappedAudioFormatReader* AudioFormat::createMemoryMappedReader (FileInputStream* fin)
  46. {
  47. delete fin;
  48. return nullptr;
  49. }
  50. #endif
  51. }