diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2016-07-12 18:46:22 +0200 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2016-07-12 18:46:22 +0200 |
commit | a06df2b593048aa4be46c127b24b7fd68a0d4564 (patch) | |
tree | 26fe8f6925df50a2f3e8039661c92618ee14c67d | |
parent | d4623d3132148ebb9ff0d329a812c4baa3fc57ff (diff) |
player: drop unneded method ControlsVolume
-rw-r--r-- | xbmc/Application.cpp | 15 | ||||
-rw-r--r-- | xbmc/ApplicationPlayer.cpp | 6 | ||||
-rw-r--r-- | xbmc/ApplicationPlayer.h | 1 | ||||
-rw-r--r-- | xbmc/cores/IPlayer.h | 1 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/IVideoPlayer.h | 4 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayer.cpp | 17 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayer.h | 8 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayerAudio.h | 2 |
8 files changed, 26 insertions, 28 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 6a30872ab5..4433418e0c 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -3406,12 +3406,8 @@ PlayBackRet CApplication::PlayFile(CFileItem item, const std::string& player, bo if (iResult == PLAYBACK_OK) { - // if player has volume control, set it. - if (m_pPlayer->ControlsVolume()) - { - m_pPlayer->SetVolume(m_volumeLevel); - m_pPlayer->SetMute(m_muted); - } + m_pPlayer->SetVolume(m_volumeLevel); + m_pPlayer->SetMute(m_muted); if(m_pPlayer->IsPlayingAudio()) { @@ -4700,11 +4696,8 @@ void CApplication::VolumeChanged() const CAnnouncementManager::GetInstance().Announce(Application, "xbmc", "OnVolumeChanged", data); // if player has volume control, set it. - if (m_pPlayer->ControlsVolume()) - { - m_pPlayer->SetVolume(m_volumeLevel); - m_pPlayer->SetMute(m_muted); - } + m_pPlayer->SetVolume(m_volumeLevel); + m_pPlayer->SetMute(m_muted); } int CApplication::GetSubtitleDelay() const diff --git a/xbmc/ApplicationPlayer.cpp b/xbmc/ApplicationPlayer.cpp index dec41a34fb..9930cfb4a6 100644 --- a/xbmc/ApplicationPlayer.cpp +++ b/xbmc/ApplicationPlayer.cpp @@ -226,12 +226,6 @@ void CApplicationPlayer::Pause() player->Pause(); } -bool CApplicationPlayer::ControlsVolume() const -{ - std::shared_ptr<IPlayer> player = GetInternal(); - return (player && player->ControlsVolume()); -} - void CApplicationPlayer::SetMute(bool bOnOff) { std::shared_ptr<IPlayer> player = GetInternal(); diff --git a/xbmc/ApplicationPlayer.h b/xbmc/ApplicationPlayer.h index 590fa8a706..fece6670a4 100644 --- a/xbmc/ApplicationPlayer.h +++ b/xbmc/ApplicationPlayer.h @@ -107,7 +107,6 @@ public: bool CanPause(); bool CanRecord(); bool CanSeek(); - bool ControlsVolume() const; void DoAudioWork(); void GetAudioCapabilities(std::vector<int> &audioCaps); int GetAudioStream(); diff --git a/xbmc/cores/IPlayer.h b/xbmc/cores/IPlayer.h index ee26ceba50..9bfddf1d30 100644 --- a/xbmc/cores/IPlayer.h +++ b/xbmc/cores/IPlayer.h @@ -257,7 +257,6 @@ public: virtual float GetCachePercentage(){ return 0;} virtual void SetMute(bool bOnOff){} virtual void SetVolume(float volume){} - virtual bool ControlsVolume(){ return false;} virtual void SetDynamicRangeCompression(long drc){} virtual bool CanRecord() { return false;}; virtual bool IsRecording() { return false;}; diff --git a/xbmc/cores/VideoPlayer/IVideoPlayer.h b/xbmc/cores/VideoPlayer/IVideoPlayer.h index aa9033a749..5fdfc7499a 100644 --- a/xbmc/cores/VideoPlayer/IVideoPlayer.h +++ b/xbmc/cores/VideoPlayer/IVideoPlayer.h @@ -181,8 +181,8 @@ public: virtual int GetLevel() const = 0; virtual bool IsInited() const = 0; virtual void SendMessage(CDVDMsg* pMsg, int priority = 0) = 0; - virtual void SetVolume(float fVolume) = 0; - virtual void SetMute(bool bOnOff) = 0; + virtual void SetVolume(float fVolume) {}; + virtual void SetMute(bool bOnOff) {}; virtual void SetDynamicRangeCompression(long drc) = 0; virtual std::string GetPlayerInfo() = 0; virtual int GetAudioBitrate() = 0; diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index fa6aca13a1..8b1fe05bdf 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -4890,6 +4890,23 @@ void CVideoPlayer::UpdateApplication(double timeout) m_UpdateApplication = m_clock.GetAbsoluteClock(); } +void CVideoPlayer::SetVolume(float nVolume) +{ + if (m_omxplayer_mode) + m_VideoPlayerAudio->SetVolume(nVolume); +} + +void CVideoPlayer::SetMute(bool bOnOff) +{ + if (m_omxplayer_mode) + m_VideoPlayerAudio->SetMute(bOnOff); +} + +void CVideoPlayer::SetDynamicRangeCompression(long drc) +{ + m_VideoPlayerAudio->SetDynamicRangeCompression(drc); +} + bool CVideoPlayer::CanRecord() { CSingleLock lock(m_StateSection); diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.h b/xbmc/cores/VideoPlayer/VideoPlayer.h index 981b9f9f6e..b2ebe5ffbd 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.h +++ b/xbmc/cores/VideoPlayer/VideoPlayer.h @@ -255,9 +255,9 @@ public: virtual float GetPercentage(); virtual float GetCachePercentage(); - virtual void SetVolume(float nVolume) { m_VideoPlayerAudio->SetVolume(nVolume); } - virtual void SetMute(bool bOnOff) { m_VideoPlayerAudio->SetMute(bOnOff); } - virtual void SetDynamicRangeCompression(long drc) { m_VideoPlayerAudio->SetDynamicRangeCompression(drc); } + virtual void SetVolume(float nVolume) override; + virtual void SetMute(bool bOnOff) override; + virtual void SetDynamicRangeCompression(long drc) override; virtual bool CanRecord(); virtual bool IsRecording(); virtual bool CanPause(); @@ -354,8 +354,6 @@ public: virtual int OnDVDNavResult(void* pData, int iMessage) override; void GetVideoResolution(unsigned int &width, unsigned int &height) override; - virtual bool ControlsVolume() {return m_omxplayer_mode;} - protected: friend class CSelectionStreams; diff --git a/xbmc/cores/VideoPlayer/VideoPlayerAudio.h b/xbmc/cores/VideoPlayer/VideoPlayerAudio.h index d1653e0ae6..7f8197a22e 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerAudio.h +++ b/xbmc/cores/VideoPlayer/VideoPlayerAudio.h @@ -55,8 +55,6 @@ public: void SendMessage(CDVDMsg* pMsg, int priority = 0) { m_messageQueue.Put(pMsg, priority); } void FlushMessages() { m_messageQueue.Flush(); } - void SetVolume(float fVolume) { m_dvdAudio.SetVolume(fVolume); } - void SetMute(bool bOnOff) { } void SetDynamicRangeCompression(long drc) { m_dvdAudio.SetDynamicRangeCompression(drc); } float GetDynamicRangeAmplification() const { return 0.0f; } |