Determining an audio plugin's UniqueID

Jack S wrote on 3/2/2023, 6:12 AM

@jetdv Hi Edward. Could you help me again? I have a block of code in my custom command that returns a plugin's UniqueID from a user input string. See below.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ScriptPortal.Vegas;

namespace MyCustomCommand
{
    public partial class MyTab4 : UserControl
    {
        Vegas myVegas = null;
        public MyTab4(Vegas vegas)
        {
            myVegas = vegas;
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string userInput = textBox1.Text;
                if (userInput.Length > 0)
                {
                    PlugInNode plugin = myVegas.VideoFX.GetChildByName(userInput);
                    string UID = plugin.UniqueID;
                    MessageBox.Show("FX UniqueID for " + userInput + " is " + UID);
                }
                else
                {
                    MessageBox.Show("You must enter a plugin name");

                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("Plugin name not recognised. Check that the spelling is correct");
            }
        }
    }
}

This works perfectly and displays the correct UniqueID for the video plugin entered in the userInput field. However, if I replace the VideoFX in the PlugInNode statement with AudioFX, the plugin can't be found and the code exits.

Would you know why the audio plugin's UniqueID can't be found using this method? Or am I doing somethng wrong?
Thanks in advance.

 

Last changed by Jack S

My system
Dell XPS 8700 (I know, it's a little outdated, but it handles VP20 quite well)
Windows 10 Home (x64)
3.1 GHz Intel Core i5-4440
16GB RAM
NVIDIA GeForce GTX 1050 Ti display adapter
System drive Samsung SSD 850 EVO 250GB

Camcorder
SONY Handycam HDR-XR550VE

Comments

jetdv wrote on 3/2/2023, 8:17 AM

In my "readGUID" script that I posted on my site, here's what I look at on AudioFX:

    foreach (PlugInNode fx in myVegas.AudioFX)
    {
        try
        {
            string s = fx.Name + " - " + fx.ClassID;

And here's what I look at on VideoFX:

    foreach (PlugInNode fx in myVegas.VideoFX)
    {
                string s = fx.Name + " - " + fx.ClassID + " UID: " + fx.UniqueID + "  isOFX: " + fx.IsOFX;

And then Media Generators:

    foreach (PlugInNode fx in myVegas.Generators)
    {
                string s = fx.Name + " - " + fx.ClassID + " UID: " + fx.UniqueID + "  isOFX: " + fx.IsOFX;

And Transitions:

        foreach (PlugInNode fx in myVegas.Transitions)
        {
            string s = fx.Name + " - " + fx.ClassID + " UID: " + fx.UniqueID + "  isOFX: " + fx.IsOFX;

And CompositeFX:

        foreach (PlugInNode fx in myVegas.VideoCompositeFX)
        {
            string s = fx.Name + " - " + fx.ClassID + " UID: " + fx.UniqueID + "  isOFX: " + fx.IsOFX;

For some reason, I did not have "UniqueID" in Audio but did for everything else. So I just changed it to:

        foreach (PlugInNode fx in myVegas.AudioFX)
        {
            try
            {
                string s = fx.Name + " - " + fx.ClassID + " UID: " + fx.UniqueID;

And it ran just fine. Here's what I got:

eFX ChorusFlanger - 4d583231-8a7a-ac64-0284-0007e95d36fa UID: {4D583231-8A7A-AC64-0284-0007E95D36FA} - Default - 0
eFX Compressor - 4d583237-3c15-40a4-0284-0007e95d36fa UID: {4D583237-3C15-40A4-0284-0007E95D36FA} - Default - 0
eFX DeEsser - 4d583238-1767-dc31-0284-0007e95d36fa UID: {4D583238-1767-DC31-0284-0007E95D36FA} - Default - 0
eFX Gate - 4d583239-72c1-99ca-0284-0007e95d36fa UID: {4D583239-72C1-99CA-0284-0007E95D36FA} - Default - 0
eFX Limiter - 4d583241-cee4-b0ce-0284-0007e95d36fa UID: {4D583241-CEE4-B0CE-0284-0007E95D36FA} - Default - 0
eFX Phaser - 4d583232-8725-7e63-0284-0007e95d36fa UID: {4D583232-8725-7E63-0284-0007E95D36FA} - Default - 0
eFX Reverb - 4d583233-bdf1-e7c5-0284-0007e95d36fa UID: {4D583233-BDF1-E7C5-0284-0007E95D36FA} - Default - 0
eFX StereoDelay - 4d583234-d195-4393-0284-0007e95d36fa UID: {4D583234-D195-4393-0284-0007E95D36FA} - Default - 0
eFX TremoloPan - 4d583332-97f3-0762-0284-0007e95d36fa UID: {4D583332-97F3-0762-0284-0007E95D36FA} - Default - 0
eFX TubeStage - 4d583242-9d12-6d49-0284-0007e95d36fa UID: {4D583242-9D12-6D49-0284-0007E95D36FA} - Default - 0
eFX VocalStrip - 4d583330-f3cb-b848-0284-0007e95d36fa UID: {4D583330-F3CB-B848-0284-0007E95D36FA} - Default - 0
Amplitude Modulation - fdb0d300-6f82-11d0-aebc-00a0c9053912 UID: {FDB0D300-6F82-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Chorus - 28d9f1e0-6ecc-11d0-aebc-00a0c9053912 UID: {28D9F1E0-6ECC-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Distortion - 39224540-6f92-11d0-aebc-00a0c9053912 UID: {39224540-6F92-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Dither - 260df3e1-ac77-11d2-9e93-00c04f68be44 UID: {260DF3E1-AC77-11D2-9E93-00C04F68BE44} - (Untitled) - 0
ExpressFX Amplitude Modulation - 00000005-0f56-11d2-9887-00a0c969725b UID: {00000005-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Audio Restoration - 0000000c-0f56-11d2-9887-00a0c969725b UID: {0000000C-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Chorus - 00000000-0f56-11d2-9887-00a0c969725b UID: {00000000-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Delay - 00000001-0f56-11d2-9887-00a0c969725b UID: {00000001-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Distortion - 00000002-0f56-11d2-9887-00a0c969725b UID: {00000002-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Dynamics - 00000008-0f56-11d2-9887-00a0c969725b UID: {00000008-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Equalization - 00000003-0f56-11d2-9887-00a0c969725b UID: {00000003-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Flange/Wah-Wah - 00000004-0f56-11d2-9887-00a0c969725b UID: {00000004-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Graphic EQ - 00000009-0f56-11d2-9887-00a0c969725b UID: {00000009-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Noise Gate - 0000000a-0f56-11d2-9887-00a0c969725b UID: {0000000A-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Reverb - 00000006-0f56-11d2-9887-00a0c969725b UID: {00000006-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Reverb - 00000006-0f56-11d2-9887-00a0c969725b UID: {00000006-0F56-11D2-9887-00A0C969725B} - [Sys] Default all parameters - 1
ExpressFX Stutter - 00000007-0f56-11d2-9887-00a0c969725b UID: {00000007-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
ExpressFX Time Stretch - 0000000b-0f56-11d2-9887-00a0c969725b UID: {0000000B-0F56-11D2-9887-00A0C969725B} - (Untitled) - 0
Flange/Wah-Wah - f09f6980-7845-11d0-aebc-00a0c9053912 UID: {F09F6980-7845-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Gapper/Snipper - 3f901a20-79be-11d0-aebc-00a0c9053912 UID: {3F901A20-79BE-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Graphic Dynamics - f3b8e880-b4e0-11d0-aebc-00a0c9053912 UID: {F3B8E880-B4E0-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Graphic EQ - 8b7226ee-4584-11d1-b4cb-00a0c9270a10 UID: {8B7226EE-4584-11D1-B4CB-00A0C9270A10} - (Untitled) - 0
Multi-Band Dynamics - 026d0aa0-9bb9-11d0-aebc-00a0c9053912 UID: {026D0AA0-9BB9-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Multi-Tap Delay - 7298a3e0-78ee-11d0-aebc-00a0c9053912 UID: {7298A3E0-78EE-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Noise Gate - b97c0f23-196d-11d1-b99b-00a0c9053912 UID: {B97C0F23-196D-11D1-B99B-00A0C9053912} - (Untitled) - 0
Pan - eb6213db-08ff-4510-9f8d-3058b0ece4c6 UID: {EB6213DB-08FF-4510-9F8D-3058B0ECE4C6} - (Untitled) - 0
Paragraphic EQ - d616f3e0-d622-11ce-aac5-0020af0b99a3 UID: {D616F3E0-D622-11CE-AAC5-0020AF0B99A3} - (Untitled) - 0
Parametric EQ - a8448720-96fd-11d0-aebc-00a0c9053912 UID: {A8448720-96FD-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Pitch Shift - ed1b4100-93be-11d0-aebc-00a0c9053912 UID: {ED1B4100-93BE-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Resonant Filter - a6a78627-d619-48bf-ad26-0c6b44b5c7d8 UID: {A6A78627-D619-48BF-AD26-0C6B44B5C7D8} - (Untitled) - 0
Reverb - 607682e0-6e21-11d0-aebc-00a0c9053912 UID: {607682E0-6E21-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Simple Delay - 54f29260-79b1-11d0-aebc-00a0c9053912 UID: {54F29260-79B1-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Smooth/Enhance - 9e3e4540-8339-11d0-aebc-00a0c9053912 UID: {9E3E4540-8339-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Time Stretch - b97c0f22-196d-11d1-b99b-00a0c9053912 UID: {B97C0F22-196D-11D1-B99B-00A0C9053912} - (Untitled) - 0
Track Compressor - 23c9f225-40ec-11d2-9d36-00c04f8edc1e UID: {23C9F225-40EC-11D2-9D36-00C04F8EDC1E} - (Untitled) - 0
Track EQ - 8cb69a0a-10e8-11d2-9b89-00104b8d13c2 UID: {8CB69A0A-10E8-11D2-9B89-00104B8D13C2} - (Untitled) - 0
Track Noise Gate - 869419dd-501f-11d3-8cdc-00c04f6b8e4c UID: {869419DD-501F-11D3-8CDC-00C04F6B8E4C} - (Untitled) - 0
Vibrato - d6802ba0-a056-11d0-aebc-00a0c9053912 UID: {D6802BA0-A056-11D0-AEBC-00A0C9053912} - (Untitled) - 0
Volume - ee38ca88-d78e-4bfb-b05e-577892730c83 UID: {EE38CA88-D78E-4BFB-B05E-577892730C83} - (Untitled) - 0
Wave Hammer Surround - 8010c341-6d4c-4390-b828-e4d246c3ddb2 UID: {8010C341-6D4C-4390-B828-E4D246C3DDB2} - (Untitled) - 0

That makes me wonder if the actual issue is that it's not finding the plugin in your "PlugInNode plugin = myVegas.VideoFX.GetChildByName(userInput);" line.

Jack S wrote on 3/3/2023, 7:24 AM

Hi Edward. I don't know why, but it's now working as it should. The only thing I did was to re-type the GetChildByName statement. Although the original compiled OK, there must have been something wrong with it that upset ScriptPortal. Anyway, it's working now, and thanks for your suggestions above,
I've wanted to report back sooner, but like other members, I've had trouble accessing the forum.

My system
Dell XPS 8700 (I know, it's a little outdated, but it handles VP20 quite well)
Windows 10 Home (x64)
3.1 GHz Intel Core i5-4440
16GB RAM
NVIDIA GeForce GTX 1050 Ti display adapter
System drive Samsung SSD 850 EVO 250GB

Camcorder
SONY Handycam HDR-XR550VE