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.

64 lines
2.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. DirectoryContentsDisplayComponent::DirectoryContentsDisplayComponent (DirectoryContentsList& l)
  16. : directoryContentsList (l)
  17. {
  18. }
  19. DirectoryContentsDisplayComponent::~DirectoryContentsDisplayComponent()
  20. {
  21. }
  22. //==============================================================================
  23. FileBrowserListener::~FileBrowserListener()
  24. {
  25. }
  26. void DirectoryContentsDisplayComponent::addListener (FileBrowserListener* l) { listeners.add (l); }
  27. void DirectoryContentsDisplayComponent::removeListener (FileBrowserListener* l) { listeners.remove (l); }
  28. void DirectoryContentsDisplayComponent::sendSelectionChangeMessage()
  29. {
  30. Component::BailOutChecker checker (dynamic_cast<Component*> (this));
  31. listeners.callChecked (checker, [] (FileBrowserListener& l) { l.selectionChanged(); });
  32. }
  33. void DirectoryContentsDisplayComponent::sendMouseClickMessage (const File& file, const MouseEvent& e)
  34. {
  35. if (directoryContentsList.getDirectory().exists())
  36. {
  37. Component::BailOutChecker checker (dynamic_cast<Component*> (this));
  38. listeners.callChecked (checker, [&] (FileBrowserListener& l) { l.fileClicked (file, e); });
  39. }
  40. }
  41. void DirectoryContentsDisplayComponent::sendDoubleClickMessage (const File& file)
  42. {
  43. if (directoryContentsList.getDirectory().exists())
  44. {
  45. Component::BailOutChecker checker (dynamic_cast<Component*> (this));
  46. listeners.callChecked (checker, [&] (FileBrowserListener& l) { l.fileDoubleClicked (file); });
  47. }
  48. }
  49. } // namespace juce