music_cmd.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 02 Jan 2016 22:12:31 -0800
changeset 712 7e59d684b070
parent 711 f40c5ac95b12
child 725 bdf7b8d20566
permissions -rw-r--r--
Updated to version 2.0.1
     1 /*
     2   SDL_mixer:  An audio mixer library based on the SDL library
     3   Copyright (C) 1997-2016 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;
    34     char *cmd;
    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 */