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

Rough implementation of automatic seekpoint using bookmarks #2437

Merged
merged 4 commits into from Jun 17, 2017

Conversation

Projects
None yet
2 participants
@Meriipu
Contributor

Meriipu commented Jun 15, 2017

#2432

This could probably be tidier in ways but it seems to work well enough for me.
Set bookmark names to use for points (A,B) in plugin config if desired (defaults are A,B).
Create bookmarks A and /or B for a track, whenever plugin is enabled and track is played, it skips to point A if it exists and stops after point B if it exists.

Are there cleaner ways to detect whether a time tracker has been destroyed?
I destroy it if point B does not exist, as there is no point I can see checking every tick if the current position is past point B if point B does not exist.

def enabled(self):
self._SeekPoint_A, self._SeekPoint_B = self._get_SeekPoints()
self._try_create_tracker(force=True)

This comment has been minimized.

@lazka

lazka Jun 17, 2017

Member

You should be able to just use enabled() and disabled() for creating/removing TimeTracker.

This comment has been minimized.

@Meriipu

Meriipu Jun 17, 2017

Contributor

Can the tracker be stopped and started otherwise so to not make on_tick callbacks for tracks that do not have a B-seekpoint, or is the overhead from that minimal?

# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# For more information, please refer to <http://unlicense.org>

This comment has been minimized.

@lazka

lazka Jun 17, 2017

Member

Please use the following license to fix the tests:

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
if self._SeekPoint_B <= time:
self._seek(app.player.info("~#length"))
def _get_SeekPoints(self):

This comment has been minimized.

@lazka

lazka Jun 17, 2017

Member

Please use lowercase function names and variable names. https://www.python.org/dev/peps/pep-0008/#function-names

@Meriipu Meriipu force-pushed the Meriipu:seekpoints_dev branch from 77fa8a9 to 980da55 Jun 17, 2017

@lazka lazka merged commit 2b8a0d7 into quodlibet:master Jun 17, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@lazka

This comment has been minimized.

Member

lazka commented Jun 17, 2017

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment