music_cmd.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. SDL_mixer: An audio mixer library based on the SDL library
  3. Copyright (C) 1997-2013 Sam Lantinga <[email protected]>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /* This file supports an external command for playing music */
  19. #ifdef CMD_MUSIC
  20. #include <sys/types.h>
  21. #include <limits.h>
  22. #include <stdio.h>
  23. #if defined(__linux__) && defined(__arm__)
  24. # include <linux/limits.h>
  25. #endif
  26. typedef struct {
  27. char *file;
  28. char *cmd;
  29. pid_t pid;
  30. } MusicCMD;
  31. /* Unimplemented */
  32. extern void MusicCMD_SetVolume(int volume);
  33. /* Load a music stream from the given file */
  34. extern MusicCMD *MusicCMD_LoadSong(const char *cmd, const char *file);
  35. /* Start playback of a given music stream */
  36. extern void MusicCMD_Start(MusicCMD *music);
  37. /* Stop playback of a stream previously started with MusicCMD_Start() */
  38. extern void MusicCMD_Stop(MusicCMD *music);
  39. /* Pause playback of a given music stream */
  40. extern void MusicCMD_Pause(MusicCMD *music);
  41. /* Resume playback of a given music stream */
  42. extern void MusicCMD_Resume(MusicCMD *music);
  43. /* Close the given music stream */
  44. extern void MusicCMD_FreeSong(MusicCMD *music);
  45. /* Return non-zero if a stream is currently playing */
  46. extern int MusicCMD_Active(MusicCMD *music);
  47. #endif /* CMD_MUSIC */