osu

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HitTypeNote = 1 << iota
	HitTypeSlider
	NewCombo
	HitTypeSpinner
	ComboColourSkip1
	ComboColourSkip2
	ComboColourSkip3
	HitTypeHoldNote
)
View Source
const (
	HitSoundNormal = 1 << iota
	HitSoundWhistle
	HitSoundFinish
	HitSoundClap
)
View Source
const (
	TaikoKatMask = HitSoundWhistle | HitSoundClap
	TaikoBigMask = HitSoundFinish
)
View Source
const (
	ModeStandard = iota
	ModeTaiko
	ModeCatch
	ModeMania
)
View Source
const ModeDefault = ModeStandard

Variables

View Source
var HitSounds = []string{"normal", "whistle", "finish", "clap"}
View Source
var SampleSets = []string{"x", "normal", "soft", "drum"}
View Source
var YetDetermined = "?"

Functions

func IsBig

func IsBig(ho HitObject) bool

func IsDon

func IsDon(ho HitObject) bool

func IsKat

func IsKat(ho HitObject) bool

func Mode

func Mode(path string) (int, int)

Types

type Colours

type Colours struct {
	Combos              [8]color.RGBA
	SliderTrackOverride color.RGBA
	SliderBorder        color.RGBA
}

type Difficulty

type Difficulty struct {
	HPDrainRate       float64 `json:"hpDrainRate"`
	CircleSize        float64 `json:"circleSize"`
	OverallDifficulty float64 `json:"overallDifficulty"`
	ApproachRate      float64 `json:"approachRate"`
	SliderMultiplier  float64 `json:"sliderMultiplier"`
	SliderTickRate    float64 `json:"sliderTickRate"`
}

type Editor

type Editor struct {
	Bookmarks       []int   // delimiter,
	DistanceSpacing float64 `json:"distanceSpacing"`
	BeatDivisor     float64 `json:"beatDivisor"`
	GridSize        int     `json:"gridSize"`
	TimelineZoom    float64 `json:"timelineZoom"`
}

type Event

type Event struct {
	Type      string
	StartTime int
	EndTime   int // optional
	Filename  string
	XOffset   int
	YOffset   int
}

storyboard not implemented yet

type Events

type Events []Event

func (Events) Background

func (es Events) Background() (Event, bool)

func (Events) Video

func (es Events) Video() (Event, bool)

type Format

type Format struct {
	FormatVersion int `json:"formatVersion"`
	General
	Editor
	Metadata
	Difficulty
	Events
	TimingPoints
	Colours
	HitObjects
}

func Parse

func Parse(dat []byte) (*Format, error)

type General

type General struct {
	AudioFilename            string  `json:"audioFilename"`
	AudioLeadIn              int     `json:"audioLeadIn"`
	AudioHash                string  `json:"audioHash"` // deprecated
	PreviewTime              int     `json:"previewTime"`
	Countdown                int     `json:"countdown"` // nofloat
	SampleSet                string  `json:"sampleSet"`
	StackLeniency            float64 `json:"stackLeniency"`
	Mode                     int     `json:"mode"` // nofloat
	LetterboxInBreaks        bool    `json:"letterboxInBreaks"`
	StoryFireInFront         bool    `json:"storyFireInFront"` // deprecated
	UseSkinSprites           bool    `json:"useSkinSprites"`
	AlwaysShowPlayfield      bool    `json:"alwaysShowPlayfield"` // deprecated
	OverlayPosition          string  `json:"overlayPosition"`
	SkinPreference           string  `json:"skinPreference"`
	EpilepsyWarning          bool    `json:"epilepsyWarning"`
	CountdownOffset          int     `json:"countdownOffset"`
	SpecialStyle             bool    `json:"specialStyle"`
	WidescreenStoryboard     bool    `json:"widescreenStoryboard"`
	SamplesMatchPlaybackRate bool    `json:"samplesMatchPlaybackRate"`
}

type HitObject

type HitObject struct {
	X            int          `json:"x"`
	Y            int          `json:"y"`
	Time         int          `json:"time"`
	NoteType     int          `json:"noteType"` // nofloat
	HitSound     int          `json:"hitSound"` // nofloat
	EndTime      int          `json:"endTime"`  // optional
	SliderParams SliderParams // optional
	HitSample    HitSample    // optional
}

func (HitObject) Column

func (ho HitObject) Column(columnCount int) int

Column returns index of column at mania playfield

func (HitObject) SliderDuration

func (h HitObject) SliderDuration(speed float64) int

func (HitObject) SliderLength

func (h HitObject) SliderLength() float64

type HitObjects

type HitObjects []HitObject

type HitSample

type HitSample struct {
	NormalSet   int    `json:"normalSet"`   // nofloat
	AdditionSet int    `json:"additionSet"` // nofloat
	Index       int    `json:"index"`       // nofloat
	Volume      int    `json:"volume"`
	Filename    string `json:"filename"`
}

type Metadata

type Metadata struct {
	Title         string   `json:"title"`
	TitleUnicode  string   `json:"titleUnicode"`
	Artist        string   `json:"artist"`
	ArtistUnicode string   `json:"artistUnicode"`
	Creator       string   `json:"creator"`
	Version       string   `json:"version"`
	Source        string   `json:"source"`
	Tags          []string // delimiter(space)
	BeatmapID     int      `json:"beatmapID"`    // nofloat
	BeatmapSetID  int      `json:"beatmapSetID"` // nofloat
}

type SliderParams

type SliderParams struct {
	CurveType   string   `json:"curveType"` // one letter
	CurvePoints [][2]int // delimiter| // delimiter: // slice of paired integers
	Slides      int      `json:"slides"`
	Length      float64  `json:"length"`
	EdgeSounds  []int    // delimiter|
	EdgeSets    [][2]int // delimiter| // delimiter:
}

type TimingPoint

type TimingPoint struct {
	Time        int     `json:"time"`
	BeatLength  float64 `json:"beatLength"`
	Meter       int     `json:"meter"`
	SampleSet   int     `json:"sampleSet"`   // nofloat
	SampleIndex int     `json:"sampleIndex"` // nofloat
	Volume      int     `json:"volume"`
	Uninherited bool    `json:"uninherited"`
	Effects     int     `json:"effects"` // nofloat
}

func (TimingPoint) BPM

func (tp TimingPoint) BPM() float64

BPM supposes tp is Uninherited.

func (TimingPoint) BeatLengthScale

func (tp TimingPoint) BeatLengthScale() float64

BeatLengthScale supposes tp is Inherited.

func (TimingPoint) IsFirstBarOmitted

func (tp TimingPoint) IsFirstBarOmitted() bool

func (TimingPoint) IsInherited

func (tp TimingPoint) IsInherited() bool

func (TimingPoint) IsKiai

func (tp TimingPoint) IsKiai() bool

type TimingPoints

type TimingPoints []TimingPoint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL