private void init() { //获取主窗口句柄 handle = new WindowInteropHelper(this).Handle; saoPlayer = new SAOPlayer(handle); //频谱计时器 effectTimer = new DispatcherTimer(); effectTimer.Interval = TimeSpan.FromMilliseconds(1); effectTimer.Tick += onEffectDrawn; }
public SpectrumWidget(SAOPlayer sPlayer) { InitializeComponent(); saoPlayer = sPlayer; //频谱计时器 effectTimer = new DispatcherTimer(); effectTimer.Interval = TimeSpan.FromMilliseconds(1); effectTimer.Tick += onEffectDrawn; if (saoPlayer.isPlay()) { onPlay(); } }