Beispiel #1
0
 public void MoveElement(TimelineElement element, Track layer, TimeCode newPosition)
 {
     this.MoveElementTimesCalled++;
     this.MoveElementCalled          = true;
     this.MoveElementElementArgument = element;
     this.MoveElementElementArguments.Add(element);
     this.MoveElementNewPositionArgument = newPosition;
     this.MoveElementNewPositionArguments.Add(newPosition);
     element.Position = newPosition;
 }
        public void ShouldSetDurationToZeroIfThereIsNoElementsInTracks()
        {
            Project project = new Project();
            Track   track1  = new Track();
            Track   track2  = new Track();

            project.Timeline.Add(track1);
            project.Timeline.Add(track2);

            project.SetProjectDuration();

            Assert.IsTrue(project.Duration == 0);
        }
        public void ShouldetTheTheProjectDurationWhenThereIsOneTrackAndOneShot()
        {
            Project project = new Project();
            Track   track   = new Track();

            project.Timeline.Add(track);
            TimelineElement timelineElement = new TimelineElement()
            {
                InPosition  = TimeCode.FromSeconds(2000.0, SmpteFrameRate.Smpte25),
                OutPosition = TimeCode.FromSeconds(3000.0, SmpteFrameRate.Smpte25),
                Position    = TimeCode.FromSeconds(10000.0, SmpteFrameRate.Smpte25)
            };

            track.Shots.Add(timelineElement);
            project.SetProjectDuration();
            var duration = timelineElement.OutPosition.TotalSeconds - timelineElement.InPosition.TotalSeconds +
                           timelineElement.Position.TotalSeconds;

            Assert.AreEqual(project.Duration, duration);
        }
Beispiel #4
0
 public IList <TimelineElement> GetElementsAtPosition(TimeCode position, Track layer)
 {
     throw new NotImplementedException();
 }
Beispiel #5
0
 public TimelineElement GetElementAtPosition(TimeCode position, Track layer, TimelineElement elementToIgnore)
 {
     throw new NotImplementedException();
 }
Beispiel #6
0
 public TimelineElement GetElementWithinRange(TimeCode startTimeCode, TimeCode endTimeCode, Track layer, TimelineElement elementToIgnore)
 {
     throw new NotImplementedException();
 }
Beispiel #7
0
 public TimelineElement GetNextElement(TimeCode position, Track layer)
 {
     throw new NotImplementedException();
 }
Beispiel #8
0
 public void AddTrack(Track track)
 {
     this.Tracks.Add(track);
 }
Beispiel #9
0
 public TimelineElement FindFirstElementLinking(TimelineElement element, Track layer)
 {
     return(element); // TODO
 }
Beispiel #10
0
 public void RemoveElement(TimelineElement element, Track layer)
 {
     this.RemoveElementCalled   = true;
     this.RemoveElementArgument = element;
     this.InvokeElementRemoved(element);
 }
Beispiel #11
0
 public void AddElement(TimelineElement element, Track layer)
 {
     this.AddElementCalled   = true;
     this.AddElementArgument = element;
     this.AddElementArguments.Add(element);
 }
Beispiel #12
0
        public void ShouldetTheTheProjectDurationWhenThereIsMoreThanOneTrackAndMoreThanOneShot()
        {
            Project project = new Project();
            Track   track1  = new Track();
            Track   track2  = new Track();

            project.Timeline.Add(track1);
            project.Timeline.Add(track2);
            TimelineElement timelineElement1 = new TimelineElement()
            {
                InPosition  = TimeCode.FromSeconds(2000.0, SmpteFrameRate.Smpte25),
                OutPosition = TimeCode.FromSeconds(3000.0, SmpteFrameRate.Smpte25),
                Position    = TimeCode.FromSeconds(10000.0, SmpteFrameRate.Smpte25)
            };

            TimelineElement timelineElement2 = new TimelineElement()
            {
                InPosition  = TimeCode.FromSeconds(2000.0, SmpteFrameRate.Smpte25),
                OutPosition = TimeCode.FromSeconds(3000.0, SmpteFrameRate.Smpte25),
                Position    = TimeCode.FromSeconds(12000.0, SmpteFrameRate.Smpte25)
            };

            TimelineElement timelineElement3 = new TimelineElement()
            {
                InPosition  = TimeCode.FromSeconds(2000.0, SmpteFrameRate.Smpte25),
                OutPosition = TimeCode.FromSeconds(3000.0, SmpteFrameRate.Smpte25),
                Position    = TimeCode.FromSeconds(14000.0, SmpteFrameRate.Smpte25)
            };

            TimelineElement timelineElement4 = new TimelineElement()
            {
                InPosition  = TimeCode.FromSeconds(2000.0, SmpteFrameRate.Smpte25),
                OutPosition = TimeCode.FromSeconds(3000.0, SmpteFrameRate.Smpte25),
                Position    = TimeCode.FromSeconds(10000.0, SmpteFrameRate.Smpte25)
            };

            TimelineElement timelineElement5 = new TimelineElement()
            {
                InPosition  = TimeCode.FromSeconds(4000.0, SmpteFrameRate.Smpte25),
                OutPosition = TimeCode.FromSeconds(6000.0, SmpteFrameRate.Smpte25),
                Position    = TimeCode.FromSeconds(12000.0, SmpteFrameRate.Smpte25)
            };

            TimelineElement timelineElement = new TimelineElement()
            {
                InPosition  = TimeCode.FromSeconds(2000.0, SmpteFrameRate.Smpte25),
                OutPosition = TimeCode.FromSeconds(4000.0, SmpteFrameRate.Smpte25),
                Position    = TimeCode.FromSeconds(20000.0, SmpteFrameRate.Smpte25)
            };

            track1.Shots.Add(timelineElement1);
            track1.Shots.Add(timelineElement2);
            track1.Shots.Add(timelineElement3);

            track2.Shots.Add(timelineElement4);
            track2.Shots.Add(timelineElement5);
            track2.Shots.Add(timelineElement);

            project.SetProjectDuration();

            var duration = timelineElement.OutPosition.TotalSeconds - timelineElement.InPosition.TotalSeconds +
                           timelineElement.Position.TotalSeconds;

            Assert.AreEqual(project.Duration, duration);
        }