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(Option<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(ObjId, Argb, &'a Path),
ExRank(ObjId, JudgeLevel),
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(ObjId, u32),
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)
#ARTIST [string]
. Defines the artist name of the music.
AtBga
Fields
#@BGA[01-ZZ] [01-ZZ] [sx] [sy] [w] [h] [dx] [dy]
. Defines the image object from trimming the existing image object.
Banner(&'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)
#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
#BGA[01-ZZ] [01-ZZ] [x1] [y1] [x2] [y2] [dx] [dy]
. Defines the image object from trimming the existing image object.
Bmp(Option<ObjId>, &'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. When the id 00
is specified, this first field will be None
and the image will be shown when the player get mistaken.
Bpm(&'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)
#BPM[01-ZZ] [f64]
. Defines the Beats-Per-Minute change object.
Case(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)
#CHANGEOPTION[01-ZZ] [string]
. Defines the play option change object. Some players interpret and apply the preferences.
Comment(&'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)
#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)
#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)
%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(ObjId, Argb, &'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(ObjId, JudgeLevel)
#EXRANK[01-ZZ] [0-3]
. Defines the judgement level change object.
ExWav(ObjId, [&'a str; 4], &'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)
#GENRE [string]
. Defines the genre of the music.
If(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)
#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)
#MAKER [string]
. Defines the author name of the score.
Message
Fields
#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)
#MIDIFILE [filename]
. Defines the MIDI file as the BGM. Deprecated
OctFp
#OCT/FP
. Declares the score as the octave mode.
Option(&'a str)
#OPTION [string]
. Defines the play option of the score. Some players interpret and apply the preferences.
PathWav(&'a Path)
#PATH_WAV [string]
. Defines the root path of Token::Wav
paths. This should be used only for tests.
Player(PlayerMode)
#PLAYER [1-4]
. Defines the play style of the score.
PlayLevel(u8)
#PLAYLEVEL [integer]
. Defines the difficulty level of the score. This can be used on music select view.
PoorBga(PoorMode)
#POORBGA [0-2]
. Defines the display mode of the POOR BGA.
Random(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)
#RANK [0-3]
. Defines the judgement level.
SetRandom(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)
#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)
#STAGEFILE [filename]
. Defines the splashscreen image. It should be 640x480.
Stop(ObjId, 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)
#SUBARTIST [string]
. Defines the sub-artist name of the music.
SubTitle(&'a str)
#SUBTITLE [string]
. Defines the subtitle of the music.
Switch(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)
#TEXT[01-ZZ] string
. Defines the text object.
Title(&'a str)
#TITLE [string]
. Defines the title of the music.
Total(&'a str)
#TOTAL [f64]
. Defines the total gauge percentage when all notes is got as PERFECT.
Url(&'a str)
%URL [string]
. The url of this score file.
VideoFile(&'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)
#VOLWAV [0-255]
. Defines the relative volume percentage of the sound in the score.
Wav(ObjId, &'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.