Skip to main content
Topic: foo_wave_seekbar (Read 572217 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_wave_seekbar

Reply #425
for me this great component could  be even better if there will be some time marks, like NI Tracktor DJ does.
what you think about that folks???
zooming looks nice but seems like its not needed here


foo_wave_seekbar

Reply #426
Alright. Could you list your OS, UI component, graphics card model, etc?


XP SP3
Ati Radeon 4850
DUI
Foobar v1.0

Hmm.
- I might try upgrading foobar (though small chance of fixing it)
- I think I fiddled with the shader file a bit. Might try reverting back to the default one.

foo_wave_seekbar

Reply #427
Is it an older shader? I added a rather important texture coordinate input semantic to it, with corresponding code in the VS function. Omitting that could very well result in the odd chimera display.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

foo_wave_seekbar

Reply #428
As for your odd display, are you running 0.2.5?

A preferences page will not happen unless it is truly component-global, and thus far I've put those options in advanced preferences.
Making a central page would unnecessarily detach the configuration from the element it is for, and you would not have an easy way to indicate which one of the elements was affected by the proposed preferences page.
This will not happen unless Peter goes insane and adds a central preferences API, which I don't see ever happening.


But where are the display options stored now? I can't find these anywhere!? Really weird that they are not reset when deleting foo_wave_seekbar.dll.cfg

EDIT: Found it. Stored in the theme. Ok, No problem.



But why does the "Compact Waveform database" function not properly rewrite the database when activating "Store scanned tracks in mono" (after tracks have been stored with all channels)? Shouldn't it do so to free up space?




In these http://download.microsoft.com/download/win...US/6channel.exe 6 channel files the "Back right" channel isn't displayed in "Downmix display to mono". Why? "Back left" is.

In these http://download.microsoft.com/download/6/b...c8/8Channel.exe 8 channel files the "Side right" and "Back right" channels are missing in the "Downmix display to mono" display. Why?

foo_wave_seekbar

Reply #429
If you're using the Direct3D mode, replace line 128 (the one with lerp from bgColor to textColor) in seekbar.fx with
: textColor;


Can you give me a hint to get a straight cursor instead of the current blurry one?

foo_wave_seekbar

Reply #430
I have created an effect that also renders the RMS part. Since I didn't like the shading, I changed that to perform a grayscale conversion on the already played part. If you poke around in the script (see below) you can also enable a sepia-like effect.

seekbar.fx: Put this in your profile or installation directory in the effects subdirectory.


This is looking great! But it's only drawing stereo files in mono, no matter if "Downmix display to mono" is enabled or not!?

"Downmix display to mono" enabled = sharp good looking mono display
"Downmix display to mono" disabled = blurry bad looking mono display


I'm using version 0.2.5.


@Zao: What about integrating RMS drawing into the default fx file too? Or why not even more "professional" using ITU-R BS.1770-1 http://webs.uvigo.es/servicios/biblioteca/...;!PDF-E.pdf

foo_wave_seekbar

Reply #431
This is looking great! But it's only drawing stereo files in mono, no matter if "Downmix display to mono" is enabled or not!?

That effect was created before this component supported multiple channels.  If it is to support multiple channels in the future, foosion will need to update it.

foo_wave_seekbar

Reply #432
Alright. Didn't know that. Thanks!

foo_wave_seekbar

Reply #433
But why does the "Compact Waveform database" function not properly rewrite the database when activating "Store scanned tracks in mono" (after tracks have been stored with all channels)? Shouldn't it do so to free up space?

In these http://download.microsoft.com/download/win...US/6channel.exe 6 channel files the "Back right" channel isn't displayed in "Downmix display to mono". Why? "Back left" is.

In these http://download.microsoft.com/download/6/b...c8/8Channel.exe 8 channel files the "Side right" and "Back right" channels are missing in the "Downmix display to mono" display. Why?


The "compact database" command is for cleaning out unused blocks in the database, it doesn't recalculate anything. If you want to rescan everything, use the "rescan all" command. There is currently no way to mangle an existing multichannel entry into a mono one, as that would be rather pointless.

As for your (what I assume are) test files, I honor the channel map that fb2k tells me tracks have. If they mismatch your expectations to what is in which channel, it's not my fault (unless I have a bug, which I doubt).
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

foo_wave_seekbar

Reply #434
Ok, no problem.



 

foo_wave_seekbar

Reply #437
This is looking great! But it's only drawing stereo files in mono, no matter if "Downmix display to mono" is enabled or not!?

That effect was created before this component supported multiple channels.  If it is to support multiple channels in the future, foosion will need to update it.


I've updated it: seekbar.fx

foo_wave_seekbar

Reply #438
This is looking great! But it's only drawing stereo files in mono, no matter if "Downmix display to mono" is enabled or not!?

That effect was created before this component supported multiple channels.  If it is to support multiple channels in the future, foosion will need to update it.


I've updated it: seekbar.fx


Thanks! Working fine.


By the way: Where do the filenames "seekbar.png" and "074.jpg" (found in the original fx file) come from? At least there are no such files on my system!?

foo_wave_seekbar

Reply #439
The Direct3D frontend is capable of loading and binding any texture listed in such an annotation. If you know how to write shaders, you can use that for gradient textures, backgrounds, custom position indicators, etc.

In this case, 074.jpg is the stone background in this screenshot and seekbar.png has never been used, it just served as a hint for the purpose of them.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

foo_wave_seekbar

Reply #440
this is very thin, but anyway just curious:

any ideas for implementing part of "next track" in current view?
maybe with providing scrolling display with custom timeframe?

of course it won't work in random/shuffle playback

foo_wave_seekbar

Reply #441
The Direct3D frontend is capable of loading and binding any texture listed in such an annotation. If you know how to write shaders, you can use that for gradient textures, backgrounds, custom position indicators, etc.

In this case, 074.jpg is the stone background in this screenshot and seekbar.png has never been used, it just served as a hint for the purpose of them.


Ok, thanks!

foo_wave_seekbar

Reply #442
Awesome component !
Thank you VERY much !!

On my dual Screen system, The waveform is only shown when Foobar sits on Primary Display.
When using GDI mode, it is always working. Only D3D is concerned.

foo_wave_seekbar

Reply #443
I have not tested with multiple GPUs at all. What GPUs and OS do you have?
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

foo_wave_seekbar

Reply #444
This is looking great! But it's only drawing stereo files in mono, no matter if "Downmix display to mono" is enabled or not!?
That effect was created before this component supported multiple channels.  If it is to support multiple channels in the future, foosion will need to update it.

I've updated it: seekbar.fx
thanks!
added one line to scale the waveform using replaygain, from another script submitted by someone else.
Code: [Select]
Texture1D tex : WAVEFORMDATA;
Texture2D seekTex < string filename = "seekbar.png"; >;

SamplerState sTex
{
    Filter = MIN_MAG_MIP_LINEAR;
    AddressU = Clamp;
};

struct VS_IN
{
float2 pos : POSITION;
float2 tc : TEXCOORD0;
};

struct PS_IN
{
float4 pos : SV_POSITION;
float2 tc : TEXCOORD0;
};


float4 backgroundColor : BACKGROUNDCOLOR;
float4 highlightColor  : HIGHLIGHTCOLOR;
float4 selectionColor  : SELECTIONCOLOR;
float4 textColor      : TEXTCOLOR;
float cursorPos        : CURSORPOSITION;
bool cursorVisible    : CURSORVISIBLE;
float seekPos          : SEEKPOSITION;
bool seeking          : SEEKING;
float4 replayGain      : REPLAYGAIN; // album gain, track gain, album peak, track peak
float2 viewportSize    : VIEWPORTSIZE;
bool horizontal        : ORIENTATION;
bool shade_played      : SHADEPLAYED;

PS_IN VS( VS_IN input )
{
PS_IN output = (PS_IN)0;

float2 half_pixel = float2(1,-1) / viewportSize;
output.pos = float4(input.pos - half_pixel, 0, 1);
if (horizontal)
output.tc = float2((input.tc.x + 1.0) / 2.0, input.tc.y);
else
output.tc = float2((-input.tc.y + 1.0) / 2.0, input.tc.x);

return output;
}

float4 bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show )
{
float dist = abs(pos - tc.x);
float4 c = (show && dist < width)
? lerp(fg, bg, smoothstep(0, width, dist))
: bg;
return c;
}

float4 grayscale( float4 color )
{
return color.r * 0.3 + color.g * 0.59 + color.b * 0.11;
}

float4 sepia( float4 color )
{
float4 weight;
weight.r = 0.3;
weight.g = 0.59;
weight.b = 0.11;
weight.a = 0;

float4 adjust;
adjust.r = 0.098039215686275;
adjust.g = -0.050980392156863;
adjust.b = -0.26274509803922;
adjust.a = 0;

float intensity = dot(color, weight) ;
color = intensity + adjust;
return saturate(color);
}

float4 contrast( float4 color, float strength )
{
return saturate((color - 0.5) * strength + 0.5);
}

float4 played( float pos, float2 tc, float4 fg, float4 bg, float alpha)
{
float4 c = bg;
if (pos > tc.x)
{
#if 0
c = contrast(c, fg.r * 2);
c = lerp(c, sepia©, fg.g);
c = lerp(c, grayscale©, fg.b);
#else
c = grayscale©;
//c = sepia©;
#endif
}
return c;
}

float4 evaluate( float2 tc, float border )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(sTex, tc.x);
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 2; //use track gain
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;

float belowWave = tc.y + border - minmaxrms.r;
float aboveWave = tc.y - border - minmaxrms.g;
float factorWave = min(abs(belowWave), abs(aboveWave));
bool insideWave = (belowWave > 0 && aboveWave < 0);

float diffRms = abs(tc.y) - border - minmaxrms.b;
float factorRms = abs(diffRms);
bool insideRms = diffRms < 0;

float factor = insideRms ? (1.0 - 0.5 * saturate(factorRms / border / 2)): 1.0;
factor = insideWave ? (factor * saturate(factorWave / border / 2)) : 0.0;

float4 wave = lerp(backgroundColor, textColor, factor);

return saturate(wave);
}

float4 PS( PS_IN input ) : SV_Target
{
float dx, dy;
if (horizontal)
{
dx = 1/viewportSize.x;
dy = 1/viewportSize.y;
}
else
{
dx = 1/viewportSize.y;
dy = 1/viewportSize.x;
}
float seekWidth = 2.5 * dx;
float positionWidth = 2.5 * dx;

float4 c0 = evaluate(input.tc, 2.5 * dy);
if (shade_played)
c0 = played(cursorPos, input.tc, highlightColor, c0, 0.3);
c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible);
c0 = bar(seekPos,  input.tc, selectionColor, c0, seekWidth,    seeking      );
return c0;
}

technique10 Render10
{
pass P0
{
SetGeometryShader( 0 );
SetVertexShader( CompileShader( vs_4_0, VS() ) );
SetPixelShader( CompileShader( ps_4_0, PS() ) );
}
}

technique Render9
{
pass
{
VertexShader = compile vs_2_0 VS();
PixelShader = compile ps_2_0 PS();
}
}

foo_wave_seekbar

Reply #445
@Zao: Would be possible to show the waveform building live on the fly while it's being calculated? Would be useful for long files ...


foo_wave_seekbar

Reply #447
@Zao: Would be possible to show the waveform building live on the fly while it's being calculated? Would be useful for long files ...

Doing so would risk things taking longer time due to the act of prerendering the waveform (in Direct2D and GDI mode) being more costly than the scanning.
Also, as it's a two-pass process currently, intermediary results are not accessible.
I'd rather not touch that code much, as it's a bit gnarly.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

foo_wave_seekbar

Reply #448
Ok. No prob.


 
SimplePortal 1.0.0 RC1 © 2008-2019