OSDN Git Service

Disable GUI Object volume control, but renable Stream volume
authorMojito Sorbet <mojitotech@gmail.com>
Wed, 2 Jun 2010 21:49:10 +0000 (21:49 +0000)
committerMojito Sorbet <mojitotech@gmail.com>
Wed, 2 Jun 2010 21:49:10 +0000 (21:49 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@670 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/Core/Media/BufferSound.cs
Radegast/Core/Media/MediaManager.cs
Radegast/Core/Media/MediaObject.cs
Radegast/GUI/Consoles/MediaConsole.Designer.cs
Radegast/GUI/Consoles/MediaConsole.resx

index 0567842..0b4519c 100644 (file)
@@ -149,7 +149,8 @@ namespace Radegast.Media
         /// </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
index b8cd1d8..cb1dba4 100644 (file)
@@ -465,10 +465,11 @@ namespace Radegast.Media
             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
             {
index 00389e5..a1244a3 100644 (file)
@@ -125,7 +125,7 @@ namespace Radegast.Media
         /// <summary>
         ///  Change a playback volume
         /// </summary>
-        protected float volume = 0.5f;
+        protected float volume = 0.8f;
         public float Volume
         {
             get
@@ -135,28 +135,25 @@ namespace Radegast.Media
             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
             }
         }
 
@@ -169,23 +166,28 @@ namespace Radegast.Media
             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
+
             }
         }
 
index 3ad82dc..ed5b77e 100644 (file)
@@ -71,9 +71,9 @@ namespace Radegast
             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();
@@ -202,6 +202,19 @@ namespace Radegast
             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);
@@ -222,20 +235,7 @@ namespace Radegast
             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
             // 
index 6dfd76d..7ce03af 100644 (file)
     <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