Beispiel #1
0
MediaTrack* GuidToTrack(const GUID* guid)
{
	if (guid)
		for (int i=0; i<=GetNumTracks(); i++)
			if (MediaTrack* tr = CSurf_TrackFromID(i, false))
				if (TrackMatchesGuid(tr, guid))
					return tr;
	return NULL;
}
Beispiel #2
0
void RestoreActiveTakes(COMMAND_T*)
{
	for (int i = 1; i <= GetNumTracks(); i++)
	{
		MediaTrack* tr = CSurf_TrackFromID(i, false);
		if (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
			// Find the saved track
			for (int j = 0; j < g_activeTakeTracks.Get()->GetSize(); j++)
				if (TrackMatchesGuid(tr, &g_activeTakeTracks.Get()->Get(j)->m_guid))
					g_activeTakeTracks.Get()->Get(j)->Restore(tr);
	}
	UpdateArrange();
}
Beispiel #3
0
//*****************************************************
// Global Functions
void SaveActiveTakes(COMMAND_T*)
{
	for (int i = 1; i <= GetNumTracks(); i++)
	{
		MediaTrack* tr = CSurf_TrackFromID(i, false);
		if (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
		{
			// Delete if exists
			for (int j = 0; j < g_activeTakeTracks.Get()->GetSize(); j++)
				if (TrackMatchesGuid(tr, &g_activeTakeTracks.Get()->Get(j)->m_guid))
				{
					g_activeTakeTracks.Get()->Delete(j--, true);
					break;
				}
			g_activeTakeTracks.Get()->Add(new ActiveTakeTrack(tr));
		}
	}
}