From da05e29b124b2f6d553dedb1c63a4a655fc4f7b6 Mon Sep 17 00:00:00 2001 From: Comment Date: Sat, 20 Apr 2013 02:01:32 +0100 Subject: audio muxer ongoing --- rotord/rotor.h | 89 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 45 insertions(+), 44 deletions(-) (limited to 'rotord/rotor.h') diff --git a/rotord/rotor.h b/rotord/rotor.h index d808dd8..d27914e 100755 --- a/rotord/rotor.h +++ b/rotord/rotor.h @@ -97,8 +97,10 @@ extern "C" { #include "vampHost.h" #include "xmlIO.h" +#include "libavaudioloader.h" #include "libavexporter.h" + namespace Rotor { #define IDLE 0 #define ANALYSING_AUDIO 1 @@ -144,7 +146,48 @@ namespace Rotor { AVPacket packet; }; - + class Image{ + public: + Image(){ + zero(); + }; + Image(int _w,int _h){ + zero(); + setup(_w,_h); + }; + ~Image() { + free(); + }; + void free(){ + if (RGBdata) delete[] RGBdata; + if (Adata) delete[] Adata; + if (Zdata) delete[] Zdata; + zero(); + } + void zero(){ + RGBdata=nullptr; + Adata=nullptr; + Zdata=nullptr; + w=0; + h=0; + } + bool setup(int _w,int _h){ + if (w!=_w||h!=_h){ + free(); + w=_w; + h=_h; + RGBdata=new uint8_t[w*h*3]; + Adata=new uint8_t[w*h]; + Zdata=new uint16_t[w*h]; + return true; + } + else return false; + } + uint8_t *RGBdata; + uint8_t *Adata; + uint16_t *Zdata; + int h,w; + }; class Time_spec{ public: Time_spec(float _seconds,float _framerate){ seconds=_seconds; framerate=_framerate; }; @@ -216,49 +259,6 @@ namespace Rotor { ID=check(settings,"ID"); } }; - class Image{ - public: - Image(){ - zero(); - }; - Image(int _w,int _h){ - zero(); - setup(_w,_h); - }; - ~Image() { - free(); - }; - void free(){ - if (RGBdata) delete[] RGBdata; - if (Adata) delete[] Adata; - if (Zdata) delete[] Zdata; - zero(); - } - void zero(){ - RGBdata=nullptr; - Adata=nullptr; - Zdata=nullptr; - w=0; - h=0; - } - bool setup(int _w,int _h){ - if (w!=_w||h!=_h){ - free(); - w=_w; - h=_h; - RGBdata=new uint8_t[w*h*3]; - Adata=new uint8_t[w*h]; - Zdata=new uint16_t[w*h]; - return true; - } - else return false; - } - uint8_t *RGBdata; - uint8_t *Adata; - uint16_t *Zdata; - private: - int h,w; - }; class Signal_node: public Node{ public: virtual float get_output(const Time_spec &time) { return 0.0f; }; @@ -414,6 +414,7 @@ namespace Rotor { private: //ofxMovieExporter *exporter; libav::exporter *exporter; + libav::audioloader audio_loader; }; //------------------------------------------------------------------- class Node_factory{ -- cgit v1.2.3