add volume control to video
							parent
							
								
									dc7e68fecc
								
							
						
					
					
						commit
						c5b9ff1677
					
				|  | @ -19,7 +19,17 @@ namespace MoonWorks.Video | ||||||
| 		internal IntPtr Handle; | 		internal IntPtr Handle; | ||||||
| 
 | 
 | ||||||
| 		public bool Loop { get; private set; } | 		public bool Loop { get; private set; } | ||||||
| 		public float Volume { get; private set; } | 		public float Volume { | ||||||
|  | 			get => volume; | ||||||
|  | 			set | ||||||
|  | 			{ | ||||||
|  | 				volume = value; | ||||||
|  | 				if (audioStream != null) | ||||||
|  | 				{ | ||||||
|  | 					audioStream.Volume = value; | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
| 		public float PlaybackSpeed { get; set; } | 		public float PlaybackSpeed { get; set; } | ||||||
| 		public double FramesPerSecond => fps; | 		public double FramesPerSecond => fps; | ||||||
| 		private VideoState State = VideoState.Stopped; | 		private VideoState State = VideoState.Stopped; | ||||||
|  | @ -43,6 +53,7 @@ namespace MoonWorks.Video | ||||||
| 
 | 
 | ||||||
| 		private AudioDevice AudioDevice = null; | 		private AudioDevice AudioDevice = null; | ||||||
| 		private StreamingSoundTheora audioStream = null; | 		private StreamingSoundTheora audioStream = null; | ||||||
|  | 		private float volume = 1.0f; | ||||||
| 
 | 
 | ||||||
| 		private Stopwatch timer; | 		private Stopwatch timer; | ||||||
| 		private double lastTimestamp; | 		private double lastTimestamp; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue