#[non_exhaustive]pub enum Token<'a> {
Show 79 variants
Argb(ObjId, Argb),
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),
Base62,
BaseBpm(Decimal),
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(Decimal),
BpmChange(ObjId, Decimal),
Case(BigUint),
Cdda(BigUint),
ChangeOption(ObjId, &'a str),
CharFile(&'a Path),
Charset(&'a str),
Comment(&'a str),
Def,
DefExRank(u64),
Difficulty(u8),
DivideProp(&'a str),
Else,
ElseIf(BigUint),
Email(&'a str),
EndIf,
EndRandom,
EndSwitch,
ExtChr(ExtChrEvent),
ExBmp(ObjId, Argb, &'a Path),
ExRank(ObjId, JudgeLevel),
ExWav {
id: ObjId,
pan: ExWavPan,
volume: ExWavVolume,
frequency: Option<ExWavFrequency>,
path: &'a Path,
},
Genre(&'a str),
If(BigUint),
LnMode(LnMode),
LnObj(ObjId),
LnTypeRdm,
LnTypeMgq,
Maker(&'a str),
Materials(&'a Path),
MaterialsBmp(&'a Path),
MaterialsWav(&'a Path),
Message {
track: Track,
channel: Channel,
message: Cow<'a, str>,
},
MidiFile(&'a Path),
Movie(&'a Path),
NotACommand(&'a str),
OctFp,
Option(&'a str),
PathWav(&'a Path),
Player(PlayerMode),
PlayLevel(u8),
PoorBga(PoorMode),
Preview(&'a Path),
Random(BigUint),
Rank(JudgeLevel),
Scroll(ObjId, Decimal),
Seek(ObjId, Decimal),
SetRandom(BigUint),
SetSwitch(BigUint),
Skip,
Speed(ObjId, Decimal),
StageFile(&'a Path),
Stop(ObjId, Decimal),
Stp(StpEvent),
SubArtist(&'a str),
SubTitle(&'a str),
SwBga(ObjId, SwBgaEvent),
Switch(BigUint),
Text(ObjId, &'a str),
Title(&'a str),
Total(Decimal),
UnknownCommand(&'a str),
Url(&'a str),
VideoColors(u8),
VideoDly(Decimal),
VideoFile(&'a Path),
VideoFs(Decimal),
VolWav(Volume),
Wav(ObjId, &'a Path),
WavCmd(WavCmdEvent),
}
Expand description
A token content of BMS format.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Argb(ObjId, Argb)
#ARGB[A1-A4] [A],[R],[G],[B]
Extended transparent color definition.
- A1: BGA BASE
- A2: BGA LAYER
- A3: BGA LAYER 2
- A4: BGA POOR
Artist(&'a str)
#ARTIST [string]
. Defines the artist name of the music.
AtBga
#@BGA[01-ZZ] [01-ZZ] [sx] [sy] [w] [h] [dx] [dy]
. Defines the image object from trimming the existing image object.
Fields
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.
Base62
#BASE 62
. Declares that the score is using base-62 object id format. If this exists, the score is treated as case-sensitive.
BaseBpm(Decimal)
#BASEBPM [f64]
is the base BPM.
It’s not used in LunaticRave2, replaced by its Hi-Speed Settings.
Bga
#BGA[01-ZZ] [01-ZZ] [x1] [y1] [x2] [y2] [dx] [dy]
. Defines the image object from trimming the existing image object.
Fields
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(Decimal)
#BPM [f64]
. Defines the base Beats-Per-Minute of the score. Defaults to 130, but some players don’t conform to it.
BpmChange(ObjId, Decimal)
#BPM[01-ZZ] [f64]
. Defines the Beats-Per-Minute change object.
Case(BigUint)
#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
.
Cdda(BigUint)
#CDDA [u64]
. CD-DA (Compact Disc Digital Audio) extension.
CD-DA can be used as BGM (Background Music).
In DDR (Dance Dance Revolution), a config of CD-Syncro
in SYSTEM OPTION
is also applied.
This allows the game to play audio directly from a CD drive.
ChangeOption(ObjId, &'a str)
#CHANGEOPTION[01-ZZ] [string]
. Defines the play option change object. Some players interpret and apply the preferences.
CharFile(&'a Path)
#CHARFILE [filename]
.
The character file similar to pop’n music. It’s filextension is .chp
.
For now, #CHARFILE
is a pomu2 proprietary extension. However, the next-generation version LunaticRave may support #CHARFILE
.
Charset(&'a str)
#CHARSET [string]
Charset declaration. Default is SHIFT-JIS.
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
.
DefExRank(u64)
#DEFEXRANK [u64]
Extended judge rank definition, defined as n% of the original.
100 means NORMAL judge.
Overrides #RANK
definition.
Difficulty(u8)
#DIFFICULTY [1-5]
. Defines the difficulty of the score. It can be used to sort the score having the same title.
DivideProp(&'a str)
#DIVIDEPROP [string]
The resolution of Measure of BMS is specified.
Deprecated.
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(BigUint)
#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
#ENDSW
. Closes the random scope. See Token::Switch
.
ExtChr(ExtChrEvent)
#ExtChr SpriteNum BMPNum startX startY endX endY [offsetX offsetY [x y]]
BM98 extended character customization.
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
#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.
Fields
volume: ExWavVolume
The volume decay of the sound.
frequency: Option<ExWavFrequency>
The pitch frequency of the sound.
Genre(&'a str)
#GENRE [string]
. Defines the genre of the music.
If(BigUint)
#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
.
LnMode(LnMode)
#LNMODE [1:LN, 2:CN, 3:HCN]
Explicitly specify LN type for this chart.
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.
Materials(&'a Path)
#MATERIALS [string]
Material path definition.
Defines the relative path which makes an executable file a starting point.
This allows BMS files to reference files in Materials subdirectories using <foldername>filename
syntax.
MaterialsBmp(&'a Path)
#MATERIALSBMP [filename]
Material BMP extension.
Deprecated.
MaterialsWav(&'a Path)
#MATERIALSWAV [filename]
Material WAV extension.
Deprecated.
Message
#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.
Fields
MidiFile(&'a Path)
#MIDIFILE [filename]
. Defines the MIDI file as the BGM.
This is a minor command extension that allows MIDI files to be used as background music.
Deprecated - Some players may not support this feature.
Movie(&'a Path)
#MOVIE [filename]
DXEmu extension, defines global video file.
- Video starts from #000.
- Priority rules:
- If #xxx04 is an image file (BMP, PNG, etc.), #MOVIE has priority.
- If both #xxx04 and #MOVIE are video files, #xxx04 has priority.
- No loop, stays on last frame after playback.
- Audio track in video is not played.
NotACommand(&'a str)
Non-empty lines that not starts in '#'
in bms file.
OctFp
#OCT/FP
. Declares the score as the octave mode.
This is a minor command extension that enables octave mode for the chart.
In octave mode, the chart may have different note arrangements or gameplay mechanics.
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.
Preview(&'a Path)
#PREVIEW [filename]
Preview audio file for music selection.
Random(BigUint)
#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.
Scroll(ObjId, Decimal)
#SCROLL[01-ZZ] [f64]
. Defines the scroll speed change object. It changes relative falling speed of notes with keeping BPM. For example, if applying 2.0
, the scroll speed will become double.
Seek(ObjId, Decimal)
#SEEK[01-ZZ] [f64]
Video seek extension.
Defines a video seek event that allows jumping to specific time positions in video files.
This is a minor command extension for advanced video control.
SetRandom(BigUint)
#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(BigUint)
#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.
Speed(ObjId, Decimal)
#SPEED[01-ZZ] [f64]
. Defines the spacing change object. It changes relative spacing of notes with linear interpolation. For example, if playing score between the objects 1.0
and 2.0
, the spaces of notes will increase at the certain rate until the 2.0
object.
StageFile(&'a Path)
#STAGEFILE [filename]
. Defines the splashscreen image. It should be 640x480.
Stop(ObjId, Decimal)
#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.
Stp(StpEvent)
#STP xxx.yyy zzzz
bemaniaDX STOP sequence.
SubArtist(&'a str)
#SUBARTIST [string]
. Defines the sub-artist name of the music.
SubTitle(&'a str)
#SUBTITLE [string]
. Defines the subtitle of the music.
SwBga(ObjId, SwBgaEvent)
#SWBGA[01-ZZ] fr:time:line:loop:a,r,g,b pattern
Key Bind Layer Animation.
Switch(BigUint)
#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(Decimal)
#TOTAL [f64]
. Defines the total gauge percentage when all notes is got as PERFECT.
UnknownCommand(&'a str)
Unknown Part. Includes all the line that not be parsed.
Url(&'a str)
%URL [string]
. The url of this score file.
VideoColors(u8)
#VIDEOCOLORS [u8]
Video color depth, default 16Bit.
Defines the color depth for video playback. Common values are 16, 24, or 32 bits.
This affects the quality and performance of video rendering.
VideoDly(Decimal)
#VIDEODLY [f64]
Video delay extension.
Defines a delay in seconds before video playback starts.
This is useful for synchronizing video with audio or other game elements.
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
.
VideoFs(Decimal)
#VIDEOF/S [f64]
Video file frame rate.
Defines the frame rate for video playback in frames per second (FPS).
This affects the smoothness and timing of video playback.
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.
WavCmd(WavCmdEvent)
#WAVCMD [param] [wav-index] [value]
MacBeat extension, pseudo-MOD effect.
Implementations§
Trait Implementations§
impl<'a> Eq for Token<'a>
impl<'a> StructuralPartialEq for Token<'a>
Auto Trait Implementations§
impl<'a> Freeze for Token<'a>
impl<'a> RefUnwindSafe for Token<'a>
impl<'a> Send for Token<'a>
impl<'a> Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> UnwindSafe for Token<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§impl<T> SourceRangeMixinExt for T
impl<T> SourceRangeMixinExt for T
Source§fn into_wrapper<W>(
self,
wrapper: &SourceRangeMixin<W>,
) -> SourceRangeMixin<Self>where
Self: Sized,
fn into_wrapper<W>(
self,
wrapper: &SourceRangeMixin<W>,
) -> SourceRangeMixin<Self>where
Self: Sized,
SourceRangeMixin
with the same span as a wrapper.Source§fn into_wrapper_range(self, range: Range<usize>) -> SourceRangeMixin<Self>where
Self: Sized,
fn into_wrapper_range(self, range: Range<usize>) -> SourceRangeMixin<Self>where
Self: Sized,
SourceRangeMixin
with a given range.Source§fn into_wrapper_span(self, span: (usize, usize)) -> SourceRangeMixin<Self>where
Self: Sized,
fn into_wrapper_span(self, span: (usize, usize)) -> SourceRangeMixin<Self>where
Self: Sized,
SourceRangeMixin
with a given (start, end) span.