void Display::slidersUpdate(){ bool change = false; if (Cfg::sliders.bank != Cfg::sliders.previousBank){ sliders(); Cfg::sliders.previousBank = Cfg::sliders.bank; change = true; } CCParam* sliderCC; for (u8 s = 0; s < 16; ++s){ sliderCC = &Cfg::sliders.ccs[Cfg::sliders.bank][s]; if (Cfg::ccChangedVblank[(*sliderCC).channel][(*sliderCC).cc]){ updateSliderUpMap(s); change = true; } } DC_FlushAll(); dmaCopy(this->slidersBg2Map, bgGetMapPtr(subbg2), 1536); if (change){ DC_FlushAll(); dmaCopy(this->slidersBg3Map, bgGetMapPtr(subbg3), 1536); } showBank(Cfg::sliders.bank, 3); }
// DISPLAY UPDATE FUNCTION //------------------------------------------------------------------------- void Display::update(){ consoleSelect(&mainConsole); iprintf("\e[37m\x1b[1;20H%4d.%1d.%1d", midi->bars, midi->beats, midi->quarters); consoleSelect(&subConsole); tempoLeds(); switch (Cfg::mode){ case KAOSS: if (Cfg::previousMode != KAOSS){ Cfg::previousMode = KAOSS; kaoss(); } if (!input->paused) kaossUpdate(); break; case PADS: if (Cfg::previousMode != PADS){ Cfg::previousMode = PADS; pads(); } padsUpdate(); break; case MIXER: if (Cfg::previousMode != MIXER){ Cfg::previousMode = MIXER; mixer(); } mixerUpdate(); break; case SLIDERS: if (Cfg::previousMode != SLIDERS){ Cfg::previousMode = SLIDERS; sliders(); } slidersUpdate(); break; } for (u8 c = 0; c < 16; ++c){ for (u8 v = 0; v < 128; ++v) Cfg::ccChangedVblank[c][v] = false; } oamUpdate(&oamSub); oamUpdate(&oamMain); ++frame; }
void Display::editSliderParams(){ CCParam ccParam; u8 color; bgSetPriority(this->subbg3, 1); DC_FlushAll(); dmaCopy(greyedBgSubTiles, bgGetGfxPtr(this->subbg3), greyedBgSubTilesLen); dmaCopy(greyedBgSubMap, bgGetMapPtr(this->subbg3), greyedBgSubMapLen); bgShow(this->subbg3); while(!(Cfg::editParams && input->pad->start() == DOWN)){ for (u8 i = 0; i<16; ++i){ ccParam = Cfg::sliders.ccs[Cfg::sliders.bank][i]; color = Cfg::sliders.colors[Cfg::sliders.bank][i]; echo(0, WHITE, 12*(i/8) , 1 + 4*(i%8), "CC"); paramsEditSprite->display(16+i, 8 + 32*(i%8), 8 + 96*(i/8), OBJPRIORITY_0, 0); iprintf("\x1b[%d;%dH%3d", 2 + 12*(i/8) , 4*(i%8), ccParam.cc); paramsEditSprite->display(32+i, 8 + 32*(i%8), 24 + 96*(i/8), OBJPRIORITY_0, 1); echo(0, WHITE, 4+12*(i/8) , 1 + 4*(i%8), "CH"); paramsEditSprite->display(48+i, 8 + 32*(i%8), 40 + 96*(i/8), OBJPRIORITY_0, 0); iprintf("\x1b[%d;%dH%3d", 6 + 12*(i/8) , 4*(i%8), 1 + ccParam.channel); paramsEditSprite->display(64+i, 8 + 32*(i%8), 56 + 96*(i/8), OBJPRIORITY_0, 1); paramsEditSprite->display(80+i, 8 + 32*(i%8), 72 + 96*(i/8), OBJPRIORITY_0, color + 2); } oamUpdate(&oamSub); input->editSliderParams(); Cfg::editParams = true; swiWaitForVBlank(); } save->write(); Cfg::editParams = false; oamClear(&oamSub, 16, 80); consoleClear(); sliders(); }
int main(int argc, char* argv[]) { QApplication app(argc, argv); QWidget topLevel; QVBoxLayout* topLevelLayout = new QVBoxLayout; ctkCollapsibleButton buttons("Buttons"); QFormLayout* buttonsLayout = new QFormLayout; buttonsLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); topLevelLayout->addWidget(&buttons); ctkCheckablePushButton checkablePushButton; checkablePushButton.setText("Checkable"); buttonsLayout->addRow("ctkCheckablePushButton", &checkablePushButton); ctkColorPickerButton colorPickerButton; colorPickerButton.setColor(QColor("#9e1414")); buttonsLayout->addRow("ctkColorPickerButton", &colorPickerButton); buttons.setLayout(buttonsLayout); ctkCollapsibleButton sliders("Sliders"); QFormLayout* slidersLayout = new QFormLayout; topLevelLayout->addWidget(&sliders); ctkRangeWidget rangeWidget; slidersLayout->addRow("ctkRangeWidget", &rangeWidget); sliders.setLayout(slidersLayout); topLevel.setLayout(topLevelLayout); topLevel.show(); return app.exec(); }