I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX
Difference between revisions of "UE1:RMusic Player"
m |
m (→Non-Native functions) |
||
Line 207: | Line 207: | ||
'''Description:''' Mutes music | '''Description:''' Mutes music | ||
− | <uscript> | + | <uscript> simulated final function RMusic_Mute();</uscript> |
Revision as of 08:33, 27 May 2008
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.
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)
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)
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
native simulated final function RMusic_SetDSPParam(string Plugin, int index, float value);
Name: RMusic_Update
Description: Updates FMOD
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
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.
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.
native simulated final function bool RMusic_IsPlaying();
Name: RMusic_SetCfgVolume
Returns: true on success
Description: Changes volume (based on RMusic_Volume value)
native simulated final function RMusic_SetCfgVolume();
Name: RMusic_SetVolume
Returns: true on success
Description: Changes volume
Parameters:
- int NewVolume - new volume
native simulated final function RMusic_SetVolume(int NewVolume);
Name: RMusic_IncVolume
Description: Increases volume
native simulated final function RMusic_IncVolume();
Name: RMusic_DecVolume
Description: decreases volume
native simulated final function RMusic_DecVolume();
Name: RMusic_GetVolume
Returns: Current volume
Description: tries to find current volume
native simulated final function int RMusic_GetVolume();
Name: RMusic_Stop
Description: Closes stream
native simulated final function RMusic_Stop();
Name: RMusic_Close
Description: Shutdown FMODEX
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
simulated final function RMusic_PlayStream(string File, bool Loop);
Name: RMusic_Mute
Description: Mutes music
simulated final function RMusic_Mute();
Name: RMusic_Reset
Description: Restes FMod
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.