Enum bms_rs::lex::token::Token[][src]

pub enum Token<'a> {
Show 53 variants Artist(&'a str), AtBga { id: ObjId, source_bmp: ObjId, trim_top_left: (i16, i16), trim_size: (u16, u16), draw_point: (i16, i16), }, Banner(&'a Path), BackBmp(&'a Path), Bga { id: ObjId, source_bmp: ObjId, trim_top_left: (i16, i16), trim_bottom_right: (i16, i16), draw_point: (i16, i16), }, Bmp(ObjId, &'a Path), Bpm(&'a str), BpmChange(ObjId, &'a str), Case(u32), ChangeOption(ObjId, &'a str), Comment(&'a str), Def, Difficulty(u8), Else, ElseIf(u32), Email(&'a str), EndIf, EndRandom, EndSwitch, ExBmp(ObjIdArgb, &'a Path), ExRank(ObjIdJudgeLevel), ExWav(ObjId[&'a str; 4], &'a Path), Genre(&'a str), If(u32), LnObj(ObjId), LnTypeRdm, LnTypeMgq, Maker(&'a str), Message { track: Track, channel: Channel, message: &'a str, }, MidiFile(&'a Path), OctFp, Option(&'a str), PathWav(&'a Path), Player(PlayerMode), PlayLevel(u8), PoorBga(PoorMode), Random(u32), Rank(JudgeLevel), SetRandom(u32), SetSwitch(u32), Skip, StageFile(&'a Path), Stop(ObjIdu32), SubArtist(&'a str), SubTitle(&'a str), Switch(u32), Text(ObjId, &'a str), Title(&'a str), Total(&'a str), Url(&'a str), VideoFile(&'a Path), VolWav(Volume), Wav(ObjId, &'a Path),
}
Expand description

A token of BMS format.

Variants

Artist(&'a str)

Tuple Fields

0: &'a str

#ARTIST [string]. Defines the artist name of the music.

AtBga

Fields

id: ObjId

The id of the object to define.

source_bmp: ObjId

The id of the object to be trimmed.

trim_top_left: (i16, i16)

The top left point of the trim area in pixels.

trim_size: (u16, u16)

The size of the trim area in pixels.

draw_point: (i16, i16)

The top left point to be rendered in pixels.

#@BGA[01-ZZ] [01-ZZ] [sx] [sy] [w] [h] [dx] [dy]. Defines the image object from trimming the existing image object.

Banner(&'a Path)

Tuple Fields

0: &'a Path

#BANNER [filename]. Defines the banner image. This can be used on music select or result view. It should be 300x80.

BackBmp(&'a Path)

Tuple Fields

0: &'a Path

#BACKBMP [filename]. Defines the background image file of the play view. It should be 640x480. The effect will depend on the skin of the player.

Bga

Fields

id: ObjId

The id of the object to define.

source_bmp: ObjId

The id of the object to be trimmed.

trim_top_left: (i16, i16)

The top left point of the trim area in pixels.

trim_bottom_right: (i16, i16)

The bottom right point of the trim area in pixels.

draw_point: (i16, i16)

The top left point to be rendered in pixels.

#BGA[01-ZZ] [01-ZZ] [x1] [y1] [x2] [y2] [dx] [dy]. Defines the image object from trimming the existing image object.

Bmp(ObjId, &'a Path)

Tuple Fields

0: ObjId
1: &'a Path

#BMP[01-ZZ] [filename]. Defines the background image/movie object. The file specified may be not only BMP format, and also PNG, AVI, MP4, MKV and others. Its size should be less than or equal to 256x256. The black (#000000) pixel in the image will be treated as transparent.

Bpm(&'a str)

Tuple Fields

0: &'a str

#BPM [f64]. Defines the base Beats-Per-Minute of the score. Defaults to 130, but some players don’t conform to it.

BpmChange(ObjId, &'a str)

Tuple Fields

0: ObjId
1: &'a str

#BPM[01-ZZ] [f64]. Defines the Beats-Per-Minute change object.

Case(u32)

Tuple Fields

0: u32

#CASE [u32]. Starts a case scope if the integer equals to the generated random number. If there’s no #SKIP command in the scope, the parsing will fallthrough to the next #CASE or #DEF. See also Token::Switch.

ChangeOption(ObjId, &'a str)

Tuple Fields

0: ObjId
1: &'a str

#CHANGEOPTION[01-ZZ] [string]. Defines the play option change object. Some players interpret and apply the preferences.

Comment(&'a str)

Tuple Fields

0: &'a str

#COMMENT [string]. Defines the text which is shown in the music select view. This may or may not be surrounded by double-quotes.

Def

#DEF. Starts a case scope if any #CASE had not matched to the generated random number. It must be placed in the end of the switch scope. See also Token::Switch.

Difficulty(u8)

Tuple Fields

0: u8

#DIFFICULTY [1-5]. Defines the difficulty of the score. It can be used to sort the score having the same title.

Else

#ELSEIF [u32]. Starts an if scope when the preceding #IF had not matched to the generated random number. It must be in an if scope.

ElseIf(u32)

Tuple Fields

0: u32

#ELSEIF [u32]. Starts an if scope when the integer equals to the generated random number. It must be in an if scope. If preceding #IF had matched to the generated, this scope don’t start. Syntax sugar for:

#ELSE
  #IF n
  // ...
  #ENDIF
#ENDIF

Email(&'a str)

Tuple Fields

0: &'a str

%EMAIL [string]. The email address of this score file author.

EndIf

#ENDIF. Closes the if scope. See Token::If.

EndRandom

#ENDRANDOM. Closes the random scope. See Token::Random.

EndSwitch

#ENDSWITCH. Closes the random scope. See Token::Switch.

ExBmp(ObjIdArgb, &'a Path)

Tuple Fields

0: ObjId
1: Argb
2: &'a Path

#BMP[01-ZZ] [0-255],[0-255],[0-255],[0-255] [filename]. Defines the background image/movie object with the color (alpha, red, green and blue) which will be treated as transparent.

ExRank(ObjIdJudgeLevel)

Tuple Fields

0: ObjId

#EXRANK[01-ZZ] [0-3]. Defines the judgement level change object.

ExWav(ObjId[&'a str; 4], &'a Path)

Tuple Fields

0: ObjId
1: [&'a str; 4]
2: &'a Path

#EXWAV[01-ZZ] [parameter order] [pan or volume or frequency; 1-3] [filename]. Defines the key sound object with the effect of pan, volume and frequency.

Genre(&'a str)

Tuple Fields

0: &'a str

#GENRE [string]. Defines the genre of the music.

If(u32)

Tuple Fields

0: u32

#IF [u32]. Starts an if scope when the integer equals to the generated random number. This must be placed in a random scope. See also Token::Random.

LnObj(ObjId)

Tuple Fields

0: ObjId

#LNOBJ [01-ZZ]. Declares the object as the end of an LN. The preceding object of the declared will be treated as the beginning of an LN.

LnTypeRdm

#LNTYPE 1. Declares the LN notation as the RDM type.

LnTypeMgq

#LNTYPE 2. Declares the LN notation as the MGQ type.

Maker(&'a str)

Tuple Fields

0: &'a str

#MAKER [string]. Defines the author name of the score.

Message

Fields

track: Track

The track, or measure, must start from 1. But some player may allow the 0 measure (i.e. Lunatic Rave 2).

channel: Channel

The channel commonly expresses what the lane be arranged the note to.

message: &'a str

The message to the channel.

#XXXYY:ZZ.... Defines the message which places the object onto the score. XXX is the track, YY is the channel, and ZZ... is the object id sequence.

MidiFile(&'a Path)

Tuple Fields

0: &'a Path

#MIDIFILE [filename]. Defines the MIDI file as the BGM. Deprecated

OctFp

#OCT/FP. Declares the score as the octave mode.

Option(&'a str)

Tuple Fields

0: &'a str

#OPTION [string]. Defines the play option of the score. Some players interpret and apply the preferences.

PathWav(&'a Path)

Tuple Fields

0: &'a Path

#PATH_WAV [string]. Defines the root path of Token::Wav paths. This should be used only for tests.

Player(PlayerMode)

Tuple Fields

#PLAYER [1-4]. Defines the play style of the score.

PlayLevel(u8)

Tuple Fields

0: u8

#PLAYLEVEL [integer]. Defines the difficulty level of the score. This can be used on music select view.

PoorBga(PoorMode)

Tuple Fields

#POORBGA [0-2]. Defines the display mode of the POOR BGA.

Random(u32)

Tuple Fields

0: u32

#RANDOM [u32]. Starts a random scope which can contain only #IF-#ENDIF scopes. The random scope must close with #ENDRANDOM. A random integer from 1 to the integer will be generated when parsing the score. Then if the integer of #IF equals to the random integer, the commands in an if scope will be parsed, otherwise all command in it will be ignored. Any command except #IF and #ENDIF must not be included in the scope, but some players allow it.

Rank(JudgeLevel)

Tuple Fields

#RANK [0-3]. Defines the judgement level.

SetRandom(u32)

Tuple Fields

0: u32

#SETRANDOM [u32]. Starts a random scope but the integer will be used as the generated random number. It should be used only for tests.

SetSwitch(u32)

Tuple Fields

0: u32

#SETSWITCH [u32]. Starts a switch scope but the integer will be used as the generated random number. It should be used only for tests.

Skip

#SKIP. Escapes the current switch scope. It is often used in the end of every case scope.

StageFile(&'a Path)

Tuple Fields

0: &'a Path

#STAGEFILE [filename]. Defines the splashscreen image. It should be 640x480.

Stop(ObjIdu32)

Tuple Fields

0: ObjId
1: u32

#STOP[01-ZZ] [0-4294967295]. Defines the stop object. The scroll will stop the beats of the integer divided by 192. A beat length depends on the current BPM. If there are other objects on same time, the stop object must be evaluated at last.

SubArtist(&'a str)

Tuple Fields

0: &'a str

#SUBARTIST [string]. Defines the sub-artist name of the music.

SubTitle(&'a str)

Tuple Fields

0: &'a str

#SUBTITLE [string]. Defines the subtitle of the music.

Switch(u32)

Tuple Fields

0: u32

#SWITCH [u32]. Starts a switch scope which can contain only #CASE or #DEF scopes. The switch scope must close with #ENDSW. A random integer from 1 to the integer will be generated when parsing the score. Then if the integer of #CASE equals to the random integer, the commands in a case scope will be parsed, otherwise all command in it will be ignored. Any command except #CASE and #DEF must not be included in the scope, but some players allow it.

Text(ObjId, &'a str)

Tuple Fields

0: ObjId
1: &'a str

#TEXT[01-ZZ] string. Defines the text object.

Title(&'a str)

Tuple Fields

0: &'a str

#TITLE [string]. Defines the title of the music.

Total(&'a str)

Tuple Fields

0: &'a str

#TOTAL [f64]. Defines the total gauge percentage when all notes is got as PERFECT.

Url(&'a str)

Tuple Fields

0: &'a str

%URL [string]. The url of this score file.

VideoFile(&'a Path)

Tuple Fields

0: &'a Path

#VIDEOFILE [filename] / #MOVIE [filename]. Defines the background movie file. The audio track in the movie file should not be played. The play should start from the track 000.

VolWav(Volume)

Tuple Fields

0: Volume

#VOLWAV [0-255]. Defines the relative volume percentage of the sound in the score.

Wav(ObjId, &'a Path)

Tuple Fields

0: ObjId
1: &'a Path

#WAV[01-ZZ] [filename]. Defines the key sound object. When same id multiple objects ring at same time, it must be played only one. The file specified may be not only WAV format, and also OGG, MP3 and others.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.