From d3b6c3e6aceea590cead8f5c79cd890b5eed85cf Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Sun, 29 Dec 2024 17:20:21 -0500 Subject: [PATCH] convert MythPlayer::SignalTracksChanged(): from a signal to a virtual function It is only used once and was only ever connected to itself. This basically reverts 4567527bc1cac98ee417b61102e458eadba449f1. --- mythtv/libs/libmythtv/decoders/decoderbase.cpp | 2 +- mythtv/libs/libmythtv/mythplayer.h | 3 ++- mythtv/libs/libmythtv/mythplayercaptionsui.cpp | 3 +-- mythtv/libs/libmythtv/mythplayercaptionsui.h | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mythtv/libs/libmythtv/decoders/decoderbase.cpp b/mythtv/libs/libmythtv/decoders/decoderbase.cpp index e820b755998..314baac2cfb 100644 --- a/mythtv/libs/libmythtv/decoders/decoderbase.cpp +++ b/mythtv/libs/libmythtv/decoders/decoderbase.cpp @@ -1160,7 +1160,7 @@ int DecoderBase::AutoSelectTrack(uint Type) .arg(m_currentTrack[Type]+1).arg(Type).arg(iso639_key_toName(lang)).arg(lang)); if (m_parent && (oldTrack != m_currentTrack[Type])) - emit m_parent->SignalTracksChanged(Type); + m_parent->tracksChanged(Type); return selTrack; } diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h index 121c12f3c66..cd9395fbe5e 100644 --- a/mythtv/libs/libmythtv/mythplayer.h +++ b/mythtv/libs/libmythtv/mythplayer.h @@ -101,7 +101,6 @@ class MTV_PUBLIC MythPlayer : public QObject void SeekingDone(); void PauseChanged(bool Paused); void RequestResetCaptions(); - void SignalTracksChanged(uint Type); public: explicit MythPlayer(PlayerContext* Context, PlayerFlags Flags = kNoFlags); @@ -204,6 +203,8 @@ class MTV_PUBLIC MythPlayer : public QObject // These two functions are not thread-safe (UI thread use only). bool GetAllowForcedSubtitles(void) const { return m_allowForcedSubtitles; } + virtual void tracksChanged([[maybe_unused]] uint TrackType) {} + // LiveTV public stuff void CheckTVChain(); void FileChangedCallback(); diff --git a/mythtv/libs/libmythtv/mythplayercaptionsui.cpp b/mythtv/libs/libmythtv/mythplayercaptionsui.cpp index de58008acf2..7851a9db0be 100644 --- a/mythtv/libs/libmythtv/mythplayercaptionsui.cpp +++ b/mythtv/libs/libmythtv/mythplayercaptionsui.cpp @@ -47,7 +47,6 @@ MythPlayerCaptionsUI::MythPlayerCaptionsUI(MythMainWindow* MainWindow, TV* Tv, P // Signalled from the decoder connect(this, &MythPlayerCaptionsUI::EnableSubtitles, this, [this](bool Enable) { this->SetCaptionsEnabled(Enable, false); }); - connect(this, &MythPlayerCaptionsUI::SignalTracksChanged, this, &MythPlayerCaptionsUI::TracksChanged); // Signalled from the base class connect(this, &MythPlayerCaptionsUI::RequestResetCaptions, this, &MythPlayerCaptionsUI::ResetCaptions); @@ -251,7 +250,7 @@ void MythPlayerCaptionsUI::EnableCaptions(uint Mode, bool UpdateOSD) /*! \brief This tries to re-enable captions/subtitles if the user * wants them and one of the captions/subtitles tracks has changed. */ -void MythPlayerCaptionsUI::TracksChanged(uint TrackType) +void MythPlayerCaptionsUI::tracksChanged(uint TrackType) { if (m_textDesired && (TrackType >= kTrackTypeSubtitle) && (TrackType <= kTrackTypeTeletextCaptions)) SetCaptionsEnabled(true, false); diff --git a/mythtv/libs/libmythtv/mythplayercaptionsui.h b/mythtv/libs/libmythtv/mythplayercaptionsui.h index 22ae2d3a441..b81ef4ee5b5 100644 --- a/mythtv/libs/libmythtv/mythplayercaptionsui.h +++ b/mythtv/libs/libmythtv/mythplayercaptionsui.h @@ -32,9 +32,10 @@ class MTV_PUBLIC MythPlayerCaptionsUI : public MythPlayerAudioUI std::chrono::milliseconds GetStreamMaxPos(); InteractiveTV* GetInteractiveTV() override; + void tracksChanged(uint TrackType) override; + protected slots: void InitialiseState() override; - void TracksChanged(uint TrackType); void SetAllowForcedSubtitles(bool Allow); void ToggleCaptions(); void ToggleCaptionsByType(uint Type);