summaryrefslogtreecommitdiff
path: root/rotord/src/graph.h
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-12-08 10:55:03 +0000
committerComment <tim@gray.(none)>2013-12-08 10:55:03 +0000
commit1d05d2380bb4f1fd265aef55744f432af38b08aa (patch)
tree89c1c15497149951d4b99938ad932abde42eae14 /rotord/src/graph.h
parente04516069c71a5a1e32e6a5fbf0eb5b86dcfc5a2 (diff)
switched signals to double and random to uint16
Diffstat (limited to 'rotord/src/graph.h')
-rw-r--r--rotord/src/graph.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/rotord/src/graph.h b/rotord/src/graph.h
index b9647bc..153bc5a 100644
--- a/rotord/src/graph.h
+++ b/rotord/src/graph.h
@@ -25,7 +25,7 @@ copy nodes `
namespace Rotor {
class Graph{
public:
- Graph(){duration=20.0f;loaded = false;audio_loaded=false;bitRate=0;outW=640;outH=360;audio_thumb=new Audio_thumbnailer();use_fragmentation=false;analysis_seed=0;};
+ Graph(){duration=20.0;loaded = false;audio_loaded=false;bitRate=0;outW=640;outH=360;audio_thumb=new Audio_thumbnailer();use_fragmentation=false;analysis_seed=0;};
Graph(const string& _uid,const string& _desc){
Graph();
init(_uid,_desc);
@@ -33,8 +33,8 @@ namespace Rotor {
void init(const string& _uid,const string& _desc){
uid=_uid;
description=_desc;
- duration=20.0f;
- framerate=25.0f;
+ duration=20.0;
+ framerate=25.0;
cancelled=false;
};
~Graph(){ clear(); delete audio_thumb;};
@@ -51,8 +51,8 @@ namespace Rotor {
std::unordered_map<string,Node*> nodes;
vector<Node*> find_nodes(const string &type); //could be a way of finding a set based on capabilities?
Node* find_node(const string &type);
- bool signal_render(xmlIO &XML,const string &node,const float framerate);
- bool video_render(const string &output_filename,const float framerate,int start, int end);
+ bool signal_render(xmlIO &XML,const string &node,const double framerate);
+ bool video_render(const string &output_filename,const double framerate,int start, int end);
bool load(string data,string media_path);
bool loadFile(string &filename,string media_path);
bool parseXml(string media_path);
@@ -75,14 +75,14 @@ namespace Rotor {
return true;
}
bool loaded;
- float duration;
- float framerate;
+ double duration;
+ double framerate;
const string graphToString();
xmlIO xml;
bool audio_loaded;
string audio_filename;
bool cancelled;
- float progress;
+ double progress;
int bitRate;
//Poco::Mutex mutex; //lock for access from parent thread
@@ -112,7 +112,7 @@ namespace Rotor {
w*4);
cairo_t * cr = cairo_create (cs);
cairo_translate(cr, w/2, h/2);
- cairo_scale(cr, ((float)w)/640.0f,((float)w)/640.0f);
+ cairo_scale(cr, ((double)w)/640.0,((double)w)/640.0);
cairo_translate(cr, -w/2, -h/2);
cairo_translate(cr, w/2-(dims.width/2), h/2-(dims.height/2));
rsvg_handle_render_cairo(rsvg,cr);
@@ -158,7 +158,7 @@ namespace Rotor {
uchar* r=co.ptr(i); //pointer to row
for (int j=0;j<w;j++){
//audio rms in 0..1 range
- if (at.audiodata[j]>abs(((float)i-h/2)/(h/2))) op=0xFF;
+ if (at.audiodata[j]>abs(((double)i-h/2)/(h/2))) op=0xFF;
else op=0x00;
r[j*3]=op/4;
r[j*3+1]=op;