Ogg support fixed and re-added. Squash of various commits made by Wouter Spruit.

This commit is contained in:
Thulinma 2014-12-23 13:05:41 +01:00
parent 689e1d714e
commit 4d9f4da3f1
11 changed files with 1238 additions and 465 deletions

View file

@ -5,23 +5,23 @@
#include <string>
#include <deque>
namespace vorbis {
struct mode {
namespace vorbis{
struct mode{
bool blockFlag;
unsigned short windowType;
unsigned short transformType;
char mapping;
};
inline unsigned int ilog(unsigned int input) {
return (std::log(input)) / (std::log(2)) + 1;
inline unsigned int ilog(unsigned int input){
return (std::log(input))/(std::log(2))+1;
}
class header {
public:
header();
header(char * newData, unsigned int length);
bool read(char * newData, unsigned int length);
bool isHeader(const char * newData, unsigned int length);
class header{
public:
~header();
header(char* newData, unsigned int length);
int getHeaderType();
long unsigned int getVorbisVersion();
char getAudioChannels();
@ -34,15 +34,19 @@ namespace vorbis {
char getFramingFlag();
std::string toPrettyString(size_t indent = 0);
std::deque<mode> readModeDeque(char audioChannels);
bool isHeader();
unsigned int getDataSize(){
return datasize;
}
protected:
uint32_t getInt32(size_t index);
uint32_t getInt24(size_t index);
uint16_t getInt16(size_t index);
private:
std::deque<mode> modes;
char * data;
char* data;
unsigned int datasize;
bool checkDataSize(unsigned int size);
bool validate();
};
};
}