Erwan
- Fixed MP3 play bug on the psp. MP3 files need to have NO Id3v2 tag, or they won't play. Also, volume control is broken - added dt to moving W's easter egg movement. - Added fullscreen for windows version - other stuff ?
This commit is contained in:
@@ -73,15 +73,15 @@ void setChannelFlag(int channel, int flag);
|
||||
#define SAMPLE_PER_FRAME 1152
|
||||
#define MAX_MP3_FILE 2
|
||||
|
||||
class JCooleyesMP3;
|
||||
class JMP3;
|
||||
|
||||
void PlayMP3(JCooleyesMP3 *mp3, bool looping = false);
|
||||
void PlayMP3(JMP3 *mp3, bool looping = false);
|
||||
void StopMP3();
|
||||
void ResumeMP3();
|
||||
bool InitMP3Decoder();
|
||||
void ResumeMP3(JMP3 *mp3);
|
||||
|
||||
void ReleaseMP3Decoder();
|
||||
void MP3AudioOutCallback(void* buf, unsigned int length, void *userdata);
|
||||
|
||||
int decodeThread2(SceSize args, void *argp);
|
||||
extern bool g_MP3DecoderOK;
|
||||
|
||||
#endif
|
||||
|
||||
59
JGE/include/JMP3.h
Normal file
59
JGE/include/JMP3.h
Normal file
@@ -0,0 +1,59 @@
|
||||
//-------------------------------------------------------------------------------------
|
||||
//
|
||||
// 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>
|
||||
// Copyright (c) 2008 Alexander Berl <raphael@fx-world.org>
|
||||
// Copyright (c) 2008 WilLoW :--) <wagic.the.homebrew@gmail.com>
|
||||
//
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
#ifndef _JMP3_
|
||||
#define _JMP3_
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
|
||||
|
||||
class JMP3
|
||||
{
|
||||
protected:
|
||||
static bool loadModules();
|
||||
int m_volume;
|
||||
int m_samplesPlayed;
|
||||
int m_inBufferSize, m_outBufferSize;
|
||||
char m_inBuffer[16*1024]; // ?
|
||||
short m_outBuffer[16*(1152/2)]; //?
|
||||
int m_numChannels;
|
||||
int m_samplingRate;
|
||||
bool m_loop;
|
||||
int m_lastDecoded;
|
||||
int m_playTime;
|
||||
public:
|
||||
int m_paused;
|
||||
int m_channel;
|
||||
int m_mp3Handle;
|
||||
int m_fileHandle;
|
||||
static JMP3* mInstance;
|
||||
JMP3(const std::string& filename, int inBufferSize= 16*1024, int outBufferSize =16*(1152/2));
|
||||
~JMP3();
|
||||
static void init();
|
||||
bool fillBuffers();
|
||||
bool load(const std::string& filename, int inBufferSize, int outBufferSize);
|
||||
bool unload();
|
||||
bool update();
|
||||
bool play();
|
||||
bool pause();
|
||||
bool setLoop(bool loop);
|
||||
int setVolume(int volume);
|
||||
int playTime() const;
|
||||
int playTimeMinutes();
|
||||
int playTimeSeconds();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <psprtc.h>
|
||||
|
||||
#include "JAudio.h"
|
||||
#include "JCooleyesMP3.h"
|
||||
#include "JMP3.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,11 +47,12 @@ class JMusic
|
||||
public:
|
||||
JMusic();
|
||||
~JMusic();
|
||||
void Update();
|
||||
|
||||
#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;
|
||||
JMP3* mTrack;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#define SCREEN_WIDTH_F 480.0f
|
||||
#define SCREEN_HEIGHT_F 272.0f
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
// #define DEFAULT_BLEND BLEND_DEFAULT
|
||||
// #define BLEND_OPTION_ADD BLEND_COLORADD
|
||||
|
||||
Reference in New Issue
Block a user