.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_EventPlayer: EventPlayer =========== **Inherits:** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Class for event stream playback. Member Functions ---------------- +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_channel_last_note_time` **(** :ref:`int` channel **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_channel_volume` **(** :ref:`int` channel **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_length` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_loop_count` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_pitch_scale` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_pos` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`EventStream` | :ref:`get_stream` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_stream_name` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_tempo_scale` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_volume` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_volume_db` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_autoplay` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_loop` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_paused` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_playing` **(** **)** const | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`play` **(** **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`seek_pos` **(** :ref:`float` time **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_autoplay` **(** :ref:`bool` enabled **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_channel_volume` **(** :ref:`int` channel, :ref:`float` channel_volume **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_loop` **(** :ref:`bool` enabled **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_paused` **(** :ref:`bool` paused **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_pitch_scale` **(** :ref:`float` pitch_scale **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_stream` **(** :ref:`EventStream` stream **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_tempo_scale` **(** :ref:`float` tempo_scale **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_volume` **(** :ref:`float` volume **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_volume_db` **(** :ref:`float` db **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`stop` **(** **)** | +----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- Class for event stream playback. Event streams are music expressed as a series of events (note on, note off, instrument change...), as opposed to audio streams, which are just audio data. Examples of event-based streams are MIDI files, or MOD music. Currently, only MOD, S3M, IT, and XM music is supported. Member Function Description --------------------------- .. _class_EventPlayer_get_channel_last_note_time: - :ref:`float` **get_channel_last_note_time** **(** :ref:`int` channel **)** const Return the time at which the last note of a given channel in the stream plays. .. _class_EventPlayer_get_channel_volume: - :ref:`float` **get_channel_volume** **(** :ref:`int` channel **)** const Return the volume scale for an individual channel of the stream. .. _class_EventPlayer_get_length: - :ref:`float` **get_length** **(** **)** const Return the song length. May be in seconds, but depends on the stream type. .. _class_EventPlayer_get_loop_count: - :ref:`int` **get_loop_count** **(** **)** const Return the number of times the playback has looped. .. _class_EventPlayer_get_pitch_scale: - :ref:`float` **get_pitch_scale** **(** **)** const Return the pitch scale factor for this player. .. _class_EventPlayer_get_pos: - :ref:`float` **get_pos** **(** **)** const Return the playback position. May be in seconds, but depends on the stream type. .. _class_EventPlayer_get_stream: - :ref:`EventStream` **get_stream** **(** **)** const Return the currently assigned stream. .. _class_EventPlayer_get_stream_name: - :ref:`String` **get_stream_name** **(** **)** const Return the name of the currently assigned stream. This is not the file name, but a field inside the file. If no stream is assigned, if returns "". .. _class_EventPlayer_get_tempo_scale: - :ref:`float` **get_tempo_scale** **(** **)** const Return the tempo multiplier. .. _class_EventPlayer_get_volume: - :ref:`float` **get_volume** **(** **)** const Return the playback volume for this player. .. _class_EventPlayer_get_volume_db: - :ref:`float` **get_volume_db** **(** **)** const Return the playback volume for this player, in decibels. .. _class_EventPlayer_has_autoplay: - :ref:`bool` **has_autoplay** **(** **)** const Return whether this player will start playing as soon as it enters the scene tree. .. _class_EventPlayer_has_loop: - :ref:`bool` **has_loop** **(** **)** const Return whether this player will be restart the playback at the end. .. _class_EventPlayer_is_paused: - :ref:`bool` **is_paused** **(** **)** const Return whether the playback is currently paused. .. _class_EventPlayer_is_playing: - :ref:`bool` **is_playing** **(** **)** const Return whether this player is playing. .. _class_EventPlayer_play: - void **play** **(** **)** Play the currently assigned stream. .. _class_EventPlayer_seek_pos: - void **seek_pos** **(** :ref:`float` time **)** Set the playback position. May be in seconds, but depends on the stream type. .. _class_EventPlayer_set_autoplay: - void **set_autoplay** **(** :ref:`bool` enabled **)** Set whether this player will start playing as soon as it enters the scene tree. .. _class_EventPlayer_set_channel_volume: - void **set_channel_volume** **(** :ref:`int` channel, :ref:`float` channel_volume **)** Set the volume scale for an individual channel of the stream, with the same value range as :ref:`set_volume`. The channel number depends on the stream format. For example, MIDIs range from 0 to 15, and MODs from 0 to 63. Many stream formats are multichannel, so this allows to affect only a part of the music. .. _class_EventPlayer_set_loop: - void **set_loop** **(** :ref:`bool` enabled **)** Set whether the stream will be restarted at the end. .. _class_EventPlayer_set_paused: - void **set_paused** **(** :ref:`bool` paused **)** Pause stream playback. .. _class_EventPlayer_set_pitch_scale: - void **set_pitch_scale** **(** :ref:`float` pitch_scale **)** Set the pitch multiplier for all sounds coming from this stream. A value of 2.0 shifts all pitches one octave up, and a value of 0.5 shifts pitches one octave down. .. _class_EventPlayer_set_stream: - void **set_stream** **(** :ref:`EventStream` stream **)** Set the :ref:`EventStream` this player will play. .. _class_EventPlayer_set_tempo_scale: - void **set_tempo_scale** **(** :ref:`float` tempo_scale **)** Set the tempo multiplier. This allows to slow down or speed up the music, without affecting its pitch. .. _class_EventPlayer_set_volume: - void **set_volume** **(** :ref:`float` volume **)** Set the playback volume for this player. This is a float between 0.0 (silent) and 1.0 (full volume). Values over 1.0 may amplify sound even more, but may introduce distortion. Negative values may just invert the output waveform, which produces no audible difference. The effect of these special values ultimately depends on the low-level implementation of the file format being played. .. _class_EventPlayer_set_volume_db: - void **set_volume_db** **(** :ref:`float` db **)** Set the playback volume for this player, in decibels. This is a float between -80.0 (silent) and 0.0 (full volume). Values under -79.0 get truncated to -80, but values over 0.0 do not, so the warnings for over amplifying (see :ref:`set_volume`) still apply. .. _class_EventPlayer_stop: - void **stop** **(** **)** Stop playing.