/// </summary>\r
private void AdjustVolume()\r
{\r
- Volume = volumeSetting * AllObjectVolume;\r
+ //TODO This is disabled until we find why FMOD objects to the handle\r
+// Volume = volumeSetting * AllObjectVolume;\r
}\r
\r
// A simpler constructor used by PreFetchSound.\r
if (allBuffers.ContainsKey(p.ID))
{
// Exists already, so modify existing sound.
- //TODO posible to change sound on the same object. Key by Object?
BufferSound snd = allBuffers[p.ID];
+ /* TODO These cause INVALID_HANDLE errors. Removed until we find why
snd.Volume = p.SoundGain * ObjectVolume;
snd.Position = fullPosition;
+ */
}
else
{
/// <summary>
/// Change a playback volume
/// </summary>
- protected float volume = 0.5f;
+ protected float volume = 0.8f;
public float Volume
{
get
set
{
volume = value;
-#if NOT
-// This is getting Bad Handle errors, so disabled for now
if (channel == null) return;
invoke(new SoundDelegate(delegate
{
try
{
- Logger.Log(
- String.Format("Volume on channel {0} sound {1} finished {2}",
- channel.getRaw().ToString("X"),
- sound.getRaw().ToString("X"),
- finished),
- Helpers.LogLevel.Debug);
FMODExec(channel.setVolume(volume));
}
catch (Exception ex)
{
- Logger.Log("Error changing volume", Helpers.LogLevel.Error, ex);
+ Logger.Log(
+ String.Format("Error on volume change on channel {0} sound {1} finished {2}",
+ channel.getRaw().ToString("X"),
+ sound.getRaw().ToString("X"),
+ finished),
+ Helpers.LogLevel.Error,
+ ex);
}
}));
-#endif
}
}
set
{
position = FromOMVSpace(value);
-#if NOT
-// This is getting Bad Handle errors, so disabled for now
if (channel == null) return;
invoke(new SoundDelegate(delegate
{
- Logger.Log(
- String.Format("Position on channel {0} sound {1} finished {2}",
- channel.getRaw().ToString("X"),
- sound.getRaw().ToString("X"),
- finished),
- Helpers.LogLevel.Debug);
- FMODExec(channel.set3DAttributes(
- ref position,
- ref ZeroVector));
+ try
+ {
+ FMODExec(channel.set3DAttributes(
+ ref position,
+ ref ZeroVector));
+ }
+ catch (Exception ex)
+ {
+ Logger.Log(
+ String.Format("Error on position change on channel {0} sound {1} finished {2}",
+ channel.getRaw().ToString("X"),
+ sound.getRaw().ToString("X"),
+ finished),
+ Helpers.LogLevel.Error,
+ ex);
+ }
}));
-#endif
+
}
}
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
+ this.ObjSoundEnable = new System.Windows.Forms.CheckBox();
this.ObjSoundGroup = new System.Windows.Forms.GroupBox();
this.ObjVolume = new System.Windows.Forms.TrackBar();
- this.ObjSoundEnable = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.volAudioStream)).BeginInit();
this.pnlParcelAudio.SuspendLayout();
this.ObjSoundGroup.SuspendLayout();
this.label1.TabIndex = 2;
this.label1.Text = "Stream";
//
+ // ObjSoundEnable
+ //
+ this.ObjSoundEnable.AutoSize = true;
+ this.ObjSoundEnable.Checked = true;
+ this.ObjSoundEnable.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.ObjSoundEnable.Location = new System.Drawing.Point(10, 44);
+ this.ObjSoundEnable.Name = "ObjSoundEnable";
+ this.ObjSoundEnable.Size = new System.Drawing.Size(59, 17);
+ this.ObjSoundEnable.TabIndex = 5;
+ this.ObjSoundEnable.Text = "Enable";
+ this.toolTip1.SetToolTip(this.ObjSoundEnable, "When checked inworld sounds will play");
+ this.ObjSoundEnable.UseVisualStyleBackColor = true;
+ //
// ObjSoundGroup
//
this.ObjSoundGroup.Controls.Add(this.ObjSoundEnable);
this.ObjVolume.Size = new System.Drawing.Size(347, 42);
this.ObjVolume.SmallChange = 2;
this.ObjVolume.TabIndex = 2;
- this.ObjVolume.Value = 25;
- //
- // ObjSoundEnable
- //
- this.ObjSoundEnable.AutoSize = true;
- this.ObjSoundEnable.Checked = true;
- this.ObjSoundEnable.CheckState = System.Windows.Forms.CheckState.Checked;
- this.ObjSoundEnable.Location = new System.Drawing.Point(10, 44);
- this.ObjSoundEnable.Name = "ObjSoundEnable";
- this.ObjSoundEnable.Size = new System.Drawing.Size(59, 17);
- this.ObjSoundEnable.TabIndex = 5;
- this.ObjSoundEnable.Text = "Enable";
- this.toolTip1.SetToolTip(this.ObjSoundEnable, "When checked inworld sounds will play");
- this.ObjSoundEnable.UseVisualStyleBackColor = true;
+ this.ObjVolume.Value = 40;
//
// MediaConsole
//
<value>2.0</value>\r
</resheader>\r
<resheader name="reader">\r
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
</resheader>\r
<resheader name="writer">\r
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
</resheader>\r
- <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.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=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\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