Skip to content

Commit

Permalink
convert MythPlayer::SignalTracksChanged(): from a signal to a virtual…
Browse files Browse the repository at this point in the history
… function

It is only used once and was only ever connected to itself.

This basically reverts 4567527.
  • Loading branch information
ulmus-scott authored and bennettpeter committed Jan 6, 2025
1 parent 224d05a commit d3b6c3e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/decoders/decoderbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/mythplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythtv/mythplayercaptionsui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/mythplayercaptionsui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d3b6c3e

Please sign in to comment.