Hello everybody.
I try to put events one-by-one
Help me to understand how is working a "op_Addition" Method
search on this forum I find that link http://mediasoftware.sonypictures.com/forums/ShowMessage.asp?ForumID=21&MessageID=198739 ,
but can't use it for my sub
There is my Sub ------>>
Public Sub AddEvent()
On Error Resume Next
Dim NewTimecode as Timecode
Dim FileName As string
Dim FilePath As string
Dim PosOfNextEvent as new Timecode()
Dim i As Long
wshell = CreateObject("Shell.Application")
q = wshell.BrowseForFolder(&H0, "Select a path for files", &H1, 17)
FilePath = q.Self.Path
FilePath = FilePath & "\"
FileName = Dir(FilePath & "*.mp3")
While AviFileName <> ""
Dim newMedia as new Media(FilePath & FileName)
Dim newStream = newMedia.Streams.GetItemByMediaType(MediaType.Audio, 0)
Dim newEvent as new AudioEvent(PosOfNextEvent, newMedia.Length)
VegasApp.Project.Tracks(0).Events.Add(newEvent)
dim newTake as new Take(newStream)
newEvent.Takes.Add(newTake)
PosOfNextEvent.op_Addition(PosOfNextEvent, newMedia.Length)
newEvent.AdjustStartLength(PosOfNextEvent, newMedia.Length, True)
FileName = Dir
i = i + 1
End While
End Sub
I try to put events one-by-one
Help me to understand how is working a "op_Addition" Method
search on this forum I find that link http://mediasoftware.sonypictures.com/forums/ShowMessage.asp?ForumID=21&MessageID=198739 ,
but can't use it for my sub
There is my Sub ------>>
Public Sub AddEvent()
On Error Resume Next
Dim NewTimecode as Timecode
Dim FileName As string
Dim FilePath As string
Dim PosOfNextEvent as new Timecode()
Dim i As Long
wshell = CreateObject("Shell.Application")
q = wshell.BrowseForFolder(&H0, "Select a path for files", &H1, 17)
FilePath = q.Self.Path
FilePath = FilePath & "\"
FileName = Dir(FilePath & "*.mp3")
While AviFileName <> ""
Dim newMedia as new Media(FilePath & FileName)
Dim newStream = newMedia.Streams.GetItemByMediaType(MediaType.Audio, 0)
Dim newEvent as new AudioEvent(PosOfNextEvent, newMedia.Length)
VegasApp.Project.Tracks(0).Events.Add(newEvent)
dim newTake as new Take(newStream)
newEvent.Takes.Add(newTake)
PosOfNextEvent.op_Addition(PosOfNextEvent, newMedia.Length)
newEvent.AdjustStartLength(PosOfNextEvent, newMedia.Length, True)
FileName = Dir
i = i + 1
End While
End Sub