void ColorCorrection::dataToFrontend() { auto _tuning = dataModel()->tunings().current(); setAllChannels(); if (!_tuning) return; setUsed(_tuning->colorCorrection().isUsed()); }
/*! \brief main program of the master Sets up the I2C device and ncurses ui. Reacts on the user input. \param argc \param argv[] \return int */ int main(int argc, char *argv[]) { int ch = 0; int i; //initialize an array of '#' which determines the maximum length of a bar for (i = 0; i<LENGTH+1; i++) row[i] = '#'; row[0] = 'a'; row[LENGTH] = '\0'; //Initialize I2C-device if (I2Cinit() != TRUE) { printf("Initializing I2C interface failed\n"); exit (1); } //Initialize ncurses initscr(); if(has_colors() == FALSE) { endwin(); printf("Your terminal does not support color\n"); exit(1); } start_color(); /* Start color */ init_pair(1, COLOR_BLUE, COLOR_BLUE); cbreak(); noecho(); //Initialize the duty cycles of the slave setAllChannels(); printScreen(); int inc = 1; /*!< Increment/Decrement per key press event */ //Wait for user input while(ch != 'q') { ch = getch(); switch(ch) { case '+':inc = 2; break; case '-':inc = -2; break; case '1': channel[0]+=inc; setSingleChannel(0); break; case '2': channel[1]+=inc; setSingleChannel(1); break; case '3': channel[2]+=inc; setSingleChannel(2); break; case '4': channel[3]+=inc; setSingleChannel(3); break; case 'a': channel[0]+=inc; channel[1]+=inc; channel[2]+=inc; channel[3]+=inc; setAllChannels(); break; } printScreen(); } endwin(); //Stop ncurses return 0; }
static void setAllChannelsIntensity(uint8_t value) { setAllChannels(intensityToPwm(value)); }