X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fglwidget.cpp;h=62aeebc9cc14a0a7de7ca47a2be03076d1d79537;hb=4df45e479ddbc8e2247be8aab7f2bab5ddaa1b74;hp=bf537de2dbdb0806d2c41fec0b8ebf3fcd74d8e7;hpb=9b7d691b4cc5db7dbfc18c82e86c1207fcac4722;p=nageru diff --git a/nageru/glwidget.cpp b/nageru/glwidget.cpp index bf537de..62aeebc 100644 --- a/nageru/glwidget.cpp +++ b/nageru/glwidget.cpp @@ -20,12 +20,12 @@ #include #include "audio_mixer.h" -#include "context.h" +#include "shared/context.h" #include "context_menus.h" #include "flags.h" #include "mainwindow.h" #include "mixer.h" -#include "ref_counted_gl_sync.h" +#include "shared/ref_counted_gl_sync.h" class QMouseEvent; @@ -72,7 +72,7 @@ void GLWidget::grab_white_balance(unsigned channel, unsigned x, unsigned y) { // Set the white balance to neutral for the grab. It's probably going to // flicker a bit, but hopefully this display is not live anyway. - global_mixer->set_wb(output, 0.5, 0.5, 0.5); + global_mixer->set_wb(output, 1.0, 1.0, 1.0); global_mixer->wait_for_next_frame(); // Mark that the next paintGL() should grab the given pixel. @@ -96,15 +96,15 @@ void GLWidget::initializeGL() global_mixer->add_frame_ready_callback(output, this, [this]{ QMetaObject::invokeMethod(this, "update", Qt::AutoConnection); }); + global_mixer->set_name_updated_callback(output, [this](const string &name){ + emit name_updated(output, name); + }); 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); }); @@ -174,7 +174,7 @@ void GLWidget::show_context_menu(const QPoint &pos) show_live_context_menu(pos); } if (output >= Mixer::OUTPUT_INPUT0) { - int signal_num = global_mixer->get_channel_signal(output); + int signal_num = global_mixer->map_channel_to_signal(output); if (signal_num != -1) { show_preview_context_menu(signal_num, pos); } @@ -228,10 +228,10 @@ void GLWidget::show_preview_context_menu(unsigned signal_num, const QPoint &pos) QActionGroup mode_group(&mode_submenu); unsigned num_cards = global_mixer->get_num_cards(); - unsigned current_card = global_mixer->map_signal(signal_num); + unsigned current_card = global_mixer->map_signal_to_card(signal_num); bool is_ffmpeg = global_mixer->card_is_ffmpeg(current_card); - if (!is_ffmpeg) { // FFmpeg inputs are not connected to any card; they're locked to a given input and have a given Y'CbCr interpretatio and have a given Y'CbCr interpretationn. + if (!is_ffmpeg) { // FFmpeg inputs are not connected to any card; they're locked to a given input and have a given Y'CbCr interpretatio and have a given Y'CbCr interpretation. for (unsigned card_index = 0; card_index < num_cards; ++card_index) { QString description(QString::fromStdString(global_mixer->get_card_description(card_index))); QAction *action = new QAction(description, &card_group); @@ -292,10 +292,8 @@ void GLWidget::show_preview_context_menu(unsigned signal_num, const QPoint &pos) if (is_ffmpeg) { // Add a menu to change the source URL if we're an FFmpeg card. // (The theme can still override.) - if (global_mixer->card_is_ffmpeg(current_card)) { - change_url_action = new QAction("Change source filename/URL…", &menu); - menu.addAction(change_url_action); - } + change_url_action = new QAction("Change source filename/URL…", &menu); + menu.addAction(change_url_action); } else { // Add a submenu for selecting video input, with an action for each input. std::map video_inputs = global_mixer->get_available_video_inputs(current_card);