song.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * This file is part of Soft Mood (https://notabug.org/alkeon/soft-mood).
  3. * Copyright (c) 2019 Alejandro "alkeon" Castilla
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, version 3.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * 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. #ifndef __SDL_SONG__
  18. #define __SDL_SONG__
  19. #include <iostream>
  20. #include "SDL_mixer.h"
  21. #include "SDL_image.h"
  22. #include "SDL.h"
  23. #include <thread>
  24. #include <chrono>
  25. using namespace std;
  26. class song{
  27. Mix_Chunk * _music;
  28. int _channel;
  29. int _volume;
  30. public:
  31. song(const string& file);
  32. void set_volume(int volume);
  33. void change_song(const string& file, int sound);
  34. };
  35. #endif