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<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);
});
connect(ui->me_live, &GLWidget::transition_names_updated, this, &MainWindow::set_transition_names);
qRegisterMetaType<Mixer::Output>("Mixer::Output");
+ connect(ui->me_live, &GLWidget::name_updated, this, &MainWindow::update_channel_name);
+ connect(ui->me_preview, &GLWidget::name_updated, this, &MainWindow::update_channel_name);
+
// Hook up the prev/next buttons on the audio views.
connect(ui->compact_prev_page, &QAbstractButton::clicked, this, &MainWindow::prev_page);
connect(ui->compact_next_page, &QAbstractButton::clicked, this, &MainWindow::next_page);
void MainWindow::update_channel_name(Mixer::Output output, const string &name)
{
- if (output >= Mixer::OUTPUT_INPUT0) {
+ if (output == Mixer::OUTPUT_LIVE) {
+ ui->label_live->setText(name.c_str());
+ } else if (output == Mixer::OUTPUT_PREVIEW) {
+ ui->label_preview->setText(name.c_str());
+ } else if (output >= Mixer::OUTPUT_INPUT0) {
unsigned channel = output - Mixer::OUTPUT_INPUT0;
previews[channel]->label->setText(name.c_str());
}
Theme::Theme(const string &filename, const vector<string> &search_dirs, ResourcePool *resource_pool, unsigned num_cards)
: resource_pool(resource_pool), num_cards(num_cards), signal_to_card_mapping(global_flags.default_stream_mapping)
{
+ // Defaults.
+ channel_names[0] = "Live";
+ channel_names[1] = "Preview";
+
L = luaL_newstate();
luaL_openlibs(L);
{
lock_guard<mutex> lock(m);
+ // We never ask the legacy channel_name() about live and preview.
+ // The defaults are set in our constructor.
+ if (channel == 0 || channel == 1) {
+ return channel_names[channel];
+ }
+
lua_getglobal(L, "channel_name");
if (lua_isnil(L, -1)) {
lua_pop(L, 1);