เอกสาร Steamworks
ISteamMusic Interface
Functions to control music playback in the steam client.

This gives games the opportunity to do things like pause the music or lower the volume, when an important cut scene is shown, and start playing afterwards.

See features/music_player for more information.

Member Functions

Member functions for ISteamMusic are called through the global accessor function SteamMusic().

BIsEnabled

bool BIsEnabled();
Checks if Steam Music is enabled.

Returns: bool
true if it is enabled; otherwise false.

BIsPlaying

bool BIsPlaying();
Checks if Steam Music is active. This does not necessarily a song is currently playing, it may be paused.

For finer grain control use GetPlaybackStatus.

Returns: bool
true if a song is currently playing, paused, or queued up to play; otherwise false.

GetPlaybackStatus

AudioPlayback_Status GetPlaybackStatus();
รับสถานะปัจจุบันของโปรแกรมฟังเพลงบน Steam

Returns: AudioPlayback_Status

GetVolume

float GetVolume();
รับระดับความดังปัจจุบันของโปรแกรมฟังเพลงบน Steam

Returns: float
The volume is returned as a percentage between 0.0 and 1.0.

Pause

void Pause();
หยุดการเล่นเพลงในโปรแกรมฟังเพลงบน Steam ชั่วคราว

Play

void Play();
ให้โปรแกรมฟังเพลงบน Steam เล่นเพลงต่อจากที่หยุดพักไว้

PlayNext

void PlayNext();
ให้โปรแกรมฟังเพลงบน Steam ข้ามไปเพลงต่อไป

PlayPrevious

void PlayPrevious();
ให้โปรแกรมฟังเพลงบน Steam เล่นเพลงก่อนหน้านี้

SetVolume

void SetVolume( float flVolume );
ชื่อTypeDescription
flVolumefloatThe volume percentage to set from 0.0 to 1.0.

ตั้งค่าความดังของโปรแกรมฟังเพลงบน Steam

Callbacks

These are callbacks which can be fired by calling SteamAPI_RunCallbacks. Many of these will be fired directly in response to the member functions of ISteamMusic.

PlaybackStatusHasChanged_t


This callback has no fields.

VolumeHasChanged_t



ชื่อTypeDescription
m_flNewVolumefloat

Enums

These are enums which are defined for use with ISteamMusic.

AudioPlayback_Status

Specifies the current playback status.

ชื่อValueDescription
AudioPlayback_Undefined0The Steam music interface probably isn't enabled.
AudioPlayback_Playing1Steam Music is currently playing.
AudioPlayback_Paused2Steam Music is currently paused.
AudioPlayback_Idle3Steam Music is currently stopped.

Constants

These are constants which are defined for use with ISteamMusic.

ชื่อTypeValueDescription
STEAMMUSIC_INTERFACE_VERSIONconst char *"STEAMMUSIC_INTERFACE_VERSION001"
  翻译: