// skip audio events that are grouped with a selected video event // that uses the same media because they usually contain the same // captioning data private bool IsPairedAudioEvent(TrackEvent trackEvent, Media media) { if (trackEvent.IsAudio() && trackEvent.IsGrouped) { TrackEventGroup group = trackEvent.Group; if (null != group) { foreach (TrackEvent groupedEvent in group) { if (groupedEvent != trackEvent) { if (groupedEvent.IsVideo() && groupedEvent.Selected) { Take take = groupedEvent.ActiveTake; if (null != take) { Media groupedMedia = take.Media; if (null != media) { if (groupedMedia == media) { return(true); } } } } } } } } return(false); }
private void EventPropertiesMarkersCopy_Invoked(object sender, EventArgs e) { var markers = new Dictionary <double, string>(); List <TrackEvent> selected = myVegas.Project.GetSelectedEvents(true); if (selected.Count == 0) { return; } TrackEvent selectedEvent = selected[0]; if (!selectedEvent.IsAudio()) { return; } Media media = selectedEvent.ActiveTake.Media; foreach (MediaMarker mk in media.Markers) { double posSeconds = (double)mk.Position.Nanos / 10000000; // ONE BILLION DOLLARS markers.Add(posSeconds, mk.Label); } Clipboard.SetData(Strings.ClipboardMarkersTag, markers); }
internal static AudioEvent AsAudioEvent(this TrackEvent tEvent) { if (tEvent.IsAudio()) { return(tEvent as AudioEvent); } else { throw new InvalidCastException($"{tEvent.Name} is not AudioEvent"); } }