add magplayer/thread code