Can I listen media selected change event in custom command?

william-j wrote on 10/25/2024, 11:34 AM

Can I listen events where users change the selected media in media pool?

However,

Vegas.MediaPoolChanged is occured when the media added or removed;

Vegas.MediaSelectionChanged is occured when user Bypass Hover Scrub.

It seems no event occured when the media item selected changed.

 

I tried to use a timer, and run Vegas.Project.MediaPool.GetSelectedMedia() per 0.1 seconds to watch the selected media change.

It seems that there may be performance issues when selecting too many media.

Comments

jetdv wrote on 10/25/2024, 5:02 PM

@william-j two things:

  1. I have never seen a way to tell if an item in the Project Media is selected. .Selected isn't available for "Media".
  2. MediaSelectionChanged is not defined in the API that I can see so I'm not sure what it's flagging.
william-j wrote on 10/26/2024, 8:59 AM
  1. I have never seen a way to tell if an item in the Project Media is selected. .Selected isn't available for "Media".
  2. MediaSelectionChanged is not defined in the API that I can see so I'm not sure what it's flagging.
  1. Although there is no ".Selected" property for media, "myVegas.Project.MediaPool.GetSelectedMedia()" will get a Media[] array which contains media selected in the project media pool.
  2. "MediaSelectionChanged" is not defined in the API indeed, but it does exist (perhaps in higher versions of Vgeas). When the user drags on the media to capture the time range of the media, this event will be triggered.