diff options
author | UbitUmarov | 2018-04-09 00:48:29 +0100 |
---|---|---|
committer | UbitUmarov | 2018-04-09 00:48:29 +0100 |
commit | 8a30d1303d20961fc251b9e89fc5201ce386ca5d (patch) | |
tree | ec923468fc2110520f879635f368fd7685d060b7 /OpenSim | |
parent | update osslEnable.ini with the new functions (diff) | |
download | opensim-SC-8a30d1303d20961fc251b9e89fc5201ce386ca5d.zip opensim-SC-8a30d1303d20961fc251b9e89fc5201ce386ca5d.tar.gz opensim-SC-8a30d1303d20961fc251b9e89fc5201ce386ca5d.tar.bz2 opensim-SC-8a30d1303d20961fc251b9e89fc5201ce386ca5d.tar.xz |
some cleanup on ll sound functions
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 100 |
1 files changed, 62 insertions, 38 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 014de69..eae4daf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3170,70 +3170,87 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3170 | { | 3170 | { |
3171 | m_host.AddScriptLPS(1); | 3171 | m_host.AddScriptLPS(1); |
3172 | 3172 | ||
3173 | // send the sound, once, to all clients in range | 3173 | if (m_SoundModule == null) |
3174 | if (m_SoundModule != null) | 3174 | return; |
3175 | { | 3175 | |
3176 | m_SoundModule.SendSound( | 3176 | UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound); |
3177 | m_host.UUID, | 3177 | if(soundID == UUID.Zero) |
3178 | ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), | 3178 | return; |
3179 | volume, false, 0, | 3179 | |
3180 | 0, false, false); | 3180 | // send the sound, once, to all clients in range |
3181 | } | 3181 | m_SoundModule.SendSound(m_host.UUID, soundID, volume, false, 0, 0, false, false); |
3182 | } | 3182 | } |
3183 | 3183 | ||
3184 | public void llLoopSound(string sound, double volume) | 3184 | public void llLoopSound(string sound, double volume) |
3185 | { | 3185 | { |
3186 | m_host.AddScriptLPS(1); | 3186 | m_host.AddScriptLPS(1); |
3187 | if (m_SoundModule != null) | 3187 | |
3188 | { | 3188 | if (m_SoundModule == null) |
3189 | m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), | 3189 | return; |
3190 | volume, 20, false,false); | 3190 | |
3191 | } | 3191 | UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound); |
3192 | if(soundID == UUID.Zero) | ||
3193 | return; | ||
3194 | |||
3195 | m_SoundModule.LoopSound(m_host.UUID, soundID, volume, 20, false,false); | ||
3192 | } | 3196 | } |
3193 | 3197 | ||
3194 | public void llLoopSoundMaster(string sound, double volume) | 3198 | public void llLoopSoundMaster(string sound, double volume) |
3195 | { | 3199 | { |
3196 | m_host.AddScriptLPS(1); | 3200 | m_host.AddScriptLPS(1); |
3197 | if (m_SoundModule != null) | 3201 | |
3198 | { | 3202 | if (m_SoundModule == null) |
3199 | m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), | 3203 | return; |
3200 | volume, 20, true, false); | 3204 | |
3201 | } | 3205 | UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound); |
3206 | if(soundID == UUID.Zero) | ||
3207 | return; | ||
3208 | |||
3209 | m_SoundModule.LoopSound(m_host.UUID, soundID, volume, 20, true, false); | ||
3202 | } | 3210 | } |
3203 | 3211 | ||
3204 | public void llLoopSoundSlave(string sound, double volume) | 3212 | public void llLoopSoundSlave(string sound, double volume) |
3205 | { | 3213 | { |
3206 | m_host.AddScriptLPS(1); | 3214 | m_host.AddScriptLPS(1); |
3207 | if (m_SoundModule != null) | 3215 | |
3208 | { | 3216 | if (m_SoundModule == null) |
3209 | m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), | 3217 | return; |
3210 | volume, 20, false, true); | 3218 | |
3211 | } | 3219 | UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound); |
3220 | if(soundID == UUID.Zero) | ||
3221 | return; | ||
3222 | |||
3223 | m_SoundModule.LoopSound(m_host.UUID, soundID, volume, 20, false, true); | ||
3212 | } | 3224 | } |
3213 | 3225 | ||
3214 | public void llPlaySoundSlave(string sound, double volume) | 3226 | public void llPlaySoundSlave(string sound, double volume) |
3215 | { | 3227 | { |
3216 | m_host.AddScriptLPS(1); | 3228 | m_host.AddScriptLPS(1); |
3217 | 3229 | ||
3230 | if (m_SoundModule == null) | ||
3231 | return; | ||
3232 | |||
3233 | UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound); | ||
3234 | if(soundID == UUID.Zero) | ||
3235 | return; | ||
3236 | |||
3218 | // send the sound, once, to all clients in range | 3237 | // send the sound, once, to all clients in range |
3219 | if (m_SoundModule != null) | 3238 | m_SoundModule.SendSound(m_host.UUID, soundID, volume, false, 0, 0, true, false); |
3220 | { | ||
3221 | m_SoundModule.SendSound(m_host.UUID, | ||
3222 | ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, false, 0, | ||
3223 | 0, true, false); | ||
3224 | } | ||
3225 | } | 3239 | } |
3226 | 3240 | ||
3227 | public void llTriggerSound(string sound, double volume) | 3241 | public void llTriggerSound(string sound, double volume) |
3228 | { | 3242 | { |
3229 | m_host.AddScriptLPS(1); | 3243 | m_host.AddScriptLPS(1); |
3244 | |||
3245 | if (m_SoundModule == null) | ||
3246 | return; | ||
3247 | |||
3248 | UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound); | ||
3249 | if(soundID == UUID.Zero) | ||
3250 | return; | ||
3251 | |||
3230 | // send the sound, once, to all clients in rangeTrigger or play an attached sound in this part's inventory. | 3252 | // send the sound, once, to all clients in rangeTrigger or play an attached sound in this part's inventory. |
3231 | if (m_SoundModule != null) | 3253 | m_SoundModule.SendSound(m_host.UUID, soundID, volume, true, 0, 0, false, false); |
3232 | { | ||
3233 | m_SoundModule.SendSound(m_host.UUID, | ||
3234 | ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, true, 0, 0, | ||
3235 | false, false); | ||
3236 | } | ||
3237 | } | 3254 | } |
3238 | 3255 | ||
3239 | public void llStopSound() | 3256 | public void llStopSound() |
@@ -3247,8 +3264,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3247 | public void llPreloadSound(string sound) | 3264 | public void llPreloadSound(string sound) |
3248 | { | 3265 | { |
3249 | m_host.AddScriptLPS(1); | 3266 | m_host.AddScriptLPS(1); |
3250 | if (m_SoundModule != null) | 3267 | |
3251 | m_SoundModule.PreloadSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), 0); | 3268 | if (m_SoundModule == null) |
3269 | return; | ||
3270 | |||
3271 | UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound); | ||
3272 | if(soundID == UUID.Zero) | ||
3273 | return; | ||
3274 | |||
3275 | m_SoundModule.PreloadSound(m_host.UUID, soundID, 0); | ||
3252 | ScriptSleep(m_sleepMsOnPreloadSound); | 3276 | ScriptSleep(m_sleepMsOnPreloadSound); |
3253 | } | 3277 | } |
3254 | 3278 | ||