Get certain Mob

Developers
Cablet
2006-03-01
2013-04-29
  • Cablet

    Cablet - 2006-03-01

    Hello,
    I am fairly new to AAF and have been messing around with InfoDumper on OSX.  Things are going well and I am learning a lot.  I am stuck with one thing and I am hoping that someone can lend a hand.  Here is some code from InfoDumper (starting at line 1373):

    os << "Mobs: " << endl;
          IEnumAAFMobsSP pMobEnum;
          IAAFMobSP pMob;
          IAAFObjectSP pObject;
          aafSearchCrit_t mobCrit;
          mobCrit.searchTag= kAAFNoSearch;
              //mobCrit.searchTag= kAAFByMobKind;
          checkResult(pHeader->GetMobs(&mobCrit,&pMobEnum));
             
           
             
          // Enumerate accross all Mobs
          while (AAFRESULT_SUCCEEDED(pMobEnum->NextOne(&pMob)))
            {
              // For now dump as object
                checkResult(pMob->QueryInterface(IID_IAAFObject,
                               (void**) &pObject));
                                                  
                                
                checkResult(dumpObject (pObject, pDict, dumpFlags, 0, os));

            }

    This code will loop through the Mob using the IEnumAAFMobsSP smart pointer.  This makes sense and works find.  But what I would like to do is display only CompositionMobs.  I have made this happen by comparing the Def name for CompositionMob but I would like to do comparisons using something other than name,  like IID's.  Can this be done?  I tried messing around with aafSearchCrit_t's but could not figure out how to use it.  I have found the values of aafSearchCrit_t in the header files but still have not been able make it work properly (at all).  Are there any code samples out there or can someone whip out some quick code as an example.  Thank you very much for any suggestions.

    Cablet

     
    • John Emmas

      John Emmas - 2006-03-01

      You were on the right lines when you tried aafSearchCrit_t. In your code, you have 3 lines like this:-

      mobCrit.searchTag= kAAFNoSearch;
      //mobCrit.searchTag= kAAFByMobKind;
      checkResult(pHeader->GetMobs(&mobCrit,&pMobEnum));

      Just change the first 2 lines to say this:-
      mobCrit.searchTag = kAAFByMobKind;
      mobCrit.tags.mobKind = kAAFCompMob;

      I think that should be enough to make it work.

       
    • Cablet

      Cablet - 2006-03-02

      Thank You.  This did the trick. 

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks