source: abuse/trunk/src/sdlport/sound.h @ 555

Last change on this file since 555 was 555, checked in by Sam Hocevar, 11 years ago

ps3: make everything compile on the PS3. Of course, nothing links yet
because so much support is missing.

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5 *
6 *  This software was released into the Public Domain. As with most public
7 *  domain software, no warranty is made or implied by Crack dot Com, by
8 *  Jonathan Clark, or by Sam Hocevar.
9 */
10
11#ifndef __SOUND_H__
12#define __SOUND_H__
13
14#if !defined __CELLOS_LV2__
15#   include <SDL/SDL_mixer.h>
16#endif
17
18/* options are passed via command line */
19
20#define SFX_INITIALIZED    1
21#define MUSIC_INITIALIZED  2
22
23int sound_init(int argc, char **argv);
24void sound_uninit();
25void print_sound_options(); // print the options avaible for sound
26
27class sound_effect
28{
29public:
30    sound_effect(char const *filename);
31    ~sound_effect();
32
33    void play(int volume = 127, int pitch = 128, int panpot = 128);
34
35private:
36#if !defined __CELLOS_LV2__
37    Mix_Chunk* m_chunk;
38#endif
39};
40
41class song
42{
43public:
44#if !defined __CELLOS_LV2__
45    char const *name() { return Name; }
46#endif
47    song(char const *filename);
48    void play(unsigned char volume=127);
49    void stop(long fadeout_time=0); // time in ms
50    int playing();
51    void set_volume(int volume);
52    ~song();
53
54private:
55#if !defined __CELLOS_LV2__
56    char *Name;
57    unsigned char *data;
58    unsigned long song_id;
59    Mix_Music* music;
60    SDL_RWops* rw;
61#endif
62};
63
64#endif
65
Note: See TracBrowser for help on using the repository browser.