public static void Execute(Vegas vegas) { Marker fistMarker = null; var markersToRemove = new List <Marker>(); var proj = vegas.Project; using (var undo = new UndoBlock("Convert Markers To Regions")) { foreach (var marker in VegasHelper.GetMarkersByTimecode(proj)) { if (fistMarker == null) { fistMarker = marker; } else { markersToRemove.Add(fistMarker); markersToRemove.Add(marker); Region currentRegion = new Region(fistMarker.Position, marker.Position - fistMarker.Position); proj.Regions.Add(currentRegion); fistMarker = null; } } foreach (var marker in markersToRemove) { proj.Markers.Remove(marker); } } }
public void FromVegas(Vegas vegas) { #if true // form1 ImportText.Form1 form = new ImportText.Form1(); if (form.ShowDialog() != DialogResult.OK) { return; } GetSettingsFromForm(form); AddMedias(vegas); #else // Common dialog. OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "テキストファイル(*.txt)|*.txt"; if (ofd.ShowDialog() != DialogResult.OK) { return; } // テキストを追加 AddMedias(vegas, ofd.FileName); #endif MessageBox.Show("終了しました。"); _currentTime = 0; //reset }
public void FromVegas(Vegas vegas) { try { _vegas = vegas; Track track = vegas.Project.AddVideoTrack(); PlugInNode generator = vegas.Generators.GetChildByName("VEGAS Titles & Text"); foreach (var region in vegas.Project.Regions) { string text = region.Label; VideoEvent e = new VideoEvent(vegas.Project, Timecode.FromMilliseconds(region.Position.ToMilliseconds()), region.Length, null); track.Events.Add(e); e.FadeIn.Curve = CurveType.Linear; e.FadeOut.Curve = CurveType.Linear; text = HandleAegisubTags(e, text); CreateTextPreset("RegionsToTextbox", "Impress BT", 14, 0.5, 0.08, 10.0, text); Media media = new Media(generator, "RegionsToTextbox"); MediaStream stream = media.Streams[0]; Take take = new Take(stream); e.Takes.Add(take); } } catch (Exception e) { vegas.ShowError(e); } }
public void FromVegas(Vegas vegas) { myVegas = vegas; if (UseProjectRulerFormatForTimecodes) { myTimecodeFormat = myVegas.Project.Ruler.Format; } String outputFile = myVegas.Project.FilePath; if (!String.IsNullOrEmpty(outputFile)) { String fileNameWOExt = Path.GetFileNameWithoutExtension(outputFile); String directoryName = Path.GetDirectoryName(outputFile); outputFile = Path.Combine(directoryName, fileNameWOExt + ".xml"); } outputFile = ShowSaveFileDialog("XML Files (*.xml)|*.xml", "XML Output File", outputFile); myVegas.UpdateUI(); if (null != outputFile) { ExportXml(outputFile); } }
public static void Execute(Vegas vegas) { var videoTracks = VegasHelper.GetTracks <VideoTrack>(vegas, 1); var selectedTrackEvents = VegasHelper.GetTrackEvents(videoTracks); var currentPosition = selectedTrackEvents[0].Start; //order the list ListHelpers.Shuffle(selectedTrackEvents, new Random()); using (var undo = new UndoBlock("Randomize Events")) { //update order of the events foreach (var selectedTrackEvent in selectedTrackEvents) { if (selectedTrackEvent.IsGrouped) { foreach (var groupedTrackEvents in selectedTrackEvent.Group) { groupedTrackEvents.Start = currentPosition; } } else { selectedTrackEvent.Start = currentPosition; } currentPosition += selectedTrackEvent.Length; } } }
public void FromVegas(Vegas vegas) { double dWidthProject = vegas.Project.Video.Width; double dHeightProject = vegas.Project.Video.Height; double dPixelAspect = vegas.Project.Video.PixelAspectRatio; double dAspect = dPixelAspect * dWidthProject / dHeightProject; List <VideoEvent> events = new List <VideoEvent>(); AddSelectedVideoEvents(vegas, events); if (0 == events.Count) { AddAllVideoEvents(vegas, events); } foreach (VideoEvent videoEvent in events) { Take take = videoEvent.ActiveTake; if (null == take) { continue; } VideoStream videoStream = take.MediaStream as VideoStream; if (null == videoStream) { continue; } double dMediaPixelAspect = videoStream.PixelAspectRatio; foreach (VideoMotionKeyframe keyframe in videoEvent.VideoMotion.Keyframes) { MatchOutputAspect(keyframe, dMediaPixelAspect, dAspect); } } }
public void FromVegas(Vegas vegas) { this.vegas = vegas; Timecode leftMostTimecode = null; foreach (Track track in vegas.Project.Tracks) { if (track.IsValid()) { foreach (TrackEvent trackEvent in track.Events) { if (trackEvent.Selected && (leftMostTimecode == null || trackEvent.Start < leftMostTimecode)) { leftMostTimecode = trackEvent.Start; } } } } if (leftMostTimecode != null) { vegas.Cursor = leftMostTimecode; } }
private Media createTextMedia(Vegas vegas, Preset preset) { PlugInNode plugin = vegas.Generators.GetChildByName("Sony Titles & Text"); Media textMedia = new Media(plugin); switch (preset) { case Preset.Title: textMedia.Generator.Preset = showPreset; break; case Preset.Song: textMedia.Generator.Preset = songPreset; break; case Preset.Rank: textMedia.Generator.Preset = rankPreset; break; default: break; } return(textMedia); }
private void Import(Config config, Vegas vegas) { Project project = vegas.Project; // Clear markers and regions if (config.ClearMarkers) { project.Markers.Clear(); } if (config.ClearRegions) { project.Regions.Clear(); } // Load log file if (!File.Exists(config.LogFile)) { throw new Exception("Log file does not exist."); } Dictionary <EventType, List <TimedEvent> > timedEvents = ParseLogFile(config); // Add markers/regions foreach (EventType eventType in timedEvents.Keys) { foreach (Visualization visualization in config.Visualizations) { if (visualization.EventType != eventType) { continue; } List <TimedEvent> filteredEvents = FilterEvents(timedEvents[eventType], visualization.Regex); foreach (TimedEvent timedEvent in filteredEvents) { Timecode start = Timecode.FromSeconds(timedEvent.Start); Timecode end = Timecode.FromSeconds(timedEvent.End); Timecode length = end - start; if (config.LoopRegionOnly) { Timecode loopRegionStart = vegas.Transport.LoopRegionStart; Timecode loopRegionEnd = loopRegionStart + vegas.Transport.LoopRegionLength; if (start < loopRegionStart || start > loopRegionEnd || end < loopRegionStart || end > loopRegionEnd) { continue; } } switch (visualization.VisualizationType) { case VisualizationType.Marker: project.Markers.Add(new Marker(start, timedEvent.Value)); break; case VisualizationType.Region: project.Regions.Add(new Region(start, length, timedEvent.Value)); break; } } } } }
public void RenderEvtFinish(RenderStatusEventArgs renderargs, Vegas vegas) { if (!PresenceEnabled) { return; } SecondsSinceLastAction = 0; isActive = false; presence = new DiscordRpc.RichPresence(); resetPresence(ref presence, vegas); switch (renderargs.Status) { case RenderStatus.Complete: presence.state = "Just finished rendering"; break; case RenderStatus.Failed: presence.state = "Just failed to render"; break; case RenderStatus.Canceled: presence.state = "Just canceled rendering"; break; } DiscordRpc.UpdatePresence(ref presence); }
public void FromVegas(Vegas vegas) { Project proj = vegas.Project; TrackEvent[] clips = FindSelectedEvents(proj); int frameOffset = 0; string input = Interaction.InputBox("Frame offset", "Chop", "1", -1, -1); if (input == "") { return; } if (int.TryParse(input, out frameOffset)) { foreach (TrackEvent clip in clips) { Chop(clip, Timecode.FromFrames(frameOffset)); } } else { MessageBox.Show("Please enter a number!"); } }
// string test; public void InitializeModule(Vegas vegas) { this.vegas = vegas; // add vegas' event handlers here eg. this.vegas.ProjectOpening += vegas_ProjectOpening; this.vegas.AppInitialized += Vegas_AppInitialized; // this.vegas.ProjectOpened += Vegas_ProjectOpened; }
internal void RegionAdjustInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; RegionAdjustParent.AddChild(RegionAdjustAutoSize); RegionAdjustParent.AddChild(RegionAdjustNudgeLeft); RegionAdjustParent.AddChild(RegionAdjustNudgeRight); RegionAdjustParent.AddChild(RegionAdjustResizeIn); RegionAdjustParent.AddChild(RegionAdjustResizeOut); RegionAdjustParent.AddChild(RegionAdjustSpacingIn); RegionAdjustParent.AddChild(RegionAdjustSpacingOut); RegionAdjustAutoSize.Invoked += RegionAdjustAutoSize_Invoked; RegionAdjustNudgeLeft.Invoked += RegionAdjustNudgeLeft_Invoked; RegionAdjustNudgeRight.Invoked += RegionAdjustNudgeRight_Invoked; RegionAdjustResizeIn.Invoked += RegionAdjustResizeIn_Invoked; RegionAdjustResizeOut.Invoked += RegionAdjustResizeOut_Invoked; RegionAdjustSpacingIn.Invoked += RegionAdjustSpacingIn_Invoked; RegionAdjustSpacingOut.Invoked += RegionAdjustSpacingOut_Invoked; CustomCommands.Add(RegionAdjustParent); CustomCommands.Add(RegionAdjustAutoSize); CustomCommands.Add(RegionAdjustNudgeLeft); CustomCommands.Add(RegionAdjustNudgeRight); CustomCommands.Add(RegionAdjustResizeIn); CustomCommands.Add(RegionAdjustResizeOut); CustomCommands.Add(RegionAdjustSpacingIn); CustomCommands.Add(RegionAdjustSpacingOut); }
public static void Execute(Vegas vegas) { var videoTracks = VegasHelper.GetTracks <VideoTrack>(vegas, 1); var selectedTrackEvents = VegasHelper.GetTrackEvents(videoTracks); var currentPosition = selectedTrackEvents[0].Start; //order the list selectedTrackEvents.Sort(new TrackEventsNameTimeComparer()); using (var undo = new UndoBlock("Order Events By Name And Time")) { //update order of the events foreach (var selectedTrackEvent in selectedTrackEvents) { if (selectedTrackEvent.IsGrouped) { foreach (var groupedTrackEvents in selectedTrackEvent.Group) { groupedTrackEvents.Start = currentPosition; } } else { selectedTrackEvent.Start = currentPosition; } currentPosition += selectedTrackEvent.Length; } } }
public void FromVegas(Vegas vegas) { string rendererName = Script.Args.ValueOf("renderer"); string templateName = Script.Args.ValueOf("template"); Renderer renderer = vegas.Renderers.FindByName(rendererName); RenderTemplate template = null; if (renderer != null) { template = renderer.Templates.FindByName(templateName); } if (template == null) { vegas.ShowError("Render template not found."); return; } string path = vegas.Project.FilePath; string saveas = Path.GetDirectoryName(path) + "\\" + Path.GetFileNameWithoutExtension(path) + ".rendered.mp4"; RenderStatus status = vegas.Render(saveas, template); if (status == RenderStatus.Complete || status == RenderStatus.Canceled || status == RenderStatus.Quit) { vegas.Exit(); } else { vegas.ShowError("Render incomplete. Please try again."); return; } }
public static void Execute(Vegas vegas) { var configData = new WallBuilderConfiguration(); if (!GetConfigurationFromUser(configData)) { return; } var wallTracks = WallBuilder.BuildWall(vegas.Project.Video.Width, vegas.Project.Video.Height, configData); using (var undo = new UndoBlock("Insert Video Wall")) { var trackNumber = 0; var videoTracks = VegasHelper.GetTracks <VideoTrack>(vegas); foreach (var track in wallTracks) { var videoTrack = SelectOrInsertVideoTrack(vegas, videoTracks, trackNumber); trackNumber += 1; SetTrackKeyFrames(videoTrack, track); } } }
internal void EventEdgeInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; CustomCommands.Add(EventEdgeParent); EventEdgeLftAuto.Invoked += EventEdgeLftAuto_Invoked; EventEdgeLftCursor.Invoked += EventEdgeLftCr_Invoke; EventEdgeLftAdj.Invoked += EventEdgeLftIn_Invoke; EventEdgeParent.AddChild(EventEdgeLftAuto); EventEdgeParent.AddChild(EventEdgeLftCursor); EventEdgeParent.AddChild(EventEdgeLftAdj); CustomCommands.Add(EventEdgeLftAdj); CustomCommands.Add(EventEdgeLftAuto); CustomCommands.Add(EventEdgeLftCursor); EventEdgeRgtAuto.Invoked += EventEdgeRgtAuto_Invoked; EventEdgeRgtCursor.Invoked += EventEdgeRgtCr_Invoke; EventEdgeRgtAdj.Invoked += EventEdgeRgtIn_Invoke; EventEdgeParent.AddChild(EventEdgeRgtAdj); EventEdgeParent.AddChild(EventEdgeRgtAuto); EventEdgeParent.AddChild(EventEdgeRgtCursor); CustomCommands.Add(EventEdgeRgtAdj); CustomCommands.Add(EventEdgeRgtAuto); CustomCommands.Add(EventEdgeRgtCursor); }
public void FromVegas(Vegas vegas) { try { VSG.MainContainer.Vegas = vegas; vegas.UnloadScriptDomainOnScriptExit = true; SetEffectService.SetEffectToElement(new VSG.ViewModel.ElementSteps.SetEffectStep( new ElementSelector { ElementMediaType = VSG.ViewModel.Enums.ElementMediaType.Video, ElementType = VSG.ViewModel.Enums.ElementType.Event, SelectorType = VSG.ViewModel.Enums.SelectorType.BySelection, Name = "21" } , new System.Collections.Generic.Dictionary <string, DataProperty> { { DataPropertyHolder.EFFECT_NAME, new DataProperty { Value = "VEGAS Glint" } }, { DataPropertyHolder.EFFECT_PRESET_NAME, new DataProperty { Value = "Sparkle" } }, })); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message, "Error: " + ex.GetType().Name); System.Windows.Forms.MessageBox.Show(ex.StackTrace, "Error: " + ex.GetType().Name); } }
internal void EventPitchInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; // Pitch CmdEventPitchUpOne.Invoked += EventPitchUpOne_Invoke; CmdEventPitchUpOct.Invoked += EventPitchUpOct_Invoke; CmdEventPitchDnOne.Invoked += EventPitchDnOne_Invoke; CmdEventPitchDnOct.Invoked += EventPitchDnOct_Invoke; CmdEventPitchReset.Invoked += EventPitchReset_Invoke; CmdEventPitchSet.Invoked += EventPitchSet_Invoke; CmdEventPitchParent.AddChild(CmdEventPitchUpOne); CmdEventPitchParent.AddChild(CmdEventPitchUpOct); CmdEventPitchParent.AddChild(CmdEventPitchDnOne); CmdEventPitchParent.AddChild(CmdEventPitchDnOct); CmdEventPitchParent.AddChild(CmdEventPitchReset); CmdEventPitchParent.AddChild(CmdEventPitchSet); CustomCommands.Add(CmdEventPitchParent); CustomCommands.Add(CmdEventPitchUpOne); CustomCommands.Add(CmdEventPitchUpOct); CustomCommands.Add(CmdEventPitchReset); CustomCommands.Add(CmdEventPitchDnOne); CustomCommands.Add(CmdEventPitchDnOct); CustomCommands.Add(CmdEventPitchSet); }
void AddMedias(Vegas vegas, string file) { // トラックを追加 Track track = new VideoTrack(0, _trackName); vegas.Project.Tracks.Add(track); track.Selected = true; // テキストファイルを開く // 1行につき1イベントを作ります System.IO.StreamReader sr = new System.IO.StreamReader(file, System.Text.Encoding.GetEncoding("shift_jis")); string line = ""; while ((line = sr.ReadLine()) != null) { // ビデオイベント作成 VideoEvent videoEvent = new VideoEvent(Timecode.FromSeconds(_currentTime), Timecode.FromSeconds(_timeLength)); track.Events.Add(videoEvent); // Takeを作成。ここにMediaのText情報が入っている Take take = GenerateTakeText(vegas, line); if (take != null) { videoEvent.Takes.Add(take); // イベントにテキストTakeを登録 } // 次の開始位置を決める _currentTime += _timeLength + _timeInterval; } sr.Close(); }
public void FromVegas(Vegas vegas) { this.vegas = vegas; Timecode rightMostTimecode = null; foreach (Track track in vegas.Project.Tracks) { if (track.IsValid()) { foreach (TrackEvent trackEvent in track.Events) { if (trackEvent.Selected && (rightMostTimecode == null || trackEvent.End > rightMostTimecode)) { rightMostTimecode = trackEvent.End; } } } } if (rightMostTimecode != null) { vegas.Cursor = rightMostTimecode; } }
public void FromVegas(Vegas vegas) { myVegas = vegas; String projectPath = myVegas.Project.FilePath; if (String.IsNullOrEmpty(projectPath)) { String dir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments); defaultBasePath = Path.Combine(dir, defaultBasePath); } else { String dir = Path.GetDirectoryName(projectPath); String fileName = Path.GetFileNameWithoutExtension(projectPath); defaultBasePath = Path.Combine(dir, fileName + "_"); } DialogResult result = ShowBatchRenderDialog(); myVegas.UpdateUI(); if (DialogResult.OK == result) { // inform the user of some special failure cases String outputFilePath = FileNameBox.Text; RenderMode renderMode = RenderMode.Project; if (RenderRegionsButton.Checked) { renderMode = RenderMode.Regions; } else if (RenderSelectionButton.Checked) { renderMode = RenderMode.Selection; } DoBatchRender(SelectedTemplates, outputFilePath, renderMode); } }
public void FromVegas(Vegas vegas) { try { Track track = vegas.Project.Tracks[0]; float rescale = 0.9f; double new_duration; foreach (TrackEvent curr_event in track.Events) { new_duration = curr_event.Length.ToMilliseconds() * rescale; curr_event.AdjustStartLength(curr_event.Start, Timecode.FromMilliseconds(new_duration), false); } Timecode curr_event_length; Timecode curr_event_start; Timecode next_event_start = Timecode.FromSeconds(0); foreach (TrackEvent curr_event in track.Events) { curr_event_length = curr_event.End; curr_event_start = curr_event.Start; curr_event.AdjustStartLength(next_event_start, curr_event.Length, false); next_event_start = curr_event.End; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
// ==================================================================== // public メンバー関数 // ==================================================================== // -------------------------------------------------------------------- // エントリーポイント // -------------------------------------------------------------------- public void FromVegas(Vegas oVegas) { try { mVegas = oVegas; // 確認 List <Media> aVideoMedias; Double aAudioLen; Check(out aVideoMedias, out aAudioLen); // 設定 Double aHead; Double aTail; Double aInterval; Settings(aVideoMedias, aAudioLen, out aHead, out aTail, out aInterval); // 実行 List <VideoPart> aVideoParts; GenerateParts(aVideoMedias, aHead, aTail, aInterval, out aVideoParts); ConcatParts(aVideoParts, aAudioLen, aInterval); MessageBox.Show("完了しました。", "報告", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception oExcep) { MessageBox.Show("切り貼り時エラー:\n" + oExcep.Message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
// // Adds a given media fileName to the current track at the specified cursorPosition // void InsertFileAt(Vegas vegas, string fileName, Timecode cursorPosition) { VideoEvent videoEvent = null; Media media = new Media(fileName); VideoTrack videoTrack = FindSelectedVideoTrack(vegas.Project); videoEvent = videoTrack.AddVideoEvent(cursorPosition, Timecode.FromSeconds(stillLength)); Take take = videoEvent.AddTake(media.GetVideoStreamByIndex(0)); videoEvent.MaintainAspectRatio = false; VideoMotionKeyframe key1 = new VideoMotionKeyframe(Timecode.FromSeconds(stillLength)); videoEvent.VideoMotion.Keyframes.Add(key1); VideoMotionKeyframe key0 = videoEvent.VideoMotion.Keyframes[0]; key0.ScaleBy(new VideoMotionVertex(initialScale, initialScale)); key0.RotateBy(initialRotationRadians * (double)rnd.Next(-1, 1)); key0.MoveBy(new VideoMotionVertex((float)rnd.Next(-15, 15), (float)rnd.Next(-20, 20))); PlugInNode plugIn = vegas.Transitions.FindChildByName(desiredTransitions[rnd.Next(0, desiredTransitions.Length - 1)]); Effect fx = new Effect(plugIn); videoEvent.FadeIn.Transition = fx; }
//String presetName = "SMPTE Drop (29.97 fps)"; public void FromVegas(Vegas vegas) { PlugInNode plugIn = vegas.VideoFX.GetChildByClassID(plugInClassID); if (null == plugIn) { throw new ApplicationException("Could not find video plug-in."); } foreach (Media media in vegas.Project.MediaPool) { // only add the effect if the media object has video if (!media.HasVideo()) { continue; } // and if it does not already have the effect if (MediaHasEffect(media, plugIn)) { continue; } Effect effect = new Effect(plugIn); media.Effects.Add(effect); if (null != presetName) { effect.Preset = presetName; } } }
public void FromVegas(Vegas vegas) { util = new Util(vegas); foreach (Track track in vegas.Project.Tracks) { if (track.IsValid()) { foreach (TrackEvent trackEvent in track.Events) { if (trackEvent.IsValid()) { Timecode regionStart = vegas.SelectionStart; Timecode regionEnd = vegas.SelectionStart + vegas.SelectionLength; if (util.IsEventInTimecodeRegion(trackEvent, regionStart, regionEnd)) { trackEvent.Selected = true; } else { trackEvent.Selected = false; } } } } } }
internal RegionRenderForm(Vegas Vegas, RenderSet RenderSet) { myVegas = Vegas; _renderSet = RenderSet; InitializeComponent(); Init(); }
public void FromVegas(Vegas vegas) { this.vegas = vegas; string projName; string projFile = this.vegas.Project.FilePath; if (string.IsNullOrEmpty(projFile)) { projName = "Untitled"; } else { projName = Path.GetFileNameWithoutExtension(projFile); } string file = null; if (this.ShowSaveDialog("Exports regions to .srt", projName + ".regions", out file, ".srt file (*.srt)|*.srt") == DialogResult.OK) { if (Path.GetExtension(file) != null) { if (Path.GetExtension(file).ToUpper() == ".SRT") { this.ExportRegions(file); } } } }
public void FromVegas(Vegas vegas) { Size projectSize = new Size(vegas.Project.Video.Width, vegas.Project.Video.Height); double projectAspect = vegas.Project.Video.PixelAspectRatio; List <VideoEvent> events = new List <VideoEvent>(); AddSelectedVideoEvents(vegas, events); if (0 == events.Count) { AddAllVideoEvents(vegas, events); } foreach (VideoEvent videoEvent in events) { Take take = videoEvent.ActiveTake; if (null == take) { continue; } VideoStream videoStream = take.MediaStream as VideoStream; if (null == videoStream) { continue; } if (!videoStream.Parent.IsGenerated()) { continue; } videoStream.Size = projectSize; videoStream.PixelAspectRatio = projectAspect; } }
public void FromVegas(Vegas vegas) { foreach (Track track in vegas.Project.Tracks) { if (track.IsValid() && track.IsVideo() && track.Selected) { foreach (TrackEvent trackEvent in track.Events) { if (trackEvent.IsVideo()) { VideoEvent videoEvent = (VideoEvent)trackEvent; string currentMediaPath = videoEvent.ActiveTake.MediaPath; string pathExtension = Path.GetExtension(currentMediaPath); if (pathExtension.Equals(findExtension, StringComparison.OrdinalIgnoreCase)) { string replacementPath = Path.ChangeExtension(currentMediaPath, replaceExtension); Media media = new Media(replacementPath); MediaStream mediaStream = media.GetVideoStreamByIndex(0); Timecode oldTakeOffset = videoEvent.ActiveTake.Offset; videoEvent.AddTake(mediaStream, true); videoEvent.ActiveTake.Offset = oldTakeOffset; } } } } } }
public static void RunSetup(Vegas Vegas) { var nextRegion = Vegas.Project.NextRegion(Vegas.Transport.CursorPosition); var currentParams = Vegas.Project.GetParamsAt((nextRegion != null) ? nextRegion.Position : Vegas.Project.Length); var form = new RenderParamsForm(Vegas, currentParams); if (form.ShowDialog() != DialogResult.OK) return; int offsetCounter = 0; const long markerSpacing = 10000; Timecode startPos = Vegas.Transport.CursorPosition; Timecode currentPos = startPos; foreach (RenderParameter param in form.UserRenderParams.RenderParams) { // skip basedir for now TODO: FIX THIS if (param.Name == RenderTags.RootDir) continue; // skip params that are the same as previous var currentParam = currentParams.GetParam(param.Name); if (param.Value.Equals(currentParam.Value)) continue; // find last marker of this type string paramName = param.Name; var sameTypeMarkers = Vegas.Project.CommandMarkers.Where(item => item.CommandType.ToString().Equals(paramName, StringComparison.InvariantCultureIgnoreCase)); var sameRegionMarkers = sameTypeMarkers.Where(sibling => !Vegas.Project.RegionsBetween(sibling.Position, currentPos)); CommandMarker updateCandidate = null; // dooo eeet foreach (var sibling in sameRegionMarkers) { updateCandidate = sibling; } if (updateCandidate != null) { updateCandidate.CommandParameter = param.Value.ToString(); } else { CommandMarker mk = null; do { try { mk = new CommandMarker(currentPos, new MarkerCommandType(param.Name), param.Value.ToString()); } catch (Exception) { currentPos += Timecode.FromNanos(markerSpacing * offsetCounter++); } } while (mk == null); Vegas.Project.CommandMarkers.Add(mk); currentPos = startPos + Timecode.FromNanos(markerSpacing * offsetCounter++); } } }
public RenderParamsForm(Vegas Vegas, RenderParamSet RenderParams) { myVegas = Vegas; _renderParams = RenderParams; InitializeComponent(); InitCustomTags(); InitRenderSelectors(); }
internal void RegionCreateInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; RegionCreateParent.AddChild(RegionCreateFromEvents); RegionCreateFromEvents.Invoked += RegionCreateFromEvents_Invoked; CustomCommands.Add(RegionCreateParent); CustomCommands.Add(RegionCreateFromEvents); }
internal void ProjectSearchInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; // Search and replace ProjectSearchReplaceCommand.MenuItemName = ProjectSearchStrings.MenuTitle; ProjectSearchReplaceCommand.DisplayName = ProjectSearchStrings.WindowTitle; ProjectSearchReplaceCommand.Invoked += ProjectSearchReplace_Invoked; ProjectSearchReplaceCommand.MenuPopup += ProjectSearchReplaceCommand_MenuPopup; CustomCommands.Add(ProjectSearchReplaceCommand); }
internal void EventPropertiesInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; // parent CustomCommands.Add(EventPropertiesParent); // properties copy EventPropertiesCopy.DisplayName = "&Copy all properties"; EventPropertiesCopy.Invoked += EventPropertiesCopy_Invoke; CustomCommands.Add(EventPropertiesCopy); EventPropertiesParent.AddChild(EventPropertiesCopy); //properties paste EventPropertiesPasteAll.DisplayName = "Paste &all properties"; EventPropertiesPasteFades.DisplayName = "Paste &fades"; EventPropertiesPasteVolumes.DisplayName = "Paste &gains"; EventPropertiesPastePitches.DisplayName = "Paste &pitches"; EventPropertiesPasteAll.Invoked += EventPropertiesPaste_Invoke; EventPropertiesPasteFades.Invoked += EventPropertiesPasteFades_Invoked; EventPropertiesPasteVolumes.Invoked += EventPropertiesPasteVolumes_Invoked; EventPropertiesPastePitches.Invoked += EventPropertiesPastePitches_Invoked; CustomCommands.Add(EventPropertiesPasteAll); CustomCommands.Add(EventPropertiesPasteFades); CustomCommands.Add(EventPropertiesPasteVolumes); CustomCommands.Add(EventPropertiesPastePitches); EventPropertiesParent.AddChild(EventPropertiesPasteAll); EventPropertiesParent.AddChild(EventPropertiesPasteFades); EventPropertiesParent.AddChild(EventPropertiesPasteVolumes); EventPropertiesParent.AddChild(EventPropertiesPastePitches); // markers EventPropertiesMarkersCopy.DisplayName = "Cop&y markers"; EventPropertiesMarkersPaste.DisplayName = "Pas&te markers"; EventPropertiesMarkersCopy.Invoked += EventPropertiesMarkersCopy_Invoked; EventPropertiesMarkersPaste.Invoked += EventPropertiesMarkersPaste_Invoked; CustomCommands.Add(EventPropertiesMarkersCopy); CustomCommands.Add(EventPropertiesMarkersPaste); EventPropertiesParent.AddChild(EventPropertiesMarkersCopy); EventPropertiesParent.AddChild(EventPropertiesMarkersPaste); // gain EventPropertiesGainReset.DisplayName = "Reset &Gain"; EventPropertiesNormGainSet.DisplayName = "Set &Normalization Gain"; EventPropertiesTakeOffline.DisplayName = "Set Take to &Offline"; EventPropertiesGainReset.Invoked += EventPropertiesGainReset_Invoked; EventPropertiesNormGainSet.Invoked += EventPropertiesNormGainSet_Invoked; EventPropertiesTakeOffline.Invoked += EventPropertiesTakeOffline_Invoked; CustomCommands.Add(EventPropertiesGainReset); CustomCommands.Add(EventPropertiesNormGainSet); CustomCommands.Add(EventPropertiesTakeOffline); EventPropertiesParent.AddChild(EventPropertiesGainReset); EventPropertiesParent.AddChild(EventPropertiesNormGainSet); EventPropertiesParent.AddChild(EventPropertiesTakeOffline); }
internal void ProjectFileInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; ProjectFileNewVersionCommand.DisplayName = ProjectFileStrings.FileNewVersionWindowTitle; ProjectFileNewVersionCommand.MenuItemName = ProjectFileStrings.FileNewVersionMenuTitle; ProjectFileNewVersionCommand.Invoked += ProjectFileNewVersionCommand_Invoked; ProjectFileParentCommand.AddChild(ProjectFileNewVersionCommand); CustomCommands.Add(ProjectFileParentCommand); CustomCommands.Add(ProjectFileNewVersionCommand); }
public MainForm(Vegas vegas) { InitializeComponent(); MyVegas = vegas; R = new Random(); TargetEvent = FirstSelectedEvent(); TargetEvent.VideoMotion.Keyframes.Clear(); TargetEvent.VideoMotion.Keyframes[0].Position = new Timecode(0); vegas.Transport.CursorPosition = TargetEvent.Start; UpdatePreview(); }
public void FromVegas(Vegas vegas) { foreach (Track Track in vegas.Project.Tracks) { if (!Track.Selected) continue; foreach (TrackEvent Event in Track.Events) { Event.Selected = (Event.Index % 2 == 0) ? true : false; } } }
public void FromVegas(Vegas vegas) { foreach (Track Track in vegas.Project.Tracks) { foreach (TrackEvent Event in Track.Events) { if (!Event.Selected) continue; Event.Length = Timecode.FromFrames(1); } } }
public void FromVegas(Vegas vegas) { foreach (Track Track in vegas.Project.Tracks) { if (!Track.Selected) continue; for (int i = 0; i < Track.Events.Count - 1; i++) { Track.Events[i].Length = Track.Events[i + 1].Start - Track.Events[i].Start; } } }
internal void MarkerInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; MarkerParentCommand.AddChild(MarkerCreateFromEventsCommand); MarkerParentCommand.AddChild(MarkerSetIntervalCommand); MarkerParentCommand.AddChild(MarkerCreateMultiCommand); MarkerCreateFromEventsCommand.Invoked += MarkerCreateFromEventsCommand_Invoked; MarkerSetIntervalCommand.Invoked += MarkerSetIntervalCommand_Invoked; MarkerCreateMultiCommand.Invoked += MarkerCreateMultiCommand_Invoked; CustomCommands.Add(MarkerParentCommand); }
internal void RegionNameInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; RegionNameParent.AddChild(RegionNameAuto); RegionNameParent.AddChild(RegionNameSeq); RegionNameAuto.Invoked += RegionNameAuto_Invoked; RegionNameSeq.Invoked += RegionNameSeq_Invoked; CustomCommands.Add(RegionNameParent); CustomCommands.Add(RegionNameAuto); CustomCommands.Add(RegionNameSeq); }
public void FromVegas(Vegas vegas) { foreach (Track Track in vegas.Project.Tracks) { if (!Track.Selected) continue; Timecode CPos = Timecode.FromNanos(0); foreach (TrackEvent Event in Track.Events) { Event.Start = CPos; CPos += Event.Length; } } }
public MainForm(Vegas vegas) { InitializeComponent(); MyVegas = vegas; listViewTracks.Items.Clear(); foreach (Track t in vegas.Project.Tracks) { ListViewItem i = new ListViewItem(new String[] { t.DisplayIndex.ToString(), t.Name??"(Sem nome)", t.Events.Count.ToString() }); i.Tag = t; listViewTracks.Items.Add(i); } listViewTracks.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); }
public void FromVegas(Vegas Vegas, String ScriptFile, XmlDocument ScriptSettings, ScriptArgs Args) { if (ArgsHasSetup(Args)) // config mode { RunSetup(Vegas); } else { var renderset = new RenderSet(); var form = new RegionRenderForm(Vegas, renderset); if (DialogResult.OK != form.ShowDialog()) return; //renderset.Render(Vegas); } }
public void MetaTakesInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; //*/ MetaTakesFirstCommand.Invoked += MetaTakesFirst_Invoke; MetaTakesNextCommand.Invoked += MetaTakesNext_Invoke; MetaTakesPrevCommand.Invoked += MetaTakesPrev_Invoke; MetaTakeGroupNextCommand.Invoked += MetaTakeGroupNextCommand_Invoked; MetaTakeGroupPrevCommand.Invoked += MetaTakeGroupPrevCommand_Invoked; //MetaTakesGetOffsetCommand.Invoked += new EventHandler(MetaTakesGetOffset_invoke); MetaTakesSetOffsetCommand.Invoked += MetaTakesSetOffset_invoke; MetaTakesResetOffsetCommand.Invoked += MetaTakesResetOffset_invoke; MetaTakesSplitEventCommand.Invoked += MetaTakesSplit_Invoke; MetaTakesDistFirstCommand.Invoked += MetaTakesDistFirstCommand_Invoked; MetaTakesDistSeqCommand.Invoked += MetaTakesDistSeqCommand_Invoked; MetaTakesDistRndCommand.Invoked += MetaTakesDistRndCommand_Invoked; MetaTakesDistRevCommand.Invoked += MetaTakesDistRevCommand_Invoked; MetaTakesParent.AddChild(MetaTakesFirstCommand); MetaTakesParent.AddChild(MetaTakesNextCommand); MetaTakesParent.AddChild(MetaTakesPrevCommand); MetaTakesParent.AddChild(MetaTakeGroupNextCommand); MetaTakesParent.AddChild(MetaTakeGroupPrevCommand); //MetaTakesParent.AddChild(MetaTakesGetOffsetCommand); MetaTakesParent.AddChild(MetaTakesSetOffsetCommand); MetaTakesParent.AddChild(MetaTakesResetOffsetCommand); MetaTakesParent.AddChild(MetaTakesSplitEventCommand); MetaTakesParent.AddChild(MetaTakesDistSeqCommand); MetaTakesParent.AddChild(MetaTakesDistRndCommand); MetaTakesParent.AddChild(MetaTakesDistRevCommand); CustomCommands.Add(MetaTakesParent); CustomCommands.Add(MetaTakesFirstCommand); CustomCommands.Add(MetaTakesNextCommand); CustomCommands.Add(MetaTakesPrevCommand); CustomCommands.Add(MetaTakeGroupNextCommand); CustomCommands.Add(MetaTakeGroupPrevCommand); //CustomCommands.Add(MetaTakesGetOffsetCommand); CustomCommands.Add(MetaTakesSetOffsetCommand); CustomCommands.Add(MetaTakesResetOffsetCommand); CustomCommands.Add(MetaTakesSplitEventCommand); CustomCommands.Add(MetaTakesDistSeqCommand); CustomCommands.Add(MetaTakesDistRndCommand); CustomCommands.Add(MetaTakesDistRevCommand); //*/ }
public void FromVegas(Vegas vegas) { myVegas = vegas; String myDocDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments); String inputFileDirectory = Path.Combine(myDocDirectory, _defaultInputDirectory); String inputFilePath = Path.Combine(inputFileDirectory, _defaultInputFileName); String projectPath = myVegas.Project.FilePath; if (String.IsNullOrEmpty(projectPath)) { String dir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments); defaultBasePath = Path.Combine(dir, defaultBasePath); } else { String dir = Path.GetDirectoryName(projectPath); String fileName = Path.GetFileNameWithoutExtension(projectPath); defaultBasePath = Path.Combine(dir, fileName + "_"); } if (_writeAllRenderers) WriteAvailableRenderers(inputFileDirectory); ArrayList lookup = ReadInputFile(inputFilePath); ArrayList selectedTemplates = FindMatchingTemplates(lookup); if (selectedTemplates.Count == 0) { MessageBox.Show("No templates found."); return; } DoBatchRender(selectedTemplates, defaultBasePath, _renderMode); string soundFile = Path.Combine(inputFileDirectory, "EndSound.wav"); if (File.Exists(soundFile)) { (new SoundPlayer(soundFile)).Play(); } else { SystemSounds.Asterisk.Play(); SystemSounds.Asterisk.Play(); } }
internal void EventPosInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; // Interval EventPosInterUpSt.Invoked += EventPosInterUpSt_Invoke; EventPosInterDnSt.Invoked += EventPosInterDnSt_Invoke; EventPosInterAuto.Invoked += EventPosInterAuto_Invoke; EventPosInterUser.Invoked += EventPosInterUser_Invoke; EventPosParent.AddChild(EventPosInterUpSt); EventPosParent.AddChild(EventPosInterDnSt); EventPosParent.AddChild(EventPosInterAuto); EventPosParent.AddChild(EventPosInterUser); // Space EventPosSpaceAuto.Invoked += EventPosSpaceAuto_Invoke; EventPosSpaceUser.Invoked += EventPosSpaceUser_Invoke; EventPosParent.AddChild(EventPosSpaceAuto); EventPosParent.AddChild(EventPosSpaceUser); // Align EventPosAlignLeft.Invoked += EventPosAlignLeft_Invoke; EventPosAlignRight.Invoked += EventPosAlignRight_Invoke; EventPosAlignByMarkers.Invoked += EventPosAlignByMarkers_Invoked; EventPosParent.AddChild(EventPosAlignLeft); EventPosParent.AddChild(EventPosAlignRight); EventPosParent.AddChild(EventPosAlignByMarkers); CustomCommands.Add(EventPosParent); CustomCommands.Add(EventPosInterUpSt); CustomCommands.Add(EventPosInterDnSt); CustomCommands.Add(EventPosInterAuto); CustomCommands.Add(EventPosInterUser); CustomCommands.Add(EventPosSpaceAuto); CustomCommands.Add(EventPosSpaceUser); CustomCommands.Add(EventPosAlignLeft); CustomCommands.Add(EventPosAlignRight); CustomCommands.Add(EventPosAlignByMarkers); }
internal void SelectionInit(Vegas Vegas, ref ArrayList CustomCommands) { myVegas = Vegas; SelectionFitToEventsCommand.Invoked += SelectionFitToEnclosedEvents_Invoke; SelectionParent.AddChild(SelectionFitToEventsCommand); SelectionFindRegionCommand.Invoked += SelectionFindRegion_Invoke; SelectionParent.AddChild(SelectionFindRegionCommand); SelectionFindAgainCommand.Invoked += SelectionFindAgain_Invoke; SelectionParent.AddChild(SelectionFindAgainCommand); SelectionSetToCurrentRegion.Invoked += SelectionSetToCurrentRegion_Invoked; SelectionParent.AddChild(SelectionSetToCurrentRegion); CustomCommands.Add(SelectionParent); CustomCommands.Add(SelectionFindRegionCommand); CustomCommands.Add(SelectionFindAgainCommand); CustomCommands.Add(SelectionFitToEventsCommand); CustomCommands.Add(SelectionSetToCurrentRegion); }
public MainForm(Vegas vegas) { InitializeComponent(); MyVegas = vegas; }
public void FromVegas(Vegas vegas) { new MainForm(vegas).ShowDialog(); }
private void Import(Config config, Vegas vegas) { Project project = vegas.Project; // Clear markers and regions if (config.ClearMarkers) { project.Markers.Clear(); } if (config.ClearRegions) { project.Regions.Clear(); } // Load log file if (!File.Exists(config.LogFile)) { throw new Exception("Log file does not exist."); } Dictionary<EventType, List<TimedEvent>> timedEvents = ParseLogFile(config); // Add markers/regions foreach (EventType eventType in timedEvents.Keys) { foreach (Visualization visualization in config.Visualizations) { if (visualization.EventType != eventType) continue; List<TimedEvent> filteredEvents = FilterEvents(timedEvents[eventType], visualization.Regex); foreach (TimedEvent timedEvent in filteredEvents) { Timecode start = Timecode.FromSeconds(timedEvent.Start); Timecode length = Timecode.FromSeconds(timedEvent.End) - start; switch (visualization.VisualizationType) { case VisualizationType.Marker: project.Markers.Add(new Marker(start, timedEvent.Value)); break; case VisualizationType.Region: project.Regions.Add(new Region(start, length, timedEvent.Value)); break; } } } } }
public void FromVegas(Vegas vegas) { Config config = Config.Load(); ImportDialog importDialog = new ImportDialog(config, delegate { Import(config, vegas); }); importDialog.ShowDialog(); config.Save(); }
public MainForm(Vegas vegas) { InitializeComponent(); MyVegas = vegas; Inicial = new WigglerKeyFrame(); propertyGridInicial.SelectedObject = Inicial; propertyGridFinal.SelectedObject = null; }
public void InitializeModule(Vegas Vegas) { myVegas = Vegas; }