Where to put AAX page table file?

I’ve included this line in my AppConfig.h file to copy my AAX page tables file into my AAX plug-in, but it’s not going there. I suspect (but don’t know for sure) that it’s not finding the file. So, where do I put the file?

#define JucePlugin_AAXPageTableFile “MyPlugin.xml”

Can I specify the path? If so, relative to what?

You’ll have to include the PageTable file as a resource of your plugin. Open your .jucer project, right click in Source to “Add existing files…”, then click on the Source folder and select the “Xcode Resource” checkbox for the PageTable file

3 Likes

Ah, that’s the trick. I hadn’t checked that box. (By default, the Binary Resource checkbox is checked.) Thanks! :sunglasses:

1 Like

Just a note for anyone reading this, it really only does apply to Xcode… somehow I mistook that :wink:

To get the PageTables on Windows you will need to have a post build script (or make this part of your build system) that copies the PageTable file into *.aaxplugin/Contents/Resources/

3 Likes

Does the xml file need to have a certain name? I added the #define JucePlugin_AAXPageTableFile “MyPlugin.xml” in JucePluginDefines.h and after adding the Plugin to ProTools, the pagetables do not appear in the menu. I added the .xml as a resource and after build, it is part of the plugin bundle. It seems that the plugin doesn’t read the pagetable though. What could be the reason?

Bumping this old thread, as I am adding Pro Tools PageTableFile support to my plugin - is there a chance that we could add “::getPageFileContent()” to the AAXClientExtensions class, so that we can just return the file as a string rather than indirectly through the filesystem - or is this a ProTools thing?

(Note that #define JucePlugin_AAXPageTableFile is deprecated - the new method is to implement AAXXClientExtensions::getPagFileName())

@ibisum in the AAX SDK there are the following enum values that we use to add the page table resource

/** The file name of the page table xml file
*/
AAX_eResourceType_PageTable,
/** The absolute path to the directory containing the plug-in's page table xml file(s)
	 
Defaults to *.aaxplugin/Contents/Resources
*/
AAX_eResourceType_PageTableDir

These are used like so in the wrapper

if (const auto searchPath = extensions.getPageFileSearchPath().getFullPathName(); searchPath.isNotEmpty())
    descriptor.AddResourceInfo (AAX_eResourceType_PageTableDir, searchPath.toRawUTF8());

if (const auto filename = extensions.getPageFileName(); filename.isNotEmpty())
    descriptor.AddResourceInfo (AAX_eResourceType_PageTable, filename.toRawUTF8());

It feels like trying to do this via contents would probably require generating a file on the fly which adds additional risks such as permissions issues or the file disappearing or changing while the plugin is running, etc. I’m not sure it’s worth the additional effort on our side.

That being said if you really wanted to, maybe you could do this yourself? Generate the file if it doesn’t already exist and just supply the filename and directory via the getPageFileSearchPath() and getPageFileName() methods?

@anthony-nicholls Thanks for that, understood. I’ve since added the following to my cmake configuration in order to handle this - posting for anyone else who finds this thread in search for a solution:

if("AAX" IN_LIST FORMATS)
	add_custom_command(
			TARGET ${PROJECT_NAME}_AAX POST_BUILD
			COMMAND ${CMAKE_COMMAND} -E copy
			${CMAKE_CURRENT_SOURCE_DIR}/extra/ProTools/PageFile.xml
			$<TARGET_FILE_DIR:${PROJECT_NAME}_AAX>/../Resources/
			COMMENT "Copying Pro Tools PageFile.xml to the Resources folder for macOS AAX build"
	)
endif()

My original issue was that I didn’t want to do this CMake trickery - but now it works, moving on …

1 Like

Thank you, this worked for me.