Project Description
MmTimer 是一个多媒体定时器的C#简单封装。
使用这个定时器,你可以得到1ms精度的单次延时或周期定时。最初是想用来做播放midi文件的时钟,当然你也可以用它来做任何它能做到的事情。
It's developed in C#.






How to use it

You can use it as follows simply:

(1) add the dll reference to your project.

(2) using the namespace.

using Dongzr.MidiLite;

(3) define the EventHandler.

void timer1_Tick(object sender, EventArgs e)
{
//..........................
}

(4) define the timer.

static MmTimer timer1;

(5) initial and start it.

timer1 = new MmTimer();
timer1.Mode = MmTimerMode.Periodic;
timer1.Interval = 1;
timer1.Tick += new EventHandler(timer1_Tick);
timer1.Start();

(6) stop and dispose it.

timer1.Stop();
timer1.Dispose();


Maybe you will use it in windows form application more often:

(1) add the dll reference to your project.

(2) add the timer component to your form (your can find it in your tool box).

(3) edit the timer's properties.

(4) add the Tick EventHandler.

(5) start, stop.

Last edited Aug 27, 2010 at 12:38 AM by dzrjojo, version 8