private void AddAudioPlaybackControl(WindowsPoint location, string audioFile) { var control = new ShowComposer.UserControls.AudioPlaybackControl(); control.IsRelativePath = false; control.AudioFile = audioFile; control.SoundVolume = 0.5; control.IsExclusivePlayback = false; ((AudioPlaybackControl)control).OnRemove += AudioPlaybackControl_OnRemove; Canvas.SetTop(control, location.Y); Canvas.SetLeft(control, location.X); AddCanvasElement(control, new WindowsPoint()); }
private void AddAudioPlaybackControl(AudioPlayerInfo info) { if (Properties.Settings.Default.AudioPlaybackOneOutput) { AudioControls.All((i) => i.Stop()); } var control = new ShowComposer.UserControls.AudioPlaybackControl(); control.IsRelativePath = info.IsRelativePath; control.AudioFile = info.AudioFile; control.SoundVolume = info.AudioVolume; control.IsExclusivePlayback = info.IsExclusivePlayback; ((AudioPlaybackControl)control).OnRemove += AudioPlaybackControl_OnRemove; Canvas.SetTop(control, info.Top); Canvas.SetLeft(control, info.Left); AddCanvasElement(control, new WindowsPoint()); }