main.cpp 527 B

123456789101112131415161718192021222324252627
  1. #include <spdlog/spdlog.h>
  2. #include <memory>
  3. #include "LogAudio.h"
  4. #include "MiniAudio.h"
  5. int main () {
  6. #ifndef DEBUG
  7. std::unique_ptr<Audio::AudioInterface> m = std::make_unique<Audio::MiniAudio>(Audio::MiniAudio());
  8. #else
  9. std::unique_ptr<Audio::AudioInterface> m = std::make_unique<Audio::LogAudio>(Audio::LogAudio());
  10. #endif
  11. m->play();
  12. if (m->is_playing()) {
  13. spdlog::info("Player is on play mode");
  14. } else {
  15. spdlog::info("Player is on pause mode");
  16. }
  17. m->pause();
  18. }