Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
- var g_drag = 0;
- var color =
- {
- background: RGB(206, 219, 213),
- frame: RGB(191, 208, 199),
- progress: RGB(188, 145, 148),
- proghead: RGB(164, 79, 85)
- };
- function on_paint(e)
- {
- e.SetTextRenderingHint(1);
- var ww = window.Width-2,
- wh = window.Height-2,
- pos = fb.PlaybackLength == 0 ? ww : (ww * fb.PlaybackTime / fb.PlaybackLength),
- headwidth = 8;
- // Draw background
- e.FillSolidRect(1, 1, ww, wh, color.background);
- // Draw progress
- e.FillSolidRect(1, 1, pos-1, wh, color.progress);
- // Draw progress head
- e.FillSolidRect(pos-headwidth < 1 ? 1 : pos-headwidth, 1, headwidth, wh, color.proghead);
- // Draw frame background
- e.DrawRect(0, 0, ww+1, wh+1, 1, color.frame);
- }
- function on_mouse_lbtn_down(x, y)
- {
- g_drag = 1;
- }
- function on_mouse_lbtn_up(x, y)
- {
- on_mouse_move(x,y);
- g_drag = 0;
- }
- function on_mouse_move(x, y)
- {
- if (g_drag)
- fb.PlaybackTime = x / window.Width * fb.PlaybackLength;
- }
- function on_mouse_wheel(delta)
- {
- fb.PlaybackTime += delta;
- }
- function on_mouse_mbtn_down(x, y) {
- fb.PlayOrPause();
- }
- function on_playback_seek()
- {
- window.Repaint();
- }
- function on_playback_time()
- {
- window.Repaint();
- }
- function on_playback_stop()
- {
- window.Repaint();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement