Poor man's monoswitch - and a bug/problem

roger_74 wrote on 4/6/2003, 3:53 PM
I tried this
import SonicFoundry.Vegas;

for (var trk : Track in Vegas.Project.Tracks)
{
for (var audioevent : AudioEvent in trk.Events)
{
audioevent.Channels = ChannelRemapping.Mono;
}
}
It works, but only after switching to another program so that Vegas redraws the UI. UpdateUI() does not help. A bug?

Comments

roger_74 wrote on 4/7/2003, 10:05 AM
Those of you that want a real monoswitch in Vegas, this is not it. It will not be the same as making the final mix mono (but it might, depending on what you've done to it). Just thought I'd clarify that.
aboukirev wrote on 4/7/2003, 11:14 AM
It might get an error before it gets to UpdateUI(). You don't check for the type of track - enumerating events on Video track and force-casting them to Audio events may generate an error. Since there is no error handling - it's not reported, but script execution stops.

Alexei
roger_74 wrote on 4/7/2003, 4:01 PM
It behaves the same way if I do this:
import SonicFoundry.Vegas;



for (var trk : Track in Vegas.Project.Tracks)
{
for (var evnt in trk.Events)
{
if (evnt.MediaType == MediaType.Audio) evnt.Channels = ChannelRemapping.Mono;
}
}
SonyPJM wrote on 4/7/2003, 4:30 PM
It is a bug... I'll have to fix it in the next version. Sorry.