Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_wave_seekbar (Read 810221 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_wave_seekbar

Reply #1651
In order to not screw up crash reporting and auto-updating, I'm going to in the future only ever use the first three version number digits, reserving the fourth to be the number of commits since the release on the develop branch. (this is much like the format from 'git describe HEAD').

So 0.2.42.2-gbc95729 is two commits into the develop branch since 0.2.42 was released, the latest of which has commit hash-like bc95729 which can be looked up on Github.
Stay sane, exile.

foo_wave_seekbar

Reply #1652
Thank you, Zao. The new version works like intended and flawlessly.
I don't think that there has something to be done on the multiplier of max. 50 (notches per track).
Your code does not depend on waveform seekbar size. Good work!

foo_wave_seekbar

Reply #1653
While we're on the subject of the new scroll-to-seek function.. could you possibly allow disabling it? I have my playlist view right above the seekbar and I've actually accidentally scrolled the seekbar twice already (it's a Logitech Microgear scrollwheel, so it can be pretty sensitive, but it doesn't bother me in other apps). Thanks.


foo_wave_seekbar

Reply #1655
My apologies if my query is answered in this long thread after all and I've simply failed to find the answer that was here all along - but I'm confused about the display, as to whether it's supposed to be mono or stereo. I use the D2D display, and it could be interpreted as either a single waveform hollowed out or as two channels of a stereo display. However, I've tried playing a file with contents of one track deleted and I get the same 'hollow' waveform appearance, so I assume that I'm getting mono - particularly as the only checkbox that produces any waveform at all is Front Centre Mono, which actually doesn't make sense to me because my recordings are all normal 2-channel stereo, and I have Downmix display set to Keep as-is (though I see no difference no matter which of those three options I choose).

I would actually like Waveform Seekbar to display in stereo if it is able to do so. So, any ideas of what I need to do to get a genuine stereo display, either with two discrete waveforms or the upper side being left and the lower side being right channel?  Or have I misunderstood the configuration options, and the actual display is really always mono?

Incidentally, I've been using this component for a fair few years now, and I really depend on it, and thus I greatly appreciate the good work that's been done to produce it.
-- Philip.

foo_wave_seekbar

Reply #1656
The D2D frontend draws a hollowed out waveform for each channel.

My psychic debugging hat tells me that you have most likely got the checkbox in advanced preferences checked to "Store analysed tracks in mono". This means that you need to rescan any tracks that were scanned with it in effect if you want any changes to apply.

If you can't be bothered hunting them all down, there's a menu option to remove all waveforms, or you could just remove the wavecache.db file.
Stay sane, exile.

foo_wave_seekbar

Reply #1657
That's it - Brilliant! -- Thanks so much, Zao!

Yes, I've now got proper stereo display. And I can see that I wasn't really being all that thick, either, because the necessary options were tucked away in places that one would hardly think to look until one pretty intimately knows the considerable intricacies of Foobar2000 configuration! 

Anyway, good on you - a great piece of work!
-- Philip.

foo_wave_seekbar

Reply #1658
Version 0.2.43 broke "my" config which was ok until version 0.2.40.

0.2.40
0.2.43

I use the code from Zao from post #1520 ( [a href='index.php?act=findpost&pid=842465']source[/a] ) and since 0.2.41 the wave form is moved from the middle to the top of the panel.
(Configuration: "Mix-down to mono" and selecting only "Front center (mono))".

Tried to repair it but I just don't understand coding.

Can somebody please give me a clue?


BTW: Thanks a lot for this component!

foo_wave_seekbar

Reply #1659
I knew I shouldn't have updated. Same issue as dinodisc, and I'm using the same code with altered colors...

edit: for some reason, you now have to shift the waveform by 0.75
so to get it to work you will have to change

output.tc = float2((input.tc.x + 1.0) / 2.0, input.tc.y);

to

output.tc = float2((input.tc.x + 1.0) / 2.0, input.tc.y + 0.75);

(line 50 in my version of the script)

edit2: I'm interested in why it's now necessary. Also, it seems like the colors need an adjustment as well...



foo_wave_seekbar

Reply #1660
Thanks ChronoSphere.

If I edit this line (line 47 in my, the original, version of the script) things look better but than I notice that, apparently, the upward shift is dependent on the loudness of the track!

foo_wave_seekbar

Reply #1661
I'm not quite sure how to fix it completely, I was just poking around the code without knowing what I'm doing, looking for any values related to the y-axis. For me, the inner wave color is still misaligned even after that, so I hope someone can fix that... we'll have to wait for anyone to be interested enough, I guess.

foo_wave_seekbar

Reply #1662
I am in the dark too! I really like this inverted scheme, so we'll have to wait indeed.

foo_wave_seekbar

Reply #1663
i *think* this fixes it.

Code: [Select]
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);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
if (replayGain.g != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.g) / 20); //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20); //use album gain
}

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

foo_wave_seekbar

Reply #1664
dinodisc, Chronosphere: I think you have run into the same issue as this poster. Ultimately, the cause is a change in the texture formats used by the component ("Delay-load D3D9/D2D1, only use RGBA8 textures instead of RGBA32F or RGB10A2."). Zao describes the necessary changes to effects in the following posts, particularly this one.

foo_wave_seekbar

Reply #1665
The original effect that you people linked to was broken all along on any machine that didn't have floating point textures. When I removed the pointless (huhu) use of floating point textures in my component his bug was exposed to everyone.
The shader code in post #1634 ought to be fixing those lopsidedness problems the original author introduced.
Stay sane, exile.

foo_wave_seekbar

Reply #1666
As for "knew I shouldn't have updated"; there's lots of "fun" in finding out new and amazing bugs that I didn't catch, report them, and get eternal glory. 
Stay sane, exile.

foo_wave_seekbar

Reply #1667
The "knew I shouldn't have updated" was referring to the fact I read dinodisc's post right before I updated
Thanks for the fast response, though after messing around with the code so much, I can't tell if the code is now "fixed" for me or not.

Might be me, but the playback cursor seems to be thicker. Can I change it's width? Ideally, I only want to see shaded and unshaded progress, no cursor.
edit: how do I invert the wave? for me the outer wave is lighter than inner wave, in the previous code it was the other way around :x
also, my other code had a "stretch to fit height" part... sorry if that's too many requests at once ^^

foo_wave_seekbar

Reply #1668
As for "knew I shouldn't have updated"; there's lots of "fun" in finding out new and amazing bugs that I didn't catch, report them, and get eternal glory. 

OK  Versions 0.2.41 and 0.2.43 don't seem to do anything when I ask them to Extract Seekbar Signature.  0.2.40 (and many others before that I've used) always worked.  I don't know what I might be doing different than other users.  I'm storing analyzed tracks in mono and using incremental update.  I don't have "Analyze tracks not in library" nor "Always rescan if requested by user" set.  I have concurrent scanning threads set to 1.  I often force a scan of SACD iso's to avoid the fan noise when I first play them, but the last two versions weren't scanning run of the mill flacs either.  My wavecache.db is about 320 Megs but it was quite a bit bigger before I killed it and changed to storing in mono.

foo_wave_seekbar

Reply #1669
I know, but with this script (i don't know if its with Direct3D 9.0c at all) channels are swapped, but not with GDI or Direct2D 1.0.
So i guessed there's something wrong with this script or with Direct3D?

Edit: With other words: when i move the front right channel at the top of the list and front left below it it is displayed as front left on top and front right below in Direct3D (or this script only).

This D3D9 specific problem should be fixed in version 0.2.44.

Might be me, but the playback cursor seems to be thicker. Can I change it's width? Ideally, I only want to see shaded and unshaded progress, no cursor.
edit: how do I invert the wave? for me the outer wave is lighter than inner wave, in the previous code it was the other way around :x
also, my other code had a "stretch to fit height" part... sorry if that's too many requests at once ^^

For the cursor, modify the positionWidth of c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible); or remove the line of code completely.
For swapping the colours, I don't follow the author's logic in the source code enough to say at a glance.
For stretching to height:
* Add a semantic at the top with the other ones: float4 track_magnitude : TRACKMAGNITUDE;
* Add in RMSfactor between the RG computation and the declaration of belowWave: minmaxrms.rgb /= max(-track_magnitude.r, track_magnitude.g); // R is minimum, G is maximum

OK  Versions 0.2.41 and 0.2.43 don't seem to do anything when I ask them to Extract Seekbar Signature.  0.2.40 (and many others before that I've used) always worked. I have concurrent scanning threads set to 1.

It is quite possible that there's some corner case occuring here, considering that I around then ripped out and replaced most of the multithreading code. I'll see if I can reproduce the problem eventually.
Stay sane, exile.

foo_wave_seekbar

Reply #1670
OK  Versions 0.2.41 and 0.2.43 don't seem to do anything when I ask them to Extract Seekbar Signature.  0.2.40 (and many others before that I've used) always worked. I have concurrent scanning threads set to 1.

It is quite possible that there's some corner case occuring here, considering that I around then ripped out and replaced most of the multithreading code. I'll see if I can reproduce the problem eventually.

With a little more testing things work fine if my CPU is not loaded.  When I have 3 of 4 cores loaded "Extract Seekbar Signature" doesn't seem to do anything: no more CPU usage.  For that matter playing a flac that never had an extraction with 3 of 4 cores busy doesn't do an extraction.  If I close foobar2000 and restart it then they extract...

foo_wave_seekbar

Reply #1671
i *think* this fixes it.
Thanks marc2003, this indeed fixes it!

Also thanks to Zao and foosion altough I will not pretent I understand it all!

foo_wave_seekbar

Reply #1672
For stretching to height:
* Add a semantic at the top with the other ones: float4 track_magnitude : TRACKMAGNITUDE;
* Add in RMSfactor between the RG computation and the declaration of belowWave: minmaxrms.rgb /= max(-track_magnitude.r, track_magnitude.g); // R is minimum, G is maximum

Thanks, the cursor worked. The stretching doesn't work with RG calculation part active (adding the line doesn't change anything), but removing the RG part stretches it as expected, so it's fine as it is.

Actually, that line doesn't seem to change anything, if I comment it out, the wave stays maximized.. oh well, it still works :3


foo_wave_seekbar

Reply #1674
Mu-mu-mu-multikill!

See, this is what you get for wholesale replacing your concurrency infrastructure to help Wine users whose upstream hates progress.
Might be message pump starvation, might be leaking resources, might be clobbering memory.
I know what I'm doing this weekend then.. 

Dandruff: Could you see if it's indeed introduced in 0.2.41, and that 0.2.40 does The Right Thing?
0.2.40 download
0.2.41 download

Common thread seems to be internet streams, so possibly something on the analysis side of things.
Stay sane, exile.