1 /**
2  * @file api_audiod_mus.h
3  * Music interface for an audio driver. @ingroup audio
4  *
5  * @authors Copyright © 2003-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
6  * @authors Copyright © 2006-2013 Daniel Swanson <danij@dengine.net>
7  *
8  * @par License
9  * GPL: http://www.gnu.org/licenses/gpl.html
10  *
11  * <small>This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by the
13  * Free Software Foundation; either version 2 of the License, or (at your
14  * option) any later version. This program is distributed in the hope that it
15  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17  * Public License for more details. You should have received a copy of the GNU
18  * General Public License along with this program; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA</small>
21  */
22 
23 #ifndef __DOOMSDAY_AUDIO_DRIVER_MUSIC_H__
24 #define __DOOMSDAY_AUDIO_DRIVER_MUSIC_H__
25 
26 /// @addtogroup audio
27 ///@{
28 
29 /// Music interface properties.
30 enum {
31     MUSIP_ID,       ///< Only for Get()ing.
32     MUSIP_PLAYING,  ///< Is playback in progress?
33     MUSIP_VOLUME
34 };
35 
36 /// Generic driver interface. All other interfaces are based on this.
37 typedef struct audiointerface_music_generic_s {
38     int             (*Init) (void);
39     void            (*Shutdown) (void);
40     void            (*Update) (void);
41     void            (*Set) (int prop, float value);
42     int             (*Get) (int prop, void *value);
43     void            (*Pause) (int pause);
44     void            (*Stop) (void);
45 } audiointerface_music_generic_t;
46 
47 /// Driver interface for playing music.
48 typedef struct audiointerface_music_s {
49     audiointerface_music_generic_t gen;
50     void*           (*SongBuffer) (unsigned int length);
51     int             (*Play) (int looped);
52     int             (*PlayFile) (const char *filename, int looped);
53 } audiointerface_music_t;
54 
55 /// Driver interface for playing CD tracks.
56 typedef struct audiointerface_cd_s {
57     audiointerface_music_generic_t gen;
58     int             (*Play) (int track, int looped);
59 } audiointerface_cd_t;
60 
61 ///@}
62 
63 #endif
64