IPB

Welcome Guest ( Log In | Register )

70 Pages V  « < 59 60 61 62 63 > »   
Reply to this topicStart new topic
foo_wave_seekbar, pretty accelerated seekbar
Wander
post Jul 24 2013, 16:20
Post #1501





Group: Members
Posts: 46
Joined: 25-May 11
From: Germany
Member No.: 90967



Is it somehow possible to get Direct2D or Direct3D rendering to work under Wine? I'm using version 0.2.34 and it falls always back to GDI rendering, which is way too blurry.

winecfg lists every d3d9 version from 24 to 43.

And btw: Thanks for this great component!

@Axon: Did Direct2D or 3D work for you any time in the past? Because I never got it to work.

This post has been edited by Wander: Jul 24 2013, 16:23
Go to the top of the page
+Quote Post
Zao
post Jul 25 2013, 00:21
Post #1502





Group: Members (Donating)
Posts: 899
Joined: 25-September 03
From: Umeć, Sweden
Member No.: 9001



CODE
libGL error: open uki failed (Operation not permitted)
libGL error: reverting to (slow) indirect rendering
err:winediag:X11DRV_WineGL_InitOpenglInfo Direct rendering is disabled, most likely your OpenGL drivers haven't been installed correctly (using GL renderer "AMD Radeon HD 7800 Series", version "2.1 (4.2.12337 Compatibility Profile Context 13.101)").
fixme:win:EnumDisplayDevicesW ((null),0,0x33f058,0x00000000), stub!
fixme:d3dx:D3DXCreateEffectEx (0x190cb0, 0x1ff920, 3852, (nil), (nil), (nil), 0, (nil), 0x33f394, 0x33f390): semi-stub
fixme:d3dx:d3dx9_base_effect_init HLSL ascii effects not supported, yet
fixme:d3dx:D3DXCreateEffectEx (0x190cb0, 0x2009a0, 3852, (nil), (nil), (nil), 0, (nil), 0x33f494, 0x33f490): semi-stub
fixme:d3dx:d3dx9_base_effect_init HLSL ascii effects not supported, yet
fixme:d3dx:D3DXCreateEffectEx (0x190cb0, 0x1fba70, 3852, (nil), (nil), (nil), 0, (nil), 0x33f46c, 0x33f468): semi-stub
fixme:d3dx:d3dx9_base_effect_init HLSL ascii effects not supported, yet
fixme:d3dx:D3DXCreateEffectEx (0x190cb0, 0x30e8a68, 3852, (nil), (nil), (nil), 0, (nil), 0x33f498, 0x33f494): semi-stub
fixme:d3dx:d3dx9_base_effect_init HLSL ascii effects not supported, yet
fixme:d3dx:ID3DXEffectImpl_Begin iface 0x1fc988, passes 0x33f690, flags 0 partial stub
fixme:d3dx:ID3DXEffectImpl_End (0x1fc988)->(): stub
fixme:d3dx:ID3DXEffectImpl_Begin iface 0x1fc988, passes 0x33f690, flags 0 partial stub
fixme:d3dx:ID3DXEffectImpl_End (0x1fc988)->(): stub

As expected, the D3DX9 implementation in an out-of-box Wine is quite a few bottles short of a rack.
If one works around their completely botched synchronization primitives, you have no chance in hell of properly compiling the effect source. You guys owe me a new X session, Wine violently crashed my open-source X driver.

At best, you'll get an empty seekbar window responsive enough to let you change to the GDI frontend. As for Direct2D, I quite doubt that there's any trace of that at all in Wine.


--------------------
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.
Go to the top of the page
+Quote Post
TomasPin
post Jul 25 2013, 05:05
Post #1503





Group: Members
Posts: 202
Joined: 5-June 13
From: Argentina
Member No.: 108508



Found out about this component too late... Thank you so much! Works fine for me smile.gif

This post has been edited by TomasPin: Jul 25 2013, 05:05


--------------------
A man and his music: http://tubular.net/
Go to the top of the page
+Quote Post
Manchesterer
post Jul 25 2013, 08:19
Post #1504





Group: Members
Posts: 25
Joined: 2-August 11
Member No.: 92721



IŽm getting double seekbar slider with version 0.2.40, GDI, foobar2000 v1.2.8.

http://postimg.org/image/3nnzdm1pl/
Go to the top of the page
+Quote Post
Zao
post Jul 25 2013, 11:39
Post #1505





Group: Members (Donating)
Posts: 899
Joined: 25-September 03
From: Umeć, Sweden
Member No.: 9001



Manchesterer: Yup, there's a known bug where it always displays the seek location indicator in the GDI frontend.


--------------------
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.
Go to the top of the page
+Quote Post
continous
post Jul 26 2013, 00:35
Post #1506





Group: Members
Posts: 7
Joined: 23-July 13
Member No.: 109228



I'm getting Direct 3D to work, but the "Frontend Settings..." button is unresponsive, where as all else are. Minor issue, should require minor fix.
Go to the top of the page
+Quote Post
Wander
post Jul 26 2013, 08:23
Post #1507





Group: Members
Posts: 46
Joined: 25-May 11
From: Germany
Member No.: 90967



Take a look at the console output, it's probably falling back to GDI. Therefore the "Frontend Settings..." doesn't work.
Go to the top of the page
+Quote Post
Zao
post Jul 26 2013, 08:29
Post #1508





Group: Members (Donating)
Posts: 899
Joined: 25-September 03
From: Umeć, Sweden
Member No.: 9001



« Minor issue, should require minor fix. » -- Famous last words.

As Wander alluded to, the configuration dialog isn't that well wired up with the actual element state, so some things like the frontend settings button will remain enabled and do-nothing.


--------------------
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.
Go to the top of the page
+Quote Post
continous
post Jul 26 2013, 09:55
Post #1509





Group: Members
Posts: 7
Joined: 23-July 13
Member No.: 109228



QUOTE (Zao @ Jul 25 2013, 23:29) *
« Minor issue, should require minor fix. » -- Famous last words.

As Wander alluded to, the configuration dialog isn't that well wired up with the actual element state, so some things like the frontend settings button will remain enabled and do-nothing.

So, you tricked me? :C
Go to the top of the page
+Quote Post
continous
post Jul 27 2013, 04:24
Post #1510





Group: Members
Posts: 7
Joined: 23-July 13
Member No.: 109228



I found the error. Turns out I had a WIP component loaded and it was conflicting with your component's D3D
Go to the top of the page
+Quote Post
Zao
post Jul 27 2013, 08:32
Post #1511





Group: Members (Donating)
Posts: 899
Joined: 25-September 03
From: Umeć, Sweden
Member No.: 9001



What on earth could such a component be doing? I'm now genuinely curious.
By the way, if you're using D3D9, don't forget to D3DCREATE_FPU_PRESERVE.


--------------------
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.
Go to the top of the page
+Quote Post
grunz
post Aug 5 2013, 18:52
Post #1512





Group: Members
Posts: 2
Joined: 20-June 13
Member No.: 108747



QUOTE (Zao @ Jun 23 2013, 05:05) *
Older versions are available for testing purposes, so if you can find the version change where it stops working it would help me find out if it's something I did and what the reason might be. Make sure you look at the console and see if it succeeds at loading the Direct3D9 frontend or if it's falling back to GDI mode.

Regarding the problem i mentioned using the waveform-seekbar with wine, I just tested the different plugin versions and found out that it stopped working for me with v0.2.36.2. Version 0.2.36.1 was still working, though.
The only output that is printed to the console is this:

RegisterShellHookWindow failure
Watching: Z:\mnt\nas-multimedia\mp3
Album List refreshed in: 0:04.545933
UI Element instantiation failure: Unknown exception

Later versions won't even allow foobar2k to start - it immediately crashes with a runtime error caused by the visual c++ runtime library. If i can contribute anything else to fix the issue, i would be more than willing to help!!
Go to the top of the page
+Quote Post
Zao
post Aug 5 2013, 21:38
Post #1513





Group: Members (Donating)
Posts: 899
Joined: 25-September 03
From: Umeć, Sweden
Member No.: 9001



The only way to get versions past that to work is completely rewrite all the threading and concurrency code to not use the C++ standard library from Visual C++ 2012 or 2013.

Those runtimes rely on functions (NUMA hardware information) that Wine has stubbed out and which the runtime doesn't expect failure from, as they should never be able to fail on a real Windows implementation.

Until some brave and bored soul makes the effort to implement all the minefield functionality that the runtime needs, the component will continue to not load.

It's reasonably trivial to hack around on a private Wine, but way more annoying to get it into upstream.

Of course, I could painstakingly roll my own threading bits and bobs, but that's nothing I dare release into the public, as there's a lot of tricky parts in my use of the existing primitives. The seekbar code relies on a lot of recursive mutexes thanks to sloppy design, and trying to unravel it has had some interesting results.

And of course, all this work doesn't help the fact that Wine's "support" for D3DX9 effects is very incomplete and unfortunately partially stubbed, so I can't detect it until far into the frontend instantiation process.

I'm quite tempted to kill off the whole frontend business and have one single slightly configurable checkbox clusterhug of a frontend, dropping the whole effect concept. At least then it would have a chance of working on such spotty platforms.


--------------------
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.
Go to the top of the page
+Quote Post
free30
post Aug 7 2013, 16:48
Post #1514





Group: Members
Posts: 10
Joined: 21-September 10
Member No.: 84037



Thanks I love this plugin.
It really makes Foobar for me.

It would be great to have the position line glide more and not seemingly stagger to each refresh.
No biggy just be better.

Umm I'm using the most up-to-date version and Direct 3d setting with a config file from this tread.

Thanks for all the great work. rolleyes.gif
Go to the top of the page
+Quote Post
Zao
post Aug 7 2013, 22:15
Post #1515





Group: Members (Donating)
Posts: 899
Joined: 25-September 03
From: Umeć, Sweden
Member No.: 9001



There is an advanced preferences setting to adjust the repaint rate.
You may need to bump it up a bit if you are using an effect with a narrow bar, as those tend to be a bit less subtle when they move around. If the problem you see is a shimmer, you may have to lower the contrast of your colours or make the bar wider.

Preferences -> Advanced -> Tools -> Waveform Seekbar -> Percentage of base display rate to display at (1-400%).


--------------------
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.
Go to the top of the page
+Quote Post
free30
post Aug 8 2013, 21:22
Post #1516





Group: Members
Posts: 10
Joined: 21-September 10
Member No.: 84037



QUOTE (Zao @ Aug 7 2013, 22:15) *
There is an advanced preferences setting to adjust the repaint rate.
You may need to bump it up a bit if you are using an effect with a narrow bar, as those tend to be a bit less subtle when they move around. If the problem you see is a shimmer, you may have to lower the contrast of your colours or make the bar wider.

Preferences -> Advanced -> Tools -> Waveform Seekbar -> Percentage of base display rate to display at (1-400%).


Thanks.
I've moved it from 100 to 400 and its a bit better.
Your right I have a narrow bar and high contrast.
Thanks again.
Go to the top of the page
+Quote Post
slyman
post Aug 18 2013, 09:49
Post #1517





Group: Members
Posts: 22
Joined: 29-March 11
Member No.: 89385



would it be possible to make the "highlight" or part that's already played, invert the color of the waveform and bg? so like if the waveform was white on a black background, the waveform would become black on a white bg.

also, i noticed that this lacks the ability to scroll through the song with the scroll wheel while the mouse pointer is over the seekbar. this is possible with the default seekbar.

This post has been edited by slyman: Aug 18 2013, 10:04
Go to the top of the page
+Quote Post
Zao
post Aug 18 2013, 10:51
Post #1518





Group: Members (Donating)
Posts: 899
Joined: 25-September 03
From: Umeć, Sweden
Member No.: 9001



The look you desire can be achieved by writing a suitable effect for the Direct3D9 frontend. For the other frontends you're currently out of luck.
The mouse wheel seek has been requested before and hasn't been implemented because of me never remembering to do it, and not wanting to figure out in what steps the default seekbar jumps.


--------------------
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.
Go to the top of the page
+Quote Post
slyman
post Aug 18 2013, 22:20
Post #1519





Group: Members
Posts: 22
Joined: 29-March 11
Member No.: 89385



QUOTE (Zao @ Aug 18 2013, 05:51) *
The look you desire can be achieved by writing a suitable effect for the Direct3D9 frontend. For the other frontends you're currently out of luck.
The mouse wheel seek has been requested before and hasn't been implemented because of me never remembering to do it, and not wanting to figure out in what steps the default seekbar jumps.

thanks smile.gif

just did it and it's kind of funny since i didn't even really know what i was doing.

first took the code that skullinsky posted on the last page and then propheticus' and wasted a bunch of time trying to figure out the differences only to realize they were pretty much the same besides propheticus' normalization (which i used). i guess it wasn't that much of a waste since i was able to figure out some things and tweak them to how i wanted.

anyway, ended up just adding this line to the identifiers

float4 foregroundColor : FOREGROUNDCOLOR;

then found the line that said backgroundColor and changed it to foregroundColor just to see what it would do and it did what i wanted haha.



here's the whole code, i'm using propheticus' normalization, a solid wave and a seekbar with a thickness of 2

CODE
Texture1D tex : WAVEFORMDATA;

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 chan_mag : CHANNELMAGNITUDE; // Requires "foo_wave_seekbar" version 0.2.34 or better
float4 track_mag : TRACKMAGNITUDE; // Requires "foo_wave_seekbar" version 0.2.34 or better
float4 backgroundColor : BACKGROUNDCOLOR;
float4 foregroundColor : FOREGROUNDCOLOR;
float4 highlightColor : HIGHLIGHTCOLOR;
float4 selectionColor : SELECTIONCOLOR;
float4 textColor : TEXTCOLOR;
float cursorPos : CURSORPOSITION;
bool cursorVisible : CURSORVISIBLE;
float seekPos : SEEKPOSITION;
bool seeking : SEEKING;
float2 viewportSize : VIEWPORTSIZE;
bool horizontal : ORIENTATION;
bool shade_played : SHADEPLAYED;
bool flipped : FLIPPED;

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);

//- NORMALIZE/RESCALE ALL WAVEFORMS TO FILL PANEL EDGE-TO-EDGE -
//Requires "foo_wave_seekbar" version 0.2.34 or better - see changelog
//This variation will map the range [-1,1] to [min_peak,max_peak].
input.tc.y = (input.tc.y + 1)/2 * (chan_mag.g - chan_mag.r) + chan_mag.r;
//This variation will map the range [-1,1] to [-largest_peak,largest_peak]
//input.tc.y = input.tc.y * max(abs(chan_mag.r), abs(chan_mag.g));

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);
}

if (flipped)
output.tc.x = 1.0 - output.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 evaluate(float4 bg, float4 fg, float factor)
{
return saturate(lerp(bg, fg, factor));
}

float4 played( float pos, float2 tc, float4 bg, float factor)
{
float4 c = bg;
if (pos > tc.x)
{
c = evaluate(backgroundColor, highlightColor, factor);
}
return c;
}

float RMSfactor( float2 tc, float border )
{
float4 minmaxrms = tex1D(sTex, tc.x);

minmaxrms.rgb *= 0.95 + 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 + .5 * saturate(factorRms / border / 100)): 1.0;
factor = insideWave ? (factor * saturate(factorWave / border / .5)) : 0; //1 = max sharp

return factor;
}

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 = 1 * dx;
float positionWidth = 2 * dx;

float factor = RMSfactor(input.tc, 2.5 * dy);

float4 c0 = evaluate(foregroundColor, textColor, factor);
if (shade_played)
c0 = played(cursorPos, input.tc, c0, factor);
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();
}
}


i was just messing with the colors and realized that this actually only makes the unshaded background black. so it's only a partial solution but it will work since that's kind of what i wanted to do anyway..

anyone know how to do it? i tried something like backgroundColor = foregroundColor under if (shade_played) but that doesn't work haha

This post has been edited by slyman: Aug 18 2013, 22:31
Go to the top of the page
+Quote Post
Zao
post Aug 18 2013, 22:52
Post #1520





Group: Members (Donating)
Posts: 899
Joined: 25-September 03
From: Umeć, Sweden
Member No.: 9001



I took the original effect by Propheticus and stripped out all the stuff that you didn't want.
The names of functions and values remain whatever they were.
The place to do the reversal is in played, swapping textColor (which is what you think of as foreground) and backgroundColor.
What your :FOREGROUNDCOLOR semantic did was just read from an unbound parameter, probably blackness.
CODE
texture tex : WAVEFORMDATA;

sampler sTex = sampler_state
{
Texture = (tex);
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = 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 flipped : FLIPPED;
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);
}

if (flipped)
output.tc.x = 1.0 - output.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 evaluate(float4 bg, float4 fg, float factor)
{
return saturate(lerp(bg, fg, factor));
}

float4 played( float pos, float2 tc, float4 bg, float factor)
{
float4 c = bg;
if (pos > tc.x)
{
c = evaluate(textColor, backgroundColor, factor);
}
return c;
}

float RMSfactor( float2 tc, float border )
{
float4 minmaxrms = tex1D(sTex, tc.x);

// uncomment code below to use replaygain
if(replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 1.2; //use album gain
}
else if(replayGain.g != -1000){
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 1.2; //use track gain
}
else {
minmaxrms.rgb *= 0.8 + minmaxrms.a;
}

//without replaygain (comment out when using the code above)
minmaxrms.rgb *= 0.8 + 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 factor = insideWave ? (saturate(factorWave / border / 1)) : 0.0; //1 = max sharp
return factor;
}

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 = 1 * dx;
float positionWidth = 1 * dx;

float factor = RMSfactor(input.tc, 2.5 * dy);

float4 c0 = evaluate(backgroundColor, textColor, factor);
if (shade_played)
c0 = played(cursorPos, input.tc, c0, factor);
c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible);
c0 = bar(seekPos, input.tc, selectionColor, c0, seekWidth, seeking );
return c0;
}

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



--------------------
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.
Go to the top of the page
+Quote Post
slyman
post Aug 18 2013, 23:12
Post #1521





Group: Members
Posts: 22
Joined: 29-March 11
Member No.: 89385



ah awesome thank you, i appreciate the help
Go to the top of the page
+Quote Post
olegausa
post Aug 19 2013, 03:32
Post #1522





Group: Members
Posts: 14
Joined: 19-May 10
Member No.: 80740



QUOTE (Zao @ Aug 18 2013, 16:52) *
I took the original effect by Propheticus and stripped out all the stuff that you didn't want.
The names of functions and values remain whatever they were.
The place to do the reversal is in played, swapping textColor (which is what you think of as foreground) and backgroundColor.
What your :FOREGROUNDCOLOR semantic did was just read from an unbound parameter, probably blackness.
CODE
texture tex : WAVEFORMDATA;

sampler sTex = sampler_state
{
Texture = (tex);
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = 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 flipped : FLIPPED;
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);
}

if (flipped)
output.tc.x = 1.0 - output.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 evaluate(float4 bg, float4 fg, float factor)
{
return saturate(lerp(bg, fg, factor));
}

float4 played( float pos, float2 tc, float4 bg, float factor)
{
float4 c = bg;
if (pos > tc.x)
{
c = evaluate(textColor, backgroundColor, factor);
}
return c;
}

float RMSfactor( float2 tc, float border )
{
float4 minmaxrms = tex1D(sTex, tc.x);

// uncomment code below to use replaygain
if(replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 1.2; //use album gain
}
else if(replayGain.g != -1000){
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 1.2; //use track gain
}
else {
minmaxrms.rgb *= 0.8 + minmaxrms.a;
}

//without replaygain (comment out when using the code above)
minmaxrms.rgb *= 0.8 + 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 factor = insideWave ? (saturate(factorWave / border / 1)) : 0.0; //1 = max sharp
return factor;
}

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 = 1 * dx;
float positionWidth = 1 * dx;

float factor = RMSfactor(input.tc, 2.5 * dy);

float4 c0 = evaluate(backgroundColor, textColor, factor);
if (shade_played)
c0 = played(cursorPos, input.tc, c0, factor);
c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible);
c0 = bar(seekPos, input.tc, selectionColor, c0, seekWidth, seeking );
return c0;
}

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



Thanks a lot it also works with other foreground colors
Go to the top of the page
+Quote Post
lynxx
post Aug 20 2013, 17:53
Post #1523





Group: Members
Posts: 6
Joined: 23-June 08
Member No.: 54783



Zao, thank you very much for this plugin! I always had this feeling that a simple seek-bar wasn't good enough to navigate through a song.
Go to the top of the page
+Quote Post
hgodzillay
post Sep 5 2013, 19:24
Post #1524





Group: Members
Posts: 6
Joined: 24-February 13
Member No.: 106853



since today i get instant crash on foobar
i reinstalled all and copy paste my configuration folder = instant crash
removed components one by one and seekbar is the problem

downloaded last version of seekbar = instant crash tongue.gif
what the ..
Go to the top of the page
+Quote Post
Zao
post Sep 5 2013, 22:10
Post #1525





Group: Members (Donating)
Posts: 899
Joined: 25-September 03
From: Umeć, Sweden
Member No.: 9001



hgodzillay: Try moving away the wavecache.db, it may have been corrupted and cause integrity failure.
What OS, UI component, foobar2000 version, etc. is this?


--------------------
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.
Go to the top of the page
+Quote Post

70 Pages V  « < 59 60 61 62 63 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th July 2014 - 00:57