summaryrefslogtreecommitdiff
path: root/rotord/src/rotor.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/rotor.h')
-rw-r--r--rotord/src/rotor.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h
index 4c71c84..ca3e5d2 100644
--- a/rotord/src/rotor.h
+++ b/rotord/src/rotor.h
@@ -131,7 +131,7 @@ namespace Rotor {
Frame_spec(int _frame,float _framerate,float _duration,int _w,int _h,Audio_frame *_audio=nullptr)
{ time=((float)_frame)/_framerate; framerate=_framerate; duration=_duration; w=_w; h=_h;audio=_audio;};
int h,w;
- Frame_spec lastframe(){
+ Frame_spec lastframe() const{
return Frame_spec(time-(1.0f/framerate),framerate,duration,w,h);
}
};
@@ -218,7 +218,7 @@ namespace Rotor {
}
else intVal=0;
}
- void init(const std::vector<std::string> &_vals){
+ void init(const std::vector<std::string> &_vals){
vals=_vals;
string s;
for (auto v:vals) s=s+v+" ";
@@ -228,7 +228,7 @@ namespace Rotor {
int intVal;
string type;
std::vector<std::string> vals;
-
+
};
class Node{
public:
@@ -253,11 +253,11 @@ namespace Rotor {
attributes[_attr]=new Attribute(_desc,_title,_value,_vals,_type);
};
void create_attribute(string *alias,const string &_attr,const string &_desc,const string &_title,const string &_value,std::vector<std::string> _vals={},std::string _type="string") {
- create_attribute(_attr,_desc,_title,_value,_vals,_type);
+ create_attribute(_attr,_desc,_title,_value,_vals,_type);
alias=&(attributes[_attr]->value);
};
void create_attribute(int *alias,const string &_attr,const string &_desc,const string &_title,const string &_value,std::vector<std::string> _vals={},std::string _type="string") {
- create_attribute(_attr,_desc,_title,_value,_vals,_type);
+ create_attribute(_attr,_desc,_title,_value,_vals,_type);
alias=&(attributes[_attr]->intVal);
};
virtual void init_attribute(const string &attr){};
@@ -389,7 +389,7 @@ namespace Rotor {
create_signal_input("Selector","Selector input");
create_attribute("mode","Cycling mode {cut|mix}","Mode","cut",{"cut","mix"});
//create_attribute("time_mode","Time mode {abs|rel}","time mode","abs",{"abs","rel","stretch"});
- create_parameter("transition_length","number","transition length","Transition length",-1.0f,0.0f,0.0f);
+ create_parameter("transition_length","number","transition length","Transition length",-1.0f,0.0f,0.0f);
title="Video cycler";
description="Cycles through video inputs according to selector signal";
duplicate_inputs=true;
@@ -511,7 +511,7 @@ namespace Rotor {
float clipframerate=(parameters["framerate"]->value==0.0f?player.get_framerate():parameters["framerate"]->value);
float clipspeed=(clipframerate/frame.framerate)*parameters["speed"]->value;
float wanted=0.0f;
- if (inputs[0]->connection) {
+ if (inputs[0]->connection) {
//using playhead
//should speed affect it?
//if you want absolute control then you just want absolute control?
@@ -688,7 +688,7 @@ namespace Rotor {
~Video_output(){ };
void create_envelope(const vector<float> &audio){
if (audio.size()){
- uint32_t i=0;
+ uint32_t i=1;
while (i<audio.size()&&audio[i]<silence_threshold) i++;
start_silence=((float)i)/audio.size();
while (i<audio.size()&&audio[i]>audio[i-1]) i++;