Guest User

Untitled

a guest
Oct 2nd, 2011
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. int CFamiTrackerDoc::DeepCloneInstrument(unsigned int Index) {
  2.     int Slot = CloneInstrument(Index);
  3.  
  4.     if (Slot != -1) {
  5.         CInstrument *newInst = m_pInstruments[Slot];
  6.         CInstrument *oldInst = m_pInstruments[Index];
  7.         if(newInst->GetType() == INST_2A03) {
  8.             for(unsigned int i = 0; i < SEQ_COUNT; i++) {
  9.                 int freeSeq = this->GetFreeSequence(i);
  10.                 int oldSeq = ((CInstrument2A03*)newInst)->GetSeqIndex(i);
  11.                 if( ((CInstrument2A03*)newInst)->GetSeqEnable(i) ) {
  12.                     this->GetSequence(freeSeq, i)->Copy( this->GetSequence(oldSeq, i) );
  13.                 }
  14.                 ((CInstrument2A03*)newInst)->SetSeqIndex(i, freeSeq);
  15.             }
  16.         }
  17.  
  18.     }
  19.  
  20.     return Slot;
  21. }
  22.  
  23.  
Advertisement
Add Comment
Please, Sign In to add comment