I’m having some newbie problems understanding how to get to the Mute property on the AudioBusTrack class. I’ve been able to loop through the BusTracks to find a specific bus but haven’t been able to go from BusTrack to AudioBusTrack to access the Mute property. The script below gives a “cast” run time error.
Any insight would be appreciated.
Larry
import System.IO;
import System.Windows.Forms;
import Sony.Vegas;
try {
var busEnum = new Enumerator(Vegas.Project.BusTracks);
while (!busEnum.atEnd()) {
MessageBox.Show (" after while statement");
// Gives a cast error on the next statement
var bustrack : AudioBusTrack = AudioBusTrack(busEnum.item() ) ;
MessageBox.Show (" Before if statement");
// Master should always exist for testing
if ( bustrack.Name == "Master" ) {
MessageBox.Show ("Master = " + bustrack);
bustrack.Mute = true;
}
busEnum.moveNext();
}
} // End try
catch (e) {
MessageBox.Show(e);
}
Any insight would be appreciated.
Larry
import System.IO;
import System.Windows.Forms;
import Sony.Vegas;
try {
var busEnum = new Enumerator(Vegas.Project.BusTracks);
while (!busEnum.atEnd()) {
MessageBox.Show (" after while statement");
// Gives a cast error on the next statement
var bustrack : AudioBusTrack = AudioBusTrack(busEnum.item() ) ;
MessageBox.Show (" Before if statement");
// Master should always exist for testing
if ( bustrack.Name == "Master" ) {
MessageBox.Show ("Master = " + bustrack);
bustrack.Mute = true;
}
busEnum.moveNext();
}
} // End try
catch (e) {
MessageBox.Show(e);
}