audio.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* audio.cpp - audio related nodes
  2. * Copyright (C) 2017 caryoscelus
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #include <core/node_info.h>
  18. #include <core/node/node.h>
  19. #include <core/node/property.h>
  20. #include <core/audio.h>
  21. namespace rainynite::core::nodes {
  22. class EmptyAudio : public AudioNode {
  23. DOC_STRING(
  24. "Empty audio node"
  25. )
  26. public:
  27. EmptyAudio() {
  28. }
  29. };
  30. REGISTER_NODE(EmptyAudio);
  31. class AudioFromFile : public AudioNode {
  32. DOC_STRING(
  33. "Play audio from file.\n"
  34. "\n"
  35. "File format support depends on rendering engine."
  36. )
  37. public:
  38. AudioFromFile() {
  39. init<string>(file_path, "");
  40. }
  41. private:
  42. NODE_PROPERTY(file_path, string);
  43. };
  44. REGISTER_NODE(AudioFromFile);
  45. } // namespace rainynite::core::nodes