]> git.sesse.net Git - nageru/blobdiff - glwidget.cpp
Make it possible to load/save input mappings.
[nageru] / glwidget.cpp
index bf3ac13a6a6cb53df3f332785af6e8c980f291b4..ec4335359e72557df0d0b9e434781fac35c227d5 100644 (file)
@@ -53,16 +53,26 @@ void GLWidget::initializeGL()
        static once_flag flag;
        call_once(flag, [this]{
                global_mixer = new Mixer(QGLFormat::toSurfaceFormat(format()), global_flags.num_cards);
+               global_audio_mixer = global_mixer->get_audio_mixer();
                global_mainwindow->mixer_created(global_mixer);
                global_mixer->start();
        });
        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);
        });
-
+       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);
@@ -181,7 +191,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) {