/// <summary> /// Wird ausgeführt, wenn ein Video einmal abgespielt wurde. /// </summary> /// <param name="vf"></param> /// <param name="Args"></param> private void OnVideoElementLoopFinished(VideoFile vf, EventArgs Args) { Chain Next = null; if (vf != null) { // Suchen, auf welches Element der Playlist das Ereignis zutrifft. foreach (Chain C in this._chains) if (((string)C.For.Filename).CompareTo((string)vf.Filename) == 0) { // Gefunden, das nächste Element muss abgespielt werden. Next = C.Next; break; } if (Next == null) return; if (((string)Next.For.Filename).CompareTo((string)vf.Filename) == 0) { // Playlist hat nur 1 Element, stoppen und gleich wieder starten. vf.Stop(); vf.Play(); } else { // Altes Video stoppen, unsichtbar machen, neues Video starten // und sichtbar machen. Der LoopCount muss auf 2 gesetzt werden! vf.Visible = false; vf.Stop(); Next.For.LoopCount = 2; Next.For.Play(); Next.For.Visible = true; } } }
/// <summary> /// Standardkonstruktor. /// </summary> /// <param name="f"></param> public Chain(VideoFile f) : this() { this.For = f; }
/// <summary> /// Erstellt ein Video aus einer Datei. Die Datei sollte vorhanden sein und ein /// gültiges Video enthalten. Anderenfalls ist das Verhalten dieser Methode /// undefiniert. /// </summary> /// <param name="Filename">Vollständiger Pfad zur Video Datei.</param> /// <returns>Eine Instanz der Klasse <see cref="VideoFile"/>, welche das Video /// beinhaltet.</returns> /// <exception cref="Line5.Liconcomp.LiconcompException">Wird ausgelöst, wenn ein /// Fehler auftritt.</exception> public VideoFile CreateVideoFromFile(string Filename) { this.CheckDisposed(); global::Liconcomp.IVideoFile vf_intf = (global::Liconcomp.IVideoFile)this._player.CreateVideoFromFile(Filename); if (vf_intf == null) throw new LiconcompException("Could not create video from file '" + Filename + "'."); VideoFile vf = new VideoFile(this, vf_intf); this._elements.Add(vf); return vf; }