diff --git a/DMX-2.0/SeqSonUI.cs b/DMX-2.0/SeqSonUI.cs index 4695de3..2600832 100644 --- a/DMX-2.0/SeqSonUI.cs +++ b/DMX-2.0/SeqSonUI.cs @@ -175,6 +175,11 @@ namespace DMX2 { Console.WriteLine("FF Released"); } + + protected void OnSclVolumeValueChanged (object sender, EventArgs e) + { + sequenceur.Volume = (uint)(sclVolume.Value); + } #endregion } diff --git a/DMX-2.0/SequenceurSon.cs b/DMX-2.0/SequenceurSon.cs index db9a985..b492e5b 100644 --- a/DMX-2.0/SequenceurSon.cs +++ b/DMX-2.0/SequenceurSon.cs @@ -35,6 +35,8 @@ namespace DMX2 string curfile = string.Empty; + uint volume=100; + Gst.Element element = null; public ReadOnlyCollection Files { @@ -66,6 +68,15 @@ namespace DMX2 } } + public uint Volume { + get{ return volume;} + set { + volume=value; + if(element!=null) + element["volume"] = (double)volume / 100.0d ; + } + } + public void DelFile (int pos) { lock (this) { @@ -95,7 +106,6 @@ namespace DMX2 if(element == null)return; element.SetState(Gst.State.Playing); } - public void Pause () { if(element == null)return; @@ -103,6 +113,7 @@ namespace DMX2 } public void Stop () { + if(element == null)return; element.SetState(Gst.State.Null); element.Dispose(); element=null; diff --git a/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs index 13a4ab6..88ef958 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs @@ -39,7 +39,7 @@ namespace DMX2 private global::Gtk.Button btnNext; private global::Gtk.Entry entry1; private global::Gtk.Button button133; - private global::Gtk.VScale vscale1; + private global::Gtk.VScale sclVolume; private global::Gtk.Toolbar toolbar4; private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.NodeView listFiles; @@ -358,20 +358,20 @@ namespace DMX2 global::Gtk.Box.BoxChild w75 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3])); w75.Position = 0; // Container child hbox1.Gtk.Box+BoxChild - this.vscale1 = new global::Gtk.VScale (null); - this.vscale1.WidthRequest = 20; - this.vscale1.CanFocus = true; - this.vscale1.Name = "vscale1"; - this.vscale1.Inverted = true; - this.vscale1.Adjustment.Upper = 100; - this.vscale1.Adjustment.PageIncrement = 10; - this.vscale1.Adjustment.StepIncrement = 1; - this.vscale1.Adjustment.Value = 100; - this.vscale1.DrawValue = true; - this.vscale1.Digits = 0; - this.vscale1.ValuePos = ((global::Gtk.PositionType)(3)); - this.hbox1.Add (this.vscale1); - global::Gtk.Box.BoxChild w76 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vscale1])); + this.sclVolume = new global::Gtk.VScale (null); + this.sclVolume.WidthRequest = 20; + this.sclVolume.CanFocus = true; + this.sclVolume.Name = "sclVolume"; + this.sclVolume.Inverted = true; + this.sclVolume.Adjustment.Upper = 100; + this.sclVolume.Adjustment.PageIncrement = 10; + this.sclVolume.Adjustment.StepIncrement = 1; + this.sclVolume.Adjustment.Value = 100; + this.sclVolume.DrawValue = true; + this.sclVolume.Digits = 0; + this.sclVolume.ValuePos = ((global::Gtk.PositionType)(3)); + this.hbox1.Add (this.sclVolume); + global::Gtk.Box.BoxChild w76 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.sclVolume])); w76.Position = 1; w76.Expand = false; w76.Fill = false; @@ -430,6 +430,7 @@ namespace DMX2 this.btnForward.Pressed += new global::System.EventHandler (this.OnBtnForwardPressed); this.btnForward.Released += new global::System.EventHandler (this.OnBtnForwardReleased); this.btnNext.Clicked += new global::System.EventHandler (this.OnBtnNextClicked); + this.sclVolume.ValueChanged += new global::System.EventHandler (this.OnSclVolumeValueChanged); } } } diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 41aa180..18f35f8 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -3866,7 +3866,7 @@ trames DMX (ms) - + 20 True @@ -3878,6 +3878,7 @@ trames DMX (ms) True 0 Bottom + 1