X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=glwidget.cpp;h=6409a1347dd869444dd039e03917373d84fae01f;hb=1fc8b5d92fce7ac0b7e87ed3087e393774fd4b3c;hp=f8e76c771402e6688e9be75e601a3f08c8230894;hpb=f006b5b162841dbc764fb620025b87a3272ac79a;p=nageru diff --git a/glwidget.cpp b/glwidget.cpp index f8e76c7..6409a13 100644 --- a/glwidget.cpp +++ b/glwidget.cpp @@ -58,12 +58,20 @@ void GLWidget::initializeGL() }); global_mixer->set_frame_ready_callback(output, [this]{ QMetaObject::invokeMethod(this, "update", Qt::AutoConnection); - emit transition_names_updated(global_mixer->get_transition_names()); - emit resolution_updated(output); - emit color_updated(output); }); - + if (output == Mixer::OUTPUT_LIVE) { + global_mixer->set_transition_names_updated_callback(output, [this](const vector &names){ + emit transition_names_updated(names); + }); + } if (output >= Mixer::OUTPUT_INPUT0) { + global_mixer->set_name_updated_callback(output, [this](const string &name){ + emit name_updated(output, name); + }); + global_mixer->set_color_updated_callback(output, [this](const string &color){ + emit color_updated(output, color); + }); + int signal_num = global_mixer->get_channel_signal(output); if (signal_num != -1) { setContextMenuPolicy(Qt::CustomContextMenu); @@ -182,7 +190,7 @@ void GLWidget::show_context_menu(unsigned signal_num, const QPoint &pos) // The same for resolution. QMenu mode_submenu; QActionGroup mode_group(&mode_submenu); - std::map video_modes = global_mixer->get_available_video_modes(current_card); + std::map video_modes = global_mixer->get_available_video_modes(current_card); uint32_t current_video_mode = global_mixer->get_current_video_mode(current_card); bool has_auto_mode = false; for (const auto &mode : video_modes) {