1 /* 2 SDL_mixer: An audio mixer library based on the SDL library 3 Copyright (C) 1997-2009 Sam Lantinga 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Library General Public 7 License as published by the Free Software Foundation; either 8 version 2 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Library General Public License for more details. 14 15 You should have received a copy of the GNU Library General Public 16 License along with this library; if not, write to the Free 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 19 Sam Lantinga 20 slouken@libsdl.org 21 */ 22 23 /* This file supports an external command for playing music */ 24 25 #ifdef CMD_MUSIC 26 27 #include <sys/types.h> 28 #include <limits.h> 29 #include <stdio.h> 30 #if defined(__linux__) && defined(__arm__) 31 # include <linux/limits.h> 32 #endif 33 typedef struct { 34 char file[PATH_MAX]; 35 char cmd[PATH_MAX]; 36 pid_t pid; 37 } MusicCMD; 38 39 /* Unimplemented */ 40 extern void MusicCMD_SetVolume(int volume); 41 42 /* Load a music stream from the given file */ 43 extern MusicCMD *MusicCMD_LoadSong(const char *cmd, const char *file); 44 45 /* Start playback of a given music stream */ 46 extern void MusicCMD_Start(MusicCMD *music); 47 48 /* Stop playback of a stream previously started with MusicCMD_Start() */ 49 extern void MusicCMD_Stop(MusicCMD *music); 50 51 /* Pause playback of a given music stream */ 52 extern void MusicCMD_Pause(MusicCMD *music); 53 54 /* Resume playback of a given music stream */ 55 extern void MusicCMD_Resume(MusicCMD *music); 56 57 /* Close the given music stream */ 58 extern void MusicCMD_FreeSong(MusicCMD *music); 59 60 /* Return non-zero if a stream is currently playing */ 61 extern int MusicCMD_Active(MusicCMD *music); 62 63 #endif /* CMD_MUSIC */ 64