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