summaryrefslogtreecommitdiff
path: root/rotord/rotor.h
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-04-20 02:01:32 +0100
committerComment <tim@gray.(none)>2013-04-20 02:01:32 +0100
commitda05e29b124b2f6d553dedb1c63a4a655fc4f7b6 (patch)
tree3453530d4d7fee2fd165b399ed9ded9fc5abb471 /rotord/rotor.h
parent3608a44b8222cfd76b8ba789e1f5ea6b7020a3e9 (diff)
audio muxer ongoing
Diffstat (limited to 'rotord/rotor.h')
-rwxr-xr-xrotord/rotor.h89
1 files changed, 45 insertions, 44 deletions
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{