osu_parser

package
v0.0.0-...-7fc25d4 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SectionGeneral      = 0
	SectionEditor       = 1
	SectionMetadata     = 2
	SectionDifficulty   = 3
	SectionEvents       = 4
	SectionTimingPoints = 5
	SectionHitObjects   = 6
	SectionIgnore       = 7
)
View Source
const (
	HitObjectTypeCircle         HitObjectType = 1
	HitObjectTypeSlider         HitObjectType = 2
	HitObjectTypeNewCombo       HitObjectType = 4
	HitObjectTypeCircleNewCombo HitObjectType = 5
	HitObjectTypeSliderNewCombo HitObjectType = 6
	HitObjectTypeSpinner        HitObjectType = 8
	HitObjectTypeColorHax       HitObjectType = 112
	HitObjectTypeHold           HitObjectType = 128

	HitSoundTypeNone    HitSoundType = 0
	HitSoundTypeDefault HitSoundType = 1
	HitSoundTypeWhistle HitSoundType = 2
	HitSoundTypeFinish  HitSoundType = 4
	HitSoundTypeClap    HitSoundType = 8

	SampleSetNone   SampleSet = 0
	SampleSetNormal SampleSet = 1
	SampleSetSoft   SampleSet = 2
	SampleSetDrum   SampleSet = 3

	CustomSampleSetNone CustomSampleSet = 0
	CustomSampleSet1    CustomSampleSet = 1
	CustomSampleSet2    CustomSampleSet = 2

	CurveTypeCatmull CurveType = 0
	CurveTypeBezier  CurveType = 1
	CurveTypeLinear  CurveType = 2
	CurveTypePerfect CurveType = 3
)
View Source
const (
	TimeSignatureQuadruple TimeSignature = 0
	TimeSignatureTriplet   TimeSignature = 1
	TimeSignature5         TimeSignature = 5
	TimeSignature6         TimeSignature = 6
	TimeSignature7         TimeSignature = 7

	SpecialNone             Special = 0
	SpecialKiai             Special = 1
	SpecialTaikoOmitBarLine Special = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color struct {
	R int32
	G int32
	B int32
}

type CurveType

type CurveType int32

type CustomSampleSet

type CustomSampleSet int32

type DifficultySection

type DifficultySection struct {
	HPDrainRate       float64
	CircleSize        float64
	OverallDifficulty float64
	ApproachRate      float64
	SliderMultiplier  float64
	SliderTickRate    float64
}

type EditorSection

type EditorSection struct {
	DistanceSpacing float64
	BeatDivisor     int32
	GridSize        int32
	Bookmarks       []int32
	TimelineZoom    float64
}

type Event

type Event struct {
	EventType EventType

	EventTime       int32
	BackgroundImage string
	BreakTimeBegin  int32
	BreakTimeEnd    int32
}

type EventType

type EventType int32
const (
	EventTypeBackground EventType = 0
	EventTypeVideo      EventType = 1
	EventTypeBreak      EventType = 2
	EventTypeColor      EventType = 3
	EventTypeSprite     EventType = 4
	EventTypeSample     EventType = 5
	EventTypeAnimation  EventType = 6
)

type EventsSection

type EventsSection struct {
	Events []Event
}

type GeneralSection

type GeneralSection struct {
	AudioFilename            string
	AudioLeadIn              int32
	AudioHash                string
	PreviewTime              int32
	Countdown                int32
	SampleSet                SampleSet
	StackLeniency            float64
	Mode                     Playmode
	LetterboxInBreaks        bool
	WidescreenStoryboard     bool
	EditorBookmarks          []int32
	EditorDistanceSpacing    float64
	StoryFireInFront         bool
	UseSkinSprites           bool
	SampleVolume             int32
	SkinPreference           string
	AlwaysShowPlayfield      bool
	EpilepsyWarning          bool
	CountdownOffset          int32
	TimelineZoom             float64
	SamplesMatchPlaybackRate bool
}

type HitObject

type HitObject struct {
	Type              HitObjectType
	Position          Vec2
	Time              float64
	NewCombo          bool
	HitSound          HitSoundType
	ComboColorOffset  int
	SampleSet         SampleSet
	SampleSetAddition SampleSet
	CustomSampleSet   CustomSampleSet
	Volume            int32
	SampleFile        string

	//Slider Specific
	CurveType          CurveType
	RepeatCount        int32
	SliderLength       float64
	SliderPoints       []Vec2
	SoundTypes         []HitSoundType
	SampleSets         []SampleSet
	SampleSetAdditions []SampleSet

	//Spinner/Hold specific
	EndTime int32
}

type HitObjectType

type HitObjectType int32

type HitObjectsSection

type HitObjectsSection struct {
	CountNormal  int64
	CountSlider  int64
	CountSpinner int64
	CountHold    int64

	List []HitObject
}

type HitSoundType

type HitSoundType int32

type MetadataSection

type MetadataSection struct {
	Title         string
	TitleUnicode  string
	Artist        string
	ArtistUnicode string
	Creator       string
	Version       string
	Source        string
	Tags          string
	BeatmapID     int32
	BeatmapSetID  int32
}

type OsuFile

type OsuFile struct {
	Version int32
	Md5Hash string

	General      GeneralSection
	Editor       EditorSection
	Metadata     MetadataSection
	Difficulty   DifficultySection
	Events       EventsSection
	TimingPoints TimingPointSection
	HitObjects   HitObjectsSection

	Length      int64
	DrainLength int64
	FirstBpm    float64

	ParserWarnings []string
}

func ParseBytes

func ParseBytes(bytes []byte) (OsuFile, error)

func ParseFile

func ParseFile(filename string) (OsuFile, error)

func ParseText

func ParseText(osuText string) (OsuFile, error)

type Playmode

type Playmode int32
const (
	PlaymodeOsu   Playmode = 0
	PlaymodeTaiko Playmode = 1
	PlaymodeCatch Playmode = 2
	PlaymodeMania Playmode = 3
)

type SampleSet

type SampleSet int32

type Special

type Special int32

type TimeSignature

type TimeSignature int32

type TimingPoint

type TimingPoint struct {
	Offset               float64
	BeatLength           float64
	TimeSignature        TimeSignature
	SampleSet            SampleSet
	CustomSampleSet      CustomSampleSet
	Volume               int32
	InheritedTimingPoint bool
	SpecialFlag          Special
}

type TimingPointSection

type TimingPointSection struct {
	TimingPoints []TimingPoint
}

type Vec2

type Vec2 struct {
	X float64
	Y float64
}

Jump to

Keyboard shortcuts

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