void PlayIconClicked(object sender, MouseButtonEventArgs e) { if (PlayIcon.Visibility == Visibility.Visible) { players.EachPlayer(p => p.Play()); } }
public void PlaylistChanged(IPlaylist NewPlaylist) { if (AutoPlay) { players.EachPlayer(p => p.Play()); } }
public void jwSetVolume(double vol) { players.EachPlayer(p => p.AudioVolume = vol / 100.0); }
void button_Clicked(object sender, IndexEventArgs e) { players.EachPlayer(p => p.GoToPlaylistIndex(e.Index)); players.EachPlayer(p => p.Play()); }
void BuildControls(JwSkinPackage pkg, ControlBarLayout layout) { SetColumnDefinitions(layout); int i = 0; FrameworkElement lastElement = null; foreach (var element in layout.Elements) { FrameworkElement c; switch (element.Type) { case ControlBarElement.ElementType.Gap: i++; continue; case ControlBarElement.ElementType.Text: if (element.Name == "elapsed") { elapsedText = new JwElapsedText { FontSize = TargetFontSize, FontColour = FontColour }; c = elapsedText; players.EachPlayer(p => players.AddBinding(p, elapsedText)); } else if (element.Name == "duration") { durationText = new JwDurationText { FontSize = TargetFontSize, FontColour = FontColour }; c = durationText; players.EachPlayer(p => players.AddBinding(p, durationText)); } else { i++; continue; } break; case ControlBarElement.ElementType.Divider: c = new PairedImage(lastElement); pkg.BindAndResize(((PairedImage)c).Image, ControlBarComponent, element.Name ?? "divider"); break; case ControlBarElement.ElementType.CapLeft: c = leftCap = new Image(); pkg.BindAndResize(leftCap, ControlBarComponent, element.Name ?? "divider"); break; case ControlBarElement.ElementType.CapRight: c = rightCap = new Image(); pkg.BindAndResize(rightCap, ControlBarComponent, element.Name ?? "divider"); break; case ControlBarElement.ElementType.Button: var btn = BindButton(element, pkg); c = btn; c.Cursor = Cursors.Hand; break; case ControlBarElement.ElementType.TimeSlider: var tsl = BuildTimeSlider(pkg); c = tsl; c.Cursor = Cursors.Hand; break; case ControlBarElement.ElementType.VolumeSlider: var vsl = BuildVolumeSlider(pkg); c = vsl; c.Cursor = Cursors.Hand; break; default: i++; continue; } LayoutRoot.Children.Add(c); lastElement = c; if (element.Name == "play" || element.Name == "pause") { lastElement = null; } c.SetValue(Grid.ColumnProperty, i); i++; } }