Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] make m_pPlayer private and expose it through method GetAppPlayer() #13259

Merged
merged 7 commits into from
Dec 30, 2017

Conversation

xhaggi
Copy link
Member

@xhaggi xhaggi commented Dec 28, 2017

see commits

@xhaggi xhaggi added the Type: Cleanup non-breaking change which removes non-working or unmaintained functionality label Dec 28, 2017
@xhaggi xhaggi force-pushed the refactor-player-member-access branch from 18120ae to dde89f0 Compare December 28, 2017 14:46
@@ -4864,6 +4865,11 @@ std::string CApplication::GetCurrentPlayer()
return m_pPlayer->GetCurrentPlayer();
}

std::shared_ptr<CApplicationPlayer> CApplication::GetAppPlayer()
{
return m_pPlayer;

This comment was marked as spam.

break;
case PLAYER_CHAPTERNAME:
if(g_application.m_pPlayer->IsPlaying())
g_application.m_pPlayer->GetChapterName(strLabel);
if(g_application.GetAppPlayer()->IsPlaying())

This comment was marked as spam.

{
strLabel = m_videoInfo.stereoMode;
}
break;
case VIDEOPLAYER_SUBTITLES_LANG:
if(g_application.m_pPlayer && g_application.m_pPlayer->IsPlaying() && g_application.m_pPlayer->GetSubtitleVisible())
if(g_application.GetAppPlayer() && g_application.GetAppPlayer()->IsPlaying() && g_application.GetAppPlayer()->GetSubtitleVisible())

This comment was marked as spam.

@@ -502,6 +501,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
std::atomic_uint m_WaitingExternalCalls; /*!< counts threads wich are waiting to be processed in FrameMove */
unsigned int m_ProcessedExternalCalls; /*!< counts calls wich are processed during one "door open" cycle in FrameMove */
unsigned int m_ProcessedExternalDecay = 0; /*!< counts to close door after a few frames of no python activity */
std::shared_ptr<CApplicationPlayer> m_pPlayer;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@xhaggi xhaggi force-pushed the refactor-player-member-access branch from dde89f0 to e60b29c Compare December 28, 2017 16:16
@@ -6136,11 +6136,11 @@ std::string CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *
}
break;
case PLAYER_PLAYSPEED:
if(g_application.m_pPlayer->IsPlaying())
if(g_application.GetAppPlayer().IsPlaying())

This comment was marked as spam.

This comment was marked as spam.

{
strLabel = CStreamDetails::VideoAspectToAspectDescription(CServiceBroker::GetDataCacheCore().GetVideoDAR());
}
break;
case VIDEOPLAYER_AUDIO_CHANNELS:
if(g_application.m_pPlayer->IsPlaying())
if(g_application.GetAppPlayer().IsPlaying())

This comment was marked as spam.

This comment was marked as spam.

int64_t playTime = g_application.m_pPlayer->GetTime();
double minSeekSize = (g_application.m_pPlayer->GetMinTime() - playTime) / 1000;
double maxSeekSize = (g_application.m_pPlayer->GetMaxTime() - playTime) / 1000;
int64_t playTime = g_application.GetAppPlayer().GetTime();

This comment was marked as spam.

@jenkins4kodi jenkins4kodi added the Rebase needed PR that does not apply/merge cleanly to current base branch label Dec 28, 2017
@xhaggi xhaggi force-pushed the refactor-player-member-access branch from c4372ef to 9ea824d Compare December 28, 2017 18:11
@xhaggi xhaggi removed the Rebase needed PR that does not apply/merge cleanly to current base branch label Dec 28, 2017
@xbmc xbmc deleted a comment from jenkins4kodi Dec 28, 2017
@jenkins4kodi jenkins4kodi added the Rebase needed PR that does not apply/merge cleanly to current base branch label Dec 29, 2017
@xhaggi xhaggi force-pushed the refactor-player-member-access branch from 9ea824d to e930ba7 Compare December 29, 2017 11:30
@jenkins4kodi jenkins4kodi removed the Rebase needed PR that does not apply/merge cleanly to current base branch label Dec 29, 2017
@xhaggi
Copy link
Member Author

xhaggi commented Dec 29, 2017

@Voyager1 FYI .. I changed the unique ptr CApplicationStackHelper to be a plain member of CApplication and made it private with a public method GetAppStackHelper.

@xhaggi
Copy link
Member Author

xhaggi commented Dec 29, 2017

jenkins build this please

@jenkins4kodi jenkins4kodi added the Rebase needed PR that does not apply/merge cleanly to current base branch label Dec 30, 2017
@xhaggi xhaggi force-pushed the refactor-player-member-access branch from e930ba7 to 395a82d Compare December 30, 2017 12:46
@xhaggi
Copy link
Member Author

xhaggi commented Dec 30, 2017

@FernetMenta would be nice if you could take another look so I don't need another rebase round.

@@ -7223,88 +7190,88 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI
CGUIWindowSlideShow *slideShow = g_windowManager.GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
bReturn = (slideShow && slideShow->GetCurrentSlide() && slideShow->GetCurrentSlide()->IsVideo());
}
else if (g_application.m_pPlayer->IsPlaying())
else if (g_application.GetAppPlayer().IsPlaying())

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@jenkins4kodi jenkins4kodi removed the Rebase needed PR that does not apply/merge cleanly to current base branch label Dec 30, 2017
…etBool

This reduces dupe code and is necessary to easily drop the IsPlaying condition in the middle of the previous elseif conditions.
@xhaggi xhaggi force-pushed the refactor-player-member-access branch from 395a82d to 5decb14 Compare December 30, 2017 13:50
@FernetMenta
Copy link
Contributor

+1

@Voyager1
Copy link

I changed the unique ptr CApplicationStackHelper to be a plain member of CApplication and made it private with a public method GetAppStackHelper.

seems ok to me.

@xhaggi
Copy link
Member Author

xhaggi commented Dec 30, 2017

Jenkins build this please

@xhaggi xhaggi merged commit 012eaf4 into xbmc:master Dec 30, 2017
@Rechi Rechi added the v18 Leia label Dec 31, 2017
@Rechi Rechi added this to the L 18.0-alpha1 milestone Dec 31, 2017
@xhaggi xhaggi deleted the refactor-player-member-access branch January 4, 2018 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Cleanup non-breaking change which removes non-working or unmaintained functionality v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants