function AIMP_VU_Meter_seting() {
ww = window.Width;
wh = window.Height;
if (!aimp_skin_check) return;
for (var c = 0; c < channels_count; c++) {
// 1 -- rescale size to retain the ratio as AIMP does. we do not scale VU meter as fb2k does.
// assuming : both left & right panel is equal in height
ww_[c] = (ww - LM)/2, wh_[c]= wh-TM;
var scaleAangle1 = ww_[c]/wh_[c];
if (scaleAangle1 > scaleAangle[c]) ww_[c] = wh_[c]*scaleAangle[c];
else wh_[c] = ww_[c]/scaleAangle[c];
// 2 -- x,y coords scale
x_[c] = LM ; y_[c] = TM ;
if (c >0) {
x_[c]=ww_[c-1]+x_[c-1];
y_[c]=y_[c-1];
// shift the right channel panel towards left if it is wider than left channel panel
if (channel_short.channel == 0) {
x_[c]=ww_[c-1]*channel_short.ratio + x_[c-1];
}
x_[c] --; // 1px to the left to hide the gab between Left and Right panel due to calculation
}
/*/ 3 -- width, height needle scaled : we have to create a needle image, then scale per actual panel size
[+] analog VU Meter:
|-- x_needle > 0:
|-- y_needle > 0:
|-- arrow_dir = other {vertical needle}
|-- arrow_dir = other {horizontal vertical} <== for left panel only
|-- arrow_dir = down
|-- y_needle <= 0:
|-- arrow_dir = down
X|-- arrow_dir = other {not practical!}
|-- x_needle <= 0:
|-- y_needle > 0:
|-- arrow_dir = other {horizon}
X|-- arrow_dir = down {not practical!}
|-- y_needle <= 0:
X|-- arrow_dir = other {not practical!}
X|-- arrow_dir = down {not practical!}
* x_needle : x_needle coords per INI file; y_needle : y_needle coords per INI file; X : Not existed/not practical VU Meter.
/*/
var xs_ = 0,ys_ = 0;
var nxs_= 0,nys_ = 0;
var wws_ =0, whs_= 0;
var nw_ = aimp_needle_img1[c].Width, nh_ = aimp_needle_img1[c].Height;
// 3.1-- analog, x_needle > 0, y_needle > 0, arrow_dir = other {vertical }[0 111]
if (aimp_type.type[c] == 0 && aimp_type.sub_type[c] == 0
&& aimp_type.x_needle_coords[c] == 1 && aimp_type.y_needle_coords[c] == 1
&& aimp_type.arrow_dir[c] ==1 ) {
ws[c] = (ww_[c]/scaleWidth[c])*2; hs[c] = (wh_[c]/scaleHeight[c])*2;
wws_ = ww_[c]; whs_ = wh_[c];
xs_ = 0; ys_ = 0 ;
nxs_ = 0; nys_ = 0;
xn_[c] = x_[c]; yn_[c] = y_[c];
}
// 3.1.1-- analog, x_needle > 0, y_needle > 0, arrow_dir = other {horizon} [0/1 111]
if (c==0 && aimp_type.type[c] == 0 && aimp_type.sub_type[c] == 1
&& aimp_type.x_needle_coords[c] == 1 && aimp_type.y_needle_coords[c] == 1
&& aimp_type.arrow_dir[c] ==1 ) {
ws[c] = (ww_[c] - ww_[c]/scaleWidth[c])*2; hs[c] = (wh_[c]/scaleHeight[c])*2;
wws_ = ww_[c]; whs_ = wh_[c];
xs_ = ws[c]/2-ww_[c]/scaleWidth[c]; ys_ = 0 ;
nxs_ = 0; nys_ = 0;
xn_[c] = x_[c] - ws[c]/2+ww_[c]/scaleWidth[c]; yn_[c] = y_[c];
}
// 3.2-- analog, x_needle <= 0, y_needle > 0, arrow_dir = other {horizon} [0 011]
if (aimp_type.type[c] == 0
&& aimp_type.x_needle_coords[c] == 0 && aimp_type.y_needle_coords[c] == 1
&& aimp_type.arrow_dir[c] ==1 ) {
ws[c] = (ww_[c]+ ww_[c]/scaleWidth[c])*2; hs[c] = (wh_[c]/scaleHeight[c])*2;
wws_ = ww_[c]; whs_ = wh_[c];
xs_ = ws[c]/2+ww_[c]/scaleWidth[c]; ys_ = 0;
nxs_ = 0; nys_ = 0;
xn_[c] = x_[c] - ws[c]/2-ww_[c]/scaleWidth[c]; yn_[c] = y_[c];
}
// 3.3-- analog, x_needle > 0, y_needle <= 0, arrow_dir = down [0 100]
if (aimp_type.type[c] == 0
&& aimp_type.x_needle_coords[c] == 1 && aimp_type.y_needle_coords[c] == 0
&& aimp_type.arrow_dir[c] == 0 ) {
ws[c] = (ww_[c]/scaleWidth[c])*2; hs[c]= (wh_[c]+ wh_[c]/scaleHeight[c] ) *2 ;
wws_ = ww_[c]; whs_ = wh_[c];
xs_ = 0; ys_ = wh_[c] + 2*wh_[c]/scaleHeight[c];
nxs_ = 0; nys_ = 0;
xn_[c] = x_[c]; yn_[c]= y_[c]- ys_;
}
// 3.4-- analog, x_needle > 0, y_needle > 0, arrow_dir = down [0 110]
if (aimp_type.type[c] == 0
&& aimp_type.x_needle_coords[c] == 1 && aimp_type.y_needle_coords[c] == 1
&& aimp_type.arrow_dir[c] == 0 ) {
ws[c] = (ww_[c]/scaleWidth[c])*2; hs[c] = (wh_[c] - wh_[c]/scaleHeight[c] ) *2 ;
wws_ = ww_[c]; whs_ = hs[c]/2;
xs_ = 0; ys_ = hs[c]/2;
nxs_ = 0; nys_ = aimp_needle_img1[c].Height/scaleHeight[c]
xn_[c] = x_[c]; yn_[c] = y_[c]-hs[c]/2 + wh_[c]/scaleHeight[c];
}
// 4-- needle scaled
// aimp_needle_img
if (aimp_needle_img[c]) aimp_needle_img[c].Dispose();
aimp_needle_img[c] = utils.CreateImage( ws[c], hs[c] );
var gb = aimp_needle_img[c].GetGraphics();
gb.DrawImage(aimp_needle_img1[c],
xs_,ys_,wws_,whs_,
nxs_,nys_,nw_,nh_);
aimp_needle_img[c].ReleaseGraphics(); gb = null;
// aimp_needle_peak_img
if (aimp_needle_peak_img[c]) aimp_needle_peak_img[c].Dispose();
aimp_needle_peak_img[c] = utils.CreateImage(ws[c], hs[c]);
var gb = aimp_needle_peak_img[c].GetGraphics();
gb.DrawImage(aimp_needle_peak_img1[c],
xs_,ys_,wws_,whs_,
nxs_,nys_,nw_,nh_);
aimp_needle_peak_img[c].ReleaseGraphics(); gb = null;
// aimp_needle_peak_peak_img
if (aimp_needle_peak_peak_img[c]) aimp_needle_peak_peak_img[c].Dispose();
aimp_needle_peak_peak_img[c] = utils.CreateImage(ws[c], hs[c]);
var gb = aimp_needle_peak_peak_img[c].GetGraphics();
gb.DrawImage(aimp_needle_peak_peak_img1[c],
xs_,ys_,wws_,whs_,
nxs_,nys_,nw_,nh_);
aimp_needle_peak_peak_img[c].ReleaseGraphics(); gb = null;
}
/*/ for testing only
window.MaxWidth = window.MinWidth = LM+aimp_needle_img1[c].Width*2;
window.MaxHeight = window.MinHeight = TM+aimp_needle_img1[c].Height;
/*/
}