]> git.sesse.net Git - nageru/blobdiff - glwidget.cpp
Add a benchmark for a simple audio chain; easier than profiling all of Nageru.
[nageru] / glwidget.cpp
index f8e76c771402e6688e9be75e601a3f08c8230894..6409a1347dd869444dd039e03917373d84fae01f 100644 (file)
@@ -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<string> &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<uint32_t, VideoMode> video_modes = global_mixer->get_available_video_modes(current_card);
+       std::map<uint32_t, bmusb::VideoMode> 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) {