0

How do I insert source media into a specific index using RV's API?

I'm creating a dynamic playlist widget that I want to manage my RV session. To append media to the end of my RV session, I'm using this command:

commands.addSourceVerbose(string; string[] fileNames, string tag = nil)

To remove media from my RV session, I'm using this command:

commands.deleteNode(void; string nodeName)

Easy enough. But how do I insert media into my RV session at a specific index?

For example, say I use my widget to add three pieces of media to the RV session such that the inputs in my session manager look like this:

  • Source1
  • Source2
  • Source3

Now I want to add Source4, but I want to add it between Source1 and Source2 so it looks like this:

  • Source1
  • Source4
  • Source2
  • Source3

Using RV's API, what's the best way to achieve this?

Thanks!

4 comments

  • Avatar
    Jon Morley Official comment

    Hi Danny,

    If you mean at the top level of Sources section of the "Session Manager" then I am afraid there isn't anything for easily rearranging the order. However if you put your sources in a Folder you can rearrange the order trivially by changing the RVFolder node input order. You can use commands.nodeConnections to get the existing inputs (as well as outputs), modify the list as you see fit reordering or inserting, then use commands.setNodeInputs to set the new input list along with the new order.

    Will that work for you?

    Thanks,
    Jon

  • 0
    Avatar
    Jon Morley

    Please read more about nodeConnections and setNodeInputs in the Help -> "Mu Commands API Broswer..."

  • 0
    Avatar
    Danny Rerucha

    Thanks Jon!

    Rearranging the node inputs for the "defaultSequence" view node seems to have done the trick!

  • 0
    Avatar
    Jon Morley

    Great!

Please sign in to leave a comment.