Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ short unsigned int attack_length;
short unsigned int attack_level;
short unsigned int fade_length;
short unsigned int fade_level;
short signed int level;
short signed int start_strength;
short signed int end_strength;
//short unsigned int* data should contain channels*
//short unsigned int8 channels

Expand Down Expand Up @@ -89,6 +92,9 @@ short unsigned int fade_level;
void set_attack_level(short unsigned int attack_level){this->attack_level = attack_level;}
void set_fade_length(short unsigned int fade_length){this->fade_length = fade_length;}
void set_fade_level(short unsigned int fade_level){this->fade_level = fade_level;}
void set_level(short signed int level){this->level = level;}
void set_start_strength(short signed int start_strength){this->start_strength = start_strength;}
void set_end_strength(short signed int end_strength){this->end_strength = end_strength;}

string get_effect_name(void){ return effect_name; }
unsigned int get_type(void){ return type;}
Expand Down Expand Up @@ -130,5 +136,8 @@ short unsigned int fade_level;
short unsigned int get_attack_level(void){return attack_level;}
short unsigned int get_fade_length(void){return fade_length;}
short unsigned int get_fade_level(void){return fade_level;}
short signed int get_level(void){return level;}
short signed int get_start_strength(void){return start_strength;}
short signed int get_end_strength(void){return end_strength;}
};
#endif //EFFECT
52 changes: 29 additions & 23 deletions ffb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ cout << "Converted value: " << sdlValue << endl;
case 1:
cout << "call 1: " << effect_data.get_direction_1() << endl;
effect.periodic.direction.dir[1] = effect_data.get_direction_1(); // Force comes from north at 180 degrees
// fallthrough
default:
cout << "call 2: " << effect_data.get_direction_0() << endl;
effect.periodic.direction.dir[0] = effect_data.get_direction_0(); // Force comes from north at 180 degrees
Expand All @@ -83,6 +84,7 @@ cout << "Converted value: " << sdlValue << endl;
case 1:
cout << "call 1: " << effect_data.get_direction_1() << endl;
effect.ramp.direction.dir[1] = effect_data.get_direction_1(); // Force comes from north at 180 degrees
// fallthrough
default:
cout << "call 2: " << effect_data.get_direction_0() << endl;
effect.ramp.direction.dir[0] = effect_data.get_direction_0(); // Force comes from north at 180 degrees
Expand All @@ -91,6 +93,8 @@ cout << "Converted value: " << sdlValue << endl;
effect.ramp.length = effect_data.get_length(); // 3 seconds long
effect.ramp.attack_length = effect_data.get_attack_length(); // 1000 = Takes 1 second to get max strength
effect.ramp.fade_length = effect_data.get_fade_length(); // 1000 = Takes 1 second to fade away
effect.ramp.start = effect_data.get_start_strength();
effect.ramp.end = effect_data.get_end_strength();
break;
case leftright:
cout << "Left/Right" << endl;
Expand All @@ -109,36 +113,35 @@ cout << "Converted value: " << sdlValue << endl;
case 1:
cout << "call 1: " << effect_data.get_direction_1() << endl;
effect.condition.direction.dir[1] = effect_data.get_direction_1(); // Force comes from north at 180 degrees
// fallthrough
default:
cout << "call 2: " << effect_data.get_direction_0() << endl;
effect.condition.direction.dir[0] = effect_data.get_direction_0(); // Force comes from north at 180 degrees
break;
}
effect.condition.length = effect_data.get_length(); // 3 seconds long
effect.condition.delay = effect_data.get_delay();
/* switch(axes_enabled){
case 2:
effect.condition.right_sat[2] = effect_data.get_right_sat_2();
effect.condition.left_sat[2] = effect_data.get_left_sat_2();
effect.condition.right_coeff[2] = effect_data.get_right_coeff_2();
effect.condition.left_coeff[2] = effect_data.get_left_coeff_2();
effect.condition.deadband[2] = effect_data.get_deadband_2();
effect.condition.center[2] = effect_data.get_center_2();
case 1:
effect.condition.right_sat[1] = effect_data.get_right_sat_1();
effect.condition.left_sat[1] = effect_data.get_left_sat_1();
effect.condition.right_coeff[1] = effect_data.get_right_coeff_1();
effect.condition.left_coeff[1] = effect_data.get_left_coeff_1();
effect.condition.deadband[1] = effect_data.get_deadband_1();
effect.condition.center[1] = effect_data.get_center_1();
default:
effect.condition.right_sat[0] = effect_data.get_right_sat_0();
effect.condition.left_sat[0] = effect_data.get_left_sat_0();
effect.condition.right_coeff[0] = effect_data.get_right_coeff_0();
effect.condition.left_coeff[0] = effect_data.get_left_coeff_0();
effect.condition.deadband[0] = effect_data.get_deadband_0();
effect.condition.center[0] = effect_data.get_center_0();
}*/

effect.condition.right_sat[2] = effect_data.get_right_sat_2();
effect.condition.left_sat[2] = effect_data.get_left_sat_2();
effect.condition.right_coeff[2] = effect_data.get_right_coeff_2();
effect.condition.left_coeff[2] = effect_data.get_left_coeff_2();
effect.condition.deadband[2] = effect_data.get_deadband_2();
effect.condition.center[2] = effect_data.get_center_2();

effect.condition.right_sat[1] = effect_data.get_right_sat_1();
effect.condition.left_sat[1] = effect_data.get_left_sat_1();
effect.condition.right_coeff[1] = effect_data.get_right_coeff_1();
effect.condition.left_coeff[1] = effect_data.get_left_coeff_1();
effect.condition.deadband[1] = effect_data.get_deadband_1();
effect.condition.center[1] = effect_data.get_center_1();

effect.condition.right_sat[0] = effect_data.get_right_sat_0();
effect.condition.left_sat[0] = effect_data.get_left_sat_0();
effect.condition.right_coeff[0] = effect_data.get_right_coeff_0();
effect.condition.left_coeff[0] = effect_data.get_left_coeff_0();
effect.condition.deadband[0] = effect_data.get_deadband_0();
effect.condition.center[0] = effect_data.get_center_0();
break;
case custom:
cout << "Custom" << endl;
Expand All @@ -149,6 +152,7 @@ cout << "Converted value: " << sdlValue << endl;
case 1:
cout << "call 1: " << effect_data.get_direction_1() << endl;
effect.custom.direction.dir[1] = effect_data.get_direction_1(); // Force comes from north at 180 degrees
// fallthrough
default:
cout << "call 2: " << effect_data.get_direction_0() << endl;
effect.custom.direction.dir[0] = effect_data.get_direction_0(); // Force comes from north at 180 degrees
Expand All @@ -167,6 +171,7 @@ cout << "Converted value: " << sdlValue << endl;
case 1:
cout << "call 1: " << effect_data.get_direction_1() << endl;
effect.constant.direction.dir[1] = effect_data.get_direction_1(); // Force comes from north at 180 degrees
// fallthrough
default:
cout << "call 2: " << effect_data.get_direction_0() << endl;
effect.constant.direction.dir[0] = effect_data.get_direction_0(); // Force comes from north at 180 degrees
Expand All @@ -178,6 +183,7 @@ cout << "Converted value: " << sdlValue << endl;
effect.constant.attack_level = effect_data.get_attack_level(); // 1000 = Takes 1 second to get max strength
effect.constant.fade_length = effect_data.get_fade_length(); // 1000 = Takes 1 second to fade away
effect.constant.fade_level = effect_data.get_fade_level(); // 1000 = Takes 1 second to fade away
effect.constant.level = effect_data.get_level();
break;
}

Expand Down
3 changes: 3 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,9 @@ void FFDWindow::update_variables()
this->effect.set_attack_level(int(attack_lvl.get_value()));
this->effect.set_fade_length(int(fade.get_value()));
this->effect.set_fade_level(int(fade_lvl.get_value()));
this->effect.set_level(int(level.get_value()));
this->effect.set_start_strength(int(start_strength.get_value()));
this->effect.set_end_strength(int(end_strength.get_value()));
}

void FFDWindow::on_file_open_response(int response_id, Gtk::FileChooserDialog* dialog)
Expand Down