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

Move seeking logic into a custom editor clock #2356

Merged
merged 13 commits into from Apr 12, 2018
Merged

Conversation

@smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Apr 6, 2018

  • Editor now has an EditorClock.
  • Moves the seek handling from HitObjectComposer to EditorClock.
  • Cleans up a lot of testcases by encapsulating the clock construction/handling logic.
  • Exposed as an IAdjustableClock to editor components through DI - if we need components to snap later on then we may expose it as the EditorClock itself, but as we discussed earlier this is not needed for now.
{
base.Update();

// We don't have any explicit way to start/stop the track, but want a relatively accurate IsRunning state

This comment has been minimized.

@peppy

peppy Apr 10, 2018
Member

i'm not sure this comment explains what's going on here so well... i can't understand it.

@@ -17,8 +17,15 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
/// </summary>
public class SummaryTimeline : BottomBarContainer
{
private readonly IAdjustableClock adjustableClock;

public SummaryTimeline(IAdjustableClock adjustableClock)

This comment has been minimized.

@peppy

peppy Apr 10, 2018
Member

what's the reasoning behind moving this out of DI?

smoogipoo and others added 4 commits Apr 12, 2018
Beatmap track shouldn't be start/stopped anyway - the IAdjustableClock should be DI'd in to perform the functionality.
ControlPointInfo = controlPointInfo;
}

public bool SeekSnapped(double position)

This comment has been minimized.

@peppy

peppy Apr 12, 2018
Member

probably best to xmldoc this (and hopefully this class too)

}

/// <summary>
/// Seek to the closest valid snap value.

This comment has been minimized.

@smoogipoo

smoogipoo Apr 12, 2018
Author Contributor

This should be something more like "Seek to the closest beat at a time."

}

/// <summary>
/// Seeks the current time one beat-snapped beat-length backwards.

This comment has been minimized.

@smoogipoo

smoogipoo Apr 12, 2018
Author Contributor

Not necessarily snapped (see param).

public void SeekBackward(bool snapped = false) => seek(-1, snapped);

/// <summary>
/// Seeks the current time one beat-snapped beat-length forwards.

This comment has been minimized.

@smoogipoo

smoogipoo Apr 12, 2018
Author Contributor

Not necessarily snapped (see param).

@peppy
peppy approved these changes Apr 12, 2018
@peppy peppy merged commit 3de460f into ppy:master Apr 12, 2018
1 check passed
1 check passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@smoogipoo smoogipoo deleted the smoogipoo:editor-clock branch Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.