get { return AllObjectVolume; }
}
+ /// <summary>
+ /// UI sounds volume
+ /// </summary>
+ public float UIVolume = 0.5f;
+
private bool m_objectEnabled = true;
/// <summary>
/// Enable and Disable inworld sounds
{
new BufferSound(
UUID.Random(),
- new UUID("5e191c7b-8996-9ced-a177-b2ac32bfea06"),
+ UISounds.Typing,
false,
true,
e.Position,
BufferSound.KillAll();
}
+ /// <summary>
+ /// Plays a sound
+ /// </summary>
+ /// <param name="sound">UUID of the sound to play</param>
+ public void PlayUISound(UUID sound)
+ {
+ new BufferSound(
+ UUID.Random(),
+ sound,
+ false,
+ true,
+ Instance.Client.Self.SimPosition,
+ UIVolume);
+ }
+
}
--- /dev/null
+//
+// Radegast Metaverse Client
+// Copyright (c) 2009-2011, Radegast Development Team
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of the application "Radegast", nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// $Id$
+//
+
+using OpenMetaverse;
+
+namespace Radegast
+{
+ /// <summary>
+ /// Predefined UI sounds
+ /// Source: https://wiki.secondlife.com/wiki/Client_sounds
+ /// </summary>
+ public static class UISounds
+ {
+ /// <summary>Sound of incoming IM</summary>
+ public static UUID IM = new UUID("67cc2844-00f3-2b3c-b991-6418d01e1bb7");
+
+ /// <summary>Typing sound</summary>
+ public static UUID Typing = new UUID("5e191c7b-8996-9ced-a177-b2ac32bfea06");
+
+ /// <summary>When user opens new IM window</summary>
+ public static UUID IMWindow = new UUID("c825dfbc-9827-7e02-6507-3713d18916c1");
+
+ /// <summary>When money balance is increased</summary>
+ public static UUID MoneyIn = new UUID("104974e3-dfda-428b-99ee-b0d4e748d3a3");
+
+ /// <summary>When money balance is decreased</summary>
+ public static UUID MoneyOut = new UUID("77a018af-098e-c037-51a6-178f05877c6f");
+
+ /// <summary>Object rezzed from inventory</summary>
+ public static UUID ObjectRez = new UUID("f4a0660f-5446-dea2-80b7-6482a082803c");
+
+ /// <summary>Object create</summary>
+ public static UUID ObjectCreate = new UUID("3c8fc726-1fd6-862d-fa01-16c5b2568db6");
+
+ /// <summary>Object deleted</summary>
+ public static UUID ObjectDelete = new UUID("0cb7b00a-4c10-6948-84de-a93c09af2ba9");
+
+ }
+}
return;
}
+ instance.MediaManager.PlayUISound(UISounds.IMWindow);
+
tabConsole.AddIMTab(av, client.Self.AgentID ^ av, name);
tabConsole.SelectTab((client.Self.AgentID ^ av).ToString());
}
return;
}
+ instance.MediaManager.PlayUISound(UISounds.IMWindow);
+
instance.TabConsole.AddIMTab(selectedFriend.UUID, client.Self.AgentID ^ selectedFriend.UUID, selectedFriend.Name);
instance.TabConsole.SelectTab((client.Self.AgentID ^ selectedFriend.UUID).ToString());
}
if (!instance.TabConsole.TabExists(g.ID.ToString()))
{
+ instance.MediaManager.PlayUISound(UISounds.IMWindow);
instance.TabConsole.AddGroupIMTab(g.ID, g.Name);
instance.TabConsole.Tabs[g.ID.ToString()].Highlight();
instance.TabConsole.Tabs[g.ID.ToString()].Select();
break;
case "rez_inworld":
+ instance.MediaManager.PlayUISound(UISounds.ObjectRez);
Vector3 rezpos = new Vector3(2, 0, 0);
rezpos = client.Self.SimPosition + rezpos * client.Self.Movement.BodyRotation;
client.Inventory.RequestRezFromInventory(client.Network.CurrentSim, Quaternion.Identity, rezpos, item);
this.cbObjSoundEnable = new System.Windows.Forms.CheckBox();
this.ObjSoundGroup = new System.Windows.Forms.GroupBox();
this.objVolume = new System.Windows.Forms.TrackBar();
+ this.UISoundsGroup = new System.Windows.Forms.GroupBox();
+ this.UIVolume = new System.Windows.Forms.TrackBar();
((System.ComponentModel.ISupportInitialize)(this.volAudioStream)).BeginInit();
this.pnlParcelAudio.SuspendLayout();
this.ObjSoundGroup.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.objVolume)).BeginInit();
+ this.UISoundsGroup.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.UIVolume)).BeginInit();
this.SuspendLayout();
//
// volAudioStream
this.objVolume.TabIndex = 0;
this.objVolume.Value = 40;
//
+ // UISoundsGroup
+ //
+ this.UISoundsGroup.AccessibleName = "UI sounds volume";
+ this.UISoundsGroup.Controls.Add(this.UIVolume);
+ this.UISoundsGroup.Location = new System.Drawing.Point(4, 220);
+ this.UISoundsGroup.Name = "UISoundsGroup";
+ this.UISoundsGroup.Size = new System.Drawing.Size(358, 53);
+ this.UISoundsGroup.TabIndex = 3;
+ this.UISoundsGroup.TabStop = false;
+ this.UISoundsGroup.Text = "UI Sounds";
+ //
+ // UIVolume
+ //
+ this.UIVolume.AccessibleName = "Object sounds volume";
+ this.UIVolume.LargeChange = 10;
+ this.UIVolume.Location = new System.Drawing.Point(4, 12);
+ this.UIVolume.Maximum = 50;
+ this.UIVolume.Name = "UIVolume";
+ this.UIVolume.Size = new System.Drawing.Size(347, 45);
+ this.UIVolume.SmallChange = 2;
+ this.UIVolume.TabIndex = 0;
+ this.UIVolume.Value = 20;
+ this.UIVolume.Scroll += new System.EventHandler(this.UIVolume_Scroll);
+ //
// MediaConsole
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.UISoundsGroup);
this.Controls.Add(this.ObjSoundGroup);
this.Controls.Add(this.pnlParcelAudio);
this.Name = "MediaConsole";
- this.Size = new System.Drawing.Size(368, 217);
+ this.Size = new System.Drawing.Size(368, 275);
((System.ComponentModel.ISupportInitialize)(this.volAudioStream)).EndInit();
this.pnlParcelAudio.ResumeLayout(false);
this.pnlParcelAudio.PerformLayout();
this.ObjSoundGroup.ResumeLayout(false);
this.ObjSoundGroup.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.objVolume)).EndInit();
+ this.UISoundsGroup.ResumeLayout(false);
+ this.UISoundsGroup.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.UIVolume)).EndInit();
this.ResumeLayout(false);
}
private System.Windows.Forms.GroupBox ObjSoundGroup;
public System.Windows.Forms.CheckBox cbObjSoundEnable;
public System.Windows.Forms.TrackBar objVolume;
+ private System.Windows.Forms.GroupBox UISoundsGroup;
+ public System.Windows.Forms.TrackBar UIVolume;
}
}
instance.MediaManager.ObjectVolume = (float)s["object_audio_vol"].AsReal();
objVolume.Value = (int)(50f * instance.MediaManager.ObjectVolume);
}
+ if (s["ui_audio_vol"].Type != OSDType.Unknown)
+ {
+ instance.MediaManager.UIVolume = (float)s["ui_audio_vol"].AsReal();
+ UIVolume.Value = (int)(50f * instance.MediaManager.UIVolume);
+ }
volAudioStream.Value = (int)(audioVolume * 50);
instance.MediaManager.ObjectEnable = cbObjSoundEnable.Checked;
s["parcel_audio_keep_url"] = OSD.FromBoolean(cbKeep.Checked);
s["object_audio_vol"] = OSD.FromReal(this.instance.MediaManager.ObjectVolume);
s["object_audio_enable"] = OSD.FromBoolean(cbObjSoundEnable.Checked);
+ s["ui_audio_vol"] = OSD.FromReal(this.instance.MediaManager.UIVolume);
}
#region GUI event handlers
Stop();
}
}
+
+ private void UIVolume_Scroll(object sender, EventArgs e)
+ {
+ instance.MediaManager.UIVolume = UIVolume.Value / 50f;
+ configTimer.Change(saveConfigTimeout, System.Threading.Timeout.Infinite);
+ }
#endregion GUI event handlers
}
}
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
<value>17, 17</value>\r
</metadata>\r
+ <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+ <value>17, 17</value>\r
+ </metadata>\r
</root>
\ No newline at end of file
private void btnTake_Click(object sender, EventArgs e)
{
+ instance.MediaManager.PlayUISound(UISounds.ObjectDelete);
client.Inventory.RequestDeRezToInventory(currentPrim.LocalID);
}
if (currentPrim.Properties != null && currentPrim.Properties.OwnerID != client.Self.AgentID)
btnReturn_Click(sender, e);
else
+ {
+ instance.MediaManager.PlayUISound(UISounds.ObjectDelete);
client.Inventory.RequestDeRezToInventory(currentPrim.LocalID, DeRezDestination.AgentInventoryTake, client.Inventory.FindFolderForType(AssetType.TrashFolder), UUID.Random());
+ }
}
private void btnReturn_Click(object sender, EventArgs e)
{
+ instance.MediaManager.PlayUISound(UISounds.ObjectDelete);
client.Inventory.RequestDeRezToInventory(currentPrim.LocalID, DeRezDestination.ReturnToOwner, UUID.Zero, UUID.Random());
}
if (!tab.Selected) tab.Highlight();
return;
}
+
+ instance.MediaManager.PlayUISound(UISounds.IM);
IMTabWindow imTab = AddIMTab(e);
tabs[e.IM.IMSessionID.ToString()].Highlight();
return;
}
+ instance.MediaManager.PlayUISound(UISounds.IM);
+
ConferenceIMTabWindow imTab = AddConferenceIMTab(e);
tabs[e.IM.IMSessionID.ToString()].Highlight();
}
return;
}
+ instance.MediaManager.PlayUISound(UISounds.IM);
+
GroupIMTabWindow imTab = AddGroupIMTab(e);
tabs[e.IM.IMSessionID.ToString()].Highlight();
}
this.groundSitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.standToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.stopAllAnimationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.changeMyDisplayNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
this.tmnuCreateLandmark = new System.Windows.Forms.ToolStripMenuItem();
this.tmnuSetHome = new System.Windows.Forms.ToolStripMenuItem();
this.ctxTreyRestore = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.ctxTreyExit = new System.Windows.Forms.ToolStripMenuItem();
- this.changeMyDisplayNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
this.stopAllAnimationsToolStripMenuItem.Text = "Stop All Animations";
this.stopAllAnimationsToolStripMenuItem.Click += new System.EventHandler(this.stopAllAnimationsToolStripMenuItem_Click);
//
+ // changeMyDisplayNameToolStripMenuItem
+ //
+ this.changeMyDisplayNameToolStripMenuItem.Name = "changeMyDisplayNameToolStripMenuItem";
+ this.changeMyDisplayNameToolStripMenuItem.Size = new System.Drawing.Size(223, 22);
+ this.changeMyDisplayNameToolStripMenuItem.Text = "Change My Display Name";
+ this.changeMyDisplayNameToolStripMenuItem.Click += new System.EventHandler(this.changeMyDisplayNameToolStripMenuItem_Click);
+ //
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.ctxTreyExit.ToolTipText = "Loggs of and closes application";
this.ctxTreyExit.Click += new System.EventHandler(this.ctxTreyExit_Click);
//
- // changeMyDisplayNameToolStripMenuItem
- //
- this.changeMyDisplayNameToolStripMenuItem.Name = "changeMyDisplayNameToolStripMenuItem";
- this.changeMyDisplayNameToolStripMenuItem.Size = new System.Drawing.Size(223, 22);
- this.changeMyDisplayNameToolStripMenuItem.Text = "Change My Display Name";
- this.changeMyDisplayNameToolStripMenuItem.Click += new System.EventHandler(this.changeMyDisplayNameToolStripMenuItem_Click);
- //
// frmMain
//
this.AutoSavePosition = true;
{
client.Parcels.ParcelProperties += new EventHandler<ParcelPropertiesEventArgs>(Parcels_ParcelProperties);
client.Self.MoneyBalanceReply += new EventHandler<MoneyBalanceReplyEventArgs>(Self_MoneyBalanceReply);
+ client.Self.MoneyBalance += new EventHandler<BalanceEventArgs>(Self_MoneyBalance);
}
private void UnregisterClientEvents(GridClient client)
{
client.Parcels.ParcelProperties -= new EventHandler<ParcelPropertiesEventArgs>(Parcels_ParcelProperties);
client.Self.MoneyBalanceReply -= new EventHandler<MoneyBalanceReplyEventArgs>(Self_MoneyBalanceReply);
+ client.Self.MoneyBalance -= new EventHandler<BalanceEventArgs>(Self_MoneyBalance);
}
void instance_ClientChanged(object sender, ClientChangedEventArgs e)
#endregion
#region Event handlers
+ void Self_MoneyBalance(object sender, BalanceEventArgs e)
+ {
+ int oldBalance = 0;
+ int.TryParse(tlblMoneyBalance.Text, out oldBalance);
+ int delta = Math.Abs(oldBalance - e.Balance);
+
+ if (delta > 50)
+ {
+ if (oldBalance > e.Balance)
+ {
+ instance.MediaManager.PlayUISound(UISounds.MoneyIn);
+ }
+ else
+ {
+ instance.MediaManager.PlayUISound(UISounds.MoneyOut);
+ }
+ }
+ }
+
void Names_NameUpdated(object sender, UUIDNameReplyEventArgs e)
{
if (!e.Names.ContainsKey(client.Self.AgentID)) return;
}
}
- int nr_reg = 0;
- int nr_agent = 0;
-
// Menu item for testing out stuff
private void testToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (nr_reg > 0)
- {
- Logger.Log("Number of regions: " + nr_reg.ToString() + " agents: " + nr_agent.ToString(), Helpers.LogLevel.Info);
- nr_reg = 0;
- nr_agent = 0;
- client.Grid.GridRegion -= new EventHandler<GridRegionEventArgs>(Grid_GridRegion);
- return;
- }
-
- client.Grid.GridRegion += new EventHandler<GridRegionEventArgs>(Grid_GridRegion);
- client.Grid.RequestMainlandSims(GridLayerType.Objects);
- }
-
- void Grid_GridRegion(object sender, GridRegionEventArgs e)
- {
- nr_reg++;
- if ((nr_reg % 100) == 0)
- {
- nr_agent += e.Region.Agents;
- Logger.Log("Number of regions: " + nr_reg.ToString() + " agents: " + nr_agent.ToString(), Helpers.LogLevel.Info);
- }
+ instance.MediaManager.PlayUISound(UISounds.IM);
}
private void reloadInventoryToolStripMenuItem_Click(object sender, EventArgs e)
return;
}
+ instance.MediaManager.PlayUISound(UISounds.IMWindow);
instance.TabConsole.AddIMTab(agentID, client.Self.AgentID ^ agentID, fullName);
instance.TabConsole.SelectTab((client.Self.AgentID ^ agentID).ToString());
}
<Compile Include="Core\Media\MediaObject.cs" />\r
<Compile Include="Core\Media\Speech.cs" />\r
<Compile Include="Core\Media\Stream.cs" />\r
+ <Compile Include="Core\Media\UISounds.cs" />\r
<Compile Include="Core\NameManager.cs" />\r
<Compile Include="Core\PluginInterface\IRadegastPlugin.cs" />\r
<Compile Include="Core\PluginInterface\PluginAttribute.cs" />\r