protected ExtraSizeTab AddExtra() { ExtraSizeTab a = new ExtraSizeTab(VideoDuration); a.ValueChanged += (o, s) => Calculate(); audioExtraFlow.Controls.Add(a); return a; }
protected ExtraSizeTab AddExtra() { ExtraSizeTab a = new ExtraSizeTab(VideoDuration); a.ValueChanged += (o, s) => Calculate(); audioExtraFlow.Controls.Add(a); return(a); }
/// <summary> /// Gets the total extra size by finding the extras and summing their sizes /// </summary> /// <returns>Total size of extra data</returns> protected IEnumerable <ExtraTrack> GetExtras() { foreach (Control c in audioExtraFlow.Controls) { if (c is ExtraSizeTab) { ExtraSizeTab a = (ExtraSizeTab)c; if (a.ExtraTrack != null) { yield return(a.ExtraTrack); } } } }
private void UpdateAudioExtraDurations(TimeSpan duration) { foreach (Control c in audioExtraFlow.Controls) { if (c is AudioTrackSizeTab) { AudioTrackSizeTab a = (AudioTrackSizeTab)c; if (a.AudioTrack != null) { a.AudioTrack = new AudioTrack(duration) { RawBytes = a.AudioTrack.RawBytes, SamplingRate = a.AudioTrack.SamplingRate, AudioCodec = a.AudioTrack.AudioCodec }; } else { a.AudioTrack = new AudioTrack(duration); } } else if (c is ExtraSizeTab) { ExtraSizeTab a = (ExtraSizeTab)c; if (a.ExtraTrack != null) { a.ExtraTrack = new ExtraTrack(duration) { RawBytes = a.ExtraTrack.RawBytes }; } else { a.ExtraTrack = new ExtraTrack(duration); } } } }