Ticket #186: show_sink_names.diff

File show_sink_names.diff, 1.7 kB (added by kritzstapf, 1 year ago)

quick fix

  • pavucontrol.cc

    old new  
    109109 
    110110    SinkType type; 
    111111    Glib::ustring description; 
     112    Glib::ustring name; 
    112113     
    113114    virtual void onMuteToggleButton(); 
    114115    uint32_t index; 
     
    468469void SinkInputWidget::buildMenu() { 
    469470    for (std::map<uint32_t, SinkWidget*>::iterator i = mainWindow->sinkWidgets.begin(); i != mainWindow->sinkWidgets.end(); ++i) { 
    470471        SinkMenuItem *m; 
    471         sinkMenuItems[i->second->index] = m = new SinkMenuItem(this, i->second->description.c_str(), i->second->index, i->second->index == sinkIndex); 
     472 
     473    char itemText[256]; 
     474    snprintf(itemText, 256, "%s [%s]", i->second->description.c_str(), i->second->name.c_str()); 
     475 
     476        sinkMenuItems[i->second->index] = m = new SinkMenuItem(this, itemText, i->second->index, i->second->index == sinkIndex); 
    472477        submenu.append(m->menuItem); 
    473478    } 
    474479 
     
    557562 
    558563    w->type = info.flags & PA_SINK_HARDWARE ? SINK_HARDWARE : SINK_VIRTUAL; 
    559564    w->description = info.description; 
     565    w->name        = info.name; 
    560566 
    561567    w->boldNameLabel->set_text(""); 
    562568    gchar *txt; 
    563     w->nameLabel->set_markup(txt = g_markup_printf_escaped("%s", info.description)); 
     569    w->nameLabel->set_markup(txt = g_markup_printf_escaped("%s [%s]", info.description, info.name)); 
    564570    g_free(txt); 
    565571 
    566572    w->setVolume(info.volume); 
     
    588594 
    589595    w->boldNameLabel->set_text(""); 
    590596    gchar *txt; 
    591     w->nameLabel->set_markup(txt = g_markup_printf_escaped("%s", info.description)); 
     597    w->nameLabel->set_markup(txt = g_markup_printf_escaped("%s [%s]", info.description, info.name)); 
    592598    g_free(txt); 
    593599     
    594600    w->setVolume(info.volume);