There is no spoon

UE1:RMusic Player

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 05:56, 27 May 2008 by Raven (Talk | contribs)

Jump to: navigation, search

About

RMusic_Player is part of RMusicPlayer beta. It's native class, which implements FMODEX API.

Important variables

Name: RMusic_Volume

Type: globalconfig int

Description:


Name: bAlwaysLoadCodecs

Type: globalconfig bool

Description: loads codecs at startup


Name: RMusic_PluginsDirectory

Type: config string

Description: plugins directory (can be overrided in subclass)


Name: RMusic_Directory

Type: config string

Description: music directory (can be overrided in subclass)


Name: bIncludeDebugInfo

Type: globalconfig bool

Description: includes debug info inside log


Name: bAuthoritative

Type: bool

Description: player controls levelchange. set to false if gametype/console should take controll over RMusic_Player

Native functions

Name: RMusic_Startup

Returns: true on success.

Description: Initialize all FMODEX related stuff. Returns true on success.

Definition: native simulated final function bool RMusic_Startup();


Name: RMusic_LoadPlugin

Returns: true on success.

Description: Loads plugin. Returns true on success.

Parameters:

  • string Plugin - Plugin name (eg. dsp_chorus.dll)

Definition: native simulated final function bool RMusic_LoadPlugin(string Plugin);


Name: RMusic_UnLoadPlugin

Returns: true on success.

Description: Unloads plugin.

Parameters:

  • string Plugin - Plugin name (eg. dsp_chorus.dll)

Definition: native simulated final function bool RMusic_UnLoadPlugin(string Plugin);


Name: RMusic_SetDSPParam

Description: Sets DSP parameter

Parameters:

  • string Plugin - Plugin name (eg. dsp_chorus.dll)
  • int index - DSP parameter index
  • float value - DSP parameter value

Definition: native simulated final function RMusic_SetDSPParam(string Plugin, int index, float value);


Name: RMusic_Update

Description: Updates FMOD

Definition: native simulated final function RMusic_Update();


Name: RMusic_Play

Returns: true on success.

Description: Plays music

Parameters:

  • string File - Music file name
  • bool Loop - Should song be looped

Definition: native simulated final function bool RMusic_Play(string File, bool Loop);


Name: RMusic_Pause

Description: Pauses/unpauses music

Parameters:

  • bool bPause - Pause (true) or not (false) currently played stream.

Definition: native simulated final function RMusic_Pause(bool bPause);


Name: RMusic_IsPlaying

Returns: true if stream is playing, false if not.

Description: Check if song is playing.

Definition: native simulated final function bool RMusic_IsPlaying();


Name: RMusic_SetCfgVolume

Returns: true on success

Description: Changes volume (based on RMusic_Volume value)

Definition: native simulated final function RMusic_SetCfgVolume();


Name: RMusic_SetVolume

Returns: true on success

Description: Changes volume

Parameters:

  • int NewVolume - new volume

Definition: native simulated final function RMusic_SetVolume(int NewVolume);


Name: RMusic_IncVolume

Description: Increases volume

Definition: native simulated final function RMusic_IncVolume();


Name: RMusic_DecVolume

Description: decreases volume

Definition: native simulated final function RMusic_DecVolume();


Name: RMusic_GetVolume

Returns: Current volume

Description: tries to find current volume

Definition: native simulated final function int RMusic_GetVolume();


Name: RMusic_Stop

Description: Closes stream

Definition: native simulated final function RMusic_Stop();


Name: RMusic_Close

Description: Shutdown FMODEX

Definition: native simulated final function RMusic_Close();

Non-Native functions

Name: RMusic_PlayStream

Description: Plays music (checks if currently music is playing and eventually fades in/crossfades music)

Parameters:

  • string File - Music file name
  • bool Loop - Should song be looped

Definition: simulated final function RMusic_PlayStream(string File, bool Loop)


Name: RMusic_Mute

Description: Mutes music

Definition: final simulated function RMusic_Mute()


Name: RMusic_Reset

Description: Restes FMod

Definition: simulated final function RMusic_Reset()

States

Name: RMusic_CrossFade

Description: Crossfades two streams


Name: RMusic_FadeIn

Description: Fades in stream


Name: RMusic_FadeOut

Description: Fades out stream and stops playing music


Name: RMusic_FadeInUnPause

Description: Unpauses and fades in stream


Name: RMusic_FadeOutPause

Description: Fades out stream and pauses

Usage

This class can be used in mods to have custom music directory. In order to do this, You have to make subclass of RMusic_Player and define RMusic_Directory and/or RMusic_PluginsDirectory.

class MyModPlayer extends RMusic_Player
defaultproperties
{
	RMusic_Directory="../MyMod/Music/"
	RMusic_PluginsDirectory="../MyMod/Plugins/"
}

Then use it in RMusic_Controller.