Struct Sound Copy item path Source pub struct Sound<S = String > {
pub fname: S,
pub volume: u8 ,
pub repeat: AudioRepetition ,
pub priority: u8 ,
pub class: Option <S>,
pub url: Option <S>,
}Expand description Sound triggers are WAV format files intended for sound effects.
See MXP specification: <SOUND>
and the MSP (Mud Sound Protocol) specification .
§ Examples
use mxp::AudioRepetition;
assert_eq! (
"<SOUND 'weather/rain.wav' V=80 L=3 P=10 T=combat U='http://example.org:5000/sound'>" .parse::<mxp::Sound>(),
Ok (mxp::Sound {
fname: "weather/rain.wav" .into(),
volume: 80 ,
repeat: AudioRepetition::Count(3 .try_into().unwrap()),
priority: 10 ,
class: Some ("combat" .into()),
url: Some ("http://example.org:5000/sound" .into()),
}),
);File name. May contain wildcards. If no extension is specified, “.wav” should be assumed.
Volume between 0 and 100.
This parameter applies when some sound is playing and another request arrives. Then, if new
request has higher (but NOT equal) priority than the one that’s currently being played, old
sound must be stopped and the new sound starts playing instead. In the case of a tie, the
sound that is already playing wins.
Type of sound, e.g. combat, zone, death, clan. Case-insensitive. This parameter was
intended to provide a way to group sounds into subfolders within the main sound directory.
Specifies the URL of the sound file. This allows downloading files from the MUD server.
Client should always look in local directories first, and only download the file if it’s
not available locally.
Returns true if this command is a <SOUND OFF> command, causing sounds to stop rather
than triggering a sound.
Applies a type transformation to all text, returning a new struct.
Returns a new struct that borrows text from this one.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Returns the “default value” for a type.
Read more Formats the value using the given formatter.
Read more The associated error which can be returned from parsing.
Parses a string
s to return a value of this type.
Read more Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
The type returned in the event of a conversion error.
Performs the conversion.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String.
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.