Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel
Difference between revisions of "UE1:RMusic Player"
m |
m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
+ | |||
+ | '''''This class is part of [[UE1:RMusicPlayer|RMusicPlayer]] by [[User:Raven|Raven]]''''' | ||
==About== | ==About== | ||
Line 55: | Line 57: | ||
'''Description:''' Initialize all FMODEX related stuff. Returns true on success. | '''Description:''' Initialize all FMODEX related stuff. Returns true on success. | ||
− | + | <uscript>native simulated final function bool RMusic_Startup();</uscript> | |
Line 67: | Line 69: | ||
* '''string Plugin''' - Plugin name (eg. dsp_chorus.dll) | * '''string Plugin''' - Plugin name (eg. dsp_chorus.dll) | ||
− | + | <uscript> native simulated final function bool RMusic_LoadPlugin(string Plugin);</uscript> | |
Line 79: | Line 81: | ||
* '''string Plugin''' - Plugin name (eg. dsp_chorus.dll) | * '''string Plugin''' - Plugin name (eg. dsp_chorus.dll) | ||
− | + | <uscript> native simulated final function bool RMusic_UnLoadPlugin(string Plugin);</uscript> | |
Line 91: | Line 93: | ||
* '''float value''' - DSP parameter value | * '''float value''' - DSP parameter value | ||
− | + | <uscript> native simulated final function RMusic_SetDSPParam(string Plugin, int index, float value);</uscript> | |
Line 98: | Line 100: | ||
'''Description:''' Updates FMOD | '''Description:''' Updates FMOD | ||
− | + | <uscript> native simulated final function RMusic_Update();</uscript> | |
Line 111: | Line 113: | ||
* '''bool Loop''' - Should song be looped | * '''bool Loop''' - Should song be looped | ||
− | + | <uscript> native simulated final function bool RMusic_Play(string File, bool Loop);</uscript> | |
Line 121: | Line 123: | ||
* '''bool bPause''' - Pause (true) or not (false) currently played stream. | * '''bool bPause''' - Pause (true) or not (false) currently played stream. | ||
− | + | <uscript> native simulated final function RMusic_Pause(bool bPause);</uscript> | |
Line 130: | Line 132: | ||
'''Description:''' Check if song is playing. | '''Description:''' Check if song is playing. | ||
− | + | <uscript> native simulated final function bool RMusic_IsPlaying();</uscript> | |
Line 139: | Line 141: | ||
'''Description:''' Changes volume (based on RMusic_Volume value) | '''Description:''' Changes volume (based on RMusic_Volume value) | ||
− | + | <uscript> native simulated final function RMusic_SetCfgVolume();</uscript> | |
Line 151: | Line 153: | ||
* '''int NewVolume''' - new volume | * '''int NewVolume''' - new volume | ||
− | + | <uscript> native simulated final function RMusic_SetVolume(int NewVolume);</uscript> | |
Line 158: | Line 160: | ||
'''Description:''' Increases volume | '''Description:''' Increases volume | ||
− | + | <uscript> native simulated final function RMusic_IncVolume();</uscript> | |
Line 165: | Line 167: | ||
'''Description:''' decreases volume | '''Description:''' decreases volume | ||
− | + | <uscript> native simulated final function RMusic_DecVolume();</uscript> | |
Line 174: | Line 176: | ||
'''Description:''' tries to find current volume | '''Description:''' tries to find current volume | ||
− | + | <uscript> native simulated final function int RMusic_GetVolume();</uscript> | |
Line 181: | Line 183: | ||
'''Description:''' Closes stream | '''Description:''' Closes stream | ||
− | + | <uscript> native simulated final function RMusic_Stop();</uscript> | |
Line 188: | Line 190: | ||
'''Description:''' Shutdown FMODEX | '''Description:''' Shutdown FMODEX | ||
− | + | <uscript> native simulated final function RMusic_Close();</uscript> | |
==Non-Native functions== | ==Non-Native functions== | ||
Line 200: | Line 202: | ||
* '''bool Loop''' - Should song be looped | * '''bool Loop''' - Should song be looped | ||
− | + | <uscript> simulated final function RMusic_PlayStream(string File, bool Loop);</uscript> | |
Line 207: | Line 209: | ||
'''Description:''' Mutes music | '''Description:''' Mutes music | ||
− | + | <uscript> simulated final function RMusic_Mute();</uscript> | |
Line 214: | Line 216: | ||
'''Description:''' Restes FMod | '''Description:''' Restes FMod | ||
− | + | <uscript> simulated final function RMusic_Reset();</uscript> | |
==States== | ==States== |
Latest revision as of 03:52, 31 May 2008
This class is part of RMusicPlayer by Raven
About[edit]
RMusic_Player is part of RMusicPlayer beta. It's native class, which implements FMODEX API.
Important variables[edit]
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[edit]
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[edit]
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[edit]
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[edit]
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.