J :
* Update for linux support.
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows.
|
||||
//
|
||||
// Licensed under the BSD license, see LICENSE in JGE root for details.
|
||||
//
|
||||
//
|
||||
// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) <jhkhui@gmail.com>
|
||||
//
|
||||
//
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
#ifndef _JSOUNDSYSTEM_H_
|
||||
@@ -22,13 +22,13 @@
|
||||
#ifdef WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#elif defined (LINUX)
|
||||
#else
|
||||
|
||||
#include <pspgu.h>
|
||||
#include <pspkernel.h>
|
||||
#include <pspdisplay.h>
|
||||
#include <pspdebug.h>
|
||||
#include <pspdebug.h>
|
||||
#include <pspctrl.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
@@ -48,12 +48,12 @@ public:
|
||||
JMusic();
|
||||
~JMusic();
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
FSOUND_SAMPLE *mTrack; // MP3 needed to be of "sample" type for FMOD, FMUSIC_MODULE is for MODs
|
||||
#else
|
||||
JCooleyesMP3* mTrack;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
~JSample();
|
||||
|
||||
int mVoice;
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
FSOUND_SAMPLE *mSample;
|
||||
#else
|
||||
WAVDATA *mSample;
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Sound engine for playing sound effects (WAV) and background
|
||||
/// Sound engine for playing sound effects (WAV) and background
|
||||
/// music (MP3).
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -96,91 +96,91 @@ public:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Load music.
|
||||
///
|
||||
///
|
||||
/// @note MP3 is the only supported format for the moment.
|
||||
///
|
||||
///
|
||||
/// @param filename - Name of the music file.
|
||||
///
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
JMusic *LoadMusic(const char *fileName);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Delete music from memory.
|
||||
///
|
||||
///
|
||||
/// @param music - Music to be deleted.
|
||||
///
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//void FreeMusic(JMusic *music);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Play music.
|
||||
///
|
||||
///
|
||||
/// @param music - Music to be played.
|
||||
/// @param looping - Play the music in a loop.
|
||||
///
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void PlayMusic(JMusic *music, bool looping = false);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Stop playing.
|
||||
///
|
||||
///
|
||||
/// @param music - Music to be stopped.
|
||||
///
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void StopMusic(JMusic *music);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Resume playing.
|
||||
///
|
||||
///
|
||||
/// @param music - Music to be resumed.
|
||||
///
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void ResumeMusic(JMusic *music);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Load sound effect.
|
||||
///
|
||||
///
|
||||
/// @note WAV sound effect only.
|
||||
///
|
||||
///
|
||||
/// @param fileName - Sound effect for loading.
|
||||
///
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
JSample *LoadSample(const char *fileName);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Delete sound effect from memory.
|
||||
///
|
||||
///
|
||||
/// @param sample - Sound to be deleted.
|
||||
///
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//void FreeSample(JSample *sample);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Play sound effect.
|
||||
///
|
||||
///
|
||||
/// @param sample - Sound for playing.
|
||||
///
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void PlaySample(JSample *sample);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Set volume for audio playback.
|
||||
///
|
||||
///
|
||||
/// @param volume - New volume.
|
||||
///
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void SetVolume(int volume);
|
||||
|
||||
protected:
|
||||
JSoundSystem();
|
||||
~JSoundSystem();
|
||||
|
||||
|
||||
void InitSoundSystem();
|
||||
void DestroySoundSystem();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
JMusic *mCurrentMusic;
|
||||
|
||||
Reference in New Issue
Block a user