refactor DemoRecorder and fix vc compile