[ create a new paste ] login | about

Link: http://codepad.org/uFXYy4fD    [ raw code | fork ]

C++, pasted on Jun 7:
#pragma once

struct Frame
{
	std::vector<unsigned int>	imgdata;
	std::vector<unsigned char>	sounddata;//8bit, 1. word = left, 2. word = right, 3. word = left etc., mono = no mixing
};

class MVILoader
{
	struct Item
	{
		int	type;//1=video, 2=unknown(only films), 3=leftchannel, 4=rightchannel, 5=palette
		int	kind;
		int	length;
		int	offset;
	};

	std::vector<unsigned char>	out;
	std::vector<Item>			items;
	unsigned int				palette[256];
	std::vector<Item>::iterator	current;
	std::ifstream				file;

public:
	MVILoader(void)					{}
	MVILoader(const MVILoader&e)	{ throw std::exception("copy of MVILoader not allowed"); }

	std::string					name;
	int							width;
	int							height;
	int							fps;
	bool						has_audio;
	int							audio_num_channels;
	int							audio_samplerate;
	int							audio_bits;
	std::vector<unsigned int>	imgdata;
	std::vector<unsigned char>	sounddata;

	void load(const char*);
	void decode_next_frame(void);
	void prefetch_sound(void);
};


Create a new paste based on this one


Comments: