public Sequence CreateTimeline() { var timeline = new Sequence(); timeline.Tracks.Add(new Track { Number = 1, TrackType = TrackType.Visual, Volume = 1 }); int?maxNumberOfAudioTracks = this.configurationService.GetParameterValueAsInt("MaxNumberOfAudioTracks").GetValueOrDefault(1); for (int i = 1; i <= maxNumberOfAudioTracks.Value; i++) { var track = new Track { Number = i + 1, TrackType = TrackType.Audio, IsMuted = true, Volume = 1 }; timeline.Tracks.Add(track); } timeline.Tracks.Add(new Track { TrackType = TrackType.Overlay }); return(timeline); }
/// <summary> /// Callback handler for the LoadProject method. /// </summary> /// <param name="project">The project.</param> private void LoadProjectCompleted(Project project) { if (project == null) { string projectId = null; if (!HtmlPage.Document.QueryString.TryGetValue("projectId", out projectId)) { projectId = Guid.NewGuid().ToString(); } project = new Project { Name = projectId, Creator = this.configurationService.GetUserName(), Created = DateTime.Now, SmpteFrameRate = SmpteFrameRate.Smpte2997NonDrop, AutoSaveInterval = 180, RippleMode = false }; Sequence sequence = this.CreateTimeline(); project.AddTimeline(sequence); project.StartTimeCode = TimeCode.FromAbsoluteTime(0, project.SmpteFrameRate); } this.currentProject = project; }
public void SetUp() { this.view = new MockCommentEditBox(); this.preview = new MockCommentViewPreview(); this.eventAggregator = new MockEventAggregator(); this.configurationService = new MockConfigurationService(); this.sequenceModel = new MockSequenceModel(); this.playCommentEvent = new MockPlayCommentEvent(); this.commentUpdatedEvent = new MockCommentUpdatedEvent(); this.sequenceRegistry = new MockSequenceRegistry(); this.sequence = new Sequence(); this.sequenceRegistry.CurrentSequence = this.sequence; this.sequenceRegistry.CurrentSequenceModel = this.sequenceModel; this.eventAggregator.AddMapping <PlayCommentEvent>(this.playCommentEvent); this.eventAggregator.AddMapping <CommentUpdatedEvent>(this.commentUpdatedEvent); }