diff --git a/effect.h b/effect.h index 2adcba7..0fa7f6d 100644 --- a/effect.h +++ b/effect.h @@ -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 @@ -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;} @@ -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 diff --git a/ffb.cpp b/ffb.cpp index 03b0599..0461ded 100644 --- a/ffb.cpp +++ b/ffb.cpp @@ -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 @@ -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 @@ -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; @@ -109,6 +113,7 @@ 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 @@ -116,29 +121,27 @@ cout << "Converted value: " << sdlValue << endl; } 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; @@ -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 @@ -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 @@ -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; } diff --git a/main.cpp b/main.cpp index 30b4228..75e0894 100644 --- a/main.cpp +++ b/main.cpp @@ -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)