Disband lime.media, create lime.audio and lime.math

This commit is contained in:
Joshua Granick
2014-08-02 10:33:32 -07:00
parent d66f48a482
commit 51017010a8
46 changed files with 899 additions and 285 deletions

View File

@@ -1,58 +0,0 @@
#ifndef LIME_MEDIA_AUDIO_BUFFER_H
#define LIME_MEDIA_AUDIO_BUFFER_H
#include <hx/CFFI.h>
#include <utils/ByteArray.h>
#ifdef ANDROID
#include <android/log.h>
#endif
#ifdef ANDROID
#define LOG_SOUND(args,...) ELOG(args, ##__VA_ARGS__)
#else
#ifdef IPHONE
//#define LOG_SOUND(args,...) printf(args, ##__VA_ARGS__)
#define LOG_SOUND(args...) { }
#elif defined(TIZEN)
#include <FBase.h>
#define LOG_SOUND(args,...) AppLog(args, ##__VA_ARGS__)
#else
#define LOG_SOUND(args,...) printf(args, ##__VA_ARGS__)
#endif
#endif
//#define LOG_SOUND(args...) { }
namespace lime {
class AudioBuffer {
public:
AudioBuffer ();
~AudioBuffer ();
value Value ();
int bitsPerSample;
int channels;
int sampleRate;
ByteArray *data;
private:
value mValue;
};
}
#endif

View File

@@ -1,40 +0,0 @@
#ifndef LIME_MEDIA_IMAGE_H
#define LIME_MEDIA_IMAGE_H
#include <hx/CFFI.h>
#include <utils/ByteArray.h>
namespace lime {
class Image {
public:
Image ();
~Image ();
void Blit (const unsigned char *data, int x, int y, int width, int height);
void Resize (int width, int height, int bpp = 4);
value Value ();
int bpp;
ByteArray *data;
int height;
int width;
private:
value mValue;
};
}
#endif

View File

@@ -1,26 +0,0 @@
#ifndef LIME_MEDIA_FORMAT_JPEG_H
#define LIME_MEDIA_FORMAT_JPEG_H
#include <media/Image.h>
#include <utils/Resource.h>
namespace lime {
class JPEG {
public:
static bool Decode (Resource *resource, Image *image);
};
}
#endif

View File

@@ -1,26 +0,0 @@
#ifndef LIME_MEDIA_FORMAT_OGG_H
#define LIME_MEDIA_FORMAT_OGG_H
#include <media/AudioBuffer.h>
#include <utils/Resource.h>
namespace lime {
class OGG {
public:
static bool Decode (Resource *resource, AudioBuffer *audioBuffer);
};
}
#endif

View File

@@ -1,26 +0,0 @@
#ifndef LIME_MEDIA_FORMAT_PNG_H
#define LIME_MEDIA_FORMAT_PNG_H
#include <media/Image.h>
#include <utils/Resource.h>
namespace lime {
class PNG {
public:
static bool Decode (Resource *resource, Image *image);
};
}
#endif

View File

@@ -1,57 +0,0 @@
#ifndef LIME_MEDIA_FORMAT_WAV_H
#define LIME_MEDIA_FORMAT_WAV_H
#include <media/AudioBuffer.h>
#include <utils/Resource.h>
namespace lime {
struct RIFF_Header {
char chunkID[4];
unsigned int chunkSize; //size not including chunkSize or chunkID
char format[4];
};
struct WAVE_Format {
char subChunkID[4];
unsigned int subChunkSize;
short audioFormat;
short numChannels;
unsigned int sampleRate;
unsigned int byteRate;
short blockAlign;
short bitsPerSample;
};
struct WAVE_Data {
char subChunkID[4]; //should contain the word data
unsigned int subChunkSize; //Stores the size of the data block
};
class WAV {
public:
static bool Decode (Resource *resource, AudioBuffer *audioBuffer);
};
}
#endif