int main() { CAAFInitialize aafInit; const aafWChar * pwFileName = L"ExportAudioExample.aaf"; const char * pFileName = "ExportAudioExample.aaf"; // Make sure all of our required plugins have been registered. checkFatal(RegisterRequiredPlugins()); printf("Creating file %s using WriteSamples (Internal Media)...\n", pFileName); checkFatal(CreateAAFFile(pwFileName, NULL, testStandardCalls)); printf("DONE\n\n"); return(0); }
// Main adapted to use command-line arguments with argument checking // NOTE: defining [0] program name; [1] filename.aaf; // Specifying that use file ExportSimpleComposition.aaf as default // The specified filename is the name of the file that is created by the program. int main(int argumentCount, char* argumentVector[]) { CAAFInitialize aafInit; // Make sure all of our required plugins have been registered. checkFatal(RegisterRequiredPlugins()); if (argumentCount ==1) { // Initialise filename variables to default settings and inform user pwFileName = L"ExportSimpleComposition.aaf"; pFileName = "ExportSimpleComposition.aaf"; printf("No file specified => defaulting to ExportSimpleComposition.aaf\n\n"); } else if (argumentCount ==2) { // Set the variables to do the specified case static char* niceFileName = argumentVector[1]; // It is a design issue whether argument must end with ".aaf" or not // If one chooses that files are specified without extension, // then uncomment the following line, which adds the ".aaf" extension //strcat (niceFileName,".aaf"); aafWChar FileNameBuffer[FILENAME_MAX]; mbstowcs(FileNameBuffer,niceFileName,FILENAME_MAX); pwFileName = FileNameBuffer; pFileName = niceFileName; } else { usage(); return 0; } // Access the AAF file with name set from argument or lack thereof printf("Working on file %s using ReadSamples\n", pFileName); ProcessAAFFile(pwFileName, testStandardCalls); printf("DONE\n\n"); return(0); }
int main(int /*argc*/, char** /*argv*/) { CAAFInitialize aafInit; const aafWChar* pwFileName = L"MetadataTest.aaf"; const char* pFileName = ""; // Make sure all of our required plugins have been registered. checkFatal(RegisterRequiredPlugins()); /**/ printf("***Creating file %s using WriteSamples (Internal Media)\n", pFileName); checkFatal(CreateAAFFile(pwFileName, NULL, testStandardCalls)); printf("***Re-opening file %s using ReadSamples\n", pFileName); ReadAAFFile(pwFileName, testStandardCalls); /**/ printf("Done\n"); return(0); }