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

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

imlib: remove a lot of dead code, especially from the linked list and
the WAV reader.

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