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

Expose OnAVChange and OnAVStarted to python api #13696

Merged
merged 1 commit into from
Mar 30, 2018

Conversation

razzeee
Copy link
Member

@razzeee razzeee commented Mar 26, 2018

Description

Exposes the new OnAVChange via out python player interface.
I find the naming interesting, as I would have expected it to be called OnAVChanged, is that on purpose or an error?

The other problem is, that it seems to be called multiple times on video start. Tested it with two movies so far and it's been called for times on each start.

Unlike onPlaybackStarted, this does not include data about the file being used. While it's not a problem for my usecase it might be a problem for the ambilight guys.

Motivation and Context

For context https://trac.kodi.tv/ticket/17632#comment:2
Problem is that onPlaybackStarted triggers so early that the player might not be available. So everybody that tries to do stuff with the player then will fail.

How Has This Been Tested?

Tested it with my trakt addon-

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the Code guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my change
  • All new and existing tests passed

#ifdef HAS_PYTHON
// informs python script currently running playback has started
// (does nothing if python is not loaded)
g_pythonParser.OnAVChange();

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@razzeee
Copy link
Member Author

razzeee commented Mar 26, 2018

Would it be possible to get something like onAVChanged, that only triggers once after the stream is initially opend? Or is there a better way to do that?

@razzeee razzeee force-pushed the add-onavchanged-to-python-api branch from 397cb45 to 62dbd4d Compare March 26, 2018 23:37
@razzeee
Copy link
Member Author

razzeee commented Mar 26, 2018

To quote myself:

Unlike onPlaybackStarted, this does not include data about the file being used. While it's not a problem for my usecase it might be a problem for the ambilight guys.

It's not true that onPlaybackStarted returns the file. While it get's passed to the player interface it's not passed along to the python representation.

@jenkins4kodi jenkins4kodi added the Rebase needed PR that does not apply/merge cleanly to current base branch label Mar 29, 2018
@razzeee razzeee force-pushed the add-onavchanged-to-python-api branch from 62dbd4d to fb50ae8 Compare March 30, 2018 09:18
@jenkins4kodi jenkins4kodi removed the Rebase needed PR that does not apply/merge cleanly to current base branch label Mar 30, 2018
@razzeee razzeee changed the title Expose OnAVChange to python api Expose OnAVChange and OnAVStarted to python api Mar 30, 2018
CGUIMessage msg(GUI_MSG_PLAYBACK_AVSTARTED, 0, 0);
g_windowManager.SendThreadMessage(msg);
}

void CApplication::OnAVChange()
{
CLog::LogF(LOGDEBUG, "CApplication::OnAVChange");

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@razzeee
Copy link
Member Author

razzeee commented Mar 30, 2018

Updated for the latest changes. @FernetMenta please have a look if you find some time.

jenkins build this please

Copy link
Contributor

@FernetMenta FernetMenta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@razzeee razzeee merged commit 5141e05 into xbmc:master Mar 30, 2018
@razzeee razzeee deleted the add-onavchanged-to-python-api branch March 30, 2018 15:46
@Rechi Rechi added this to the Leia 18.0-alpha2 milestone Apr 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants