Apply an Audio effect to Event

Thiago_Sase wrote on 7/21/2024, 9:41 AM

@jetdv Hello Sir, please, how can i add in the code bellow the possibility when the audio fx effect is applied, the Audio Event FX pop-up window opens automatically?

using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            

            PlugInNode effects = myVegas.AudioFX;

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsAudio())  //Is it an audio track?
                {
                    foreach (AudioEvent aEvnt in myTrack.Events)
                    {
                        if (aEvnt.Selected)
                        {
                            Guid effGUID = new Guid("ee38ca88-d78e-4bfb-b05e-577892730c83");
                            PlugInNode thisEff = effects.GetChildByClassID(effGUID);
                            Effect audioEffect = new Effect(thisEff);
                            

                            aEvnt.Effects.Add(audioEffect);
                        }
                    }
                }
            }
        }
     }
  }

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

Comments

jetdv wrote on 7/21/2024, 1:26 PM

There is no option for opening the AudioFX UI. Only the VideoFX and Generated Media UI can be opened.

Thiago_Sase wrote on 7/21/2024, 1:59 PM

@jetdv Understood. Thanks for the explanation.