MCPcopy Create free account
hub / github.com/TheWaveWarden/odin2 / forceValueTreeOntoComponentsOnlyMainPanel

Method forceValueTreeOntoComponentsOnlyMainPanel

Source/PluginEditor.cpp:1088–1132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1086}
1087
1088void OdinEditor::forceValueTreeOntoComponentsOnlyMainPanel() {
1089
1090 m_unison_selector.setValue(m_value_tree.state.getChildWithName("misc")["unison_voices"]);
1091 m_pitch_amount.setValue(m_value_tree.state.getChildWithName("misc")["pitchbend_amount"]);
1092 m_mono_poly_legato_dropdown.setSelectedId((int)VALUETREETOPLAYMODE((int)m_value_tree.state.getChildWithName("misc")["legato"]), dontSendNotification);
1093
1094 // ugly fix to set highlighted fx panel
1095 std::string fx_name = "delay";
1096 if ((float)m_value_tree.state.getChildWithName("fx")["phaser_selected"] > 0.5) {
1097 fx_name = "phaser";
1098 } else if ((float)m_value_tree.state.getChildWithName("fx")["flanger_selected"] > 0.5) {
1099 fx_name = "flanger";
1100 } else if ((float)m_value_tree.state.getChildWithName("fx")["chorus_selected"] > 0.5) {
1101 fx_name = "chorus";
1102 } else if ((float)m_value_tree.state.getChildWithName("fx")["reverb_selected"] > 0.5) {
1103 fx_name = "reverb";
1104 }
1105 setActiveFXPanel(fx_name);
1106
1107 const auto env_1_selected = (float)m_value_tree.state.getChildWithName("misc")["env_left_selected"] > 0.5;
1108 m_env_1_button.setToggleState(env_1_selected, dontSendNotification);
1109 m_env_3_button.setToggleState(!env_1_selected, dontSendNotification);
1110 setEnv13(env_1_selected);
1111 const auto env_2_selected = (float)m_value_tree.state.getChildWithName("misc")["env_right_selected"] > 0.5;
1112 m_env_2_button.setToggleState(env_2_selected, dontSendNotification);
1113 m_env_4_button.setToggleState(!env_2_selected, dontSendNotification);
1114 setEnv24(env_2_selected);
1115
1116 const auto lfo_1_selected = (float)m_value_tree.state.getChildWithName("lfo")["lfo_left_selected"] > 0.5;
1117 m_lfo_1_button.setToggleState(lfo_1_selected, dontSendNotification);
1118 m_lfo_2_button.setToggleState(!lfo_1_selected, dontSendNotification);
1119 setLfo12(lfo_1_selected);
1120 const auto lfo_3_selected = (float)m_value_tree.state.getChildWithName("lfo")["lfo_right_selected"] > 0.5;
1121 m_lfo_3_button.setToggleState(lfo_3_selected, dontSendNotification);
1122 m_lfo_4_button.setToggleState(!lfo_3_selected, dontSendNotification);
1123 setLfo34(lfo_3_selected);
1124
1125 const float bottom_section_selection = (float)m_value_tree.state.getChildWithName("misc")["arp_mod_selected"];
1126 m_select_arp_button.setToggleState(fabs(bottom_section_selection - (float)MATRIX_SECTION_INDEX_ARP) < 0.1f, dontSendNotification);
1127 m_select_modmatrix_button.setToggleState(fabs(bottom_section_selection - (float)MATRIX_SECTION_INDEX_MATRIX) < 0.1f, dontSendNotification);
1128 m_select_presets_button.setToggleState(fabs(bottom_section_selection - (float)MATRIX_SECTION_INDEX_PRESETS) < 0.1f, dontSendNotification);
1129 setMatrixSectionModule((int)(bottom_section_selection + 0.5f));
1130
1131 setFXModulesEnablements();
1132}
1133
1134void OdinEditor::forceValueTreeOntoComponents(bool p_reset_audio) {
1135

Callers

nothing calls this directly

Calls 1

setValueMethod · 0.45

Tested by

no test coverage detected