Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
remove PlayEngine::isAudioOnly() and check albumart directly through …
Browse files Browse the repository at this point in the history
…stream information
  • Loading branch information
bylee20 committed Mar 30, 2015
1 parent da2c8ee commit c8741a1
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/bomi/player/mainwindow_m.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ auto MainWindow::Data::plugMenu() -> void
PROP_NOTIFY(video_color, [=] (auto eq) { return eq.description(); });

connect(e.params(), &MrlState::currentTrackChanged, p, [=] (StreamType type) {
// qDebug() << "notified" << e.params()->tracks(type).selectionId();
if (auto track = e.params()->tracks(type).selection())
showMessage(e.params()->description(type), track->name());
else
Expand Down
4 changes: 2 additions & 2 deletions src/bomi/player/mainwindow_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,9 @@ auto MainWindow::Data::doVisibleAction(bool visible) -> void
p->setIcon(cApp.defaultIcon());
#endif
} else {
if (!pref.pause_minimized())
if (!pref.pause_minimized() || !e.isPlaying())
return;
if (!e.isPlaying() || (pref.pause_video_only() && e.isAudioOnly()))
if (pref.pause_video_only() && e.video()->track()->isAlbumArt())
return;
pausedByHiding = true;
e.pause();
Expand Down
14 changes: 0 additions & 14 deletions src/bomi/player/playengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,8 @@ PlayEngine::PlayEngine()
connect(&d->params, &MrlState::video_effects_changed, d->vr, [=] (auto e)
{ d->vr->setFlipped(e & VideoEffect::FlipH, e & VideoEffect::FlipV); });
connect(&d->params, &MrlState::video_tracks_changed, this, [=] (StreamList list) {
bool audioOnly = true;
for (const auto &track : list) {
if (!track.isAlbumArt()) {
audioOnly = false;
break;
}
}
if (_Change(d->hasVideo, !list.isEmpty()))
emit hasVideoChanged();
if (_Change(d->audioOnly, audioOnly))
emit audioOnlyChanged();
d->info.video.setTracks(list);
});

Expand Down Expand Up @@ -656,11 +647,6 @@ auto PlayEngine::seekEdition(int number, int from) -> void
}
}

auto PlayEngine::isAudioOnly() const -> bool
{
return d->audioOnly;
}

auto PlayEngine::setAudioVolume(double volume) -> void
{
if (d->params.set_audio_volume(volume))
Expand Down
2 changes: 0 additions & 2 deletions src/bomi/player/playengine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class PlayEngine : public QObject {
auto chapters() const -> const QVector<ChapterObject*>&;
auto seekEdition(int number, int from = 0) -> void;
auto seekChapter(int number) -> void;
auto isAudioOnly() const -> bool;

auto setAudioFiles(const QStringList &files) -> void;
auto addAudioFiles(const QStringList &files) -> void;
Expand Down Expand Up @@ -293,7 +292,6 @@ public slots:
void hwaccChanged();
void cacheUsedChanged();
void hasVideoChanged();
void audioOnlyChanged();
void chapterChanged();
void subtitleTrackInfoChanged();
void metaDataChanged();
Expand Down
2 changes: 1 addition & 1 deletion src/bomi/player/playengine_p.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct PlayEngine::Data {
QSharedPointer<MrlState> local;
} t; // thread local

bool hasImage = false, seekable = false, hasVideo = false, audioOnly = false;
bool hasImage = false, seekable = false, hasVideo = false;
bool pauseAfterSkip = false, resume = false, hwdec = false;
bool quit = false, preciseSeeking = false, mouseInButton = false;
bool filterResync = false;
Expand Down

0 comments on commit c8741a1

Please sign in to comment.