I am trying to resolve some major roadblock I am for sure just having in MY mind with the code snippet enclosed. Obviously, it compiles but doesn't run.
Looking in the debugger, I see that audioTrack->Envelopes is indicating a NULL reference. I understand that Add(..) will then fail of course. On the other hand I am missing a constructor for Envelopes, there is only an Add(...) method. And an AudioTrack permits only get() for Envelopes, so, even if I would be able to create an Envelopes-object, I would not be able assign it.
Can someone give me a hint, what I missed? Is there a comprehensive description of the vegas scripting dll? I downloaded the API items for vegas 7 + 8 with the API description and FAQ, but maybe my question is something anyone usually knows.
Any hint appreciated.
Thanks,
Thomas
using namespace System::Windows::Forms;
using namespace Sony::Vegas;
public ref class EntryPoint
{
public:
void FromVegas(Vegas vegas) {
Project ^project = vegas.Project;
// create objects...
AudioTrack ^audioTrack = gcnew AudioTrack();
Envelope ^volEnvelope = gcnew Envelope(EnvelopeType::Volume);
// link them
/* --> */ audioTrack->Envelopes->Add(volEnvelope);
project->Tracks->Add(audioTrack);
return;
}
};
Looking in the debugger, I see that audioTrack->Envelopes is indicating a NULL reference. I understand that Add(..) will then fail of course. On the other hand I am missing a constructor for Envelopes, there is only an Add(...) method. And an AudioTrack permits only get() for Envelopes, so, even if I would be able to create an Envelopes-object, I would not be able assign it.
Can someone give me a hint, what I missed? Is there a comprehensive description of the vegas scripting dll? I downloaded the API items for vegas 7 + 8 with the API description and FAQ, but maybe my question is something anyone usually knows.
Any hint appreciated.
Thanks,
Thomas