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.

69 lines
2.4KB

  1. /*
  2. ==============================================================================
  3. This file is part of the Water library.
  4. Copyright (c) 2016 ROLI Ltd.
  5. Copyright (C) 2017 Filipe Coelho <falktx@falktx.com>
  6. Permission is granted to use this software under the terms of the ISC license
  7. http://www.isc.org/downloads/software-support-policy/isc-license/
  8. Permission to use, copy, modify, and/or distribute this software for any
  9. purpose with or without fee is hereby granted, provided that the above
  10. copyright notice and this permission notice appear in all copies.
  11. THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
  12. TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  13. FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
  14. OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  15. USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  17. OF THIS SOFTWARE.
  18. ==============================================================================
  19. */
  20. #ifndef WATER_FILEINPUTSOURCE_H_INCLUDED
  21. #define WATER_FILEINPUTSOURCE_H_INCLUDED
  22. #include "InputSource.h"
  23. #include "../files/File.h"
  24. namespace water {
  25. //==============================================================================
  26. /**
  27. A type of InputSource that represents a normal file.
  28. @see InputSource
  29. */
  30. class FileInputSource : public InputSource
  31. {
  32. public:
  33. //==============================================================================
  34. /** Creates a FileInputSource for a file.
  35. If the useFileTimeInHashGeneration parameter is true, then this object's
  36. hashCode() method will incorporate the file time into its hash code; if
  37. false, only the file name will be used for the hash.
  38. */
  39. FileInputSource (const File& file, bool useFileTimeInHashGeneration = false);
  40. /** Destructor. */
  41. ~FileInputSource();
  42. InputStream* createInputStream();
  43. InputStream* createInputStreamFor (const String& relatedItemPath);
  44. int64 hashCode() const;
  45. private:
  46. //==============================================================================
  47. const File file;
  48. bool useFileTimeInHashGeneration;
  49. CARLA_DECLARE_NON_COPY_CLASS (FileInputSource)
  50. };
  51. }
  52. #endif // WATER_FILEINPUTSOURCE_H_INCLUDED