Commit 4124467e authored by minus's avatar minus

Displayed tuned in status

parent 89b0e8c5
......@@ -21,7 +21,8 @@ struct show_mute_and_speakers_config {
struct fav_config {
struct seq_port *sp;
enum button button;
enum button button_fav;
enum button button_tuned;
char *hash;
bool is_fav;
char *username;
......@@ -74,7 +75,11 @@ static gboolean on_fav_info(GIOChannel *source, GIOCondition condition, gpointer
}
if (len >= 22 && memcmp(line, "playing favorite", 16) == 0) {
fc->is_fav = strcmp(&line[17], "true\n") == 0;
midi_button_led(fc->sp->seq, fc->sp->port, fc->button, fc->is_fav ? BUTTON_LED_ON : BUTTON_LED_OFF);
midi_button_led(fc->sp->seq, fc->sp->port, fc->button_fav, fc->is_fav ? BUTTON_LED_ON : BUTTON_LED_OFF);
}
if (len >= 16 && memcmp(line, "user tuned", 10) == 0) {
bool is_tuned = strcmp(&line[11], "true\n") == 0;
midi_button_led(fc->sp->seq, fc->sp->port, fc->button_tuned, is_tuned ? BUTTON_LED_ON : BUTTON_LED_OFF);
}
g_free(line);
......@@ -167,7 +172,8 @@ int main(int argc, char *argv[]) {
struct fav_config fc = {
.sp = &sp,
.button = BOTTOM7,
.button_fav = BOTTOM7,
.button_tuned = TOP7,
.username = "minus",
.stdin = child_stdin,
};
......@@ -191,7 +197,8 @@ int main(int argc, char *argv[]) {
struct fav_config fc2 = {
.sp = &sp,
.button = BOTTOM8,
.button_fav = BOTTOM8,
.button_tuned = TOP8,
.username = "mns",
.stdin = child_stdin2,
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment