I have a problem I can’t to solve with the MediaPool.
When I add a media to the RootMediaBin, after that I ‘m not able to access to MediaPool.
Please try this simple CS script:
Media is added but after I get this error:
“System.InvalidCastException: Unable to cast object of type 'Sony.Vegas.Media' to type 'Sony.Vegas.MediaBin'.”
Any help is welcome.
TIA
Gilles
When I add a media to the RootMediaBin, after that I ‘m not able to access to MediaPool.
Please try this simple CS script:
using System;
using Sony.Vegas;
using System.Windows.Forms;
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
MediaBin bin = vegas.Project.MediaPool.RootMediaBin;
Media media = new Media(@"D:\Essai\scene0005.avi");// replace with your own media
bin.Add(media);
foreach (MediaBin binScan in vegas.Project.MediaPool.RootMediaBin)
{
MessageBox.Show(binScan.Name);
}
}
}
Media is added but after I get this error:
“System.InvalidCastException: Unable to cast object of type 'Sony.Vegas.Media' to type 'Sony.Vegas.MediaBin'.”
Any help is welcome.
TIA
Gilles