Advertisement
Guest User

Untitled

a guest
May 20th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void MainWindow::onFormatComboBoxIndexChanged(int AIndex)
  2. {
  3.     QAVOutputFormat format;
  4.     QString name = ui->cmbFormat->itemData(AIndex).toString();
  5.     ui->cmbCodec->clear();
  6.  
  7.     for (format = QAVOutputFormat::first(); format; ++format)
  8.         if (format.name()==name)
  9.             break;
  10.  
  11.     if (format)
  12.     {
  13.         QList<QAVCodec> encoders = QAVCodec::getCodecs(QAVCodec::Encoder, QAVCodec::MT_Audio);
  14.         for (QList<QAVCodec>::ConstIterator it=encoders.constBegin(); it!=encoders.constEnd(); ++it)
  15.             if (format.queryCodec(*it))
  16.                 ui->cmbCodec->addItem((*it).longName(), (*it).id());
  17.         ui->lblFormatName->setText(format.name());
  18.     }
  19.     else
  20.         ui->lblFormatName->clear();
  21. }
  22.  
  23.  
  24.  
  25. // Static methods
  26. QAVOutputFormat QAVOutputFormat::first()
  27. {
  28.     return QAVOutputFormat(av_oformat_next(NULL));
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement