Do workouts track calories based on heart rate or category?

I've been combining cardio, weights, and walking in place in one workout, but don't see a specific activity that fits this. If I just choose one, will it track calories accurately? For example, if I track as walking, but then there are several minutes where I'm not moving because I'm using weights, will it track for my heart rate, or see that I'm not moving and reduce the calories burned?