/*
 * gauche-sdl-mixer.h - Gauche SDL_mixer extension
 *
 *  Copyright(C) 2003 by Michael Vess (mvess@michaelvess.com)
 *
 *  Permission to use, copy, modify, distribute this software and
 *  accompanying documentation for any purpose is hereby granted,
 *  provided that existing copyright notices are retained in all
 *  copies and that this notice is included verbatim in all
 *  distributions.
 *  This software is provided as is, without express or implied
 *  warranty.  In no circumstances the author(s) shall be liable
 *  for any damages arising out of the use of this software.
 *
 *  $Id: gauche-sdl-mixer.h,v 1.3 2003/02/25 02:21:07 mikiso Exp $
 */

#ifndef GAUCHE_SDL_MIXER_H
#define GAUCHE_SDL_MIXER_H

#include "../gauche-sdl.h"

#include <SDL_mixer.h>

/*****************************************************************************
 * Mixer
 */

/* Chunk */
typedef struct ScmMixChunkRec {
    SCM_HEADER;
    Mix_Chunk *chunk;
} ScmMixChunk;

SCM_CLASS_DECL(Scm_MixChunkClass);
#define SCM_CLASS_MIX_CHUNK          (&Scm_MixChunkClass)
#define SCM_MIX_CHUNK(obj)           (((ScmMixChunk*)(obj))->chunk)
#define SCM_MIX_CHUNK_P(obj)         SCM_XTYPEP(obj, SCM_CLASS_MIX_CHUNK)
#define SCM_MIX_CHUNK_OR_NULL(obj)   (SCM_FALSEP(obj)?NULL:SCM_MIX_CHUNK(obj))
#define SCM_MIX_CHUNK_OR_NULL_P(obj) (SCM_FALSEP(obj)||SCM_MIX_CHUNK_P(obj))

void mix_chunk_finalize(ScmObj obj, void *data);


/* Music */
typedef struct ScmMixMusicRec {
    SCM_HEADER;
    Mix_Music *music;
} ScmMixMusic;

SCM_CLASS_DECL(Scm_MixMusicClass);
#define SCM_CLASS_MIX_MUSIC          (&Scm_MixMusicClass)
#define SCM_MIX_MUSIC(obj)           (((ScmMixMusic*)(obj))->music)
#define SCM_MIX_MUSIC_P(obj)         SCM_XTYPEP(obj, SCM_CLASS_MIX_MUSIC)
#define SCM_MIX_MUSIC_OR_NULL(obj)   (SCM_FALSEP(obj)?NULL:SCM_MIX_MUSIC(obj))
#define SCM_MIX_MUSIC_OR_NULL_P(obj) (SCM_FALSEP(obj)||SCM_MIX_MUSIC_P(obj))

void mix_music_finalize(ScmObj obj, void * data);


#endif /* GAUCHE_SDL_MIXER_H */


syntax highlighted by Code2HTML, v. 0.9.1