AutoGetMediaInfo1 usage

All about PB Automation and custom integration

Moderator: Moderator Group

AutoGetMediaInfo1 usage

Postby luciepix » Tue Jun 09, 2015 10:05 pm

Hello

I am doing custom media animations using PBAutomation. For one of the functionality I am working on, I need to know the resolution of the media. From my understanding of the documentation, the AutoGetMediaInfo1(index As Integer, MediaInfo As MediaType1) will give me exactly that in the returned MediaInfo structure.

My problem is, what is the index? The documentation says:
AutoGetMediaInfo1(index As Integer, MediaInfo As MediaType1)
Gets information on media identified by index

index: Index
MediaInfo: MediaInfo1 object to write information to

Success. When false is returned check AutoGetLastError()


Which does not give any information about what is this index. Could you please give me more details about the usage of the function?

Thank you!
luciepix
 
Posts: 6
Joined: Thu Oct 23, 2014 3:48 pm

Re: AutoGetMediaInfo1 usage

Postby Dennis Kuypers » Sun Jun 14, 2015 1:29 pm

Hello Lucie,

index is the TreeItemIndex. Look at the project tab in Pandoras Box and expand all tree items so that you can see all of the tree elements. Now you can count from top to bottom, where the first element (the project folder) is ID 0. The item below is 1 and so on. The hierarchy is not important, you just count from top to bottom.

Regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: AutoGetMediaInfo1 usage

Postby florian » Sun Jun 14, 2015 2:57 pm

Wow...

That's a blunt-instrument approach.

It may not be such a terrible idea to put assets used this way in the root of the project and prefix assets you might want to recall with 001.-999. LX style. Depending on how many assets you may also want to go hex.
-flo

"Wise men learn more from fools than fools from the wise."

Cato the Elder, Plutarch's Life of Cato
User avatar
florian
 
Posts: 162
Joined: Fri Jul 25, 2008 3:49 pm
Location: Los Angeles, CA

Re: AutoGetMediaInfo1 usage

Postby Dennis Kuypers » Sun Jun 14, 2015 8:34 pm

Hey,

Remember that there are applications that want performance and using a simple index is pretty much the fastest way. String operations are always expensive. This is also the reason for the SetParamKind command. It is faster to have a integer than doing string parsing and comparision.

A sophisticated application should be able to deal with this interface and should not put a burden like that on the user forcing him to do such an approach.

Regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: AutoGetMediaInfo1 usage

Postby florian » Sun Jun 14, 2015 10:43 pm

Dennis Kuypers wrote:A sophisticated application should be able to deal with this interface and should not put a burden like that on the user forcing him to do such an approach.


I couldn't agree more. :)

As a programmer, my main concern here would be: if I use the SDK calls to load new media into the project, I probably wont be around to make a visual inspection of the project stack and thus, won't be able to determine which indexes have shifted and where my new asset is.

This brute force alphabetical hiearchy (god forbid you use folders) approach only works if you are building an interface for a pandora project with no changes in content at runtime. I guess the alternative to the leading digit sort idea, would be to purge all project assets, and build a lookup table using file system operations in .NET before loading everything.

With regards to Index lookup operations being faster than string operations, this is totally true, but unless you are parsing out a couple hundred string variables, modern computers have plenty of cycles to chuck at string variable methods. Also, pandora already features a native numeric indexing feature in it's Folder/FileID asset property. On the one hand it seems odd to me that this wouldn't get used instead of just consecutively numbering all the assets in the tree, but then again, it's nice to not have to do all your counting in 8-bit registers just because it was meant to be dialed in via DMX.

Cheers!
-flo

"Wise men learn more from fools than fools from the wise."

Cato the Elder, Plutarch's Life of Cato
User avatar
florian
 
Posts: 162
Joined: Fri Jul 25, 2008 3:49 pm
Location: Los Angeles, CA

Re: AutoGetMediaInfo1 usage

Postby luciepix » Sun Jun 28, 2015 2:32 am

Thanks Dennis and Florian!

It doesn't make sense to me that this function uses the index while the majority of all the other functions related to medias in the SDK use the folder/fileid structure (all the media assignation functions for example).

Counting my files is definitely not an option for a project on a deadline with media changing until the last minute as Florian said. So I'll stick to my plan B for now, which is to configure the resolution information by hand.

Lucie

P.S. the "Notify me when a reply is posted" does not seem to work... which explains my late reply.
luciepix
 
Posts: 6
Joined: Thu Oct 23, 2014 3:48 pm

Re: AutoGetMediaInfo1 usage

Postby Dennis Kuypers » Sun Jun 28, 2015 2:53 am

Hello,

The SDK grows with the requirements for the Widget Designer, so in the past there was a need for such a function, so it was implemented like that.

Maybe the email got caught by the spam filter?

Regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm


Return to Integration of 3rd party applications (SDK)

Who is online

Users browsing this forum: No registered users and 1 guest

cron