changeset 4:d32ae6be32a4

*: mass rename files committer: GitHub <noreply@github.com>
author Paper <37962225+mrpapersonic@users.noreply.github.com>
date Mon, 23 Jan 2023 23:35:06 -0500
parents 958615460fe5
children 6dcd5eef9c97
files Add Dynamics.cs Convert Pitch Scheme.cs Disable Resample.cs Flip Events (Quad).cs Flip Events.cs add_dynamics.cs convert_pitch_scheme.cs disable_resample.cs screenflip.cs screenflip_vert.cs
diffstat 10 files changed, 233 insertions(+), 233 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Add Dynamics.cs	Mon Jan 23 23:35:06 2023 -0500
@@ -0,0 +1,35 @@
+#define VER_GEQ_14 // remove this for vegas 13
+#if VER_GEQ_14
+using ScriptPortal.Vegas;
+#else
+using Sony.Vegas;
+#endif
+using System.Windows.Forms;
+
+public class EntryPoint {
+    string DynamicsID = "{00000008-0F56-11D2-9887-00A0C969725B}";
+    public void FromVegas(Vegas vegas) {
+        foreach (PlugInNode plugin in vegas.AudioFX) {
+            if (plugin.Name == "ExpressFX Dynamics" && plugin.UniqueID == DynamicsID) {
+                foreach (Track track in vegas.Project.Tracks) {
+                    foreach (TrackEvent trackEvent in track.Events) {
+                        if (trackEvent.Selected && trackEvent.IsAudio()) {
+                            AudioEvent audio = trackEvent as AudioEvent;
+                            foreach (Effect effect in audio.Effects) {
+                                if (effect.PlugIn.UniqueID == DynamicsID) {
+                                    audio.Effects.Remove(effect);
+                                }
+                            }
+                            Effect DynamicsPlugin = audio.Effects.AddEffect(plugin);
+                            foreach (Preset preset in DynamicsPlugin.Presets) {
+                                if (preset.Name == "preset") {
+                                    DynamicsPlugin.CurrentPreset = preset;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Convert Pitch Scheme.cs	Mon Jan 23 23:35:06 2023 -0500
@@ -0,0 +1,110 @@
+/* NOTE: Requires VEGAS 16 or higher. */
+
+using ScriptPortal.Vegas;
+using System;
+using System.Windows.Forms;
+using System.Collections.Generic;
+
+public class EntryPoint {
+    private Dictionary<string, int> stretchAttributes = new Dictionary<string, int>
+    {
+        {"Pro", 0},
+        {"Efficient", 1},
+        {"Soloist (Monophonic)", 2},
+        {"Soloist (Speech)", 3},
+        {"A01. Music 1 (minimum flange, may echo)", 4},
+        {"A02. Music 2", 5},
+        {"A03. Music 3 (less echo)", 6},
+        {"A04. Music 4 (fast, good for bass)", 7},
+        {"A05. Music 5", 8},
+        {"A06. Music 6", 9},
+        {"A07. Speech 1", 10},
+        {"A08. Speech 2", 11},
+        {"A09. Speech 3 (fast)", 12},
+        {"A10. Solo instruments 1", 13},
+        {"A11. Solo instruments 2", 14},
+        {"A12. Solo instruments 3", 15},
+        {"A13. Solo instruments 4 (less echo)", 16},
+        {"A14. Solo instruments 5", 17},
+        {"A15. Solo instruments 6", 18},
+        {"A16. Solo instruments 7 (fast)", 19},
+        {"A17. Drums, unpitched (minimum echo)", 20},
+        {"A18. Drums (better for toms)", 21},
+        {"A19. Drums (tiny echo)", 22}
+    };
+    public void FromVegas(Vegas vegas) {
+        int stretchAttribute = Prompt.GetOptions(stretchAttributes);
+        foreach (var track in vegas.Project.Tracks) {
+            foreach (var trackEvent in track.Events) {
+                if (trackEvent.Selected && trackEvent.IsAudio()) {
+                    AudioEvent audio = trackEvent as AudioEvent;
+                    if ((stretchAttribute >= 0) && (stretchAttribute <= 3)) {
+                        audio.Method = (TimeStretchPitchShift)2; /* pitch shift method; 0 is elastique, 1 is acid style, 2 is classic, and 3 is none */
+                        audio.ElastiqueAttribute = (ElastiqueStretchAttributes)stretchAttribute;
+                    } else if (stretchAttribute >= 4) {
+                        audio.Method = (TimeStretchPitchShift)0;
+                        audio.ClassicAttribute = (ClassicStretchAttributes)stretchAttribute-4;
+                    }
+                }
+            }
+        }
+    }
+}
+
+class Prompt
+{
+    public static int GetOptions(Dictionary<string,int> stretchAttributes)
+    {
+        Form prompt = new Form() {
+            Width = 300,
+            Height = 103,
+            FormBorderStyle = FormBorderStyle.FixedSingle,
+            MaximizeBox = false,
+            MinimizeBox = false,
+            ShowIcon = false,
+            Text = "made by paper"
+        };
+        ComboBox
+        inputValue = new ComboBox()
+        {
+            Left = 7,
+            Top = 10,
+            Width = (prompt.Width - 30)
+        };
+        Button
+        confirmation = new Button()
+        {
+            Text = "OK",
+            Left = 7,
+            Width = (prompt.Width - 30),
+            Top = 35,
+            DialogResult = DialogResult.OK
+        };
+
+        inputValue.BeginUpdate();
+        inputValue.DataSource = new BindingSource(stretchAttributes, null);
+        inputValue.DisplayMember = "Key";
+        inputValue.ValueMember = "Value";
+        inputValue.EndUpdate();
+
+        inputValue.DropDownStyle = ComboBoxStyle.DropDownList;
+
+        prompt.Controls.Add(inputValue);
+        prompt.Controls.Add(confirmation);
+        prompt.AcceptButton = confirmation;
+
+        confirmation.Click += (sender, e) =>
+        {
+            prompt.Close();
+        };
+
+        if (prompt.ShowDialog() == DialogResult.OK)
+        {
+            return inputValue.SelectedIndex;
+        }
+        else
+        {
+            return -1;
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Disable Resample.cs	Mon Jan 23 23:35:06 2023 -0500
@@ -0,0 +1,14 @@
+using Sony.Vegas;
+
+public class EntryPoint {
+	public void FromVegas(Vegas vegas) {
+		foreach (Track track in vegas.Project.Tracks) {
+			if (track.IsVideo()) {
+				foreach (TrackEvent evnt in track.Events) {
+					VideoEvent videoEvent = (VideoEvent)evnt;
+					videoEvent.ResampleMode = VideoResampleMode.Disable;
+				}
+			}
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Flip Events (Quad).cs	Mon Jan 23 23:35:06 2023 -0500
@@ -0,0 +1,41 @@
+#define VER_GEQ_14 // remove this for vegas 13
+#if VER_GEQ_14
+using ScriptPortal.Vegas;
+#else
+using Sony.Vegas;
+#endif
+using System.Windows.Forms;
+
+public class EntryPoint {
+    public void FromVegas(Vegas vegas) {
+        foreach (Track track in vegas.Project.Tracks) {
+            int count = 1;
+            foreach (TrackEvent trackEvent in track.Events) {
+                if (trackEvent.Selected && trackEvent.IsVideo()) {
+                    VideoEvent video = trackEvent as VideoEvent;
+                    foreach (VideoMotionKeyframe keyframe in video.VideoMotion.Keyframes) {
+                        VideoMotionVertex tl = keyframe.TopLeft, 
+                                          tr = keyframe.TopRight, 
+                                          bl = keyframe.BottomLeft, 
+                                          br = keyframe.BottomRight;
+                        VideoMotionBounds bh = new VideoMotionBounds(tl, tr, br, bl);
+                        switch (count) {
+                            case 2:
+                                keyframe.Bounds = new VideoMotionBounds(tr, tl, bl, br);
+                                break;
+                            case 3:
+                                keyframe.Bounds = new VideoMotionBounds(br, bl, tl, tr);
+                                break;
+                            case 4:
+                                keyframe.Bounds = new VideoMotionBounds(bl, br, tr, tl);
+                                break;
+                        }
+                        if (count == 4)
+                            count = 0;
+                        count += 1;
+                    }
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Flip Events.cs	Mon Jan 23 23:35:06 2023 -0500
@@ -0,0 +1,33 @@
+#define VER_GEQ_14 // remove this for vegas 13
+#if VER_GEQ_14
+using ScriptPortal.Vegas;
+#else
+using Sony.Vegas;
+#endif
+using System.Windows.Forms;
+
+public class EntryPoint {
+    public void FromVegas(Vegas vegas) {
+        foreach (Track track in vegas.Project.Tracks) {
+            int count = 1;
+            foreach (TrackEvent trackEvent in track.Events) {
+                if (trackEvent.Selected && trackEvent.IsVideo()) {
+                    VideoEvent video = trackEvent as VideoEvent;
+                    foreach (VideoMotionKeyframe keyframe in video.VideoMotion.Keyframes) {
+                        VideoMotionVertex tl = keyframe.TopLeft, 
+                                          tr = keyframe.TopRight, 
+                                          bl = keyframe.BottomLeft, 
+                                          br = keyframe.BottomRight;
+                        VideoMotionBounds bh = new VideoMotionBounds(tl, tr, br, bl);
+                        if (count == 2)
+                            bh = new VideoMotionBounds(tr, tl, bl, br);
+                        keyframe.Bounds = bh;
+                    }
+                    if (count == 2)
+                        count = 0;
+                    count += 1;
+                }
+            }
+        }
+    }
+}
--- a/add_dynamics.cs	Mon Jan 23 23:33:36 2023 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#define VER_GEQ_14 // remove this for vegas 13
-#if VER_GEQ_14
-using ScriptPortal.Vegas;
-#else
-using Sony.Vegas;
-#endif
-using System.Windows.Forms;
-
-public class EntryPoint {
-    string DynamicsID = "{00000008-0F56-11D2-9887-00A0C969725B}";
-    public void FromVegas(Vegas vegas) {
-        foreach (PlugInNode plugin in vegas.AudioFX) {
-            if (plugin.Name == "ExpressFX Dynamics" && plugin.UniqueID == DynamicsID) {
-                foreach (Track track in vegas.Project.Tracks) {
-                    foreach (TrackEvent trackEvent in track.Events) {
-                        if (trackEvent.Selected && trackEvent.IsAudio()) {
-                            AudioEvent audio = trackEvent as AudioEvent;
-                            foreach (Effect effect in audio.Effects) {
-                                if (effect.PlugIn.UniqueID == DynamicsID) {
-                                    audio.Effects.Remove(effect);
-                                }
-                            }
-                            Effect DynamicsPlugin = audio.Effects.AddEffect(plugin);
-                            foreach (Preset preset in DynamicsPlugin.Presets) {
-                                if (preset.Name == "preset") {
-                                    DynamicsPlugin.CurrentPreset = preset;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
--- a/convert_pitch_scheme.cs	Mon Jan 23 23:33:36 2023 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/* NOTE: Requires VEGAS 16 or higher. */
-
-using ScriptPortal.Vegas;
-using System;
-using System.Windows.Forms;
-using System.Collections.Generic;
-
-public class EntryPoint {
-    private Dictionary<string, int> stretchAttributes = new Dictionary<string, int>
-    {
-        {"Pro", 0},
-        {"Efficient", 1},
-        {"Soloist (Monophonic)", 2},
-        {"Soloist (Speech)", 3},
-        {"A01. Music 1 (minimum flange, may echo)", 4},
-        {"A02. Music 2", 5},
-        {"A03. Music 3 (less echo)", 6},
-        {"A04. Music 4 (fast, good for bass)", 7},
-        {"A05. Music 5", 8},
-        {"A06. Music 6", 9},
-        {"A07. Speech 1", 10},
-        {"A08. Speech 2", 11},
-        {"A09. Speech 3 (fast)", 12},
-        {"A10. Solo instruments 1", 13},
-        {"A11. Solo instruments 2", 14},
-        {"A12. Solo instruments 3", 15},
-        {"A13. Solo instruments 4 (less echo)", 16},
-        {"A14. Solo instruments 5", 17},
-        {"A15. Solo instruments 6", 18},
-        {"A16. Solo instruments 7 (fast)", 19},
-        {"A17. Drums, unpitched (minimum echo)", 20},
-        {"A18. Drums (better for toms)", 21},
-        {"A19. Drums (tiny echo)", 22}
-    };
-    public void FromVegas(Vegas vegas) {
-        int stretchAttribute = Prompt.GetOptions(stretchAttributes);
-        foreach (var track in vegas.Project.Tracks) {
-            foreach (var trackEvent in track.Events) {
-                if (trackEvent.Selected && trackEvent.IsAudio()) {
-                    AudioEvent audio = trackEvent as AudioEvent;
-                    if ((stretchAttribute >= 0) && (stretchAttribute <= 3)) {
-                        audio.Method = (TimeStretchPitchShift)2; /* pitch shift method; 0 is elastique, 1 is acid style, 2 is classic, and 3 is none */
-                        audio.ElastiqueAttribute = (ElastiqueStretchAttributes)stretchAttribute;
-                    } else if (stretchAttribute >= 4) {
-                        audio.Method = (TimeStretchPitchShift)0;
-                        audio.ClassicAttribute = (ClassicStretchAttributes)stretchAttribute-4;
-                    }
-                }
-            }
-        }
-    }
-}
-
-class Prompt
-{
-    public static int GetOptions(Dictionary<string,int> stretchAttributes)
-    {
-        Form prompt = new Form() {
-            Width = 300,
-            Height = 103,
-            FormBorderStyle = FormBorderStyle.FixedSingle,
-            MaximizeBox = false,
-            MinimizeBox = false,
-            ShowIcon = false,
-            Text = "made by paper"
-        };
-        ComboBox
-        inputValue = new ComboBox()
-        {
-            Left = 7,
-            Top = 10,
-            Width = (prompt.Width - 30)
-        };
-        Button
-        confirmation = new Button()
-        {
-            Text = "OK",
-            Left = 7,
-            Width = (prompt.Width - 30),
-            Top = 35,
-            DialogResult = DialogResult.OK
-        };
-
-        inputValue.BeginUpdate();
-        inputValue.DataSource = new BindingSource(stretchAttributes, null);
-        inputValue.DisplayMember = "Key";
-        inputValue.ValueMember = "Value";
-        inputValue.EndUpdate();
-
-        inputValue.DropDownStyle = ComboBoxStyle.DropDownList;
-
-        prompt.Controls.Add(inputValue);
-        prompt.Controls.Add(confirmation);
-        prompt.AcceptButton = confirmation;
-
-        confirmation.Click += (sender, e) =>
-        {
-            prompt.Close();
-        };
-
-        if (prompt.ShowDialog() == DialogResult.OK)
-        {
-            return inputValue.SelectedIndex;
-        }
-        else
-        {
-            return -1;
-        }
-    }
-}
\ No newline at end of file
--- a/disable_resample.cs	Mon Jan 23 23:33:36 2023 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-using Sony.Vegas;
-
-public class EntryPoint {
-	public void FromVegas(Vegas vegas) {
-		foreach (Track track in vegas.Project.Tracks) {
-			if (track.IsVideo()) {
-				foreach (TrackEvent evnt in track.Events) {
-					VideoEvent videoEvent = (VideoEvent)evnt;
-					videoEvent.ResampleMode = VideoResampleMode.Disable;
-				}
-			}
-		}
-	}
-}
--- a/screenflip.cs	Mon Jan 23 23:33:36 2023 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#define VER_GEQ_14 // remove this for vegas 13
-#if VER_GEQ_14
-using ScriptPortal.Vegas;
-#else
-using Sony.Vegas;
-#endif
-using System.Windows.Forms;
-
-public class EntryPoint {
-    public void FromVegas(Vegas vegas) {
-        foreach (Track track in vegas.Project.Tracks) {
-            int count = 1;
-            foreach (TrackEvent trackEvent in track.Events) {
-                if (trackEvent.Selected && trackEvent.IsVideo()) {
-                    VideoEvent video = trackEvent as VideoEvent;
-                    foreach (VideoMotionKeyframe keyframe in video.VideoMotion.Keyframes) {
-                        VideoMotionVertex tl = keyframe.TopLeft, 
-                                          tr = keyframe.TopRight, 
-                                          bl = keyframe.BottomLeft, 
-                                          br = keyframe.BottomRight;
-                        VideoMotionBounds bh = new VideoMotionBounds(tl, tr, br, bl);
-                        if (count == 2)
-                            bh = new VideoMotionBounds(tr, tl, bl, br);
-                        keyframe.Bounds = bh;
-                    }
-                    if (count == 2)
-                        count = 0;
-                    count += 1;
-                }
-            }
-        }
-    }
-}
--- a/screenflip_vert.cs	Mon Jan 23 23:33:36 2023 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#define VER_GEQ_14 // remove this for vegas 13
-#if VER_GEQ_14
-using ScriptPortal.Vegas;
-#else
-using Sony.Vegas;
-#endif
-using System.Windows.Forms;
-
-public class EntryPoint {
-    public void FromVegas(Vegas vegas) {
-        foreach (Track track in vegas.Project.Tracks) {
-            int count = 1;
-            foreach (TrackEvent trackEvent in track.Events) {
-                if (trackEvent.Selected && trackEvent.IsVideo()) {
-                    VideoEvent video = trackEvent as VideoEvent;
-                    foreach (VideoMotionKeyframe keyframe in video.VideoMotion.Keyframes) {
-                        VideoMotionVertex tl = keyframe.TopLeft, 
-                                          tr = keyframe.TopRight, 
-                                          bl = keyframe.BottomLeft, 
-                                          br = keyframe.BottomRight;
-                        VideoMotionBounds bh = new VideoMotionBounds(tl, tr, br, bl);
-                        switch (count) {
-                            case 2:
-                                keyframe.Bounds = new VideoMotionBounds(tr, tl, bl, br);
-                                break;
-                            case 3:
-                                keyframe.Bounds = new VideoMotionBounds(br, bl, tl, tr);
-                                break;
-                            case 4:
-                                keyframe.Bounds = new VideoMotionBounds(bl, br, tr, tl);
-                                break;
-                        }
-                        if (count == 4)
-                            count = 0;
-                        count += 1;
-                    }
-                }
-            }
-        }
-    }
-}