Absolutely!
Ok so for the Seekbar with track information, here is the code. In Bold [edited to green so it shows better ] is colour adjustment, and text adjustment
var DT_CENTER = 0x00000001;
DT_CALCRECT = 0x00000400;
DT_NOPREFIX = 0x00000800;
var g_font = gdi.Font([color=green]"Segoe UI", 15, 0[/color]);
var g_drag = 0;
var g_bar_height = 15;
var g_cycles = 0;
var ww = 0,
wh = 0;
var top = 0;
var g_pos = 0;
var g_drag_seek = 0;
var g_timer, txt;
function RGB(r,g,b) {
return (0xff000000|(r<<16)|(g<<8)|(b));
}
function on_size() {
ww = window.Width;
wh = window.Height;
}
function on_paint(gr) {
[color=green]gr.FillSolidRect(0, 0, ww, wh, RGB(240,240,240));
gr.FillSolidRect(0, 0, ww, wh+2, RGB(67,90,203));[/color]
if(fb.IsPlaying) {
if(fb.PlaybackLength > 0) {
if(g_drag){
t = fb.PlaybackLength * g_drag_seek;
h = Math.floor(t/3600)
m = Math.floor((t-=h*3600)/60);
s = Math.floor(t-=m*60);
pos = ww * g_drag_seek;
txt = (h > 0 ? h + ":" + (m <10 ? "0" + m : m) : m) + ":" + (s < 10 ? "0" + s : s) + " / " + length;
} else {
pos = ww * (fb.PlaybackTime / fb.PlaybackLength);
txt = fb.IsPaused ? "Paused" : fb.titleformat([color=green]"%artist% - %title%"[/color]).Eval();
}
gr.FillSolidRect(0, 0, pos, wh+2, RGB(0,44,190));
} else if(fb.PlaybackTime > 0.1) {
txt = fb.IsPaused ? "Paused" : fb.titleformat[color=green]("%playback_time%"[/color]).Eval() + " /LIVE";
}
[color=green]gr.GdiDrawtext(txt, g_font, RGB(255,255,255), 0, 3, ww-8, wh, DT_CENTER | DT_CALCRECT | DT_NOPREFIX);[/color]
}
gr.FillSolidRect(0, 0, ww, 0, RGB(50,52,133));
}
function on_mouse_lbtn_down(x,y){
if(fb.IsPlaying && fb.PlaybackLength > 0) g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
if(g_drag) {
g_drag = 0;
g_drag_seek = x < 0 ? 0 : x > window.Width ? 1 : x / window.Width;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
}
function on_mouse_move(x,y){
if(y > wh) g_drag = 0;
if(g_drag) {
g_drag_seek = x < 0 ? 0 : x > window.Width ? 1 : x / window.Width;
window.Repaint();
}
}
function on_playback_new_track() {
length = fb.TitleFormat("%length%").Eval();
g_timer = window.CreateTimerInterval(100);
}
function on_playback_stop() {
if(g_timer) window.KillTimer(g_timer);
window.Repaint();
CollectGarbage();
}
function on_playback_seek(time){
window.Repaint();
}
function on_timer(id){
window.Repaint();
}
function on_mouse_wheel(delta) {
fb.PlaybackTime = fb.PlaybackTime + delta;
}
if(fb.isplaying) on_playback_new_track();
VOLUME BAR
// vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et:
function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}
// gdi.Font is changed, the last parameter is style flags
// FontStyleRegular = 0,
// FontStyleBold = 1,
// FontStyleItalic = 2,
// FontStyleBoldItalic = 3,
// FontStyleUnderline = 4,
// FontStyleStrikeout = 8
// Here is 0, means FontStyleRegular
var g_font = gdi.Font("Segoe UI", 15, 0);
var g_drag = 0;
function on_paint(gr) {
gr.SetTextRenderingHint(5);
var ww = window.Width;
var wh = window.Height;
var volume = fb.Volume;
var pos = window.Width * ((100 + volume) / 100);
var txt = (Math.ceil(volume)) + [color=green](" dB")[/color];
[color=green] gr.FillSolidRect(0, 0, ww, wh+2, RGB(0,44,190))
gr.FillSolidRect (pos, 0, ww - pos, wh, RGB(67,90,203));
gr.DrawString(txt, g_font, RGB(255, 255, 255), 0, 0, ww, wh, 0x11005000);[/color]
}
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) {
var v = x / window.Width;
v = (v < 0) ? 0 : (v < 1) ? v : 1;
v = -100 * (1 - v);
if (fb.Volume != v) fb.Volume = v;
}
}
function on_mouse_wheel(delta) {
if (delta > 0) fb.VolumeUp();
else fb.VolumeDown();
}
function on_volume_change(val) {
window.Repaint();
}