Ejemplo n.º 1
0
void BlockControl::AddKeyToTempControl(TimeValue t,  TimeValue scale, BOOL isRelative)
{
//DebugPrint(_T("key data\n"));
for (int i =0; i < controls.Count();i++)
   {
//copy track in 
//need to add relative controls
		Interval iv(start,m_end);
   TrackClipObject *cpy = controls[i]->CopyTrack(iv, TIME_INCLEFT|TIME_INCRIGHT);
// int sz = sizeof(&cpy);
		iv.Set(t,t + (m_end-start));
   DWORD flags = TIME_INCLEFT|TIME_INCRIGHT;
   if (isRelative)
      {
      flags |= PASTE_RELATIVE;
//look at last key   and get offset
      }

   tempControls[i]->PasteTrack(cpy, iv, flags);
//now loop through and add relative value

//now need to scale those keys
   float s = 1.0f;
		if ((m_end-start) != 0)
			s =  (float)scale/(float)(m_end-start);

   tempControls[i]->ScaleTime(iv, s);

   cpy->DeleteThis();
   }
}
Ejemplo n.º 2
0
void BlockControl::AddKeyToSub(Control *sub, int whichSub, TimeValue t,  TimeValue scale, Interval mrange,BOOL isRelative)
{
//DebugPrint(_T("key data\n"));
int i = whichSub;
   
//copy track in 
//need to add relative controls
	Interval iv(start,m_end);
   TrackClipObject *cpy = controls[i]->CopyTrack(iv, TIME_INCLEFT|TIME_INCRIGHT);
//now need to scale those keys
   float s = 1.0f;
	if ((m_end-start) != 0)
		s =  (float)scale/(float)(m_end-start);
	iv.Set(t,t + (m_end-start));
   DWORD flags = TIME_INCLEFT|TIME_INCRIGHT;
   if (isRelative)
      {
      flags |= PASTE_RELATIVE;
//look at last key   and get offset
      }

   Interval scaleIV = iv;
   iv = iv & mrange;
   sub->PasteTrack(cpy, iv, flags);
//now loop through and add relative value

   sub->ScaleTime(scaleIV, s);

   cpy->DeleteThis();
      }
Ejemplo n.º 3
0
void BlockControl::AddKeyToSub(Control *sub, int whichSub, TimeValue t,  TimeValue scale, Interval mrange,BOOL isRelative)
{
//DebugPrint("key data\n");
int i = whichSub;
//for (int i =0; i < controls.Count();i++)
//Nuke all keys
	{
	
//copy track in 
//need to add relative controls
	Interval iv(start,end);
	TrackClipObject *cpy = controls[i]->CopyTrack(iv, TIME_INCLEFT|TIME_INCRIGHT);
//	int sz = sizeof(&cpy);
//now need to scale those keys
	float s = 1.0f;
	if ((end-start) != 0)
		 s =  (float)scale/(float)(end-start);
   	iv.Set(t,t + (end-start));
	DWORD flags = TIME_INCLEFT|TIME_INCRIGHT;
	if (isRelative)
		{
		flags |= PASTE_RELATIVE;
//look at last key	and get offset
		}

	Interval scaleIV = iv;
	iv = iv & mrange;
	sub->PasteTrack(cpy, iv, flags);
//now loop through and add relative value


	sub->ScaleTime(scaleIV, s);

//	int numKeys = tempControls[i]->NumKeys();
	cpy->DeleteThis();
//			}
//		tempControls[i]->DeleteKeys(TRACK_DOALL);
	}

}