@@ -1922,7 +1922,7 @@ void MainWindow::setChapters(QList<Chapter> chapters)
1922
1922
}
1923
1923
}
1924
1924
1925
- void MainWindow::setAudioTracks (QList<QPair< int64_t , QString> > tracks)
1925
+ void MainWindow::setAudioTracks (QList<Track > tracks)
1926
1926
{
1927
1927
ui->menuPlayAudio ->clear ();
1928
1928
ui->menuPlayAudio ->setEnabled (false );
@@ -1932,12 +1932,12 @@ void MainWindow::setAudioTracks(QList<QPair<int64_t, QString>> tracks)
1932
1932
return ;
1933
1933
ui->menuPlayAudio ->setEnabled (true );
1934
1934
audioTracksGroup = new QActionGroup (this );
1935
- for (const QPair< int64_t , QString> &track : tracks) {
1935
+ for (const Track &track : tracks) {
1936
1936
QAction *action = new QAction (this );
1937
- action->setText (track.second );
1937
+ action->setText (track.title );
1938
1938
action->setCheckable (true );
1939
1939
action->setActionGroup (audioTracksGroup);
1940
- int64_t index = track.first ;
1940
+ int64_t index = track.id ;
1941
1941
connect (action, &QAction::triggered, this , [this ,index] {
1942
1942
emit audioTrackSelected (index, true );
1943
1943
});
@@ -1946,7 +1946,7 @@ void MainWindow::setAudioTracks(QList<QPair<int64_t, QString>> tracks)
1946
1946
audioTracksGroup->actions ()[0 ]->setChecked (true );
1947
1947
}
1948
1948
1949
- void MainWindow::setVideoTracks (QList<QPair< int64_t , QString> > tracks)
1949
+ void MainWindow::setVideoTracks (QList<Track > tracks)
1950
1950
{
1951
1951
ui->menuPlayVideo ->clear ();
1952
1952
ui->menuPlayVideo ->setEnabled (false );
@@ -1961,12 +1961,12 @@ void MainWindow::setVideoTracks(QList<QPair<int64_t, QString>> tracks)
1961
1961
ui->menuPlayVideo ->addAction (ui->actionResetVideoAspect );
1962
1962
ui->menuPlayVideo ->addAction (ui->actionDisableVideoAspect );
1963
1963
ui->menuPlayVideo ->addSeparator ();
1964
- for (const QPair< int64_t , QString> &track : tracks) {
1964
+ for (const Track &track : tracks) {
1965
1965
QAction *action = new QAction (this );
1966
- action->setText (track.second );
1966
+ action->setText (track.title );
1967
1967
action->setCheckable (true );
1968
1968
action->setActionGroup (videoTracksGroup);
1969
- int64_t index = track.first ;
1969
+ int64_t index = track.id ;
1970
1970
connect (action, &QAction::triggered, this , [this ,index]() {
1971
1971
emit videoTrackSelected (index, true );
1972
1972
});
@@ -1976,7 +1976,7 @@ void MainWindow::setVideoTracks(QList<QPair<int64_t, QString>> tracks)
1976
1976
updateOnTop ();
1977
1977
}
1978
1978
1979
- void MainWindow::setSubtitleTracks (QList<QPair< int64_t , QString> > tracks)
1979
+ void MainWindow::setSubtitleTracks (QList<Track > tracks)
1980
1980
{
1981
1981
ui->menuPlaySubtitles ->clear ();
1982
1982
ui->menuPlaySubtitles ->setEnabled (false );
@@ -1997,12 +1997,12 @@ void MainWindow::setSubtitleTracks(QList<QPair<int64_t, QString> > tracks)
1997
1997
ui->menuPlaySubtitles ->addAction (ui->actionDecreaseSubtitlesDelay );
1998
1998
ui->menuPlaySubtitles ->addAction (ui->actionIncreaseSubtitlesDelay );
1999
1999
ui->menuPlaySubtitles ->addSeparator ();
2000
- for (const QPair< int64_t , QString> &track : tracks) {
2000
+ for (const Track &track : tracks) {
2001
2001
QAction *action = new QAction (this );
2002
- action->setText (track.second );
2002
+ action->setText (track.title );
2003
2003
action->setCheckable (true );
2004
2004
action->setActionGroup (subtitleTracksGroup);
2005
- int64_t index = track.first ;
2005
+ int64_t index = track.id ;
2006
2006
connect (action, &QAction::triggered, this , [this ,index]() {
2007
2007
emit subtitleTrackSelected (index, true );
2008
2008
});
0 commit comments