示例#1
0
        private void PosAlignByMarkers()
        {
            var selectedByTrack = myVegas.Project.GetSelectedEvents().GroupBy(item => item.Track);

            if (selectedByTrack.Count() < 2)
            {
                return;
            }

            var guideEvents = selectedByTrack.First();

            var punchpoints = (guideEvents.Select(Ev => new { Ev, mmk = Ev.FindCurrentMetaMarker() }).Select(T => T.Ev.Start + T.mmk.GlobalMarkerOffset)).ToList();

            selectedByTrack = selectedByTrack.Skip(1);             // don't adjust the guide track

            using (var undo = new UndoBlock("Align by markers"))
            {
                foreach (var group in selectedByTrack)
                {
                    var events = new List <TrackEvent>();
                    events.AddRange(group);
                    for (int i = 0; i <= events.Count - 1; i++)
                    {
                        if (i > punchpoints.Count - 1)
                        {
                            break;
                        }
                        TrackEvent ev       = events[i];
                        MetaMarker mmk      = ev.FindCurrentMetaMarker();
                        Timecode   newMkPos = punchpoints[i];
                        ev.Start = newMkPos - mmk.GlobalMarkerOffset;
                    }
                }
            }
        }
示例#2
0
文件: Ext.cs 项目: teetow/teevegas
        internal static Marker FindCurrentMarker(this TrackEvent Event)
        {
            MetaMarker mmk = Event.FindCurrentMetaMarker();

            if (mmk != null)
            {
                return(mmk.Marker);
            }
            return(null);
        }
示例#3
0
        private void SetCurrentMarkerOffset(TrackEvent Event, Timecode Offset)
        {
            MetaMarker mmk = Event.FindCurrentMetaMarker();

            if (mmk == null)
            {
                return;
            }
            Event.ActiveTake.Offset = mmk.LocalMarkerOffset - Offset;
        }
示例#4
0
        public void SetMetaTake(TrackEvent TrackEvent, Marker TargetMarker)
        {
            MetaMarker currentMmk = TrackEvent.FindCurrentMetaMarker();

            if (currentMmk == null)
            {
                return;
            }

            var targetMmk = new MetaMarker(TargetMarker, TrackEvent);

            TrackEvent.ActiveTake.Offset = targetMmk.GlobalMarkerPosition - currentMmk.GlobalMarkerOffset;
        }
示例#5
0
		public void SetMetaTake(TrackEvent TrackEvent, Marker TargetMarker)
		{
			MetaMarker currentMmk = TrackEvent.FindCurrentMetaMarker();
			if (currentMmk == null)
				return;

			var targetMmk = new MetaMarker(TargetMarker, TrackEvent);
			TrackEvent.ActiveTake.Offset = targetMmk.GlobalMarkerPosition - currentMmk.GlobalMarkerOffset;
		}
示例#6
0
		private void SetCurrentMarkerOffset(TrackEvent Event, Timecode Offset)
		{
			MetaMarker mmk = Event.FindCurrentMetaMarker();
			if (mmk == null)
				return;
			Event.ActiveTake.Offset = mmk.LocalMarkerOffset - Offset;
		}