HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: Zao on 2010-01-03 19:20:53

Title: foo_wave_seekbar
Post by: Zao on 2010-01-03 19:20:53
Changelog:
Component release changelog (https://github.com/zao/foo_wave_seekbar/wiki/Changelog)

Description:
It's an UI element for both the Default UI and Columns UI that provides seekbar functionality (seeking, position indicator) on top of a pretty image of the waveform of the currently playing song, drawn using either Direct3D 9.0c, Direct2D 1.0 or GDI.
The Direct3D 9.0c mode requires a PS2.0 capable card, and has some support for strange cards like the Intel 945. The HLSL effect can be modified with the embedded text editor to further customize the look.
To avoid having to scan tracks on the fly, the component can extract the waveform signature of a song in advance through a context menu item. The process works in the background and resumes after closing foobar2000. It will automatically analyse the currently playing song and other tracks that are likely to be used soon, which should give an appearance of always having the visuals available.
The seekbar has three frontends and some per-instance customizable settings accessible through the UI element context menu, as well as seeking functionality if you click and drag, like the regular seekbar.
If your machine is not capable of running the Direct3D9 or Direct2D modes, the GDI mode should work as a fallback on any machine that foobar2000 can run on, as it only requires Windows XP and GDI.

Links:
foo_wave_seekbar component page (http://www.foobar2000.org/components/view/foo_wave_seekbar)

The Direct3D 9.0c mode requires the DirectX end-user runtime dated earliest February 2010, which can be installed through use of the DirectX end-user Runtime Web Installer (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en) (make sure to not accidentally install the Bing Bar they try to force on you).
Note that the DirectX redistributable is required on all OSes no matter whether you think you "have DirectX installed already, lol" or not.

The Direct2D 1.0 mode requires either Windows Vista SP2 or Windows 7 and up. For Vista SP2 it requires installation of the Platform Update (http://support.microsoft.com/kb/971644).

Versions above 0.2.45 require the Visual Studio 2010 SP1 (x86) runtime once again as I value XP and Wine compatibility. From 0.2.45.3 and onward, I attempt to bundle it in the component to avoid upgrades causing the component to stop working due to added requirements.

Installation:
- Download the .fb2k-component file from the components page.
- Install the dependencies needed as per the Links section above.
- Doubleclick the file or drag it onto the foobar2000 components pane in the preferences or navigate to it with the Install button as with any other component.

Usage:
- Highlight one or more files in your playlist. Rightclick on them and use the context menu items to "Extract Seekbar Signature"
- Add UI element to the Default UI or Columns UI as normal (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Layout_Editing_Mode)
- The backing storage does not know or care about file operations like moving, renaming and such. In order to remove dead items from the storage or compact the storage, there are menu items for that under the Library main menu.

Future changes:
- Lots.

Bio:
I'm a software developer in northern Sweden. I like electronic cats and writing software that occasionally does what it should.
If all you want to do is shout good or bad things at me about this component, there's always this thread to post in.
If you for some reason feel a reason to give me money I can spend irresponsibly on beer and Red Bull, you can use this shiny PayPal button - (https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif) (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KUXVUBSGQVJPG)
Title: foo_wave_seekbar
Post by: Jens Rex on 2010-01-03 19:23:18
Fix 120 DPI mode!
Title: foo_wave_seekbar
Post by: yandexx on 2010-01-03 19:24:11
BIG UP
Title: foo_wave_seekbar
Post by: bb10 on 2010-01-03 19:26:20
Yaay!
Title: foo_wave_seekbar
Post by: StuPC on 2010-01-03 19:55:25
It doesn't seem to like Windows 7, presumably because it's on DX 10 -

"Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000."

And I was looking forward to seeing this, too :-(
Title: foo_wave_seekbar
Post by: Andreasvb on 2010-01-03 19:59:37
Works fine for me on Windows 7, and it's DX 11.

One question. Where's the database kept?

Thanks.
Title: foo_wave_seekbar
Post by: Bollerkopp on 2010-01-03 20:00:12
"Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000."


The same here on XP incl. SP3 (beta 6).
Title: foo_wave_seekbar
Post by: wojtek on 2010-01-03 20:01:56
Quote
"Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000."


same here, win7 x64
Title: foo_wave_seekbar
Post by: Andreasvb on 2010-01-03 20:02:43
Try this runtime and see if it works: http://www.microsoft.com/downloads/details...;displaylang=en (http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en)
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-03 20:04:18
Thanks for horrible Intel on-board support 
I sent crash report and back to fast 0.27
Title: foo_wave_seekbar
Post by: The Link on 2010-01-03 20:04:42
@people getting "Failed to load DLL: foo_wave_seekbar.dll"
The Direct3D 9.0c mode requires a PS2.0 capable card, and has some hacks to support horrible cards like the Intel 945. The HLSL effect (in the effects directory) can be modified using any text editor to customize the look further. Furthermore, it requires installation of the DirectX August 2009 runtime redistributable (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en).
Title: foo_wave_seekbar
Post by: Chaser on 2010-01-03 20:12:17
Could somebody please post a screenshot?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-03 20:13:05
It doesn't seem to like Windows 7, presumably because it's on DX 10 -

"Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000."

And I was looking forward to seeing this, too :-(

The D3D9 mode works on all OSes, albeit a silly typo may prevent the component from loading in XP currently.
Ensure that you have the August 2009 DXredist installed.

One question. Where's the database kept?

The database is stored in your foobar2000 profile directory as wavecache.db.

Could somebody please post a screenshot?

(http://www.acc.umu.se/~zao/seekbar19.png)
Title: foo_wave_seekbar
Post by: saivert on 2010-01-03 20:13:46
If you were one of the beta testers prior to the public release you must also remove foo_wave_cache.dll from your components directory as this is no longer needed and will conflict with the built-in wave cache component of foo_wave_seekbar.dll.
Title: foo_wave_seekbar
Post by: bb10 on 2010-01-03 20:23:10
Could somebody please post a screenshot?

D3D:
(http://bb10x.org/temp/D3D.png)

D2D:
(http://bb10x.org/temp/D2D.png)
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-03 20:28:11
thanks saivert, that was it
looks great
Title: foo_wave_seekbar
Post by: rol on 2010-01-03 20:35:26
awesome, thanks so much but "extrack seekbar signature" should be automatic.
Title: foo_wave_seekbar
Post by: bb10 on 2010-01-03 20:37:57
awesome, thanks so much but "extrack seekbar signature" should be automatic.

It is, it extracts the track you play and the next track too.
Title: foo_wave_seekbar
Post by: rol on 2010-01-03 20:39:45
oh right my bad, sorry.
Title: foo_wave_seekbar
Post by: marc2003 on 2010-01-03 20:39:51
thanks for this. i'll have to switch to DUI to use it though. it looks totally out of place in my CUI config.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-03 21:07:08
Note that you can customize the colors used in the configuration dialog from the context menu, if the global ones are not suitable.
Title: foo_wave_seekbar
Post by: skelly831 on 2010-01-03 21:14:48
This is really nice, works smoothly on my old Pentium D machine. I just want to ask for a tooltip that shows the bars' time when I drag it, like the standard seekbar so I can replace it completely.

Great component, thanks Zao

Quick thing I noticed: when in Direct3D mode, if I maximize the window, the played part of the waveform is no longer highlighted.
Title: foo_wave_seekbar
Post by: bb10 on 2010-01-03 21:22:48
Quick thing I noticed: when in Direct3D mode, if I maximize the window, the played part of the waveform is no longer highlighted.

The "shade played" feature has known bugs.
Title: foo_wave_seekbar
Post by: Gapkiller on 2010-01-03 21:23:48
Thank You for this awesome component.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-03 21:29:02
Shade played will stick properly when resizing in next version.
Title: foo_wave_seekbar
Post by: wojtek on 2010-01-03 21:30:02
Works beautifully after Direct upgrade.
Title: foo_wave_seekbar
Post by: Jack Schmaltz on 2010-01-03 21:39:35
dont know if im missing something here but i can not get this to load.
keep getting this:

Failed to load DLL: foo_wave_seekbar.dll
Reason: Wrong version number; this component appears to have been built with a newer version of the foobar2000 SDK, please download latest version of foobar2000 in order to use it.

i have installed the DirectX August 2009 runtime redistributable & already had the Microsoft Visual C++ 2008 Redistributable Package installed.
running v0.9.6.9 on Vista Ultimate SP2, any ideas? thanks
Title: foo_wave_seekbar
Post by: Zao on 2010-01-03 21:49:04
I would guess that the SDK most probably has 1.0 as a minimum version by default.
Also, it does not require the VC++ redist as it's statically linked against VC10's CRT.
Title: foo_wave_seekbar
Post by: Jack Schmaltz on 2010-01-03 21:54:42
fair enough, at least i know its not me being a numpty then.
so this is only for v1.0 of foobar then? will it be staying like this or will it be made compatible with the current stable version?
thanks for your time
Title: foo_wave_seekbar
Post by: Zao on 2010-01-03 22:16:08
The baseline will most probably be 1.0 as I cannot see any smooth way to support older ones except for modifying the SDK (would probably backfire horribly) or downgrade the SDK (no thanks).
Title: foo_wave_seekbar
Post by: ExtremeHunter on 2010-01-03 22:53:36
Thanks alot for this component!! 

Works fine on Windows 7 64bit.
Title: foo_wave_seekbar
Post by: dubpistol on 2010-01-03 22:54:58
Brilliant component.

Thank you!
Title: foo_wave_seekbar
Post by: insnowflakes on 2010-01-03 23:25:28
Great mod, thanks a lot.
Title: foo_wave_seekbar
Post by: mudlord on 2010-01-03 23:32:52
Thanks alot for this component!! 

Works fine on Windows 7 64bit.


Have to echo those sentiments. Works great on 64bit Win7 and with the Direct2D renderer.
Title: foo_wave_seekbar
Post by: Horst Fux on 2010-01-03 23:54:26
Just awesome, works perfect.

But needs a little bit time to analyse the song, though. It's great anyways.

One request:

In the normal seekbar I can abort the seeking by pressing Esc while holding the bar; would it be possible?

It's not like I need this feature everyday but sometimes.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-04 00:06:02
You can abort seeking by moving your cursor far enough away from the bar while dragging, much like scrollbars in Windows in general.
Title: foo_wave_seekbar
Post by: mudlord on 2010-01-04 01:08:09
Quote
But needs a little bit time to analyse the song, though.


Thats expected, as it needs to do a FFT on the stream to get the spectrum readout.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-04 01:19:05
No FFT needed, as it's min/max/rms amplitude over time. I haven't profiled it, but there's not much to improve; most of the cost is in IO, which I guess could be serialized to get sequential disk reads.
It already runs up to three concurrent worker threads for the scan jobs, so it's already taking advantage of multiple cores if available.
Title: foo_wave_seekbar
Post by: randal1013 on 2010-01-04 01:50:07
crashes my foobar when i try to place the component.

win7 x64, foobar 1.0 beta6



will directx 9.0c co-exist peacefully with directx 11?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-04 02:00:16
Yes, they coexist perfectly fine.
What kind of graphics hardware do you have? The crash is when trying to load the effect. Try 0.1.3.
Title: foo_wave_seekbar
Post by: NullString on 2010-01-04 02:35:17
works like a charm  gj
Title: foo_wave_seekbar
Post by: Zao on 2010-01-04 02:42:45
how does the db cope with moving of files, or tag modifications?
the scanning of tracks is fast and all that, but takes its time when considering lots of albums.

As mentioned in the first post, it doesn't track moved or renamed files. It associates the scanned data with the location (path + subsong) of the track.
Removing dead items and rescanning tends to be feasible, but I realize that things like moving your whole music library to a different drive or portable installs could be painful.
It is possible to change the locations in the storage database, but currently one has to resort to the standalone sqlite3 client as the component does not expose any such functionality yet.
Title: foo_wave_seekbar
Post by: NullString on 2010-01-04 03:50:26
how does the db cope with moving of files, or tag modifications?
the scanning of tracks is fast and all that, but takes its time when considering lots of albums.

It is possible to change the locations in the storage database, but currently one has to resort to the standalone sqlite3 client as the component does not expose any such functionality yet.

thanks, sounds interesting, maybe to make some reports with the data in the db, I'll give it a look
Title: foo_wave_seekbar
Post by: Snowknight26 on 2010-01-04 04:18:20
If only you could replace the toolbar's seekbar with this one..
Title: foo_wave_seekbar
Post by: midkay on 2010-01-04 04:27:48
this is awesome, thanks for the great work!
Title: foo_wave_seekbar
Post by: mudlord on 2010-01-04 06:36:49
No FFT needed, as it's min/max/rms amplitude over time. I haven't profiled it, but there's not much to improve; most of the cost is in IO, which I guess could be serialized to get sequential disk reads.
It already runs up to three concurrent worker threads for the scan jobs, so it's already taking advantage of multiple cores if available.


Thanks for the correction.
Title: foo_wave_seekbar
Post by: (Sly) on 2010-01-04 07:28:07
Works fine with Windows XP SP3, DirectX 9.0c latest and crappy Intel Mobile 965.

Nice component !!

I have 3 requests:

1. What about decentralized wavecache.db, as is thumbs.db for picture thumbnails. Every folder has it's own Database. Or even to write to ID3 tag in something like WAVEFORM.

2. A scanning engine like replaygain or foo_bpm.

3. For Default UI make it available as toolbar element, too.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-04 07:46:27
1. Per-folder databases could technically be possible, but they would interfere with things like the renamer deleting/moving old folder contents. As for storing them in tags, it too is technically possible.
2. Elaborate. Are you referring to some kind of progress bar? That is planned eventually.
3. There exists no SDK interface to make non-button toolbar elements.
Title: foo_wave_seekbar
Post by: dubpistol on 2010-01-04 08:35:31
I just want to ask for a tooltip that shows the bars' time when I drag it, like the standard seekbar

I follow up this question.
Title: foo_wave_seekbar
Post by: (Sly) on 2010-01-04 09:23:26
2. Yes. And a scan results window showing if some files failed to scan for example.

For big files like comedy shows (60min+) it should display intermediate results of the on-the-fly scanning. like Virtual DJ does.
Title: foo_wave_seekbar
Post by: ojdo on 2010-01-04 10:01:58
Thank you very much for this very promising component!

Bugs:
Feature request:
Title: foo_wave_seekbar
Post by: NullString on 2010-01-04 10:26:59
storing the data in the file tags would be awesome, besides it would take advantage of the compression of the fb2k database
Title: foo_wave_seekbar
Post by: fuflo on 2010-01-04 11:08:50
thanks for this great component. and well, since everybody's asking questions, i'll ask this - where are the settings saved? i don't see a separate config file in config dir. also checked registry - nothing's there. the settings are kept after deleting wavecache.db, so it's not there. also removing the component and then restoring it ( removing foo_wave_seekbar.dll ) doesn't remove the settings. where are they?
Title: foo_wave_seekbar
Post by: (Sly) on 2010-01-04 11:14:38
In the directory where foobar2000.exe is in file "wavecache.db"

There is no config file because it does need to save any configuration right now.
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-04 12:00:15
Looks like a nice component, but it doesn't work for me. I guess it's my 5 year old laptop not having good enough hardware. I get this in the console:

Seekbar: taking Direct3D9 path.
Seekbar: frontend creation failed: Direct3D9: could not create texture.

The panel draws whatever was on the screen previously, but it still acts as a seekbar. It seems to process the songs properly as well (i.e. create the waveforms). Is there anything I can do?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-04 12:46:10
I just want to ask for a tooltip that shows the bars' time when I drag it, like the standard seekbar

Planned eventually.

Bugs:
  • The panel is not correctly redrawn when switching (CUI) layouts: the waveform disappears and the whole panel is filled with the highlight colour. Correct appearance is restored when starting playback on a new song. Addition: The behaviour is equivalent to the second bug. The panel only visualises the song's first second.
  • When adding a second panel instance to the same or another layout, both panels stop working properly. No waveform is visible and the panel seems only to visualise the first second of the song, so the selection bar quickly "runs" through the panel and vanishes.

Feature request:
  • Allow mouse wheel to seek (just like the default seekbar does).

Those aren't bugs, those are features:
Things I didn't know existed:

storing the data in the file tags would be awesome, besides it would take advantage of the compression of the fb2k database

The foobar2000 database has compression? I do not believe so. I do need to look into whether it's feasible to compress this data.

thanks for this great component. and well, since everybody's asking questions, i'll ask this - where are the settings saved? i don't see a separate config file in config dir. also checked registry - nothing's there. the settings are kept after deleting wavecache.db, so it's not there. also removing the component and then restoring it ( removing foo_wave_seekbar.dll ) doesn't remove the settings. where are they?

The only settings it has currently is per instance of the UI panel/element, which are stored using the DUI/CUI configuration framework.

Looks like a nice component, but it doesn't work for me. I guess it's my 5 year old laptop not having good enough hardware. I get this in the console:

Seekbar: taking Direct3D9 path.
Seekbar: frontend creation failed: Direct3D9: could not create texture.

The panel draws whatever was on the screen previously, but it still acts as a seekbar. It seems to process the songs properly as well (i.e. create the waveforms). Is there anything I can do?

Ooh, fun.

I have a fallback path that is good enough for the horrible Intel cards, but apparently not horrible enough.
What kind of graphics hardware do you have?
The fallback path uses an A2R10G10B10 (2 bits alpha, 10 bits for each of red, green, blue) for the waveform data, but I suppose one might try A8R8G8B8 if that fails.
Title: foo_wave_seekbar
Post by: randal1013 on 2010-01-04 12:49:42
crashes my foobar when i try to place the component.

win7 x64, foobar 1.0 beta6



will directx 9.0c co-exist peacefully with directx 11?

i ended up having other windows problems to deal with last night. the seekbar works fine and looks cool.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-04 12:59:01
I guess zooming (middle scroll) is out of question? (in case some time grid is added as requested)
Title: foo_wave_seekbar
Post by: Zao on 2010-01-04 13:15:00
The data set used is rather sparse, just 2048 data points. You'd just be looking at interpolation when zooming or with a large enough window.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-04 13:23:07
I wouldn't mind seeing large blocks if it is feasible 
It's CEP/AU behavior I'm used to, scroll to zoom or middle click then slide to go right/left
Title: foo_wave_seekbar
Post by: Zao on 2010-01-04 13:27:35
I'll put that under the category »maybe if I'm horribly bored some day«.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-04 13:28:39
deal
Title: foo_wave_seekbar
Post by: Hengest on 2010-01-04 14:20:05
Well just to say thankyou for this component - it's really great .

Also, would it be possible to scale the waveform according to replaygain values for each track/album?
Title: foo_wave_seekbar
Post by: ojdo on 2010-01-04 15:33:42
Bugs: [...] The panel is not correctly redrawn when switching (CUI) layouts. [...]

Those aren't bugs, those are features: CUI probably does horrible things to my window when mangling layouts.

So this should be reported in the foo_ui_columns thread, right?
Title: foo_wave_seekbar
Post by: bbt-hh on 2010-01-04 16:17:04
Everything loads fine, but the Waveform Seekbar shows nothing than white space? Seeking works though. (Win XP SP3, Radeon 9550)
Title: foo_wave_seekbar
Post by: rol on 2010-01-04 16:57:44
Can u fix high CPU usage? On Win7 and Pentium 4 i have ~20%, without plugin 0%
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-04 17:09:57
What kind of graphics hardware do you have?

I have an Intel 82852/82855 GM/GME Graphics Controller: http://www.intel.com/support/graphics/intel852gm/index.htm (http://www.intel.com/support/graphics/intel852gm/index.htm)

I'll update my driver and see if that makes a difference.
Title: foo_wave_seekbar
Post by: bb10 on 2010-01-04 17:22:54
I have an Intel 82852/82855 GM/GME Graphics Controller: http://www.intel.com/support/graphics/intel852gm/index.htm (http://www.intel.com/support/graphics/intel852gm/index.htm)

I'll update my driver and see if that makes a difference.

I'm afraid you're out of luck.

Can u fix high CPU usage? On Win7 and Pentium 4 i have ~20%, without plugin 0%

Are you using D2D?
Title: foo_wave_seekbar
Post by: rol on 2010-01-04 17:49:31
DX 9.0c
Title: foo_wave_seekbar
Post by: Horst Fux on 2010-01-04 18:00:11
If only you could replace the toolbar's seekbar with this one..


You mean like this?


[a href="http://img527.imageshack.us/i/afsafs.jpg/" target="_blank"](http://img527.imageshack.us/img527/7393/afsafs.th.jpg) (http://www.abload.de/image.php?img=fbarqaav.jpg)
Title: foo_wave_seekbar
Post by: NullString on 2010-01-04 18:40:39
storing the data in the file tags would be awesome, besides it would take advantage of the compression of the fb2k database

The foobar2000 database has compression? I do not believe so. I do need to look into whether it's feasible to compress this data.

right, some compression would be appreciated. The .db file weights 730MB, and the compression ratio is like 75% (using rar). not that it matters, because the indexing of the data and the requirement of secuential reading to decompress the whole db would make it not feasible.

although these sqlite extensions might point you to a better approach, compressing each row with zlib:
http://www.mail-archive.com/sqlite-users@s...g/msg17018.html (http://www.mail-archive.com/sqlite-users@sqlite.org/msg17018.html)
(which is wrapped in a better way here)
http://geomapx.blogspot.com/2009/11/fts3-compression.html (http://geomapx.blogspot.com/2009/11/fts3-compression.html)
or an alternative,
http://lserinol.googlepages.com/sqlitecompress (http://lserinol.googlepages.com/sqlitecompress)
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-04 19:01:32
I'll update my driver and see if that makes a difference.

I've updated my driver, problem still exists
Title: foo_wave_seekbar
Post by: bb10 on 2010-01-04 19:23:09
I'll update my driver and see if that makes a difference.

I've updated my driver, problem still exists

A driver update won't resolve the non-existent DirectX 9 support of your GPU.
Title: foo_wave_seekbar
Post by: Andreasvb on 2010-01-04 19:29:05
I'll update my driver and see if that makes a difference.

I've updated my driver, problem still exists

A driver update won't resolve the non-existent DirectX 9 support of your GPU.

It says it's DX 9.0.
Quote
The Intel® 82830M and Intel® 82852/82855 GM/GME graphics controllers are compatible with versions of Microsoft* DirectX* up to 9.0.
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-04 19:51:54
A driver update won't resolve the non-existent DirectX 9 support of your GPU.

ok, I missed your reply. I think I have DirectX 9, it must be pixel shader support that I need. That was a problem for me with Shpeck+Milkdrop, I could only run a handful of presets.  (I didn't realise what PS meant in the OP )
Title: foo_wave_seekbar
Post by: bb10 on 2010-01-04 19:56:26
It says it's DX 9.0.
Quote
The Intel® 82830M and Intel® 82852/82855 GM/GME graphics controllers are compatible with versions of Microsoft* DirectX* up to 9.0.


Compatible != compliant.

ok, I missed your reply. I think I have DirectX 9, it must be pixel shader support that I need. That was a problem for me with Shpeck+Milkdrop, I could only run a handful of presets.  (I didn't realise what PS meant in the OP )

Yes, it has no pixel shaders which it needs to be fully directx9 compliant.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-04 20:49:23
I have an Intel 82852/82855 GM/GME Graphics Controller: http://www.intel.com/support/graphics/intel852gm/index.htm (http://www.intel.com/support/graphics/intel852gm/index.htm)

The Direct3D9 mode will not work on your hardware, as it's much like the Matrox Parhelia, having drivers built against the DX9 SDK but no real DX9 capabilities. For instance, querying the caps database shows a lack of both the A2R10G10B10 texture format and a supported pixel shader level of 0.0.

Also, would it be possible to scale the waveform according to replaygain values for each track/album?

In the Direct3D version, the effect has a variable that exposes the album gain/peak and track gain/peak. Some trivial math in the shader will do what you want, I haven't been bothered to look into what's in the ReplayGain values myself.
As for Direct2D, it requires explicit support from my side, as it doesn't have programmable shaders.

CUI probably does horrible things to my window when mangling layouts.

So this should be reported in the foo_ui_columns thread, right?

No. They're not Columns UI bugs, they are me not knowing about intended Columns UI behaviour and not testing much in it. musicmusic is not at fault here.

Everything loads fine, but the Waveform Seekbar shows nothing than white space? Seeking works though. (Win XP SP3, Radeon 9550)

Anything interesting in your console?

Can u fix high CPU usage? On Win7 and Pentium 4 i have ~20%, without plugin 0%

The component has a fixed update rate of 60Hz or so, which produces neglible CPU usage on my machine and GPU. I suppose it should probably be tunable.
Title: foo_wave_seekbar
Post by: StuPC on 2010-01-04 20:56:46
OK, here's a weird bug - I've installed the DX redistributable and followed all the instructions on this forum, but the component crashes every time I try and make it visible.  I'm using CUI on Windows 7 32-bit with a quadcore processor.  I've got the component installed and *sort of* displaying in my Layout BUT I can't make it visible.  At the moment it's obscured by the caption - if I untick "Show caption"OR if I try to stretch my foobar vertically so as to be able to see this component then my foobar instantly crashes.  This has now happened about 20 times in a row... :-(
Title: foo_wave_seekbar
Post by: bbt-hh on 2010-01-04 21:03:50
Quote
Everything loads fine, but the Waveform Seekbar shows nothing than white space? Seeking works though. (Win XP SP3, Radeon 9550)

Anything interesting in your console?

Not at all, thats why I noted 'everything loads fine'.
Console: Seekbar: taking Direct3D9 path. / Seekbar: Frontend initialized. / Wave cache: finished analysis of...
Title: foo_wave_seekbar
Post by: shakey_snake on 2010-01-04 21:18:05
It's great to have an "oohh shiny!" component that actual adds to my ability to browse and listen to my music (rather than distract from it, like most shiny components) because it actually lets me look inside my individual tracks.

Great work Zao.
This is a shining example of what third-party components should be about, IMO.
Title: foo_wave_seekbar
Post by: Hamallainen on 2010-01-05 00:05:23
Thank you for this great plugin.

I have 2 questions/requests :
- Is it possible to choose where is located wavecache.db, i'd prefer to have it at the root of my media library folder instead of within the foobar2000 folder.

- That would be nice it could display the according image of a track (for tracks already scanned) even if playback is stopped. A kind of follow cursor if playback is stopped. And then if this is possible that would be great if double-clicking the wave could start the playback at the desired position.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-05 01:42:41
0.1.4 should hopefully give better diagnostic output and crash less for people who haven't got the relevant runtimes installed or dependencies unmet.

I have 2 questions/requests :
- Is it possible to choose where is located wavecache.db, i'd prefer to have it at the root of my media library folder instead of within the foobar2000 folder.

- That would be nice it could display the according image of a track (for tracks already scanned) even if playback is stopped. A kind of follow cursor if playback is stopped. And then if this is possible that would be great if double-clicking the wave could start the playback at the desired position.

Global database location could be configurable, I guess.

Displaying the selected track when not playing has been suggested. I'm just a bit split on whether it should scan selected tracks automatically or only on playback.
As for searching by doubleclicking, that'd probably be possible.
Title: foo_wave_seekbar
Post by: smkk on 2010-01-05 02:32:29
Displaying every selected track would probably put alot of stress on the HDD, if you implement this please make it optional.
Thanks for this nice plugin.
Title: foo_wave_seekbar
Post by: rupert on 2010-01-05 03:40:13
FB1.0b6 and WaveSeekBar 0.1.4 produce an error like "Seekbar: taking Direct3D9 path. / Seekbar: frontend creation failed: / Direct3D9: could not create effects." :-/

O$: XPproSp3

DirectX Version: DirectX 9.0c (4.09.0000.0904)
Card name: ATI Radeon 9600 / X1050 Series

Registry: OK
DDraw Status: Enabled
D3D Status: Enabled
AGP Status: Not Available
DDraw Test Result: All tests were successful.
D3D7 Test Result: All tests were successful.
D3D8 Test Result: All tests were successful.
D3D9 Test Result: All tests were successful.

How can we better report the errors or ia a debug/log switch possible?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-05 04:50:04
If the effect failed to compile, you should have gotten errors in your console, so it's probably a missing file.
Did you extract the effects directory into your foobar2000 or profile directory?
The structure should be:
Code: [Select]
foobar2000/
` components/
  ` foo_wave_seekbar.dll
  effects/
  ` seekbar.fx
Title: foo_wave_seekbar
Post by: q_b6 on 2010-01-05 07:24:55
Cheers!
Works great! 

Does it consider replaygain tags when drawing?
Title: foo_wave_seekbar
Post by: sld on 2010-01-05 14:46:17
1.0.3 was crashing, but 1.0.4 runs! There's a slight problem on my setup, though: the peaks extend beyond the vertical space set for the seekbar, and the entire diagram seems to be offset downwards by quite a few pixels' worth. In other words, the 0 dB line isn't dead centre. Toggling the border setting provides no benefit.

I'm running Windows 7 build 7100, Foobar2000 1.0 beta 6, GMA945 Intel "Extreme" Graphics, using Direct2D 1.0 mode.
Title: foo_wave_seekbar
Post by: bbt-hh on 2010-01-05 16:23:55
Quote
Everything loads fine, but the Waveform Seekbar shows nothing than white space? Seeking works though. (Win XP SP3, Radeon 9550)
Console: Seekbar: taking Direct3D9 path. / Seekbar: Frontend initialized. / Wave cache: finished analysis of...
Unfortunately no changes with version 0.1.4.
Title: foo_wave_seekbar
Post by: rupert on 2010-01-05 19:49:45
If the effect failed to compile, you should have gotten errors in your console, so it's probably a missing file.
Did you extract the effects directory into your foobar2000 or profile directory?
The structure should be:
Code: [Select]
foobar2000/
` components/
  ` foo_wave_seekbar.dll
  effects/
  ` seekbar.fx


Uuhm, mea culpa!
It works (now).

THX, rupert
Title: foo_wave_seekbar
Post by: foosion on 2010-01-05 22:16:07
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 (http://foosion.foobar2000.org/misc/seekbar.fx.txt): Put this in your profile or installation directory in the effects subdirectory.
(http://foosion.foobar2000.org/misc/foo_wave_seekbar.png)
Title: foo_wave_seekbar
Post by: Zao on 2010-01-05 22:41:44
1.0.3 was crashing, but 1.0.4 runs! There's a slight problem on my setup, though: the peaks extend beyond the vertical space set for the seekbar, and the entire diagram seems to be offset downwards by quite a few pixels' worth. In other words, the 0 dB line isn't dead centre. Toggling the border setting provides no benefit.

I'm running Windows 7 build 7100, Foobar2000 1.0 beta 6, GMA945 Intel "Extreme" Graphics, using Direct2D 1.0 mode.

The Direct2D frontend may very well be misbehaving after making it behave in high DPI scenarios (in which it's broken again).

Quote
Everything loads fine, but the Waveform Seekbar shows nothing than white space? Seeking works though. (Win XP SP3, Radeon 9550)
Console: Seekbar: taking Direct3D9 path. / Seekbar: Frontend initialized. / Wave cache: finished analysis of...
Unfortunately no changes with version 0.1.4.

Somewhat odd. Currently I'm battling some elusive crashes so I haven't looked into this much yet.
A bunch of error checks for next version ought to give some more insight. Otherwise I guess you've got to use some other frontend like the primitive GDI+ one coming up.

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.

Isn't it nice when things are customizable using proper programming languages.
Title: foo_wave_seekbar
Post by: dano on 2010-01-05 23:28:19
Could the calculation of the wave form (theoretically) be accelerated with GPU support?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-05 23:42:34
Could the calculation of the wave form (theoretically) be accelerated with GPU support?

Unlikely. Most of the cost tends to be in decoding the input.
Title: foo_wave_seekbar
Post by: stefle on 2010-01-05 23:58:52
Hello,

actually a nice plugin,couldn't wait to try it.

I think wave seekbar should be perfect for music of the classical genre, e.g. long symphonic movements or the like. RMD level could be a kind of orientation when seeking particular parts like Development, Reprise, a certain loud passage.

But now, having tried, I'm a bit confused. I'm not really sure that the curve calculated by the plugin matches my perception of loudness. Sometimes it seems to me unreliable. Thus I compared the displayed graphics with that of Audacity, using Bruckner, Symphony No.9. There are spots where music is really soft while the plugin's curve makes a large amplitude - and vice versa. The Audacity curve looks quite different and seems to be more suitable regarding orientation matters.
Title: foo_wave_seekbar
Post by: Xezzy on 2010-01-06 00:04:33
Thanks for this component, it looks amazing. And it works in DUI. Dunno if it was mentioned, but traktor has similiar feature and it's great to see that in foobar! Except in traktor the slider was "fixed" and wave was scrolling, and you could move entire wave left and right, causing cool vinyl sliding sound effect  But I realize it would take a lot more work to do.

Back to reality:
I got this (http://img682.imageshack.us/img682/2624/clipboard02m.jpg)
(on this picture we can see that wave is one-coloured)

But I saw screens with two-colored wave, plus dicrect2D mode is also two-colored. Is something wrong? My card supports ps2.0 and I'm running vista.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-06 00:11:19
But now, having tried, I'm a bit confused. I'm not really sure that the curve calculated by the plugin matches my perception of loudness. Sometimes it seems to me unreliable. Thus I compared the displayed graphics with that of Audacity, using Bruckner, Symphony No.9. There are spots where music is really soft while the plugin's curve makes a large amplitude - and vice versa. The Audacity curve looks quite different and seems to be more suitable regarding orientation matters.

The scanner divides the track into 2048 sections, and for each section it records the minimum and maximum values (and calculates RMS power). As such, the wave might seem a bit bloated compared to other visualisations.

But I saw screens with two-colored wave, plus dicrect2D mode is also two-colored. Is something wrong? My card supports ps2.0 and I'm running vista.

In the default effect, the colors are interpolated from background colour onto the border of the wave, where it uses the foreground colour. Inside of that, it shoots "past" the foreground colour towards white or black.
Try playing with the color settings in the Configure context menu item.
Title: foo_wave_seekbar
Post by: Xezzy on 2010-01-06 01:28:54
Ugh, obviously... Thanks
Title: foo_wave_seekbar
Post by: Hengest on 2010-01-06 03:54:03
Here's (http://www.hydrogenaudio.org/forums/index.php?act=Attach&type=post&id=5607) a  quick mod of foosion's effect for those who would like to have the RMS rendered, but also keep the shading effect. As usual, place 'seekbar.fx' in the 'effects' folder of your foobar dir. 

(http://i45.tinypic.com/205v3it.png)

Also, I'll see if I can get it to use the replaygain variable present; however, I'm not very familiar with programming, so I'm not sure if I'll have any luck.

Edit: added screenshot.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-06 03:59:41
Fun fact of the day - this is the same shader language used to create the shaders for real games.
Title: foo_wave_seekbar
Post by: Hengest on 2010-01-06 07:36:44
And here's (http://www.hydrogenaudio.org/forums/index.php?act=Attach&type=post&id=5609) a new modification of 'seekbar.fx' that scales the waveform according to Replay Gain data. By default, it will use the track gain; however, a quick edit of the file will enable the use of the album gain mode instead.
Title: foo_wave_seekbar
Post by: sld on 2010-01-06 09:39:34
The Direct2D frontend may very well be misbehaving after making it behave in high DPI scenarios (in which it's broken again).

Indeed, I use 125 DPI because of my Thinkpad's impossible 1400 by 1050 pixels resolution. Quite nice to have exact measurements with a ruler, too. Is this a bug with Direct2D?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-06 11:00:22
... Is this a bug with Direct2D?

Not with Direct2D itself, just with my use of it. Well, it has some rather annoying DPI semantics that tends to destroy beautiful code.
Title: foo_wave_seekbar
Post by: _oao on 2010-01-06 11:51:00
feature request: it seems that people started to customize the seekbar appearance, would it be possible to add an option to select different effects instead of overwriting the seekbar.fx every time we want to try a new one?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-06 11:59:22
feature request: it seems that people started to customize the seekbar appearance, would it be possible to add an option to select different effects instead of overwriting the seekbar.fx every time we want to try a new one?

It's been in todo.txt since day one. It's pending implementation of frontend-specific configuration.
Title: foo_wave_seekbar
Post by: Xezzy on 2010-01-06 12:53:13
I've noticed you can't access context menu items while in layout editing mode.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-06 13:24:12
Correct. It's on the todo.
Heh, just about every reply here is "it's on the todo". I should probably make it more public or take time to set up a bug tracker.
Title: foo_wave_seekbar
Post by: stefle on 2010-01-06 13:24:58
1)
I know what the problem is. (see my last posting http://www.hydrogenaudio.org/forums/index....st&p=677826 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77490&view=findpost&p=677826))

Wave Seekbar stretches the curve cutting it at the end. (I have made a screenshot, but problems to upload. Perhaps later.)
Is this a bug or a configuration issue?

2)
Ist ist possible to update my onboard graphics to Direct 3D? Don’t have a video card. My Motherboard is MSI K9AG Neo2-Digital with AMD 690G and SB600 Chipset. OS: Vista 32
Title: foo_wave_seekbar
Post by: Zao on 2010-01-06 13:46:01
1) If you have a non-default DPI, my use of Direct2D is likely broken again as mentioned earlier in the thread.
2) The X1250 integrated GPU of your motherboard should be capable of driving the Direct3D frontend, as the GPU supports PS2.0b. Does your console log any errors when trying to use the Direct3D mode? Ensure that you have the August 2009 DirectX runtime installed.
Title: foo_wave_seekbar
Post by: stefle on 2010-01-06 13:57:04
Thx!
Didn't understand that DPI prob, but will reread the thread.

Wave Seekbar windows doesn't show anything if D3D is set. Now Foobar even crashes, no chance to look at console.

Okay, I have to install August 2009 DirectX runtime first.
Title: foo_wave_seekbar
Post by: stefle on 2010-01-06 14:15:45
Don't understand that DPI issue yet. My monitor's resolution is about 94 DPI (LCD 21,3' - 1600x1200).
What is this high-DPI setting and how can I get rid of it?  ;-)
Title: foo_wave_seekbar
Post by: sld on 2010-01-06 14:40:15
Not with Direct2D itself, just with my use of it. Well, it has some rather annoying DPI semantics that tends to destroy beautiful code.

No worries. I don't even know that a waveform seekbar THIS cool is actually possible in FB2K.

Allow me to add another bug though, this time with the Direct3D mode on 945GM. While Direct2D shifts the 0 dB line downwards and stretches the waveform beyond the vertical borders, Direct3D mode does the exact opposite: the 0 dB line is shifted upwards, while the waveform amplitudes are so small...
Title: foo_wave_seekbar
Post by: StuPC on 2010-01-06 17:23:28
edited - never mind, I am an idiot! :-(
Title: foo_wave_seekbar
Post by: Andreasvb on 2010-01-06 17:27:37
StuPC, did you download the DX update linked in 1st post?
And what's your graphics card, can it handle D3D?
Title: foo_wave_seekbar
Post by: lvqcl on 2010-01-06 17:30:43
StuPC: "Furthermore, it requires installation of the DirectX August 2009 runtime redistributable."
Title: foo_wave_seekbar
Post by: Anomalous on 2010-01-07 02:57:50
What about identifying tracks using the audio MD5 where possible?
Title: foo_wave_seekbar
Post by: frogworth on 2010-01-07 03:36:05
Logging in purely to say that this plugin is the best thing since sliced bread.
Thanks, Zao! Awesome work.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-07 05:19:26
What about identifying tracks using the audio MD5 where possible?

I prefer methods where collisions do not occur. In any way, a MD5 of the audio data would be a bit error-prone unless the decoder provides bit-exact identical output on multiple runs.
In any way, computing the MD5 of the data would cost about as much as analyzing it, as most of the cost is in I/O and decoding.
If you mean to take the MD5 of compressed audio, I do not believe that that data is exposed by the input or decoder services.

The direction I'm going to take files with changing locations is to provide per-directory databases and tag-based storage, prioritized via preferences.

And oh, 0.1.5 is out with lots of fixes, including a GDI+ mode for people without GPUs.
Title: foo_wave_seekbar
Post by: jeremija on 2010-01-07 07:13:55
This is a brilliant plug-in! Thank you for your hard work!
Title: foo_wave_seekbar
Post by: q_b6 on 2010-01-07 07:44:28
It is strange, but when I was using the first version, I can use 'Direct3d' mode. Now it is 0.1.5, 'Direct3d' just doesn't draw (or 'redraw', 'refresh') anythin :S
Title: foo_wave_seekbar
Post by: Anomalous on 2010-01-07 07:48:39
I prefer methods where collisions do not occur.

Surely the probability of two valid audio files having the same MD5 is tiny, the wavpack site even mentions using it for identification.
Quote
MD5 audio checksums for verification and identification


In any way, a MD5 of the audio data would be a bit error-prone unless the decoder provides bit-exact identical output on multiple runs.
In any way, computing the MD5 of the data would cost about as much as analyzing it, as most of the cost is in I/O and decoding.
If you mean to take the MD5 of compressed audio, I do not believe that that data is exposed by the input or decoder services.

The direction I'm going to take files with changing locations is to provide per-directory databases and tag-based storage, prioritized via preferences.

By "where possible", I meant for formats which already include the MD5 hash, such as flac and wavpack. For those that don't, you could either fall back on the file name or use the MD5 of the audio part and put it in a tag (http://www.hydrogenaudio.org/forums/index.php?showtopic=42276) (if that's possible).

Just some suggestions, my music doesn't move much so I'm happy with whatever you decide.
Title: foo_wave_seekbar
Post by: q_b6 on 2010-01-07 08:14:41
To identify a track, I think a hash of the number of total samples and several samples in the middle is enough in practical use ...
Title: foo_wave_seekbar
Post by: NEMO7538 on 2010-01-07 08:28:27
Version 0.1.5 does not work on one of my systems (Lenovo T60, Intel G945 Graphics, XP SP3).
I now have the two options (GDI and Direct3D 9.0) but none of them is working (the panel remains blank and is never refreshed). When I select Direct3D 9.0c, then close and reopen the preferences panel, GDI remains selected.

Version 1.0.4 was working fine with Direct3D 9.0c only after installing the August 2009 Direct X runtime redistributable.
Title: foo_wave_seekbar
Post by: Qest on 2010-01-07 08:31:47
Very cool. This definitely makes the cut into my layout.

Small Request: Any chance you could change the border toggle into a combo for select between 'None', 'Gray', and 'Sunken' like other Columns UI components?

EDIT: Thought I should add that this is working absolutely perfectly!
Title: foo_wave_seekbar
Post by: shavenne on 2010-01-07 08:49:02
What does happen when I play an audio CD?
Can't test it at the moment. I'm using foobar2000 in my car (CarPC) and I have the 0.9 version and I don't want to upgrade to 1.0 until it's stable. I just don't want to install a new foobar version every month . It's cold out there .
Title: foo_wave_seekbar
Post by: sld on 2010-01-07 09:26:37
Version 0.1.5 does not work on one of my systems (Lenovo T60, Intel G945 Graphics, XP SP3).
I now have the two options (GDI and Direct3D 9.0) but none of them is working (the panel remains blank and is never refreshed). When I select Direct3D 9.0c, then close and reopen the preferences panel, GDI remains selected.

Version 1.0.4 was working fine with Direct3D 9.0c only after installing the August 2009 Direct X runtime redistributable.

Same here. However, since I use Windows 7, I can make GDI+ work by selecting Direct2D first, and then GDI+. Doing this resets the window or something like that, apparently. Direct3D mode is now broken.
Title: foo_wave_seekbar
Post by: fuflo on 2010-01-07 10:00:22
0.1.5 works fine here. 8800gts 320, amd x2 5000+.

gdi+ mode flickers a little but that's probably it's own limitation or smth..
Title: foo_wave_seekbar
Post by: rol on 2010-01-07 12:37:36
I have one request: mouse scroll to zoom.
Title: foo_wave_seekbar
Post by: grimes on 2010-01-07 12:49:59
Or mouse scroll to seek?
Title: foo_wave_seekbar
Post by: rol on 2010-01-07 13:03:47
There is some kind of bug on my Window 7. When i resize component to about > 500px my sound laggy as hell. Probably too much cpu usage
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-07 16:30:28
Thanks for the GDI+ thing, it's working, although I had to download gdiplus.dll from microsoft... my laptop must really be terrible!

I can't seem to get the custom seekbar.fx files working (e.g. by foosion on page 4) though, I saved it in the right directory and restarted foobar, but it hasn't changed anything.
Title: foo_wave_seekbar
Post by: Xezzy on 2010-01-07 16:42:59
Try messing around with colors using configure from right-click menu. It helped in my case (but with default effect, this can be some other thing).
Title: foo_wave_seekbar
Post by: garbanzo.bean on 2010-01-07 17:08:49
great component! many thanks

could you please add an option to reverse the direction? i want to use a vertical bar, but would like the progress to go from the bottom to the top.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-07 17:28:43
To identify a track, I think a hash of the number of total samples and several samples in the middle is enough in practical use ...

Except that formats like MP3 are horribly costly to seek in.

Version 0.1.5 does not work on one of my systems (Lenovo T60, Intel G945 Graphics, XP SP3).
I now have the two options (GDI and Direct3D 9.0) but none of them is working (the panel remains blank and is never refreshed). When I select Direct3D 9.0c, then close and reopen the preferences panel, GDI remains selected.

Version 1.0.4 was working fine with Direct3D 9.0c only after installing the August 2009 Direct X runtime redistributable.

I suppose that my fancy-pants detection of August 2009 misfires.
What console messages do you people get if you add a new seekbar to the layout?

Small Request: Any chance you could change the border toggle into a combo for select between 'None', 'Gray', and 'Sunken' like other Columns UI components?

Quite possibly.

What does happen when I play an audio CD?

In ancient versions, it tried to automatically analyze the track while playing. Being in two places at once on a CD is impossible if you want realtime playback.
I restricted all CDDA analyzation after that, and now relaxed that to allow explicit analyzation via the context menu.
The use case presented was "I want to scan my CDs beforehand and use cached data when playing", which is fair enough.

gdi+ mode flickers a little but that's probably it's own limitation or smth..

I weighed between buffering or not, and balked at the increased CPU cost, reasoning that it looks good enough on my test setup (Seven x64 and a VM with XPSP3 x86).

Thanks for the GDI+ thing, it's working, although I had to download gdiplus.dll from microsoft... my laptop must really be terrible!

I can't seem to get the custom seekbar.fx files working (e.g. by foosion on page 4) though, I saved it in the right directory and restarted foobar, but it hasn't changed anything.

Odd, I thought that any remotely updated XP machine should have GDI+.
As for effects, it prefers the one in profile_dir\effects over one in foobar_dir\effects, if any.

Try messing around with colors using configure from right-click menu. It helped in my case (but with default effect, this can be some other thing).

Visuals missing some state is known, a workaround is if you juggle settings or change tracks.

could you please add an option to reverse the direction? i want to use a vertical bar, but would like the progress to go from the bottom to the top.

Possibly.
Title: foo_wave_seekbar
Post by: NEMO7538 on 2010-01-07 20:48:54
Version 0.1.5 does not work on one of my systems (Lenovo T60, Intel G945 Graphics, XP SP3).
I now have the two options (GDI and Direct3D 9.0) but none of them is working (the panel remains blank and is never refreshed). When I select Direct3D 9.0c, then close and reopen the preferences panel, GDI remains selected.

Version 1.0.4 was working fine with Direct3D 9.0c only after installing the August 2009 Direct X runtime redistributable.

I suppose that my fancy-pants detection of August 2009 misfires.
What console messages do you people get if you add a new seekbar to the layout?



Here are the messages I got :
[blockquote]Seekbar: taking Direct3D9 path.
Seekbar: frontend creation failed: Direct3D9: could not create texture.
Opening track for playback: "M:\Music\Emerson Hart - 2007 - Cigarettes & Gasoline\04 - I Wish the Best for You.mp3"
Wave cache: redundant request for "M:\Music\Emerson Hart - 2007 - Cigarettes & Gasoline\04 - I Wish the Best for You.mp3"
[/blockquote]
Title: foo_wave_seekbar
Post by: Zao on 2010-01-07 21:09:54
Fixed. Silly copy/paste error made it try to create fancy floating-point textures three times instead of the two fallback formats.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-07 21:16:01
Fixed

unfortunately, not
Title: foo_wave_seekbar
Post by: NEMO7538 on 2010-01-07 21:20:48
I guess we have to wait for 0.1.16
Title: foo_wave_seekbar
Post by: Zao on 2010-01-07 21:36:05
unfortunately, not

With which version? *points at 0.1.6*
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-07 21:41:41
Odd, I thought that any remotely updated XP machine should have GDI+.

OK, so it turns out I do have GDI+... For some reason it didn't load in GDI+ mode first, so I looked in my system32 folder, couldn't find gdiplus.dll and assumed the worst. So then I downloaded it from microsoft, and it seemed to fix things. Then I had the bright idea to search my windows folder for gdiplus.dll, because as you said XP is supposed to have it. It turns out it is there, but in some other folder. So then I deleted what I downloaded, and it's working properly now. Phew!

It still isn't loading the custom seekbar.fx though, and my profile folder is my install folder.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-07 21:49:01
0.1.6 works fine

[edit] corrected version number, blame on NEMO7538
Title: foo_wave_seekbar
Post by: foosion on 2010-01-07 22:22:21
It still isn't loading the custom seekbar.fx though, and my profile folder is my install folder.
The GDI+ mode does not use the seekbar.fx file, only the D3D modes do.
Title: foo_wave_seekbar
Post by: Hamallainen on 2010-01-08 08:32:19
I have a strange behaviour in d3d.
I have 2 monitors. If i display the foobar window on the fisrt one everything is fine but on the 2nd, i get a ~90/100% cpu usage (even when it's not scanning and even if playback is stopped). If the window is minimized on monitor 2, cpu usage falls back to 0/2%

Another thing, i get a lot of flickering in gdi+ on the highlighted part and the selection bar

foobar 1.0 b6 / foo wave seekbar 1.0.6 /XP SP3
Title: foo_wave_seekbar
Post by: Zao on 2010-01-08 10:27:14
I have a strange behaviour in d3d.
I have 2 monitors. If i display the foobar window on the fisrt one everything is fine but on the 2nd, i get a ~90/100% cpu usage (even when it's not scanning and even if playback is stopped). If the window is minimized on monitor 2, cpu usage falls back to 0/2%

Another thing, i get a lot of flickering in gdi+ on the highlighted part and the selection bar

foobar 1.0 b6 / foo wave seekbar 1.0.6 /XP SP3

Bug (http://zao.se:8080/flyspray/index.php?do=details&task_id=23) logged.
It's likely due to different devices being used for each monitor, incurring a costly copy if primarily on the non-primary monitor.
It may be solvable through multiple devices or magic.
Vista and Seven behaves much nicer in this regard, which is why I haven't noticed it as my test machines are Seven x64 multimon and a VM XPSP3 x86 with single monitor.

As for GDI+, known.
Title: foo_wave_seekbar
Post by: rol on 2010-01-08 11:12:04
small request: disable indicator line.
Title: foo_wave_seekbar
Post by: frogworth on 2010-01-08 11:49:14
small request: disable indicator line.


You can do this yourself by editing seekbar.fx in the effects folder. Where you find:
Code: [Select]
    float seekWidth = 2.5 * dx;
    float positionWidth = 2.5 * dx;

just change the scaling number to suit. I actually like it at 1 * dx myself. You can make it 0 if you like.
(NB: IANAP. I just hack away, so... it could be that only one of the two float values needs changing! No harm with both though.)
Title: foo_wave_seekbar
Post by: Zao on 2010-01-08 11:53:32
Yes, if you're using the Direct3D9 frontend you can either modify the widths (one applies to the position bar and one for the seeking bar).
You could also comment out or completely remove one or both of the calls to bar() on lines 101-102.

Be happy that this isn't the effect file from the 0.0.x versions, as that wasn't remotely as modular.
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-08 12:38:44
The GDI+ mode does not use the seekbar.fx file, only the D3D modes do.
OK, that explains it!

All I'm after really is the RMS values superimposed on the normal amplitude. Zao, would it be possible to have an option for that in GDI+ mode?

Oh and another request... moodbar (http://www.hydrogenaudio.org/forums/index.php?showtopic=74255&hl=moodbar) colours! mmm it would be amazing!  Please?
Title: foo_wave_seekbar
Post by: Devocalypse on 2010-01-08 13:22:22
First of all thank you for this great component and I find it extremely useful.

It's working good on my Win7x64 on the Secondary monitor with no noticable CPU spikes.

However when the computer is Locked (Win+L) and the Foobar window is NOT minimized I get constant 100% cpu usage on my C2D. Regardless of that on which monitor and it happens only when this component is enabled. In a multiuser scenario this is catastrophic as it leeches all the cpu cycles continuously and the other user cannot use the computer properly.

How to reproduce:
1. Run, process explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)
2. Minimize it to tray.
3. Run foobar.
4. Do not minimize the foobar window and hit Win+L
5. Login again in a few seconds.
6. Check the graph on the cpu usage in process explorer.

NOTE: Happens only in Direct3D mode. (GeForce 8800GTX driver 195.62)

Strange thing is that once you login the cpu usage drops to normal again.
Looking forward to getting this fixed.
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-08 15:04:41
I think this component is causing problems for me when I listen to radio streams. It's not crashing foobar so there's no log, but the screen goes crazy, there is a box the same size as the seekbar panel in the top left of my screen, foobar loses its title bar, and the UI is just barely usable. The problem completely disappears when I minimize foobar, but comes back again, and doesn't properly fix itself until I restart foobar. It's hard to describe really. I'm only guessing that it's this component- it's the only one I've added recently.
Title: foo_wave_seekbar
Post by: LarsK on 2010-01-08 15:12:56
Hello,

is it possible to start playing with double click in the waveform?

Thank you,
Lars
Title: foo_wave_seekbar
Post by: Zao on 2010-01-08 15:16:56
However when the computer is Locked (Win+L) and the Foobar window is NOT minimized I get constant 100% cpu usage on my C2D.

Reported in early 0.0.x series, I lose the device and do probably not do the re-acquire test properly.

I think this component is causing problems for me when I listen to radio streams.

Remove the component and see what happens? Also, what protocol; it should completely ignore MMS etc.

is it possible to start playing with double click in the waveform?

Requested already.
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-08 16:53:15
If I set the panel to hidden (in columns UI layout prefs) everything is fine. The bad things only happen after listening to the stream for about 5 minutes or more. It's an m3u stream. From what I could see of the console it said it was skipping the stream. It also happens with mms streams. It seems to happen every time I listen to one, but only after a while.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-08 19:06:57
As the GDI+ mode is an overnight hack, it may very well be horribly broken.
A quick inspection with Process Explorer tells me I'm leaking GDI handles like crazy. Yay.
Title: foo_wave_seekbar
Post by: (Sly) on 2010-01-08 19:55:18
Major bug: I was playing Heroes Might & Magic III in fullscreen when i discovered this bug.

On track change (one track ended other started) the playback stopped until i Alt-Tab-ed out from the game, after that playback continued normally. This happened on every tack change. Everybody knows that this is not a CPU speed problem, Heroes III uses very few resources. I'm running Windows XP SP3, DX9C latest, T2390 1.86GHz, 2GB RAM, Intel Mobile 965 Express @ Laptop.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-09 07:04:52
0.1.8 is out, improving greatly on performance, especially the high load when listening to streams. See changelog for all the changes.
Title: foo_wave_seekbar
Post by: (Sly) on 2010-01-09 08:49:54
Major bug: I was playing Heroes Might & Magic III in fullscreen when i discovered this bug.

On track change (one track ended other started) the playback stopped until i Alt-Tab-ed out from the game, after that playback continued normally. This happened on every tack change. Everybody knows that this is not a CPU speed problem, Heroes III uses very few resources. I'm running Windows XP SP3, DX9C latest, T2390 1.86GHz, 2GB RAM, Intel Mobile 965 Express @ Laptop.



Bug is gone with 0.1.8. I was using 0.1.4.

Keep up the good work. Waiting for embended data in tags, or datatbase in root of music library. I hope that Peter releases the SDK for writing Default UI elements, for you to be able to create this greate addon as pure toolbar element.
Title: foo_wave_seekbar
Post by: kode54 on 2010-01-09 09:49:31
I hope that Peter releases the SDK for writing Default UI elements, for you to be able to create this greate addon as pure toolbar element.

It already is a UI Element. There is no way for components to add to the toolbar.
Title: foo_wave_seekbar
Post by: Hamallainen on 2010-01-09 11:34:56
No more flickering with gdi. Thanks
Title: foo_wave_seekbar
Post by: fuflo on 2010-01-09 15:30:51
regarding the effects:

i have some general knowledge in programming, but not graphical.

how would i go about changing the bar() function to make the bar smaller in vertical size? the reason i'm asking is i'm trying out some designs for foobar with this component and it would look much less blockier if the bar was a little smaller vertically.
i tried hacking the default effect a little to no avail...
Title: foo_wave_seekbar
Post by: Zao on 2010-01-09 16:54:47
how would i go about changing the bar() function to make the bar smaller in vertical size? the reason i'm asking is i'm trying out some designs for foobar with this component and it would look much less blockier if the bar was a little smaller vertically.
i tried hacking the default effect a little to no avail...

The following code may be acceptable and will available for use in the default effect in next release. Tweak the last two parameters to the function to indicate from what amplitude the bar should start fading and which amplitude it's fully gone. For fun, also try reversing the order of them, which would give a bar that's hollow towards zero.
Code: [Select]
float4 fade_bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show, float vert_from, float vert_to )
{
    float dist = abs(pos - tc.x);
    float vertical = smoothstep(vert_from, vert_to, abs(tc.y));
    float4 c = show
        ? lerp(fg, bg, max(vertical, smoothstep(0, width, dist)))
        : bg;
    return c;
}

For example, to fade from solid at amplitude 0.3 to 0.8:
Code: [Select]
c0 = faded_bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible, 0.3, 0.8);
Title: foo_wave_seekbar
Post by: fuflo on 2010-01-09 21:24:57
hmm.. either i'm doing it wrong or i have no idea..
it doesn't seem to have any effect. i added that function to default seekbar.fx and replaced bar() references with fade_bar() with added values 0.3 and 0.8 where you mentioned and it doesn't seem to have any effect.
also from your description of that function it doesn't seem to be what i actually want..

ps. although as i'm writing this, i had a couple or more beers so i'll check back tommorow with a clear mind
Title: foo_wave_seekbar
Post by: Gapkiller on 2010-01-09 21:45:31
feature request:

Please add function to temporarily turn off wave analyzing.
When i make playlists I scroll and click tracks pretty fast so it gets very high on cpu usage...
It would be perfect if it would display only the scrollbar without analyzing!

Thx
Title: foo_wave_seekbar
Post by: Zao on 2010-01-09 21:59:52
hmm.. either i'm doing it wrong or i have no idea..
it doesn't seem to have any effect. i added that function to default seekbar.fx and replaced bar() references with fade_bar() with added values 0.3 and 0.8 where you mentioned and it doesn't seem to have any effect.
also from your description of that function it doesn't seem to be what i actually want..

(http://www.acc.umu.se/~zao/seekbar24.png)
Left to right is (0.3, 0.7), (0.3, 0.35), (0.7, 0.3).
If you've got a seekbar.fx in both your profile and foobar dir, it prefers the profile one. Also, note that .fx files only affect the Direct3D mode, not GDI or Direct2D.

Please add function to temporarily turn off wave analyzing.
When i make playlists I scroll and click tracks pretty fast so it gets very high on cpu usage...
It would be perfect if it would display only the scrollbar without analyzing!

The processing threads run at idle priority, so it should not be horribly noticeable, responsivity-wise.
But yes, an "inhibit enqueueing of new tracks" command might be doable. It'd be tricky to get it to affect work items previously enqueued though.
Title: foo_wave_seekbar
Post by: Gapkiller on 2010-01-09 22:13:13
Quote
The processing threads run at idle priority, so it should not be horribly noticeable, responsivity-wise.
But yes, an "inhibit enqueueing of new tracks" command might be doable. It'd be tricky to get it to affect work items previously enqueued though.


Thank you for considering this. Would be a very helpful feature to me!
Title: foo_wave_seekbar
Post by: Hancoque on 2010-01-10 00:12:12
How is the waveform calculated? Is it just a sum of all channels? I noticed that the channels of a 5.1 file are treated differently. The LFE channel, for example, receives a boost. I'd like to be able to limit the calculation to certain channels or even use only one channel. As most music is in stereo, a two-channel view would also be great. The main reason for me to use this component would be to examine the material as accurately as possible, especially in terms of dynamics compression. That possibility is greatly reduced when viewing only a mono sum as it makes the material look better than it really is.
Title: foo_wave_seekbar
Post by: boombaard on 2010-01-10 00:53:27
How is the waveform calculated? Is it just a sum of all channels? I noticed that the channels of a 5.1 file are treated differently. The LFE channel, for example, receives a boost. I'd like to be able to limit the calculation to certain channels or even use only one channel. As most music is in stereo, a two-channel view would also be great. The main reason for me to use this component would be to examine the material as accurately as possible, especially in terms of dynamics compression. That possibility is greatly reduced when viewing only a mono sum as it makes the material look better than it really is.

Actually, my girlfriend will love this visualizer. I acquainted her with the Loudness War a while back, and it's helped her identify why she didn't care for some music without really knowing why. Still, it would be nice to have 2 channels, or at least know if the single-wave output is RMSed or summed.
In any case: Thanks Zao
Title: foo_wave_seekbar
Post by: Zao on 2010-01-10 02:24:55
The mixdown algorithm is very unscientific.

Code: [Select]
switch (channelCount)
{
case 8:
    frame[0] += frame[6] * sqrt_half;
    frame[1] += frame[7] * sqrt_half;
case 6:
    frame[0] += frame[2] * sqrt_half + frame[4] * sqrt_half + frame[3];
    frame[1] += frame[2] * sqrt_half + frame[5] * sqrt_half + frame[3];
case 2:
    frame[0] += frame[1];
    frame[0] /= 2.0;
    break;
case 4:
    frame[0] += frame[1] + frame[2] + frame[3];
    frame[0] /= 4.0;
}


That is, 7.1ch is mixed to 5.1ch.
5.1ch is mixed to stereo.
Stereo is averaged to mono (which will mislead with phase-skewed channels).
4ch is similarily averaged to mono.
Title: foo_wave_seekbar
Post by: fuflo on 2010-01-10 11:41:24
finally found why fade_bar didn't work for me.

from your example:

float4 fade_bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show, float vert_from, vert_to )

should be:

float4 fade_bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show, float vert_from, float vert_to )

and now it works perfectly. thanks
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-10 14:40:52
Thanks for the latest version, it works well and looks great.

Would a transparent background be possible at all? Or maybe the ability to define a background image? I realise the foreground colour is calculated using the background colour, so maybe not, just thought I'd suggest it
Title: foo_wave_seekbar
Post by: boombaard on 2010-01-10 16:13:10
Something quite problematic my gf pointed out:
Background: Black
foreground: Red
(hl: darkgreen selection:yellow
Now, if I disable the fg color, the fg (that is, the waveform) becomes white, but it also grows by a significant %age. What's happening there?
(The same thing applies when you change the bg color, btw)
Title: foo_wave_seekbar
Post by: aphasia on 2010-01-10 16:33:03
Thanks for a very cool component. Kudos Zao!
Title: foo_wave_seekbar
Post by: fuflo on 2010-01-10 16:44:21
hmm.. i don't know if this is a bug but with d3d, making foobar's window transparent, wave seekbar's bg is black ( and not transparent ). gdi is fine
Title: foo_wave_seekbar
Post by: Zao on 2010-01-11 02:18:04
float4 fade_bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show, float vert_from, vert_to )
float4 fade_bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show, float vert_from, float vert_to )

I'm fairly sure that the console should log any effect compilation errors with line and column.

Would a transparent background be possible at all? Or maybe the ability to define a background image? I realise the foreground colour is calculated using the background colour, so maybe not, just thought I'd suggest it

Since early on, I have intended to load any textures referenced by annotations in the effect file, but sadly enough I have not implemented it yet.
An example of such an annotation is line 2 of the default seekbar.fx.

Something quite problematic my gf pointed out:
Background: Black
foreground: Red
(hl: darkgreen selection:yellow
Now, if I disable the fg color, the fg (that is, the waveform) becomes white, but it also grows by a significant %age. What's happening there?
(The same thing applies when you change the bg color, btw)

At the edge of the waveform, the color is bg. To a certain distance inside the waveform, the color is linearly interpolated to fg. Inside of that distance, color continues the interpolation, depending on how b and fg relate to each other.

If bg.r is redder than fg.r, the center will go towards a color without red.
If bg.r is less red than fg.r, it will go towards a full red component.
Likewise for green and blue.

The more similiar bg and fg are, the softer the edge will seem and the less extreme the interior will be.

Note that what you disable is the override of the global colors, not the color itself. It will use whatever you have set in the DUI/CUI global preferences.

hmm.. i don't know if this is a bug but with d3d, making foobar's window transparent, wave seekbar's bg is black ( and not transparent ). gdi is fine

That's expected, and I do not believe that it's solvable, not even with Direct3D9Ex.
Similarily, it will most probably not do the right thing in the unholy Panel Stack of Columns.
Title: foo_wave_seekbar
Post by: eke on 2010-01-12 10:40:45
is it possible to display 2 wavebars at once for 2 files, in order to compare them to each other?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-12 11:28:12
is it possible to display 2 wavebars at once for 2 files, in order to compare them to each other?

No. At least not currently. Maybe when I get around implementing displaying the selected song I can implement a setting to not track the currently playing one.
Title: foo_wave_seekbar
Post by: eke on 2010-01-13 14:13:22
is it possible to display 2 wavebars at once for 2 files, in order to compare them to each other?

No. At least not currently. Maybe when I get around implementing displaying the selected song I can implement a setting to not track the currently playing one.

that would be supercool, esp. when dealing with timed audios where you want to compare if the silence parts are identical between 2 files at the same time index.
Title: foo_wave_seekbar
Post by: ejac on 2010-01-13 20:35:29
GREAT component, thx a lot!!
Title: foo_wave_seekbar
Post by: Zao on 2010-01-15 13:02:36
Preview of how one can load and use textures (in good and bad ways). (Thumbnails with links to make 2E7AH happy.)
(http://www.acc.umu.se/~zao/seekbar25_t.png) (http://www.acc.umu.se/~zao/seekbar25.png)(http://www.acc.umu.se/~zao/seekbar26_t.png) (http://www.acc.umu.se/~zao/seekbar26.png)
Use cases range from a nice background image to a fancy position indicator to a custom gradient for the interior. The sky (and competence) is the limit!
Title: foo_wave_seekbar
Post by: Harm on 2010-01-15 15:58:35
I think I found a bug: When I switch between two layouts (CUI), both having a wave seekbar, fb2k sometimes - but not always - crashes, pointing the problem to wave seekbar.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-15 17:41:10
There seems to be some lovely crashes with 0.1.8, it's likely due to my main thread callbacks.
It seems to happen mostly with CUI, but some DUI ones do occur.

0.1.9 most probably fixes it.
Title: foo_wave_seekbar
Post by: SpaceAgeHero on 2010-01-16 10:14:31
Thank you for 0.1.9. I really like this component.
Title: foo_wave_seekbar
Post by: cc_bbs on 2010-01-16 16:16:43
hi,can the foo+wave_seekbar work with FX5200? I tried it ,but it doesn't work
Title: foo_wave_seekbar
Post by: Zao on 2010-01-16 17:19:46
hi,can the foo+wave_seekbar work with FX5200? I tried it ,but it doesn't work

It should run, assuming that you have reasonably decent drivers and the August 2009 runtime.
What errors/warnings do you get, and what "doesn't work"?
Title: foo_wave_seekbar
Post by: NullString on 2010-01-16 17:38:58
Preview of how one can load and use textures (in good and bad ways). (Thumbnails with links to make 2E7AH happy.)
(http://www.acc.umu.se/~zao/seekbar25_t.png) (http://www.acc.umu.se/~zao/seekbar25.png)(http://www.acc.umu.se/~zao/seekbar26_t.png) (http://www.acc.umu.se/~zao/seekbar26.png)
Use cases range from a nice background image to a fancy position indicator to a custom gradient for the interior. The sky (and competence) is the limit!

nice!

for those who don't know how, you have to place a picture for the texture in the "effects" folder, and then you have to edit the following lines in seekbar.fx (with notepad)

(line 2)
Code: [Select]
Texture2D bgTex < string ResourceName = "074.jpg"; >;

replacing "074.jpg" with the filename of the texture you want as background (that you placed in the "effects" folder)

and then

(line 102)
Code: [Select]
#if 1

changing it to
Code: [Select]
#if 0
Title: foo_wave_seekbar
Post by: pIv on 2010-01-16 19:01:38
In windows xp I can use 3 modes of frontend - GDI, Direct2D 1.0 and Direct3D 9.0c.

I change my os to windows 7, and now I can use only 2 modes of frontend - GDI, Direct2D 1.0. If I change mode to Direct3D 9.0c then panel wave_seekbar  ifs freeze.

Why?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-16 19:14:34
In windows xp I can use 3 modes of frontend - GDI, Direct2D 1.0 and Direct3D 9.0c.

I change my os to windows 7, and now I can use only 2 modes of frontend - GDI, Direct2D 1.0. If I change mode to Direct3D 9.0c then panel wave_seekbar  ifs freeze.

Why?

With what video card, do you have the August 2009 DirectX runtime installed, do you have video drivers installed, do you get anything in the console, does it crash properly, does it stop responding, does it just not repaint, did you submit a crash report, etc.?
Title: foo_wave_seekbar
Post by: seigert on 2010-01-16 20:02:48
I've added a wave_seekbar to a DarkOne theme for a ColumnsUI, but there is a little problem: thin white border on left and top sides of seekbar:

[a href="http://alexey.shuksto.name/data/uploads/fb2k/foo_wave_seekbar_bg_border_bug.png" target="_blank"]

Can this issue be resolved via shader code editing?
Title: foo_wave_seekbar
Post by: Harm on 2010-01-16 20:17:34
I don't have the option for Direct3D, just Direct2D and GDI. I use windows 7 64 bits and have a nvidia GT220M graphics card with the latest drivers. What could be wrong?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-16 20:24:23
I've added a wave_seekbar to a DarkOne theme for a ColumnsUI, but there is a little problem: thin white border on left and top sides of seekbar:

Try adding float2(dx, dy) from the texture coordinates used to sample the texture. This is the usual half-pixel offset problem of Direct3D9. I'm so used to 10, I keep forgetting that it exists - see Understanding half-pixel and half-texel offsets (http://drilian.com/2008/11/25/understanding-half-pixel-and-half-texel-offsets/).

I don't have the option for Direct3D, just Direct2D and GDI. I use windows 7 64 bits and have a nvidia GT220M graphics card with the latest drivers. What could be wrong?

Ensure as per the original post and countless others, that you have installed the DirectX August 2009 Redistributable.
Title: foo_wave_seekbar
Post by: seigert on 2010-01-16 21:45:29
Try adding float2(dx, dy) from the texture coordinates used to sample the texture.


Either I do not understand what values to use, or i do not understand where to add them -- i can perfectly well mess texture itself (mirror it or shift it) but i cannot move it.
Title: foo_wave_seekbar
Post by: bbt-hh on 2010-01-16 22:13:37
Everything loads fine, but the Waveform Seekbar shows nothing than white space? Seeking works though. (Win XP SP3, Radeon 9550)
As of version 0.1.9 console prints:
Seekbar: taking Direct3D9 path.
Wave seekbar: Direct3D9: Could not load annotation texture 074.jpg
Wave seekbar: Direct3D9: Could not load annotation texture seekbar.png
Seekbar: Frontend initialized.
Wave seekbar: Direct3D9: Could not load annotation texture 074.jpg
Wave seekbar: Direct3D9: Could not load annotation texture seekbar.png
Title: foo_wave_seekbar
Post by: Zao on 2010-01-16 23:27:31
Everything loads fine, but the Waveform Seekbar shows nothing than white space? Seeking works though. (Win XP SP3, Radeon 9550)
As of version 0.1.9 console prints:
*snip*

Your issue still makes no sense, so I haven't investigated that further.
The spam is unrelated and will be gone with 0.1.10. Does the GDI mode work?
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-16 23:34:54
(Thumbnails with links to make 2E7AH happy.)

eh thanks  it's not that hard
and you made them as a gentleman - with direct link + optimized png
Title: foo_wave_seekbar
Post by: Zao on 2010-01-16 23:59:41
Either I do not understand what values to use, or i do not understand where to add them -- i can perfectly well mess texture itself (mirror it or shift it) but i cannot move it.

The problem was not with sampling the texture, it was with the coordinates of my full-window quad, which were shifted half a pixel shifted to the right/down, causing the border you saw.
It will be fixed in 0.1.11 when I get around collecting enough fixes for it. Until then, change
Code: [Select]
output.pos = float4(input.pos, 0, 1);
in VS() to
Code: [Select]
float2 half_pixel = float2(1,-1) / viewportSize;
output.pos = float4(input.pos - half_pixel, 0, 1);
Title: foo_wave_seekbar
Post by: cc_bbs on 2010-01-17 04:30:21
hi,can the foo+wave_seekbar work with FX5200? I tried it ,but it doesn't work

It should run, assuming that you have reasonably decent drivers and the August 2009 runtime.
What errors/warnings do you get, and what "doesn't work"?


on my pc,the error with FX5200 is
"Failed to load DLL: foo_wave_seekbar.dll
Reason: ?????????  " 
and ,i have installed the August 2009 runtime
Title: foo_wave_seekbar
Post by: T.P Wang on 2010-01-17 05:42:56
@cc_bbs:
I can only imagine that LoadLibrary fails with error ERROR_PROC_NOT_FOUND (127) is that dll files in your system are messed up (Wrong dll version number? Mixed newer and older dll files but older dlls are loadded first?)
Title: foo_wave_seekbar
Post by: bbt-hh on 2010-01-17 10:08:41
Everything loads fine, but the Waveform Seekbar shows nothing than white space? Seeking works though. (Win XP SP3, Radeon 9550)
As of version 0.1.9 console prints:
*snip*
Your issue still makes no sense, so I haven't investigated that further.
The spam is unrelated and will be gone with 0.1.10. Does the GDI mode work?
I see, just mentioned it, because the console message was introduced in this version. GDI mode works fine.
D3D might work in a forthcoming version for me. Thanks for your effort, nice component.
Title: foo_wave_seekbar
Post by: seigert on 2010-01-17 10:26:09
Big thanks!
Title: foo_wave_seekbar
Post by: cc_bbs on 2010-01-17 10:41:30
@cc_bbs:
I can only imagine that LoadLibrary fails with error ERROR_PROC_NOT_FOUND (127) is that dll files in your system are messed up (Wrong dll version number? Mixed newer and older dll files but older dlls are loadded first?)

Would you like to tell me how to fix it ?thanks
Title: foo_wave_seekbar
Post by: seigert on 2010-01-17 11:23:03
Found new strange thing: without border with same gradient texture for background now i have two thin lines -- dark one at the top and light one at the bottom of seekbar:

(http://alexey.shuksto.name/data/uploads/fb2k/foo_wave_seekbar_bg_border_bug-2-thumb.png) (http://alexey.shuksto.name/data/uploads/fb2k/foo_wave_seekbar_bg_border_bug-2.png)

Seems to me that top- and bottom pixels of texture are mirrored when component drawing a seekbar.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-17 12:38:29
Change AddressV in the sampler to Clamp instead of Wrap.
The reason is that with Wrap, the texture is tiled and the topmost texel is filtered together with the bottommost and vice versa.
Your texture coordinates may be slightly off, but it should not be noticeable much.
Title: foo_wave_seekbar
Post by: TuNk77 on 2010-01-17 17:41:57
Thank you for this nice plug-in
v0.1.10 seems to be a bit faster on analyzing than v0.1.9. With v0.1.10 it takes about 1,5 seconds on average to analyze, v0.1.9. used up to 3 seconds to analyze.
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-01-17 18:23:29
I'm for looking for some help on editing the seekbar.fx file.  This should be easy, but I can't figure it out.  Basically, I'd like to add a 1px border around the selection rectangle.  I like using the "no border" option and making the background blend into my UI.  Unfortunately, I don't like the transition from the background color to the highlight color. 

So, what I have currently is this (using Hengest's replaygain effect):
(http://imgur.com/cd3LE.png)

What I'd like is this:
(http://imgur.com/qDjT9.png)

Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-17 19:40:55
Code: [Select]
float4 played( float pos, float2 tc, float4 fg, float4 bg, float alpha)
{
    float4 c = bg;
    float2 d = 1 / viewportSize;
    if (pos > tc.x)
    {
        if (tc.x < d.x || tc.y >= (1 - d.y) || tc.y <= (2 * d.y - 1))
            c = fg;
        else
            c = lerp(c, fg, saturate(alpha));
    }
    return c;
}
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-01-17 20:58:09
Thanks, that worked well.
Title: foo_wave_seekbar
Post by: pIv on 2010-01-18 09:39:35
2Zao

Everest.exe report about version directx in my Windows 7/32 ultimate  - 11.
I  run dxwebsetup.exe and install all updates of directx 9.0.
Now I try change frontend mode to Directx3d 9.0c and waveseekbar panel is freeze.
Console report:
"Seekbar: taking Direct3D9 path failed."
I use Nvidia 8500 GT graphic card.

Title: foo_wave_seekbar
Post by: Andreasvb on 2010-01-18 11:37:06
Did you install the specific DirectX August 2009?
Title: foo_wave_seekbar
Post by: pIv on 2010-01-18 12:22:20
2Andreasvb

I use dxwebsetup.exe - this program is web directx setup and load directx files fom microsoft.com (http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en)
Title: foo_wave_seekbar
Post by: Zao on 2010-01-18 12:23:57
For future information, the only usage scenarios I've personally verified works are as a DUI element or inside of a regular vertical/horizontal splitter in CUI.
A long time ago I tried it inside that Panel Stack plugin and made so that it at least didn't crash much, but I wouldn't say it "supports" PSS.

Now I try change frontend mode to Directx3d 9.0c and waveseekbar panel is freeze.
Console report:
"Seekbar: taking Direct3D9 path failed."
I use Nvidia 8500 GT graphic card.


I have searched my codebase and cannot find that message being emitted. Can you copy/paste it as-is?
Title: foo_wave_seekbar
Post by: pIv on 2010-01-18 15:06:34
Now I try change frontend mode to Directx3d 9.0c and waveseekbar panel is freeze.
Console report:
"Seekbar: taking Direct3D9 path failed."
I use Nvidia 8500 GT graphic card.


I have searched my codebase and cannot find that message being emitted. Can you copy/paste it as-is?


Sorry now I place rigth condole log (copy-paste)
Quote
Seekbar: taking GDI path.
Seekbar: Frontend initialized.
Seekbar: taking Direct2D1 path.
Seekbar: Frontend initialized.
Opening track for playback: "I:\Audio\Jazz\Various Artists\2000 - El.Condor.Pasa\01 Lianto de una paloma.mpc"
Wave cache: finished analysis of "I:\Audio\Jazz\Various Artists\2000 - El.Condor.Pasa\01 Lianto de una paloma.mpc"
Wave cache: finished analysis of "I:\Audio\Jazz\Various Artists\2000 - El.Condor.Pasa\02 Thinku.mpc"
Seekbar: taking Direct3D9 path.
Seekbar: frontend creation failed: Direct3D9: could not create device.
Seekbar: taking Direct2D1 path.
Seekbar: Frontend initialized.
Reopening played file after update: "I:\Audio\Jazz\Various Artists\2000 - El.Condor.Pasa\01 Lianto de una paloma.mpc"
Seekbar: taking GDI path.
Seekbar: Frontend initialized.


I choose GDI, Direct2D1 and Direct3D9 frontend mode, then GDI again.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-18 15:19:56
That's ... surprising.
I guess I should add more error handling in that area, but it should have no problems whatsoever on that card.
Do you have proper drivers from NVIDIA installed?
Title: foo_wave_seekbar
Post by: pIv on 2010-01-18 16:12:06
That's ... surprising.
I guess I should add more error handling in that area, but it should have no problems whatsoever on that card.
Do you have proper drivers from NVIDIA installed?


I use 195.62_desktop_win7_winvista_32bit_international_whql early and yesterday when I found bug  I install 195.81_desktop_win7_winvista_32bit_international_beta.

Error appears in both versions of this NVIDIA drivers.

Also I use two monitors connected to my graphic card (desktop extended to both monitors).
Title: foo_wave_seekbar
Post by: noisia on 2010-01-18 17:01:33
can't play/pause when gaming with this/
Title: foo_wave_seekbar
Post by: Zao on 2010-01-18 17:19:06
can't play/pause when gaming with this/

What do you do, what happens, what do you expect will happen?
Title: foo_wave_seekbar
Post by: noisia on 2010-01-18 17:55:56
can't play/pause when gaming with this/

What do you do, what happens, what do you expect will happen?

I press my mouse button for play/pause, music keeps playing if i started the game with music playing, doesnt play if i starte the game on pauze
Title: foo_wave_seekbar
Post by: Zao on 2010-01-18 19:23:15
I assume from your horribly short description that you're playing a game (windowed?), try to click in the foobar2000 toolbar (DUI/CUI?) to play/pause, and it does what (freeze, crash, nothing at all) while looking normal (not redrawing?)?
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-01-18 22:21:54
While trying to customize the effects file, I'm frequently running into this error:

"Compiled shader code uses too many arithmetic instruction slots (66). Max. allowed by the target (ps_2_0) is 64"

Is there anything that can be done about this, or is it just a limitation of the pixel shader that has to be worked around?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-18 22:55:43
While trying to customize the effects file, I'm frequently running into this error:

"Compiled shader code uses too many arithmetic instruction slots (66). Max. allowed by the target (ps_2_0) is 64"

Is there anything that can be done about this, or is it just a limitation of the pixel shader that has to be worked around?

Assuming you have the hardware, you can change the version in the technique to one of ps_2_b, ps_2_a or ps_3_0, in rough order of competence, latter is better.

The 2_a and 2_b levels have 512 combined arbitrary instructions and the 3_0 level has a minimum of 512 instructions supported.

I made the base effect use 2_0 as it's supported on the widest base of hardware.

Notable is that my shader isn't remotely efficient. It's written for legibility.
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-01-18 23:58:02
Changing it to 3_0 worked.

EDIT: One more thing.  Is it possible to access the "track peak" info, rather than just "track gain"?  Thanks.
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-01-19 10:45:19
Nevermind, I figured it out.
Title: foo_wave_seekbar
Post by: cc_bbs on 2010-01-19 13:15:26
ZAO,I also cann't  run it under my FX5200.What should I do ?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-19 13:55:44
The four available ReplayGain values are available in the same float4, as per the comment.

I have currently lent out my FX card, so I cannot verify why it fails.
There's plans to make device creation more robust and verifying more.
What failure do you get? The device one?
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-19 14:15:42
Hi, this component seems to give me 403 forbidden errors when listening to last.fm radio, would it be accessing the tracks at all? It definitely seems to be caused by this component as I can listen fine when I remove it from my config, otherwise I get a 403 error after about 20 seconds then it skips two tracks forwards.
Title: foo_wave_seekbar
Post by: cc_bbs on 2010-01-19 14:34:40
ZAO,I also cann't  run it under my FX5200.What should I do ?

the information is :
"Failed to load DLL: foo_wave_seekbar.dll
Reason: ?????????  "
and i have installed DirectX August 2009.

the same version of foo_wave_seekbar.dll,I used in a Q35 mainbroad,it is run .
So,is the FX5200's reason?
when  you can test it ,please tell me the result .thank you very much!
Title: foo_wave_seekbar
Post by: Zao on 2010-01-19 15:51:47
Hi, this component seems to give me 403 forbidden errors when listening to last.fm radio, would it be accessing the tracks at all? It definitely seems to be caused by this component as I can listen fine when I remove it from my config, otherwise I get a 403 error after about 20 seconds then it skips two tracks forwards.


I assume that last.fm tracks are one-time listen only.
This component assumes that playable locations are idempotent. That is, you get the same output on subsequent decodings and you can decode it more than once.
This does not hold for regular streams, random: and some other input components.

Currently there is a blacklist of input paths that it should not attempt to decode. How does such a mysterious last.fm location entry look?
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-01-19 16:17:20
Yeah they're one time only, they look something like this:
FOO_LASTFM_RADIO://play.last.fm/user/c8878bea8ecb7e714adb3d101fdfe64a.mp3LASTFM

Thanks
Title: foo_wave_seekbar
Post by: cerAmik on 2010-01-21 13:27:52
very nice component.

request: please add a timing tooltip (or another indicator) on x milliseconds mouseover (and when seeking)
Title: foo_wave_seekbar
Post by: Zao on 2010-01-21 16:20:43
request: please add a timing tooltip (or another indicator) on x milliseconds mouseover (and when seeking)

In the todo list since forever, will do once I can be bothered reading up on how to do tooltips with WTL, and get some of that mythical Free Time.
Title: foo_wave_seekbar
Post by: Squeller on 2010-01-23 15:59:04
[OT] Hey Zao, is that you?  http://tr.im/LkOR (http://tr.im/LkOR) - Did you recognize Google Streetview has been in your country  I love this service, unfortunately we'll see Germany there not soon I guess. Germany basically is a rather anti-progressive country IMO, people keep on complaining and complaining. I'm not surprised many non-german speaking people in the world know the german word "Verboten", which is sad.
Title: foo_wave_seekbar
Post by: q_b6 on 2010-01-23 16:18:12
request: editable boolean expression (just like foo_skip) to specify whether to skip analyzing tracks
Title: foo_wave_seekbar
Post by: Zao on 2010-01-23 17:16:17
I do not quite want to pollute the worker threads with accessing tags, let alone titleformatting.
I intend to provide preferences to exclude protocols, much like the current hardcoded set.
Title: foo_wave_seekbar
Post by: drmrbrewer on 2010-01-23 20:21:01
This is an excellent component.  Many thanks for making this available.

Since installing it, however, I am getting a few of the following error popups:

Could not update tags (Sharing violation) on: "blah blah blah.m4a"

I don't think that this component actually writes anything to the track itself, but maintains a separate database (right?).  I suspect that it's a conflict with another component I have installed (http://www.hydrogenaudio.org/forums/index.php?showtopic=76968) that is attempting to write a lyric tag to the file at the same time as your seekbar component is reading from the file during its initial analysis.

Could there be any other explanation?  Thing is, it doesn't happen every time a new track is played, and it's often the case that a lyric tag is written and the seekbar analysis is performed concurrently (well, roughly at the same time) without any conflict; maybe the timing is such that the lyric is written soon after the seekbar component has done its stuff.

Thanks,

Mike
Title: foo_wave_seekbar
Post by: NullString on 2010-01-24 01:44:28
Could there be any other explanation?  Thing is, it doesn't happen every time a new track is played, and it's often the case that a lyric tag is written and the seekbar analysis is performed concurrently (well, roughly at the same time) without any conflict; maybe the timing is such that the lyric is written soon after the seekbar component has done its stuff.

most probably when the lyrics are getting written on the file tags, the operation fails because wave_seekbar is scanning the file.
would be better to get lyrics and track signatures at different times 
Title: foo_wave_seekbar
Post by: Zao on 2010-01-24 14:30:06
Could not update tags (Sharing violation) on: "blah blah blah.m4a"
Could there be any other explanation?  Thing is, it doesn't happen every time a new track is played, and it's often the case that a lyric tag is written and the seekbar analysis is performed concurrently (well, roughly at the same time) without any conflict; maybe the timing is such that the lyric is written soon after the seekbar component has done its stuff.

Your interpretation is likely correct. It only reads the track while decoding and never writes anything to it. The act of decoding it is enough to block other usage of it.
I have no way of detecting that someone is interested in writing to something I am busy decoding.
I already make an effort to not have the input open longer than necessary.
Cloning the file and decoding from a copy would still have a vulnerable period, so that wouldn't help.
Title: foo_wave_seekbar
Post by: Xezzy on 2010-01-24 16:36:04
There is a glitch when playing MIDI files, it thinks to much and slows down foobar.

BTW, it would be nice to see MIDI notes in wave seekbar ^^ just sayin'
Title: foo_wave_seekbar
Post by: Zao on 2010-01-24 16:49:49
Rendering MIDI files taking up CPU is something you have to take up with the author of whatever MIDI component you use.
As for visualizing notes, that's nothing I have access to, nor want to.
Title: foo_wave_seekbar
Post by: drmrbrewer on 2010-01-24 16:50:40
I have no way of detecting that someone is interested in writing to something I am busy decoding.


Didn't think so.  I think the only solution would be for the lyric component to delay writing the lyric to the file... a 5 second delay would be plenty in my experience so far for wave_seekbar to have finished.

Thanks again for this component.  It is very interesting to see the whole dynamic of a track laid out before you.

Mike
Title: foo_wave_seekbar
Post by: Zao on 2010-01-24 17:09:45
Introducing delays to the left and right will just modify the probability of a collision, not solve it.
I'd prefer it if the lyrics component author handled such things by either retrying or storing the data in a friendlier way.

What file format is this? Some people tell me that they have no trouble whatsoever to update their tags while playing, including RG and interactive editing via properties.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-24 18:41:12
I think the only solution would be for the lyric component to delay writing the lyric to the file...

It's not only about lyrics, but any kind of tagging, i.e. using discogs/muscibrainz tagger or tagging yourself some new (unprocessed) release
Maybe there should be option to switch the component like - don't process items not in media library, or something like that
Title: foo_wave_seekbar
Post by: drmrbrewer on 2010-01-24 18:55:22
I'd prefer it if the lyrics component author handled such things by either retrying or storing the data in a friendlier way.


There is an option inthe component to store lyrics in a separate file.  But I prefer the lyric to travel with the track.  But yes, it would be better to try, and retry if the file is open by another process.

What file format is this? Some people tell me that they have no trouble whatsoever to update their tags while playing, including RG and interactive editing via properties.


There isn't usually a problem updating tags while playing; I update my (embedded) ratings all the time when the track is playing.  I don't know how foobar2000 handles reading of the track for output: perhaps it makes a temporary duplicate and reads from that, leaving other components to do what they like with the underlying file.

Quote from: 2E7AH link=msg=0 date=
It's not only about lyrics, but any kind of tagging


Of course.  The problem is that both this component and the lyric component trigger when the track starts, and therefore there is a likelihood of conflict.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-24 20:19:35
Maybe there should be option to switch the component like - don't process items not in media library, or something like that

That has been suggested before and I will likely add a preferences toggle for that.
Title: foo_wave_seekbar
Post by: drmrbrewer on 2010-01-25 22:06:03
Do you have a description somewhere of what the displayed signatures actually represent -- can be fairly technical, I can cope with it !  It's just that a couple of signatures have surprised me a little -- but it's just my lack of understanding of what they truly represent.

Thanks,

Mike
Title: foo_wave_seekbar
Post by: ExUser on 2010-01-25 22:29:31
Each song is chopped into N pieces (N=2048?). Each piece is analyzed for three values: peak max, peak min, and RMS. This results in N*3 values, and is the basis of the display.
Title: foo_wave_seekbar
Post by: drmrbrewer on 2010-01-25 22:33:46
OK, so how do you get the two traces from the three values?

Mike
Title: foo_wave_seekbar
Post by: Zao on 2010-01-25 22:39:26
The process is done on a mono channel. I mix any higher channel counts down to mono before analysis, as mentioned a few pages back.

The out-of-the-box visualisations are centered around zero DC and extend to +1 amplitude towards the top and -1 amplitude at the bottom of the window.

The upper bound of the waveform is formed by the Maximum values, the lower bound of the waveform is formed by the Minimum values and the RMS values are symmetrical around zero.

Any surprises you see are likely due to that it picks the min/max value over each chunk, and that I mixdown before analyzing. I have pondered doing the analysis per-channel and doing the mixdown later.
Title: foo_wave_seekbar
Post by: drmrbrewer on 2010-01-26 10:28:58
Maximum and Minimum of what? 

So the overall separation of the two traces is meant to represent loudness, while the variation in each trace is meant to represent variation in Maximum value (for upper trace) and Minimum value (for lower trace)?  It's just that some tracks seem overall to be fairly quiet, but the separation between tracks is quite high, and in some tracks the variation in audio seems quite low but the traces show a high variation.

And what determines where +1 and -1 are -- is it normalised per track, or is it consistent across tracks?  Sometimes, for particularly "messy" traces, the trace appears as if it is oscillating so much that it is off the scale.  Do you take account of replaygain values?

Thanks,

Mike
Title: foo_wave_seekbar
Post by: Zao on 2010-01-26 14:16:21
Maximum and minimum of decoded floating point audio amplitude.
As I said earlier, tracks where the channels are out of phase will bloat or reduce the measurements, as I work on the downmixed data.

An amplitude of 1.0 is equivalent to the maximum value representable in a regular integer-based format. Similarly, -1.0 is the minimum value representable in a integer-based format. Unless audio is glitched or decoders overshoot, you will be much outside [-1.0, 1.0].

It is not normalized in any form, it's the raw downmixed output from the decoder. All four ReplayGain values are available but they are not taken into account in the default effect or frontends.
Title: foo_wave_seekbar
Post by: ExUser on 2010-01-26 18:12:51
"Bug": When foo_wave_seekbar is installed on a machine without the DirectX redist, clicking on the place where the wave seekbar should be causes the current track to restart.
Title: foo_wave_seekbar
Post by: drmrbrewer on 2010-01-26 20:10:18
Would it be possible to add an option *not* to write signatures to the database?  On my system it only takes ~ two seconds to generate the signature after the new track starts, and it really doesn't bother me that the signature only flashes up after two seconds.  Otherwise the signature database will continue to grow and grow... mine is up to 7 GB already and I've only been using it on and off for a few days now.

Mike
Title: foo_wave_seekbar
Post by: _oao on 2010-01-26 20:14:38
mine is up to 7 GB already and I've only been using it on and off for a few days now.
weird, i'm using this component since the official release and my "wavecache.db" file is only 83.8MB...
Title: foo_wave_seekbar
Post by: drmrbrewer on 2010-01-26 20:25:27
weird, i'm using this component since the official release and my "wavecache.db" file is only 83.8MB...


I couldn't find a red-faced smiley to insert here to indicate my embarrassment.  OK, OK, it's only MB not GB!  Still, the database will just keep growing in size, whereas personally I don't see the need to store the results for future use at all.  A 2 second delay for the results appear really doesn't bother me, and I'd prefer that to thinking of this ever-growing signature database lurking on my system.

Mike
Title: foo_wave_seekbar
Post by: Zao on 2010-01-27 00:10:29
Canar: You're probably seeking to the first second or so, I'd reckon.
drmrbrewer: I guess you could create a file in its place, setting permissions to VERBOTEN, preventing the component from using it. Theoretically.

I'll probably add a transient mode to preferences the day I get around adding a preferences page. Real life is rather bogged down currently, so this component is on the back burner for now.
Title: foo_wave_seekbar
Post by: ExUser on 2010-01-27 01:24:37
That's it. Could we change it to do nothing in that case? Just display an empty frame?
Title: foo_wave_seekbar
Post by: Zao on 2010-01-27 05:42:00
It should be falling back to the fully functional GDI mode. You should see something, even if the view state (track length, etc) fails to propagate.
Title: foo_wave_seekbar
Post by: jeremija on 2010-01-27 08:45:41
Would it be possible to add the option to manually start the plugin via the View -> Visualization -> Wave seekbar (like other visualizations included in foobar2000), so that I don't actually have to have the panel included in my config, but can open it at will?
Title: foo_wave_seekbar
Post by: bb10 on 2010-01-27 18:57:25
Would it be possible to add the option to manually start the plugin via the View -> Visualization -> Wave seekbar (like other visualizations included in foobar2000), so that I don't actually have to have the panel included in my config, but can open it at will?

This is not a visualization though...
Title: foo_wave_seekbar
Post by: jeremija on 2010-01-28 10:10:10
Just because it doesn't use FFT analysis and display it with all of the fancy effects or doesn't animate much, it doesn't mean that it couldn't be considered a music visualization. It's like a static oscilloscope, or an oscilloscope which displays once already recorded data. If the author likes that idea and has the will to do it, I really don't see no reason why it could not be implemented from the technical point of view.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-01-28 10:28:53
I think he meant that it doesn't use visualization API, while Zao is considering some kind of switch for non media library files AFAIK, which is closest to what you asked, or if I misunderstood you can use it with dockable panels
Title: foo_wave_seekbar
Post by: Axon on 2010-01-28 22:15:52
So, there is a lot of profound awesomeness in this plugin, and I am using it, but I'm still a little critical.

First, I don't consider my system that sluggish - a P4 2.4 with a 6600GT running XP with two monitors in horizontal span mode - but it seems like running D3D mode in parallel with anything else using D3D (in my case, JEdit, making use of Java2D's D3D acceleration) occasionally sucks CPU like a dog. It goes away when I minimize foobar2000. I'm not really sure this is your problem to begin with, but it sure is aggravating.

Using pixel shaders on a 2D texture to encode a 1D height map has to be akin to drilling holes in wood with a 10-gauge. Wouldn't this have been easier to write in assembly language?  You're basically using several gigaflops of computing power, to.... draw a few lines.
Title: foo_wave_seekbar
Post by: Zao on 2010-01-29 00:58:35
Your problem probably lies mostly with running XP, I'd reckon.
Multiple concurrent D3D/GL contexts tend to interfere on XP, especially with multiple monitors involved. I may be able to make the component be kinder to such situations, but it's not high on the priority list as I do not have any living non-virtual XP machines. Most have exploded.

As for using pixel shaders, it's a matter of programmability. End users can customize the look greatly in a language suitable for the task. I do agree that it's slightly overkill though, but you should be happy to know that the Direct3D10 frontend isn't up to date.

As for update rate, I intend to make it configurable to lessen the load for the kind of people that do not need super-smooth sub-pixel position indicator movement.
Title: foo_wave_seekbar
Post by: jeremija on 2010-01-29 12:00:26
I think he meant that it doesn't use visualization API, while Zao is considering some kind of switch for non media library files AFAIK, which is closest to what you asked, or if I misunderstood you can use it with dockable panels

Yeah, I meant something like that, but AFAIK dockable panels are a bit outdated so I made a suggestion because this component is a really useful tool, but looks better on bigger layouts...
Title: foo_wave_seekbar
Post by: Zao on 2010-01-29 19:15:26
If there is some standalone UI element host in the API I can use, it wouldn't be horribly hard. If there's not, I'm not going to implement my own.
Title: foo_wave_seekbar
Post by: Caleb on 2010-01-29 22:43:42
I'm running Win7 with fb2k 1.0 here, and for some reason I don't get the waveform at all.

I right clicked on a track (FLAC), chose Extract Seekbar Signature, and then created a Waveform UI Element in the Scratchbox.
I can seek by clicking on various locations on it, but I do not see a waveform.
Title: foo_wave_seekbar
Post by: jeremija on 2010-01-29 23:41:44
did you try to restart the player after adding the panel to the main layout?
Title: foo_wave_seekbar
Post by: Caleb on 2010-01-30 07:11:30
did you try to restart the player after adding the panel to the main layout?


That did the trick, thanks.

Too bad this cannot go on the actual toolbar on top and replace the real seekbar.

Another feature suggestion: hovering the mouse on various positions could show a "ghost" seeker there and show the time of that spot in a hint or whatever.
Title: foo_wave_seekbar
Post by: jeremija on 2010-01-30 07:45:42
This has already been requested multiple times:
check the on-line bug/feature tracker: http://zao.se:8080/flyspray/ (http://zao.se:8080/flyspray/)
Title: foo_wave_seekbar
Post by: marc2003 on 2010-02-01 08:05:33
first of all, thanks to Zao for this component.

i just have a little query though - i have no idea about audio analysis or how this works but most of my library shows a nice symmetrical result. but listening to one album this morning (Underworld - Second Toughest In The Infants) is showing these odd patterns. i'm just wondering if anybody has any idea why this is?

(http://k5sbdw.blu.livefilestore.com/y1ptSdos-zDaCHtIlCJrjem-pNV9TPucqoZzpk4x1DijMhuA7nbO8PCINmaGPnSE5gOGi9kWMolD6i7rk5XgD1mRilRNz4qddYt/underworld3.png)

(http://k5sbdw.blu.livefilestore.com/y1p9dqi2YGpXkRvPf_KMopoQIse08_lqUSA39dgflVW7YjG4otFUMxLwYOhcSLDPIJjQmYfZoSIhXV4hBDVyoXEIUW4Q_0RTDnX/underworld4.png)


Title: foo_wave_seekbar
Post by: fuflo on 2010-02-01 08:22:52
yeah, i noticed some anomalies myself. by the idea it would seem that the wave should always be symetrical vertically, but i had a couple of tracks where for several seconds the wave is a little dropped. i'll post screenies when i find the specific tracks (if that's needed) ...
Title: foo_wave_seekbar
Post by: Zao on 2010-02-01 09:04:45
That's how the track really looks, for certain values of "looks".
A sound wave is a sequence of signed amplitude samples, which are measured against a zero reference. When playing back, zero is no speaker movement while positive/negative amplitudes translate to movement along the speaker element axis.
There's nothing that says that a waveform should be symmetrical, it's just that most of them tend to be. In computer generated music, especially chiptunes and old video game music, it's quite common with lopsided signals.
Also, as previously mentioned, I downmix before analyzing, and a downmix will always be vulernable to phase shifts.
(http://www.acc.umu.se/~zao/seekbar27_t.png) (http://www.acc.umu.se/~zao/seekbar27.png)
Title: foo_wave_seekbar
Post by: fuflo on 2010-02-01 09:52:56
oh.. i didn't thought of that. i thought it only measured amplitude.. well that's an oversight by me, thanks for clearing that up
Title: foo_wave_seekbar
Post by: dutch109 on 2010-02-03 21:21:30
Bug report :
When the converter is active on a playlist while playing another, the component seems to analyze the tracks of the converting playlist, not the one that is playing, thus the seekbar is displayed empty.

Awesome component by the way.

EDIT : False alert, the waveform is displayed after ~1min, probably because the converter is eating all the CPU time, and the analyzing thread is running at a low priority.
Title: foo_wave_seekbar
Post by: Zao on 2010-02-04 01:24:46
The worker threads intentionally have idle priority to not impact the system or the rest of foobar.
Title: foo_wave_seekbar
Post by: Jack Schmaltz on 2010-02-04 18:25:39
hey Zao, thank you for this great component, i have been enjoying it for a few weeks now.

iv ran into a very strange problem today however that appears to be due to wave seekbar.
when im playing a particular album (Venetian Snares - Printf) it takes over a minute to analyze the next track & in the process freezes foobar making it completely unresponsive.
iv tried other tracks since noticing this issue & they work fine as usual, only appears to be isolated to the tracks on this one album.

i dont know what other information i can provide at the moment as all that shows up in the console is track start then a minute later the wave seekbar finalization text.
however, if i can provide more info please ask.

thanks again

(http://i280.photobucket.com/albums/kk161/jackschmaltz/wave_analyze.png)
Title: foo_wave_seekbar
Post by: Zao on 2010-02-15 05:34:48
I have breathed life into my old P2 which contains a Geforce FX 5600 card on XP, and the seekbar runs perfectly fine, so I cannot reproduce the failure you two FX guys cited.
Title: foo_wave_seekbar
Post by: marc2003 on 2010-02-15 12:37:34
is the component analysing the same track twice when there is only 1 item in the playlist? i just noticed this in my console....

Code: [Select]
Wave cache: finished analysis of "F:\downloads\DJ_Retardo_-_What_the_North_Koreans_listen_to-Feb-2010\DJ_Retardo_-_What_the_North_Koreans_listen_to-Feb-2010.mp3"
Wave cache: finished analysis of "F:\downloads\DJ_Retardo_-_What_the_North_Koreans_listen_to-Feb-2010\DJ_Retardo_-_What_the_North_Koreans_listen_to-Feb-2010.mp3"

Title: foo_wave_seekbar
Post by: Zao on 2010-02-15 16:43:35
Yes. Until a track has been fully scanned and recorded into the database, it is possible to trigger additional scans. In your case, it's from the "scan next track in advance for linear playback orders" logic that enqueues it.
They are harmless and will just burn a bunch of CPU.
Title: foo_wave_seekbar
Post by: kopf on 2010-02-16 22:51:16
Can't add this DUI element to foobar v1.0 without having it crash foobar.

Let us know when it's stable and doesn't just invariably shit the bed.
Title: foo_wave_seekbar
Post by: marc2003 on 2010-02-16 23:03:05
it works fine in DUI/foobar v1 for me. i think the problem is at your end. 

is your hardware up to it? directx upto date as outlined in the opening post?
Title: foo_wave_seekbar
Post by: Zao on 2010-02-17 05:37:21
Can't add this DUI element to foobar v1.0 without having it crash foobar.
Let us know when it's stable and doesn't just invariably shit the bed.

Thank you for the encouraging feedback. Your crashes are Module Not Found while delay-loading d3dx10_42 for some reason. This is very strange, as you've successfully passed the d3dx9_42.dll test. Are you sure that you have installed the DirectX redist for August 2009 or later (February 2010 is available). The only reason I could see for such a crash would be someone grabbing single DirectX components and throwing them into the SysWoW64 folder.
Title: foo_wave_seekbar
Post by: kopf on 2010-02-17 08:58:35
Can't add this DUI element to foobar v1.0 without having it crash foobar.
Let us know when it's stable and doesn't just invariably shit the bed.

Thank you for the encouraging feedback. Your crashes are Module Not Found while delay-loading d3dx10_42 for some reason. This is very strange, as you've successfully passed the d3dx9_42.dll test. Are you sure that you have installed the DirectX redist for August 2009 or later (February 2010 is available). The only reason I could see for such a crash would be someone grabbing single DirectX components and throwing them into the SysWoW64 folder.


You're very welcome for the crude feedback. I installed the dx redist and all's working now. That hadn't occured to me to be the possible source of the problem, since I'd installed dx with a game or two, and everything else that'd been using it was happy with that setup - i figured it was installed in its entirity.

cheers for the help zao, plugin looks gut
Title: foo_wave_seekbar
Post by: xapz on 2010-02-18 15:17:34
This plugin is just awesome. I don't now how I could live without it for so long. 

I'm streaming all my music in FLAC from my NAS and at the beginning I was afraid the caching of the waveform data could be very slow, but it works like a charm.

Thank you very much Zao and keep up the good work! 
Title: foo_wave_seekbar
Post by: dhromed on 2010-02-25 23:17:50
Most excellent!

I'm just letting it draw from the layout colours; will play around with that later.

An issue: the highlight doesn't advance smoothly like the vertical bar. I tried to set it up so that the bar would be gone (0px), but highlight would stll be there, and it seems it advances a whole pixel at a time.
Title: foo_wave_seekbar
Post by: Zao on 2010-02-26 01:08:34
An issue: the highlight doesn't advance smoothly like the vertical bar. I tried to set it up so that the bar would be gone (0px), but highlight would stll be there, and it seems it advances a whole pixel at a time.

The highlight indeed does, as it's just a binary test per pixel whether it represents a past or future part.
If you want some light smoothing, consider a same-coloured position bar maybe, or if you're using the D3D frontend, maybe hack around a bit in the highlighting function.
I didn't put much time on smoothness for the played overlay, as the edge is hidden by the cursor.
Title: foo_wave_seekbar
Post by: dano on 2010-02-26 01:49:31
Is it possible to remove dead entries from the .db file?
Title: foo_wave_seekbar
Post by: Anomalous on 2010-02-26 02:09:38
Library > Remove Dead Waveforms

Also, any possibility of getting a fix for the freezing when the computer is locked (win+L)?
Title: foo_wave_seekbar
Post by: Zao on 2010-02-26 14:16:52
Depends. I haven't reproduced it here yet, so it's a bit hard to figure out what's wrong.
I do have some theories, but haven't verified them yet, I probably do not handle lost devices that well.

Does it break on lock even if you have say the GDI or Direct2D frontend, or heck, if you remove all visible bars?
Title: foo_wave_seekbar
Post by: Anomalous on 2010-02-26 14:45:23
When a song ends, the cpu usage goes to 50% (one core), and the next song does not play. Unlocking the computer resumes playback with no errors or anything in the console. This only happens with "Direct 3D 9.0c", removing the UI element also stops the problem from occurring. Possibly related, Process Explorer crashes when viewing foobar's threads, and foo_wave_seekbar.dll seems to be creating and destroying them like crazy even without the UI element visible.
Title: foo_wave_seekbar
Post by: Zao on 2010-02-27 06:23:38
The Process Explorer bug is a bug with Process Explorer which I have contacted the author about. The seekbar does not create threads like crazy, it's the long symbol names in the DLL that confuses it.
Title: foo_wave_seekbar
Post by: dhromed on 2010-02-28 16:25:00
Suddenly, the seekbar in D2D mode has decided to go to town on one of my cores, occupying between 50% and 100%. It affects the entire computer to the point where I can hardly browse folder in Explorer.

If I remove it from the layout or minimze Foobar or choose GDI, it all returns to normal instantly.

:\

What more details can I provide?
Title: foo_wave_seekbar
Post by: Zao on 2010-02-28 16:38:39
Suddenly, the seekbar in D2D mode has decided to go to town on one of my cores.
What more details can I provide?

I haven't had this happen on any machine I own, but you're not alone.
What OS and GPU are you on? If on Vista or Seven, do you use accelerated Aero or Aero Basic?
Title: foo_wave_seekbar
Post by: dhromed on 2010-02-28 19:30:53
XP SP3 Classic shell, Ati HD4850, AMD 5050e.
Catalyst 9.3, 2D Driver Version 6.14.10.6925
DX 4.09.000000000000000000(000)00000.0904

Title: foo_wave_seekbar
Post by: unclean on 2010-02-28 23:10:37
Thank you for this component, it's amazing! Second only to the Channel spectrum panel, I think.

My only problem with it is that it makes resizing foobar incredibly sluggish even after it's hidden with $showpanel in pss, which is something that doesn't seem to happen with other visualizations. Would be nice if it removed itself from memory when it isn't visible (or whatever it is that's happening).

Other then that good job

Title: foo_wave_seekbar
Post by: Zao on 2010-03-01 02:31:23
... it makes resizing foobar incredibly sluggish even after it's hidden with $showpanel in pss, ...
Any malfunctions when hosted in CUI are probably due to differences in how CUI handles hidden panels, as I use DUI for development and daily use.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-03-01 02:46:09
here is some Yirkha and musicmusic talk concerning stopping Shpeck when CUI panel isn't visible: http://www.hydrogenaudio.org/forums/index....st&p=609073 (http://www.hydrogenaudio.org/forums/index.php?showtopic=59388&view=findpost&p=609073)
Title: foo_wave_seekbar
Post by: unclean on 2010-03-01 23:33:48
Thank you for that! Resizing the width and height to zero does the trick.
Title: foo_wave_seekbar
Post by: sld on 2010-03-02 10:08:44
Hi Zao, is the Direct2D display anomaly at high DPI due to driver limitations, and can it be worked around?
Title: foo_wave_seekbar
Post by: Zao on 2010-03-02 13:42:55
No, it's solely in my code. I've made some misunderstanding of how Direct2D handles and propagates DPI, and it has worked properly in the past.
I'll fix it some day when I get around working on the seekbar again, I've been rather swamped with other work lately.
Title: foo_wave_seekbar
Post by: sld on 2010-03-02 17:00:38
I'm already happy knowing that it's not some fungled-up shoddy coding in Intel's drivers. I'm currently experiencing the same problem in Firefox's DirectWrite alpha. So it can be rectified after all!

Please don't rush a hobby project, whatever brings in the salary is more important. In fact, GDI looks sweeter than Direct2D in the Wave seekbar, just that Direct2D is smoother. Thanks for the good news and a cool component.
Title: foo_wave_seekbar
Post by: servimo on 2010-03-03 05:37:18
Nice component. I am seeing it in many screenshots.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-05 00:20:55
I got around rolling up accumulated changes and hacks into a release, this should fix assorted crashes and niggles, including high DPI mode, probably.
Title: foo_wave_seekbar
Post by: sld on 2010-03-05 06:52:06
Hey thanks for the PM! It's amusing to know that I was using an upside-down seekbar all this while, but it's been great to be able to easily seek back to sections of songs I'm trying to figure out guitar chords for every now and then.

The DPI problem is gone. My laptop uses 945GM graphics, so it's probably the lowest common denominator to bugfix compatibility for. The Firefox devs working on D2D should use your component as inspiration!
Title: foo_wave_seekbar
Post by: tits on 2010-03-05 23:51:23
please anybody help me to place this seekbar in this way:
(http://img94.imageshack.us/img94/5243/picki.th.jpg) (http://img94.imageshack.us/i/picki.jpg/)
Title: foo_wave_seekbar
Post by: emitter on 2010-03-06 00:30:56
A big disadvantage to the normal "boring" Seekbar is, that i don't see in to which minute or second i search, can u add this?
Title: foo_wave_seekbar
Post by: emitter on 2010-03-06 00:33:08
please anybody help me to place this seekbar in this way:
(http://img94.imageshack.us/img94/5243/picki.th.jpg) (http://img94.imageshack.us/i/picki.jpg/)


I would like it too like this on your screenshot!
Title: foo_wave_seekbar
Post by: Gapkiller on 2010-03-06 01:33:36
please anybody help me to place this seekbar in this way:
...snip...


please post a screenshot of your splitter settings...(Columns Ui\Layout Tab)
Title: foo_wave_seekbar
Post by: tits on 2010-03-06 01:45:09
please post a screenshot of your splitter settings...(Columns Ui\Layout Tab)


(http://img31.imageshack.us/img31/2723/pic2pz.th.jpg) (http://img31.imageshack.us/i/pic2pz.jpg/)
Title: foo_wave_seekbar
Post by: Gapkiller on 2010-03-06 01:54:21
right click the second panel stack splitter and insert a vertikal splitter.
right click that vertikal splitter and insert waveform seekbar.
move the vertikal splitter up until you are between the panel stack splitters on the third level.

done.

edit: oh and remove the other waveform seekbar..
Title: foo_wave_seekbar
Post by: tits on 2010-03-06 02:10:00
right click the second panel stack splitter and insert a vertikal splitter.
right click that vertikal splitter and insert waveform seekbar.
move the vertikal splitter up until you are between the panel stack splitters on the third level.

done.

edit: oh and remove the other waveform seekbar..


Thank you so much!!!
Now everything is just like I want.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-06 16:37:48
A big disadvantage to the normal "boring" Seekbar is, that i don't see in to which minute or second i search, can u add this?

I intend to have a tooltip, eventually.
Title: foo_wave_seekbar
Post by: DragonQ on 2010-03-07 01:20:34
A big disadvantage to the normal "boring" Seekbar is, that i don't see in to which minute or second i search, can u add this?

I intend to have a tooltip, eventually.


Awesome, this is the only thing preventing me from using this instead of the normal seek bar.
Title: foo_wave_seekbar
Post by: emitter on 2010-03-07 11:45:12
right click the second panel stack splitter and insert a vertikal splitter.
right click that vertikal splitter and insert waveform seekbar.
move the vertikal splitter up until you are between the panel stack splitters on the third level.

done.

edit: oh and remove the other waveform seekbar..


Can i get the Seekbar just like he do without using colums UI? I like the default theme ;-)
Title: foo_wave_seekbar
Post by: Zao on 2010-03-07 12:55:52
Naturally. Just go into edit mode and add splitters where suitable.
If you're inexperienced with the Default UI, there is a "sandbox" you can play around in.
Title: foo_wave_seekbar
Post by: emitter on 2010-03-07 19:21:24
Naturally. Just go into edit mode and add splitters where suitable.
If you're inexperienced with the Default UI, there is a "sandbox" you can play around in.


Sry im new in foobar editing and a got no plan how i do that ^^ is there anywhere a guide for the editing mode?
Title: foo_wave_seekbar
Post by: Jack Schmaltz on 2010-03-07 19:57:36
theres an overview here http://wiki.hydrogenaudio.org/index.php?ti...28foo_ui_std%29 (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Default_user_interface_%28foo_ui_std%29) with links to more info.
just mess around with it, its not overly complicated.
Title: foo_wave_seekbar
Post by: emitter on 2010-03-07 20:23:56
theres an overview here http://wiki.hydrogenaudio.org/index.php?ti...28foo_ui_std%29 (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Default_user_interface_%28foo_ui_std%29) with links to more info.
just mess around with it, its not overly complicated.


Omg i didn't really know how awesome this program is!!!

A little Question in the false Forum ^^ --> Can i or how can i rename the tabs (Playing, Artist Album, Track No...)
Title: foo_wave_seekbar
Post by: boombaard on 2010-03-09 09:27:40
Could you add a "force rescan waveform" option? I recently had a few tracks i'd mis-tagged (wrong order), and after I fixed the tags and renamed them again, the old waveforms still applied to the new tracks, with no way to fix them.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-09 19:17:13
Odd, I'm fairly sure that scanning tracks through the context menu will clobber any existing data. It may have silently broken, of course. If all else fails, open the database file with a sqlite3 tool and delete the relevant rows.
You could also move the files temporarily, invoke Library -> Remove Dead Waveforms, and move them back.
Title: foo_wave_seekbar
Post by: eerg on 2010-03-10 12:40:23
is there a possibility to scan whole playlist before playing song? my foobar freezes for 5-10 seconds while loading new song. i would like to scan every file on playlist, and then fluently change them without necessity to wait. "extract seekbar signature" doesnt work. i think it is not caused by computer (i7 720, ati 4650).

also could you please paste your seekbar.fx with 3d effect?

Title: foo_wave_seekbar
Post by: Zao on 2010-03-10 15:53:32
If your foobar freezes when decoding a song, you've got something fishy going on. Does it wedge if you use say the converter or checksum a file?
I highly doubt that it's this component, as all it does is a full decode and stores the results in a database.

Try doing it with a pristine portable installation with no other components.
Title: foo_wave_seekbar
Post by: freestyler on 2010-03-10 19:45:43
Can anyone write step by step how to make the plugin appear on foobar screen?
I can't figure it out.
Title: foo_wave_seekbar
Post by: eerg on 2010-03-10 20:01:41
thank you Zao, i think biography plugin caused those freezes. on new portable installation it works really smooth.

freestyler, it depends on which user interface you are using. if its default, then go to view > enable layout edition mode, and then just put wave seekbar somewhere

if its columns ui, then you should go to preferences > diplay > columns ui> layout
Title: foo_wave_seekbar
Post by: cwilliams on 2010-03-11 03:41:56
Thanks for the awesome plugin Zao, I love it!

I have what might be viewed as an odd feature request. Can there be a user definable boost in the db calculated by the waveform?

I replaygain all my tracks to 89db. I apply the replaygain to the MP3s themselves, so any of my many uses of my music (streamed from my comp, MP3 cds, put on my phone, etc.) all have a nice level even if they don't support replaygain. The side effect of this is all my waveforms become compressed. See the attached screenshot:

(http://lh4.ggpht.com/_nLkAIczqfjk/S5hlsEgD3YI/AAAAAAAAGMA/70D7CBZd9BY/s144/example.jpg) (http://picasaweb.google.com/lh/photo/vXt8-mWwaW1gXx3l-pwJIg?authkey=Gv1sRgCKn_w_Ctu5ebQQ&feat=embedwebsite)

A way to configure a db boost, or possibly have waveform automatically use all the available vertical space, would bring the nice looking waveforms that exist before I apply the replaygain.

Thanks again for the plugin!
Title: foo_wave_seekbar
Post by: Zao on 2010-03-11 04:07:11
If you're using the Direct3D mode, you can always modify the .fx file to apply a compensating scale.
Title: foo_wave_seekbar
Post by: cwilliams on 2010-03-11 04:17:14
If you're using the Direct3D mode, you can always modify the .fx file to apply a compensating scale.

I opened that file, only to immediately realize I was in over my head

On more thought, and playing with other filetypes I have (such as emulated formats .nsf, .spc etc.) a static scale increase won't work to do what I am picturing. I guess the request would then be for a optional feature to automatically scale the waveform to fill most the vertical space. It just looks so much better that way

Thanks for the quick reply and awesome plug in.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-11 04:25:08
My ulterior motive with this component is to educate the unwashed masses in the finer points of programmable shader pipelines.
Anyway, I'll put it on the todo, if it's not already there somewhere.
Title: foo_wave_seekbar
Post by: cwilliams on 2010-03-11 04:39:00
My ulterior motive with this component is to educate the unwashed masses in the finer points of programmable shader pipelines.

Hahaha, I knew there was more to your plan.

Anyway, I'll put it on the todo, if it's not already there somewhere.

Cool, if you get to it, great. Even if you don't, I'm still using and loving this plugin so thanks!
Title: foo_wave_seekbar
Post by: Zao on 2010-03-15 01:30:19
Could you add a "force rescan waveform" option? I recently had a few tracks i'd mis-tagged (wrong order), and after I fixed the tags and renamed them again, the old waveforms still applied to the new tracks, with no way to fix them.

That feature accidentally disappeared when reworking the queue system a few versions ago. It should be fixed for the next version, which also will have a rewritten analysis core, which will cure most phase issues.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-15 07:30:35
I've made some work towards supporting multiple channels.
If I decide to do that, there will be slightly more work when loading the waveform as well as an increase in database disk usage (probably) linear to the number of channels.
Is this something that's acceptable? I've added transparent compression so the hit should probably be around 1-1.5x for stereo files, tops.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-03-15 08:35:57
How and why would it affect stereo file behavior?
Title: foo_wave_seekbar
Post by: Zao on 2010-03-15 09:10:40
Because currently I only persist a single channel of mixed down information.
The proposal is to persist each channel individually and display either a mixed down display or separate channel displays.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-03-15 09:41:25
OK, waiting for your implementation 
It's not very clear to me what you mean with 1-1.5x: is it additional CPU work or you talk about disk space increase compared to current for stereo files
I take your talk for CPU when scanning stereo files
Title: foo_wave_seekbar
Post by: cwilliams on 2010-03-15 15:49:45
I've made some work towards supporting multiple channels.
If I decide to do that, there will be slightly more work when loading the waveform as well as an increase in database disk usage (probably) linear to the number of channels.
Is this something that's acceptable? I've added transparent compression so the hit should probably be around 1-1.5x for stereo files, tops.


I think any increase in CPU usage for extracting the waveform is acceptable because of the extract seekbar option that lets me do all that work up front anyway. 50% increase filesize for double the channels seems reasonable to me as well, I say go for it.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-15 21:58:55
The analysis will take twice as long for stereo, six times as long for 5.1, etc. That's already implemented, and won't change.
The disk storage will double for stereo files, etc. Although, with compression, I expect it to rise with 50% or so, at most.
There will be a slight increase in CPU usage for loading a waveform, but it's neglible as the amounts of data is so small.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-03-15 22:05:13
What will happen with current data?
Title: foo_wave_seekbar
Post by: Zao on 2010-03-15 23:25:48
Currently, old data is untouched. It will probably be interpreted as a mono signal.
Rescanning files will replace them with the new format, with multiple channels and compression.
I could implement some compression functionality of old data, but as the generation method has changed, one probably wants to rescan anyway.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-03-15 23:36:13
Don't want to sound demoralizing but I would also appreciate option not to use this advanced feature if it's somehow possible without sticky "last working for me version" option

Maybe:
- prolong CPU and storage even further with providing "mixed" mode data in normal state, and
- just work (scan and show) in "mixed" mode for users who want single wave representation
Title: foo_wave_seekbar
Post by: NullString on 2010-03-16 02:05:34
rescanning would be odd, but nothing serious
compression is appreciated. the db weights a lot currently, even with just mono signatures
Title: foo_wave_seekbar
Post by: labou on 2010-03-17 04:59:39
For me it does not show up at all. the panel just remains blank and if i click on it it restarts the song. that's it. I installed the DirectX August 2009 Redistributable and the DirectX February 2010 runtime redistributable. I also installed Microsoft Visual C++ 2008 Redistributable Package (x86), but im sure that was useless because im running windows 7 ultimate x64. any ideas about how to fix this?
Title: foo_wave_seekbar
Post by: wasmachien on 2010-03-17 15:55:41
For me it does not show up at all. the panel just remains blank and if i click on it it restarts the song. that's it. I installed the DirectX August 2009 Redistributable and the DirectX February 2010 runtime redistributable. I also installed Microsoft Visual C++ 2008 Redistributable Package (x86), but im sure that was useless because im running windows 7 ultimate x64. any ideas about how to fix this?

Try right clicking, configure, and replacing DirectX with GDI. That worked for me.

Great component by the way, the only thing that lacks for now is a tooltip to indicate the track time.
Title: foo_wave_seekbar
Post by: servimo on 2010-03-17 18:39:37
Don't want to sound demoralizing but I would also appreciate option not to use this advanced feature if it's somehow possible without sticky "last working for me version" option

Maybe:
- prolong CPU and storage even further with providing "mixed" mode data in normal state, and
- just work (scan and show) in "mixed" mode for users who want single wave representation

I want this too. My computer is slow and old. And I am happy with just showing the mixed way. But sometimes I want to see how the stereo is, or how the multiple channels looks. If there is some difference between channels.
Title: foo_wave_seekbar
Post by: ExUser on 2010-03-17 19:04:34
There will likely be no significant speed difference between the "old", mono scanning method and the new multi-channel one. There will be a bit more storage, that's about it. Those of you with slow computers do not fear! Zao still loves you.
Title: foo_wave_seekbar
Post by: labou on 2010-03-17 19:49:48
For me it does not show up at all. the panel just remains blank and if i click on it it restarts the song. that's it. I installed the DirectX August 2009 Redistributable and the DirectX February 2010 runtime redistributable. I also installed Microsoft Visual C++ 2008 Redistributable Package (x86), but im sure that was useless because im running windows 7 ultimate x64. any ideas about how to fix this?

Try right clicking, configure, and replacing DirectX with GDI. That worked for me.

Great component by the way, the only thing that lacks for now is a tooltip to indicate the track time.


I can't even do that. When I put it in a panel and right click the option that says waveform seekerbar is faded out
Title: foo_wave_seekbar
Post by: servimo on 2010-03-17 20:07:24
For me it does not show up at all. the panel just remains blank and if i click on it it restarts the song. that's it. I installed the DirectX August 2009 Redistributable and the DirectX February 2010 runtime redistributable. I also installed Microsoft Visual C++ 2008 Redistributable Package (x86), but im sure that was useless because im running windows 7 ultimate x64. any ideas about how to fix this?

Try right clicking, configure, and replacing DirectX with GDI. That worked for me.

Great component by the way, the only thing that lacks for now is a tooltip to indicate the track time.


I can't even do that. When I put it in a panel and right click the option that says waveform seekerbar is faded out

Maybe you have to wait a little, like me, it will not show up immediately. It is not play a song and see the waveform. It have to seek in a song for peaks and then display. Happen this to me. I have an AMD XP 2400+ processor and no video card, 512MB RAM. I use GDI.
Title: foo_wave_seekbar
Post by: tom_vienna_at on 2010-03-19 12:53:12
And here's (http://www.hydrogenaudio.org/forums/index.php?act=Attach&type=post&id=5609) a new modification of 'seekbar.fx' that scales the waveform according to Replay Gain data. By default, it will use the track gain; however, a quick edit of the file will enable the use of the album gain mode instead.


That modification would be oh-so-very useful for me, but for whatever reason it is not working... same waveform regardless if replaygain-values are present or not. Same waveform regardless of album- or track mode. Any idea? Thx.
Title: foo_wave_seekbar
Post by: mccarver on 2010-03-19 13:26:46
That modification would be oh-so-very useful for me, but for whatever reason it is not working... same waveform regardless if replaygain-values are present or not. Same waveform regardless of album- or track mode. Any idea? Thx.


It works fine here.. Now waveforms seem to be RG-independent. But non replaygained files return an empty waveform. Guess it's normal.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-19 13:36:07
When querying for non-existant replaygain, the track and album gain is -1000, and the peaks are -1. Adjusting the effect to test for negative values will likely do the trick.
Title: foo_wave_seekbar
Post by: tits on 2010-03-19 15:28:07
Just an idea where such seekbar will be also useful - a graphic scale in am/fm radio receiver. One will see the points where signal is clear.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-20 23:32:03
That would be quite out of scope of the component though, and more suitable for a domain-specific component, most probably integrated with whatever AM/FM tuner component you're using.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-27 10:46:45
A teaser of things to come:
(http://www.acc.umu.se/~zao/seekbar31_t.png) (http://www.acc.umu.se/~zao/seekbar31.png) (http://www.acc.umu.se/~zao/seekbar30_t.png) (http://www.acc.umu.se/~zao/seekbar30.png)

Is this configuration UI something that looks friendly and usable with regard to reordering the display of channels and toggling their visibility?

In my development version, it's fully functional and the Direct3D9 mode can display channels as can be seen in the above images. It also has other nice features like storage compression, optional multi-channel scanning and storage, an rescan command that actually works, and more. The next release will require some slight modifications to effect files to handle the additional texcoord parameter fed to it, but it should be a three line change in most cases.

And oh, before I forget it, a new Process Explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) version has been released, which fixes the Process Explorer crash bug that my component caused due to being too awesome (and having too long symbols, but I blame it on being awesome).
Title: foo_wave_seekbar
Post by: cymoon on 2010-03-28 19:40:07
Awesome. This is the feature I dreamed of.

It would be nice if it would be a part of the toolbar. So it could replace the seekbar completely.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-28 19:56:21
That is impossible for now, as there exists no published interface to augment the toolbar.
Title: foo_wave_seekbar
Post by: DragonQ on 2010-03-30 23:21:03
Looks great Zao.

Probably wanna move those tick boxes to the right a bit, they look too close to the edge of the group box at the moment.
Title: foo_wave_seekbar
Post by: Zao on 2010-03-31 00:54:46
That's how a list view with checkboxes looks natively. I will not muck around with owner drawing or other ill stuff. I value my sanity.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-01 02:11:21
0.2.0 released, see OP for a glorious changelog.
Highlights include multichannel display, fancy configuration for said display, multichannel analysis, storage compression.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-04-01 03:49:01
Thanks Zao, looking good
Roughly I can't notice any difference in scanning speed which is great I guess
Title: foo_wave_seekbar
Post by: captorofsin on 2010-04-01 12:20:33
Thank you! My Foobar looks so cool now with multichannel waveforms. 

This is a truly magnificent add on, keep up the good work Zao.
Title: foo_wave_seekbar
Post by: adam777 on 2010-04-01 16:05:47
Thanks for the update, Zao, works great.
Title: foo_wave_seekbar
Post by: s33m33 on 2010-04-01 20:25:18
Thanks Zao.

Excellent addon.
Title: foo_wave_seekbar
Post by: mudlord on 2010-04-01 23:12:40
Very nice indeed.
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-04-02 11:54:20
Thanks for the latest version Zao, and thanks for blocking scanning of last.fm radio tracks. It doesn't interrupt playback anymore, but unfortunately it seems to try and scan them when they are the next thing in the playlist, so some tracks get skipped when foobar tries to play them.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-02 16:45:40
Hrm, odd. There should be no difference whatsoever between how the current and next tracks are auto-scanned.
Can you PM me your console contents when this happens?
Also, what is the URL/location of the entries it occurs on? Are they lastfm://, http://, or other?
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-04-02 19:22:32
thanks for blocking scanning of last.fm radio tracks.

Mine doesn't do that.  I'm using the latest 0.2.0 release, and I still get errors on Last.fm radio streams.  Any track that I select plays for a few seconds, then I get an error and it skips to the next track.  I'm using the Last.fm radio component, and the stream URLs begin with FOO_LASTFM_RADIO://.  If this protocol isn't automatically skipped, can it be?  Additionally, my http:// streams are also being scanned, but it's not causing problems (yet).
Title: foo_wave_seekbar
Post by: Zao on 2010-04-02 19:56:34
I'll add those silly foo_lastfm_radio: and lastfm: protocols to the next version, but your HTTP claim bothers me.
Can you show a complete URL that it tries to scan together with the console output for it? If it contains sensitive fields like user/pass, censor those.
Note that messages like "Wave cache: skipping location ..." are from when the exclusion filter works. Any file that that message appears for will not be scanned.
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-04-02 22:38:10
Hmm it's started skipping tracks again. But the seekbar doesn't say it's scanning them, here's the console log:

Code: [Select]
Last.fm Radio: Handshake successful.
Last.fm Radio: Retrieved track "Fushitsusha [Pathetique] - Pathetique Pt. 2"
Last.fm Radio: Retrieved track "The Gerogerigegege [Tokyo Anal Dynamite] - Track 73"
Last.fm Radio: Retrieved track "Ruins [1986 - 1992] - Praha In Spring"
Last.fm Radio: Retrieved track "High Rise [Live] - Mainliner"
Last.fm Radio: Retrieved track "Keiji Haino with Boris [Black, Implication Flooding] - a rise, a moment before something unexpected is on the verge of starting"
Opening track for playback: "FOO_LASTFM_RADIO://play.last.fm/user/edbbe0bdade3d7d9d26c5c07e6e8d6c4.mp3LASTFM"
Last.fm Radio: Problem opening track "FOO_LASTFM_RADIO://play.last.fm/user/edbbe0bdade3d7d9d26c5c07e6e8d6c4.mp3LASTFM" : Forbidden (403)
Opening track for playback: "FOO_LASTFM_RADIO://play.last.fm/user/67467814a3f56101b38f7b014791fe6d.mp3LASTFM"
Last.fm Radio: Problem opening track "FOO_LASTFM_RADIO://play.last.fm/user/67467814a3f56101b38f7b014791fe6d.mp3LASTFM" : Forbidden (403)
Decoding failure at 0:00.000 (Unsupported format or corrupted file):
"FOO_LASTFM_RADIO://play.last.fm/user/67467814a3f56101b38f7b014791fe6d.mp3LASTFM"
Opening track for playback: "FOO_LASTFM_RADIO://play.last.fm/user/a7890215f52583f3731a1c99d365026f.mp3LASTFM"
Last.fm Radio: Problem opening track "FOO_LASTFM_RADIO://play.last.fm/user/67467814a3f56101b38f7b014791fe6d.mp3LASTFM" : Forbidden (403)
Last.fm Radio: Updating playlist "lastfm://artist/灰野敬二"
Last.fm Radio: Problem opening track "FOO_LASTFM_RADIO://play.last.fm/user/a7890215f52583f3731a1c99d365026f.mp3LASTFM" : Forbidden (403)
Last.fm Radio: Retrieved track "Masonna [Release Your Mind Volume 2 (Disc 3)] - Spark"
Last.fm Radio: Retrieved track "Merzbow [1930] - Intro"
Last.fm Radio: Retrieved track "John Wiese [Soft Punk] - PS2"
Last.fm Radio: Retrieved track "灰野敬二 [A Challenge To Fate] - My Only Friend"
Last.fm Radio: Retrieved track "Sutcliffe Jügend [We Spit on Their Graves (tape 1)] - Kill, Kill, Kill!"

It has managed to play a couple of tracks OK now though...

They all seem to be FOO_LASTFM_RADIO://
Title: foo_wave_seekbar
Post by: Zao on 2010-04-02 23:36:49
0.2.1 (see OP) now ignores stuff. Try it.
Title: foo_wave_seekbar
Post by: NullString on 2010-04-03 00:40:02
Thanks for the update(s)!
Title: foo_wave_seekbar
Post by: boombaard on 2010-04-03 08:50:13
Since .2, it seems to randomly decide whether or not to draw the seekbar in the window. Sometimes it returns if I switch between dx9/d2d/gdi, but most of the times it's just gone now.
(Playing .ape files from within my library)
Title: foo_wave_seekbar
Post by: TomBarlow on 2010-04-03 10:30:51
Thanks very much Zao
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-03 15:53:58
Short samples seems to be problematic (in 0.2.1)!?


With these samples for example I'm not getting any waveform display:

http://www.freesound.org/download/60719/60...ct_Goa_Kick.wav (http://www.freesound.org/download/60719/60719_Dstruct_Goa_Kick.wav)
http://www.freesound.org/download/76289/76...weight_Kick.wav (http://www.freesound.org/download/76289/76289_Dstruct_Heavyweight_Kick.wav)


But I think it should display something like that:

(http://media.freesound.org/data/60/images/60719__Dstruct__Goa_Kick.png)

(http://media.freesound.org/data/76/images/76289__Dstruct__Heavyweight_Kick.png)
Title: foo_wave_seekbar
Post by: Zao on 2010-04-03 16:28:18
boombaard: Oh joy. There's always someone that fails horribly. What OS and machine are you on, and does it occur with older versions (preferably including 0.1.12 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.1.12.7z), 0.1.13 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.1.13.7z); back up your DB and configuration beforehand)?

Dandruff: There goes my assumption that "surely no-one will have really really short tracks".
The thought struck me when rewriting the analysis code, but I focused effort on things that mattered more. I might look into it if free time magically appears.
Title: foo_wave_seekbar
Post by: boombaard on 2010-04-03 16:35:57
boombaard: Oh joy. There's always someone that fails horribly. What OS and machine are you on, and does it occur with older versions (preferably including 0.1.12 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.1.12.7z), 0.1.13 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.1.13.7z); back up your DB and configuration beforehand)?

All previous versions worked fine (.12, .13, .14) running win7 x64 (ATI HD3300 chipset, recent drivers). Stopped working with .2, .21 not working also.
After some finnicking with the new options, however, I noticed that it was due to the files I was using.
Apparently files that are mono (that is, with identical l/r channels) but encoded as stereo are displayed in the Center channel rather than frontleft/right. I'd disabled all other channels yesterday, hence it didn't do anything.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-03 16:57:40
Dandruff: There goes my assumption that "surely no-one will have really really short tracks".


Yeah. I actually have quite a lot of such samples. So it would be nice to be able to browse them with waveform display too ...


I might look into it if free time magically appears.


Thanks! Much appreciated!



Another suggestion: What about a "Normalize waveform display" option to get quiet tracks displayed in full height too? Would help the visibility quite a lot I think ...
Title: foo_wave_seekbar
Post by: Zao on 2010-04-03 18:17:05
I thought that the (mono) annotation on the center channel should be enough, but you've shown me wrong.
Yes, tracks with "legacy" single-channel waveforms will display in the center (mono) channel. Note that if a channel is not present, it will not take any place in the display, so there's no harm in having them all enabled.

I'd recommend rescanning your whole library if you want proper multichannel. There's a command in the menu under Library to do just that.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-03 18:26:27
Ahh, this was the problem with my short samples too. Now they show a waveform but in a very ugly way.



For http://www.freesound.org/download/60719/60...ct_Goa_Kick.wav (http://www.freesound.org/download/60719/60719_Dstruct_Goa_Kick.wav) I'm getting this display:

waveform-seekbar-goa-kick.png


Almost invisible/unreadable. Guess the line should be thicker ...
Title: foo_wave_seekbar
Post by: Zao on 2010-04-03 18:51:51
In D3D/GDI, the line thickness is determined by the difference between the maximum and minimum amplitude within a 1/2048th of the waveform. As your waveforms are very short, 16000-30000 samples, it's working with segments 7-14 samples wide. There's not much variation there really.

You could use the Direct2D mode, as that draws a line at the upper and lower bound of the waveform, or edit the shader for Direct3D, artificially adding a constant factor to the waveform.
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-04-03 19:14:17
I'll add those silly foo_lastfm_radio: and lastfm: protocols to the next version,

Thanks, the latest version works great.

but your HTTP claim bothers me.
Can you show a complete URL that it tries to scan together with the console output for it? If it contains sensitive fields like user/pass, censor those.
Note that messages like "Wave cache: skipping location ..." are from when the exclusion filter works. Any file that that message appears for will not be scanned.

Oops, never mind.  I misunderstood what was meant by "skipping" a track.  It skips the http:// tracks just fine (doesn't try to calculate the waveform, and the message you mentioned appears in the console), however, the progress bar tries to appear.  The progress bar flashes over the length of the seekbar a few times, and then goes to the end and stays there while the song is playing.  I'm guessing that this is because it can't properly compute the length of a streaming track, right?  Is it possible for the progress bar to completely ignore http:// tracks?
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-03 19:16:26
You could use the Direct2D mode, as that draws a line at the upper and lower bound of the waveform


This mode isn't avaliable here. I guess because I'm on XP.



or edit the shader for Direct3D, artificially adding a constant factor to the waveform.


Ok. But shouldn't that be done by default (with the next update) to make it looking better?
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-03 19:21:29
Is it possible for the progress bar to completely ignore http:// tracks?


Yeah, I wanted to ask the same. Would be nice if the seekbar would only show the background color for http streaming. At the moment it gets filled completely with the highlight color which is looking odd.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-03 19:32:08
I see you're on XP. That's too bad, as the following Direct2D shots will make you want to upgrade.
(http://www.acc.umu.se/~zao/seekbar34_t.png) (http://www.acc.umu.se/~zao/seekbar34.png)
(http://www.acc.umu.se/~zao/seekbar35_t.png) (http://www.acc.umu.se/~zao/seekbar35.png)

I played around with the shader and I couldn't hack up a decent look for such thin waveforms. The current architecture is not designed for such a thing.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-03 20:00:29
I see you're on XP. That's too bad, as the following Direct2D shots will make you want to upgrade.
(http://www.acc.umu.se/~zao/seekbar34_t.png) (http://www.acc.umu.se/~zao/seekbar34.png)
(http://www.acc.umu.se/~zao/seekbar35_t.png) (http://www.acc.umu.se/~zao/seekbar35.png)

I played around with the shader and I couldn't hack up a decent look for such thin waveforms. The current architecture is not designed for such a thing.


Alright. Thanks for trying! No big problem. But the Direct2D screenshot is looking very good indeed!
Title: foo_wave_seekbar
Post by: mauzel on 2010-04-03 23:02:31
Hello, this is probably going to sound retarded because I don't really know anything about computers, but I'm going to try posting about it.

A week ago, I installed the foo_wave_seekbar (0.1.11) component into foobar2000 (v1.0.1). I was very pleased with it. I promptly generated waveforms for the music I had in my playlists (only about 20 songs or so) so I could take care of the bulk of the CPU usage at once. So everything seemed dandy.

However, over the past week after installing the component, my computer has started acting up. For example, seemingly at random times, my computer would get extremely, extremely sluggish. More specifically, my CPU usage would spike to 100% for a few seconds at a time, which would cause everything on to be sluggish as one would imagine. If foobar2000 was playing music, the music would start stuttering during these slow downs, and my computer basically would be unresponsive/unusable during these periods.

If I merely had foobar2k open without any music playing, and was, for example, playing a video in MPC and my computer started slowing down, the video file's audio stream would be uninterrupted (it would NOT stutter) but new frames of the video stream would not render or whatever (basically my video and audio would desync because of the immense spike in CPU usage, I guess).

At first, I didn't think it would have been caused by foo_wave_seekbar. The first thing I did was scan my computer for spyware and viruses, which turned up nothing. Then I used SeaTools to check my hard drives (just did simple SMART and Short Drive Self Test (Short DST)), and then I verified and rebuilt my RAID unit. Anyway, after that the spike in CPU usage+slow down persisted; I then saw that v0.2.0 of foo_wave_seekbar had been released, so I upgraded to that version. However, my computer still experienced CPU usage spikes at seemingly completely random intervals.

At this point, I said "o ok" and tried removing foo_wave_seekbar from my foobar2000 components directory. Apparently, I haven't had any problems since then. I wasn't smart enough to check ProcExp or Resource Manager to see exactly what process/threads/whatever was behind the CPU usage spiking, but what I can say is that after I removed foo_wave_seekbar, I have not had any slow downs.

I really would like to use the component, so it makes me sad that foo_wave_seekbar was apparently the culprit. What I would like to ask is if anyone can give me any advice as how to truly isolate whether it is the component that caused the slow downs. Like I said, the CPU usage spikes seemed to happen entirely randomly, whether I was putting my system on load or whether I was just sitting in front of the computer chatting with people and doing nothing else---the only condition for the CPU usage spikes seemed to be to have foobar2000 open with foo_wave_seekbar installed.

If it helps, this is how I have things setup:
- Vista x64
- foobar2k outputs to a USB Audio DAC
- DirectX 10 (does it matter?)

And yeah, if I said anything dumb, it's because I don't really know anything about anything. Basically just wanted to report this and hopefully find out whether it is possible for foo_wave_seekbar to be the culprit, and if it is, whether it is possible to fix. If it isn't possible for foo_wave_seekbar to be behind my CPU usage spikes, then it must have been some strange coincidence that the sluggishness started after I installed it, and stopped after I removed it.

Also, I did check my list of components against the foobar2000 troubleshooter thing and it said that there were no problematic components found.

tl;dr version: I'm retarded, but I think that foo_wave_seekbar causes my computron to explode with massive spikes in CPU usage at random intervals. I did various scans/tests to try to figure out what the problem was, but the only thing that seemed to solve the issue was to entirely remove foo_wave_seekbar from my foobar2k directory.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-04 00:16:35
First you could test whether it occurs on a freshly started foobar2000 without any UI elements from it in your layout. It should do absolutely nothing then.
Then you could test whether the behaviour differs between the three frontends available (Direct3D, Direct2D, GDI), as the Direct3D one has had a bit of trouble with lost devices.
I can't really see it doing much to disturb the system in general, except for maybe excessive timer usage, or a slow disk.

If you manage to catch it in the act, try to get to the threads view of the foobar2000 process and see which thread that's eating all the CPU.
Title: foo_wave_seekbar
Post by: mauzel on 2010-04-05 00:55:26
Unfortunately, I won't be able to use the computer I've had the problems on for another 4 days or so. However, once I return, I will try the things you have suggested to possibly isolate the problem (if it pops up again).

Anyway, thanks for the reply.
Title: foo_wave_seekbar
Post by: Anomalous on 2010-04-05 13:41:39
I think I'm having the same problem. It does not occur with no UI elements present at startup, but as soon as the element is added it eats up the cpu. Music doesn't have to be playing and changing the frontends doesn't help.

Here's the threads:
(http://i42.tinypic.com/357rsht_th.jpg) (http://i42.tinypic.com/357rsht.jpg)

Title: foo_wave_seekbar
Post by: Zao on 2010-04-05 18:53:44
What frontend are you using, and is there anything interesting in the console?
Title: foo_wave_seekbar
Post by: Anomalous on 2010-04-05 19:17:26
I guess I should have checked the console first, it's rescanning all the songs again. I have no idea why, since they've all been done already. Is there a shortcut key to rescan them which I might have pressed or something?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-05 19:25:26
If you've terminated foobar incorrectly, the component will continue with all the scanning jobs that were in queue at last successful shutdown. I can't see how it could be anything else, really.
I've just released 0.2.2 by the way, which fixes a nasty bug at shutdown. Upgrading is strongly recommended.
Title: foo_wave_seekbar
Post by: ggggg on 2010-04-06 00:27:21
The wave seekbar doesn't work with ogg vorbis.
Could you solve this problem in one of the next updates? 

Or am I not able to install it correctly?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-06 00:51:53
What happens? Does it crash, does it not show any waveform, does the console say anything, what UI do you use?
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-06 01:14:10
Working fine here with Ogg Vorbis.
Title: foo_wave_seekbar
Post by: Anomalous on 2010-04-06 04:57:06
Changelog:
0.2.3 (2010/04/06)
Fixed the blocking on track change and 100% CPU when display is locked or some game are running.

Foobar now crashes when changing tracks while the computer is locked, the seekbar was on screen before locking, and the track changes; when foobar is minimised it works. Report submited.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-06 05:22:28
Curse you users, finding holes in my code!
0.2.4 is up, probably fixes the problem and ensures that all relevant state is updated on device re-acquire.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-06 13:18:08
Here two screenshots of 0.2.4:

(http://www.outburst-audio.com/maik/waveform-seekbar-ok.png)

(http://www.outburst-audio.com/maik/waveform-seekbar-ugly.png)


The first image is looking ok. Taken after foobar2000 starting up in maximized window (1920x1176 pixels). The second image was taken after foobar2000 starting up in small windows size (634x387 pixels) and maximized afterwards. Obviously the waveform isn't recalculated/redrawn properly automatically on window maximize!? Looks quite ugly. Too blurry ...
Title: foo_wave_seekbar
Post by: Jack Schmaltz on 2010-04-06 13:29:46
thank you for your continued work zao, its greatly appreciated
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-06 16:22:40
A problem with 0.2.4 in GDI mode:


-> maximize foobar2000 (so that we see a large waveform) - in my case the foobar window is 1920x1176 pixels large
-> open waveform seekbar configuration panel

=> Takes several seconds to open!? Makes it look like a hanging application. In "Direct3D 9.0c" mode it opens immediately!
Title: foo_wave_seekbar
Post by: ggggg on 2010-04-06 16:47:07
Okay it works fine with ogg vorbis.
I just rescaned all waveforms and now it works.
Before that it shew nothing, i could skip but there were no graphics.
The console doesn't say anything about the seekbar, no error or anything else.

But now it works after rescan.
I use CUI.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-06 22:23:16
Dandruff: Both your bugs should be fixed in 0.2.5.
The stretching was due to the device loss fixes accidentally destroyed the reset call needed to resize the backbuffer. It reused the backbuffer from first creation, no matter the window size.
The load time was because the frontend recreated the rendered waveform once per channel in the list, at least. This has been fixed.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-06 22:35:31
Dandruff: Both your bugs should be fixed in 0.2.5.
The stretching was due to the device loss fixes accidentally destroyed the reset call needed to resize the backbuffer. It reused the backbuffer from first creation, no matter the window size.
The load time was because the frontend recreated the rendered waveform once per channel in the list, at least. This has been fixed.


Confirmed. Both fixed! Many thanks!



Any chance to get an option to disable antialiasing completely in the future? For my taste the whole waveform drawing is too blurry ...
Title: foo_wave_seekbar
Post by: Zao on 2010-04-06 22:43:28
If you're using the Direct3D mode, replace line 128 (the one with lerp from bgColor to textColor) in seekbar.fx with
: textColor;
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-06 22:51:29
And for GDI mode?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-07 00:37:20
There you're out of luck. The GDI mode is mostly only intended to be a last fallback for machines that for some reason doesn't have D3D or D2D capabilities.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-07 07:47:14
Ok, thanks. No big problem.
Title: foo_wave_seekbar
Post by: za222 on 2010-04-07 17:59:57
Awesome plugin!

I am missing something, tho:

Would it be possible to cancel analysis of a track on manual track advance?

Example:

Let's say i have this playlist:
Track1
Track2
Track3
Track4
Track5

I start playing Track1, then i press "next" 4 times, so i listen to Track5. What happens now is that Tracks 1 to 4 are being analyzed first and i have to wait a long time for the waveform of Track5 to appear.
This also puts heavy load on CPU and HDD when i'm only randomly skipping throught tracks (for example when looking for a specific track).

My request could probably be summarized as:
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-08 08:39:13
Another suggestion: What about a "Normalize waveform display" option to get quiet tracks displayed in full height too? Would help the visibility quite a lot I think ...


Any opinions about this? Of course it should be optional only. Basically all my music is using Bobn Katz K-20 level reference (means -20dBFS RMS). Now with heavy compressed music you have plenty of empty room above and below the waveform ...



More suggestions:

1. Would be nice if there would be 2 or 3 pixels empty space above and below the waveform. So that a 0dB peaking sound doesn't look like shashed to the window edges ...

2. Optional solid 1 pixel center line(s) to mark the center of waveform(s). Should be drawn behind the waveform(s) of course.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-08 15:05:50
I didn't say anything as it has been suggested in the past.
It should probably be reasonably easy to do nowadays, but don't expect it anytime soon.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-08 15:28:19
Alright, thanks!
Title: foo_wave_seekbar
Post by: DragonQ on 2010-04-09 17:14:10
Not really a major thing but is there any chance of acquiring the waveforms in a multi-threaded operation? It takes ages for my entire playlist so if I ever had to re-scan them (like when the multi-channel waveforms feature was added), it'd be nice if it used all 8 of my CPU cores rather than just one.
Title: foo_wave_seekbar
Post by: mauzel on 2010-04-09 17:45:21
If anybody was wondering about my problem before, I seem to somehow have done things to my computer that make it so that I don't get the spikes in CPU usage I mentioned before.

At first, I was getting CPU spikes using the Direct3D path, but did not get periods of high CPU usage using GDI. Using Direct3D, it was not foobar's threads that were eating up CPU, but it was actually Vista's dwm.exe's thread starting at milcore.dll (start address: milcore.dll!VirtualChannelGetInstance+x1420c) that would eat up all the CPU. However, dwm.exe would only cause CPU usage to spike if I had foobar2k open with the waveform seekbar component enabled. I don't really know about these things, but that's what I've observed.

(http://tri4.net/linksys/images/foobar2000/fb2k_v_dwm.png)


After that, I switched my DAC from USB to optical (SPDIF) (for reasons unrelated to my foo_wave_seekbar issues), but I doubt this made the difference, although I did notice that foobar2k seemed to use more CPU when outputting via SPDIF than it did when it output to USB (I'm assuming this is because my optical/SPDIF out is on-board so is at least partially controlled by my CPU, and I guess more resources were needed to control SPDIF than were needed to control USB or something, I dunno).

Also, I updated foo_wave_seekbar to 0.2.5.

Then, after that, I installed Vista SP2 and the platform update for Vista SP2 (so before that, I didn't have support for D2D I guess). Along with foobar2k not using as much CPU as it did before after I switched to optical output, the spiking in CPU usage related to dwm.exe and using the Direct3D frontend seems to have stopped.

So, basically I don't really know what happened, whether it was coincidence or whether something in Vista's SP2/SP2 platform update fixed it, but I guess things are fixed.


Edit: Oh, and I should note that nothing was happening in foobar2k's console during the CPU usage spikes (so I wasn't having that problem the other user mentioned where foobar2k was picking up from where it left off scanning waveforms).
Title: foo_wave_seekbar
Post by: Zao on 2010-04-09 20:01:27
DragonQ: There are up to three background threads for analyzing tracks. This cap was determined by empirical studies showing that more than three just swamped the disk with I/O, actually reducing throughput. I'm considering adding an advanced preference to raise this cap, but beware that it may very well backfire on you if you raise it.

mauzel: SP2 or the Platform Update may very well have provided a more efficient code path for the DWM or Direct3D9, so it sounds like a reasonable theory. By the way, the long symbols exported by the seekbar are essentially meaningless, they're an artifact from one of the libraries I use.
Title: foo_wave_seekbar
Post by: DragonQ on 2010-04-09 20:12:36
Hmm I'm pretty sure it never goes above 13% (one core) for me.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-09 20:26:38
For me it does (on a Dual Core). You also should test this without other applications running. The threads seem to have very low priority (which I like).
Title: foo_wave_seekbar
Post by: Zao on 2010-04-09 20:39:58
How many cores does this (http://www.acc.umu.se/~zao/core_count.exe) tell you you have?
Title: foo_wave_seekbar
Post by: DragonQ on 2010-04-09 21:12:17
8, as expected. Maybe it does occasionally use 2 or 3 cores, I didn't check it for more than like 10 seconds. If the threads are indeed low priority then it's possible only one core is used sometimes cos I do a lot of multitasking (no point having 8 cores otherwise ).
Title: foo_wave_seekbar
Post by: Zao on 2010-04-09 21:15:40
The only reason the three cores would not all be churning away at 100% each is because of non-processing overhead, like I/O, lock contention, etc.
As for idle priority, if nothing else wants to run, they will be running at full speed. Priority is just a scheduler hint.
Also, unless you have some magical multi-chip machine, you have four cores. Hyperthreading has always been and will always be, crap.
Title: foo_wave_seekbar
Post by: Andreasvb on 2010-04-09 21:16:46
Zao, it says 4, I got a Quad Core Q6600, so it's correct.

foobar2000 can utilize up to 80% of the CPU sometimes when first analyzing the waveforms.
Usually it's around 50%, seems to work very well.
Title: foo_wave_seekbar
Post by: kode54 on 2010-04-09 21:36:07
it says 4, I got a Quad Core Q6600, so it's correct.

That does not reflect on HyperThreading, which your CPU does not support.
Title: foo_wave_seekbar
Post by: DragonQ on 2010-04-10 00:01:41
The only reason the three cores would not all be churning away at 100% each is because of non-processing overhead, like I/O, lock contention, etc.
As for idle priority, if nothing else wants to run, they will be running at full speed. Priority is just a scheduler hint.
Also, unless you have some magical multi-chip machine, you have four cores. Hyperthreading has always been and will always be, crap.


Actually HyperThreading is a logical way to make much more efficient use of a CPU core. Not gonna derail your thread with an argument about it. I watched the CPU % indicator for longer this time and it does look like most of the time it uses 2 cores so that's better than nothing I suppose.
Title: foo_wave_seekbar
Post by: dhromed on 2010-04-11 18:48:51
I'm getting some anomalous display with the latest version.

Image. (http://www.pliv.com/things/wave_anomaly.png)

It looks like the top half only shows the top half of the left channel, and the bottom half nly shows the bottom half of the right channel.

Different subject: I feel the preferences should move to the main prefs, to fortify consistency. I'm not sure how exactly, or where they should go, because all other layout elements seem to have their unique configs in a context menu. Even a big one like Facets is almost entirely set-up via context menu. I also don't spy a logical place in the preferences tree.

Nonetheless, It's a typical pref-page-like window with lots of options, and I keep going to prefs when I want to configre it, and then remember I have to select the 1-item context menu from the element itself.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-11 21:14:39
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.
Title: foo_wave_seekbar
Post by: dhromed on 2010-04-11 23:45:05
> As for your odd display, are you running 0.2.5?

Yes.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-12 01:23:16
Alright. Could you list your OS, UI component, graphics card model, etc?
Title: foo_wave_seekbar
Post by: CyberFoxx on 2010-04-12 03:05:37
Well, I wasn't sure if I should report this, um, bug, but I guess it couldn't hurt.
Anyway, with the Waveform Seekbar in my foobar layout, for some odd reason, the Windows Sidebar cannot keep window focus. (Eg: Context menus on gadgets and the Sidebar close as if I clicked away, Gadget Gallery window loses focus even though the mouse cursor never left it's window, etc) But, if I just remove the Waveform Seekbar from my layout, there's no problems with the Windows Sidebar losing focus. I've tried switching between Direct3D, Direct2D and GDI frontends to no effect. Even having foobar minimized with Waveform Seekbar in my layout still causes focus loss with the Sidebar. Oh, and a waveform has to have been displayed at least once, just starting up foobar won't cause it to happen, you have to hit play first.

Like I said, wasn't quite sure if I should report this, but it's the first time I've seen anything weird like this happen. I've tried other D3D and D2D apps to see if they do the same thing to the Sidebar, but nothing so far. If it's just one of those weird random one in a million things, then I'll just deal with it for now. Didn't think it'd hurt to report it...

Anyway, just in case it might help:
OS: Windows Server 2008 Standard
Graphics card: Radeon X1600 XT
UI: Columns UI 0.3.8.3
Title: foo_wave_seekbar
Post by: tropicalfish on 2010-04-12 07:05:59
Haven't been able to find it here in the thread, but is there a way to "sharpen" the waveform a bit? So it isn't faded/blurred.

Thanks for the add-on, though! It works really nicely.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-12 07:13:14
CyberFoxx: Sidebar here on Seven works as intended with both CUI and DUI.
I'm going to randomly blame you running a server SKU on a desktop; you having an ATI card; and you're using CUI. 

tropicalfish: As for "sharpening" it, twiddle the assorted constants in the shader file if you use Direct3D; most particularly the "factor" variable, or write your own 
Title: foo_wave_seekbar
Post by: CyberFoxx on 2010-04-12 09:02:51
Well, looks like it was ATI's fault. On a lark, I went to see if ATI/AMD decided to update their legacy drivers, they did. Installed the new drivers, and everything is playing together nicely. How and what was happening with the old drivers, who knows. I'm just glad it's working now.

(As to why I'm running 2K8, it was free from MS. Didn't think I could go wrong with free...)
Title: foo_wave_seekbar
Post by: bacti_buster on 2010-04-12 14:05:47
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

Title: foo_wave_seekbar
Post by: dhromed on 2010-04-12 17:53:27
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.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-12 17:58:43
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.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-13 16:49:02
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 (http://download.microsoft.com/download/winmediatech40/Utility/1.0/W98NT42KMeXP/EN-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 (http://download.microsoft.com/download/6/b/1/6b17045c-6ce8-4dc4-a3b5-2717b8711fc8/8Channel.exe) 8 channel files the "Side right" and "Back right" channels are missing in the "Downmix display to mono" display. Why?
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-13 17:22:43
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?
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-13 20:34:04
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 (http://foosion.foobar2000.org/misc/seekbar.fx.txt): Put this in your profile or installation directory in the effects subdirectory.
(http://foosion.foobar2000.org/misc/foo_wave_seekbar.png)


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 (http://webs.uvigo.es/servicios/biblioteca/uit/rec/BS/R-REC-BS.1770-1-200709-I!!PDF-E.pdf)
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-04-13 21:29:09
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.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-13 21:44:21
Alright. Didn't know that. Thanks!
Title: foo_wave_seekbar
Post by: Zao on 2010-04-14 01:05:21
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 (http://download.microsoft.com/download/winmediatech40/Utility/1.0/W98NT42KMeXP/EN-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 (http://download.microsoft.com/download/6/b/1/6b17045c-6ce8-4dc4-a3b5-2717b8711fc8/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).
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-14 01:18:43
Ok, no problem.
Title: foo_wave_seekbar
Post by: dhromed on 2010-04-14 21:53:47
Omitting [the new shader] could very well result in the odd chimera display.


Fix!
Title: foo_wave_seekbar
Post by: ExUser on 2010-04-14 22:09:20
Fix!
Ambiguous!
Title: foo_wave_seekbar
Post by: bb10 on 2010-04-14 22:17:05
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 (http://bb10x.org/temp/seekbar.fx.txt)
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-15 01:47:53
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 (http://bb10x.org/temp/seekbar.fx.txt)


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!?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-15 14:06:26
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 (http://www.acc.umu.se/~zao/seekbar26.png) and seekbar.png has never been used, it just served as a hint for the purpose of them.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-04-15 15:45:41
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
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-15 15:49:18
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 (http://www.acc.umu.se/~zao/seekbar26.png) and seekbar.png has never been used, it just served as a hint for the purpose of them.


Ok, thanks!
Title: foo_wave_seekbar
Post by: megar on 2010-04-16 13:05:26
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.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-16 13:19:48
I have not tested with multiple GPUs at all. What GPUs and OS do you have?
Title: foo_wave_seekbar
Post by: NullString on 2010-04-16 15:41:18
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 (http://bb10x.org/temp/seekbar.fx.txt)
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();
}
}
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-16 22:00:55
@Zao: Would be possible to show the waveform building live on the fly while it's being calculated? Would be useful for long files ...
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-16 22:03:20
added one line to scale the waveform using replaygain


What's the use/result of it?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-16 22:07:21
@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.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-16 22:12:57
Ok. No prob.
Title: foo_wave_seekbar
Post by: NullString on 2010-04-17 13:15:25
added one line to scale the waveform using replaygain


What's the use/result of it?

scaled smaller same sized waveforms, personal preference
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-17 14:56:42
added one line to scale the waveform using replaygain


What's the use/result of it?

scaled smaller same sized waveforms, personal preference


Tried your script. Doesn't run here. Pasted it into Notepad and saved as seekbar.fx. But Waveform Seekbar reverts to GDI mode on startup.
Title: foo_wave_seekbar
Post by: lvqcl on 2010-04-17 15:08:18
Tried your script. Doesn't run here. Pasted it into Notepad and saved as seekbar.fx. But Waveform Seekbar reverts to GDI mode on startup.

Change © to ( c )
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-17 15:22:04
Tried your script. Doesn't run here. Pasted it into Notepad and saved as seekbar.fx. But Waveform Seekbar reverts to GDI mode on startup.

Change © to ( c )


Ok, working now. Thanks.


But:

1. Non-ReplayGain-tagged files are not showing any waveform now. Just a horizontal grey line visible.
2. Why not normalizing the Waveform display by peak value of the file so that it would also work for non-ReplayGain-tagged files? Is this not possible?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-17 15:29:48
Dandruff, NullString: From earlier in this thread -
When querying for non-existant replaygain, the track and album gain is -1000, and the peaks are -1. Adjusting the effect to test for negative values will likely do the trick.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-17 16:06:48
Ok, scripting is not my thing. But thanks.


Are ReplayGain tags required to scale the waveform height? Does Waveform Seekbar know the real peak value to be able to normalize the display for all tracks?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-17 16:56:59
It could probably be provided, but I'd rather not go break the effect interface again before I get around fixing multiple effects and add effect versioning.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-17 19:26:01
Ok, thanks!
Title: foo_wave_seekbar
Post by: Purple Monkey on 2010-04-18 15:16:28
Got a new bug:

I installed foobar 1.0.2.1 and seekbar 0.2.5 on to my notebook which has an Intel 945 Express display adapter. I get no issues with GDI, but with DirectX9c it's not so good:
(http://img.photobucket.com/albums/v627/PurpleMonkeyMad/th_seek_mp3.png) (http://smg.photobucket.com/albums/v627/PurpleMonkeyMad/seek_mp3.png)

It would appear to be something to do with large peaks as the same original flac file (which has a peak < 1) displays fine, along with other mp3s that have a have peaks < 1.

(http://img.photobucket.com/albums/v627/PurpleMonkeyMad/th_seek_flac.png) (http://smg.photobucket.com/albums/v627/PurpleMonkeyMad/seek_flac.png)

(http://img.photobucket.com/albums/v627/PurpleMonkeyMad/th_seek_mp3_low.png) (http://smg.photobucket.com/albums/v627/PurpleMonkeyMad/seek_mp3_low.png)

I attempted to scale the waveform in seebar.fx but this had no effect. I've seen other developers complain about how broken Intel's drivers are so I would hazard a guess it's the cards handling of textures.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-18 17:15:05
I'm currently in an awesome state of sleep deprivation, but I can tell you this: this texture scaling code looks like the works of a madman.
Try the 0.2.6 I just uploaded. It might even fix it.
Title: foo_wave_seekbar
Post by: Purple Monkey on 2010-04-18 18:51:59
Can confirm that the new version does fix it, thanks a lot.

I wasn't expecting it to happen that fast, I don't know about everyone else but I'm always happy to wait for a fix if it means that you don't burn yourself out. Get some well deserved sleep.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-19 07:10:52
I was bending my sleep back into shape for the weekdays, so I had nothing to do anyway. 
I can't see how this code ever really worked right. Waveforms ought to have been mis-scaled by 4x, if it does what I think it did.
Title: foo_wave_seekbar
Post by: Virtureal on 2010-04-19 18:10:12
Could I get some help with the RMS script? It doesn't seem to be working with 0.2.6. Also I get no waveform when playing a specific vinyl 24bit FLAC rip, everything else loads just fine  Is it the processing time which is incredibly long or am I having a problem here? I'm not seeing anything in the console.

/EDIT during the 13:48 minutes one of the songs is, the waveform never loads
Title: foo_wave_seekbar
Post by: Falstaff on 2010-04-19 18:29:59
i have 3 available modes in te options for rendering of the wave :

Direct2D 1.0
Direct3D 9.c
GDI

but Direct3D 9.c doesn't work at all, empty panel or freeze of the previous rendering (GDI or Direct2D)

i run the latest version 0.2.6 under Seven x64 with a Geforce 8800 GTS video card with the latest video drivers (just installed to be sure my problem was not from the drivers)

any idea ? (i've try to installe again DirectX, but on install, system says i already have the latest version installed, for sure!)

so, what's the problem, plugin bug or vieo card (nvidia Geforce 8) not compatible??

i'm stuck
Title: foo_wave_seekbar
Post by: Zao on 2010-04-19 20:00:04
The Direct3D9 mode supports cards down to the weak Intel cards and GF FX cards. Check your console for failure information.
Judging by your claim that the redist says you're up to date, you must be trying to run the web installer. If you've got spare time and a decent internet connection, there's always the full redist (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=0cef8180-e94a-4f56-b157-5ab8109cb4f5).
Did you extract the effects directory into your foobar2000 profile or foobar2000 install directories?
Title: foo_wave_seekbar
Post by: Falstaff on 2010-04-19 20:24:43
all methods tried for installing DirectX again (in case of...) : web or full redist package, same

effects folder is at the good place i mean, check below:

(http://xs.to/thumb-12E6_4BCCAB5F.jpg) (http://xs.to/share-12E6_4BCCAB5F.html)

the CONSOLE display this error when i select Direct3D render mode :

Seekbar: taking Direct3D9 path.
Seekbar: Direct3D: D3DXERR_INVALIDDATA(-2005529767) Invalid data
Seekbar: frontend creation failed: Direct3D9: could not create effects.


any idea ?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-19 20:46:04
At first guess, I would guess that it's probably the u-with-grave (ù) in your path, but I'd have to test that to be sure.
Also, can you upload your effect file intact somewhere. You might have accidentally saved it as UTF-8 with a BOM or with characters outside low ASCII. Both those things will make it fail.
Title: foo_wave_seekbar
Post by: Falstaff on 2010-04-19 20:53:20
At first guess, I would guess that it's probably the u-with-grave (ù) in your path, but I'd have to test that to be sure.
Also, can you upload your effect file intact somewhere. You might have accidentally saved it as UTF-8 with a BOM or with characters outside low ASCII. Both those things will make it fail.


foobar2000 for renamed without ù and now it works (/fubar - tech/)... how do you get the foobar root folder in your code ? something is looking bad in ...

thanx for the help, and add an advert in the doc to explain that are restrictions in the name of the root foobar folder naming for Direct3D rendering ... just until you fix it


EDIT: the behaviour of this component is weird when i change seekbar.fx script, it's no always updated ... keep playing with it
Title: foo_wave_seekbar
Post by: Falstaff on 2010-04-19 21:11:05
requests:

1. could it be possible to never save the wave form in db, maybe an option to purpose no ?

2. multiple instance of this panel (in a CUI config) ? for example, to display left channel in a panel and right panel in another one ...
Title: foo_wave_seekbar
Post by: Zao on 2010-04-19 21:21:09
I have uploaded 0.2.7 which solves both possible problems.
It loads the file into memory using the foobar2000 infrastructure so it should behave properly with any paths that foobar2000 supports.
It also filters out (and warns) about any non-ASCII bytes in the effect file.

Multiple instances works out of the box. Just create two of it, and just check/uncheck channel checkboxes in each of them.

As for not storing waveforms and/or storing it in separate files, it's on the TODO but nothing concrete for now.
Title: foo_wave_seekbar
Post by: Falstaff on 2010-04-19 21:30:38
I have uploaded 0.2.7 which solves both possible problems.
It loads the file into memory using the foobar2000 infrastructure so it should behave properly with any paths that foobar2000 supports.
It also filters out (and warns) about any non-ASCII bytes in the effect file.

Multiple instances works out of the box. Just create two of it, and just check/uncheck channel checkboxes in each of them.

As for not storing waveforms and/or storing it in separate files, it's on the TODO but nothing concrete for now.


i'm going to test the new version right now, thanx

"...storing it in separate files" -> would be cool to obtain the wave as a .png image in the music folder or in a specified folder (to set), so the wave form could be exploited out of the box with other components (WSH for example in order to code a more complex seekbar...)

thanx again Zao!

EDIT: all is fine in this new version foobar root folder name (fùbar is ok now) + multiple instances are ok (tested with both only)
Title: foo_wave_seekbar
Post by: Zao on 2010-04-19 21:43:32
Back in the 0.0.x days, there used to be two separate components, foo_wave_cache and foo_wave_seekbar. The former had a public interface that could be used by any component.
Internally, that's still the case, so it sure would be possible to query the cache from other components. It's not separated enough to be usable by anyone else, and I doubt that anyone that was competent enough to do component dev would want it. Especially as if I publish an interface to it, I would be forced to ensure binary compatibility forever, which I'd rather not.

As for exporting PNG files, that's a bit restrictive and cumbersome, as the waveform is stored internally as a 1D texture.
Title: foo_wave_seekbar
Post by: Falstaff on 2010-04-19 21:52:37
I understand

but ... exporting this 1D texture as a data file, that would be a useful option, for example, this will allow us to read this data file (ascii format because jscript can't read binary files) in a WSH script to draw to desired form, like a wave or like a color (like the moodbar of Amarok ...)

what do you think about it ?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-19 21:59:11
To quote Samir from Office Space: »Yes, this is horrible, this idea.«.
A solution not involving the file system would be most optimal. Possible implementation methods would be to use the non-existant service of my component, or opening the sqlite3 database yourself, or writing an component or external tool to extract such information. Or heck, expose it as a metadata field, but then we're getting into cwbowron-grade insanity.
Title: foo_wave_seekbar
Post by: lediur on 2010-04-20 05:04:42
When I try to add this to my config, foobar immediately crashes with this in the event log:

Code: [Select]
Faulting application name: foobar2000.exe, version: 1.0.2.1, time stamp: 0x4bc1080c
Faulting module name: ntdll.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdb3b
Exception code: 0xc0000374
Fault offset: 0x000cdcbb
Faulting process id: 0x88c
Faulting application start time: 0x01cae03e20fa652f
Faulting application path: E:\Media\foobar2000\foobar2000.exe
Faulting module path: C:\Windows\SysWOW64\ntdll.dll
Report Id: 6cb7f953-4c31-11df-984f-f2b8e5f08a48


Here are my components:

Code: [Select]
Core (2010-04-10 23:21:50 UTC)
    foobar2000 core 1.0.2.1
foo_ac3.dll (2010-01-11 17:18:40 UTC)
    AC3 decoder 0.9.4
foo_adpcm.dll (2010-01-11 17:19:30 UTC)
    ADX decoder 1.8
    BRR decoder 0.7
    GCN DSP decoder 1.4
    Interplay ACM decoder 1.0
    kode's ADPCM decoders 1.4
    OKI-ADPCM decoder 0.14
    RAC decoder 1.0
    XA ADPCM decoder 1.5
foo_albumlist.dll (2010-04-10 23:19:56 UTC)
    Album List 4.4
foo_audioscrobbler.dll (2010-02-07 21:16:48 UTC)
    Audioscrobbler 1.4.6
foo_cdda.dll (2010-04-10 23:19:48 UTC)
    CD Audio Decoder 3.0
foo_channel_mixer.dll (2008-03-12 09:37:47 UTC)
    Channel Mixer 0.9.6.5
foo_converter.dll (2010-04-10 23:19:30 UTC)
    Converter 1.4
foo_dsp_dolbyhp.dll (2010-01-22 19:40:28 UTC)
    Dolby Headphone Wrapper 1.4.1
foo_dsp_fsurround.dll (2010-03-31 10:35:38 UTC)
    FreeSurround 0.3.5
foo_dsp_std.dll (2010-04-10 23:20:02 UTC)
    Standard DSP Array 1.0
foo_dumb.dll (2010-01-16 13:01:20 UTC)
    DUMB module decoder 0.9.9.12
foo_fileops.dll (2010-04-10 23:19:08 UTC)
    File Operations 2.1.2
foo_freedb2.dll (2010-04-10 23:19:10 UTC)
    freedb Tagger 0.6.2
foo_gep.dll (2010-02-10 05:23:54 UTC)
    Game Emu Player 1.94
foo_input_dts.dll (2010-01-11 17:28:30 UTC)
    DTS decoder 0.2.8
foo_input_std.dll (2010-04-10 23:19:50 UTC)
    Standard Input Array 1.0
foo_input_usf.dll (2010-02-04 00:10:14 UTC)
    LazyUSF 2.0 (Build Feb  3 2010)
foo_jesus.dll (2010-01-03 19:41:18 UTC)
    Autosave & Autobackup 8
foo_lastfm_radio.dll (2010-02-18 03:21:28 UTC)
    Last.fm Radio 0.5.7e
foo_midi.dll (2010-02-18 18:15:52 UTC)
    MIDI synthesizer host 1.99
foo_out_asio.dll (2009-03-22 20:15:46 UTC)
    ASIO support 1.2.7
foo_playcount.dll (2009-04-30 02:09:32 UTC)
    Playback Statistics 2.1.9
foo_podcatcher.dll (2010-03-26 02:30:42 UTC)
    Podcatcher 0.1.6d (beta)
foo_prettypop.dll (2009-12-06 03:31:08 UTC)
    Pretty Popup 1.2.5
foo_psf.dll (2010-03-04 04:52:40 UTC)
    Highly Experimental 2.0.12
foo_rgscan.dll (2010-04-10 23:19:38 UTC)
    ReplayGain Scanner 2.0.9
foo_sid.dll (2010-01-11 16:38:46 UTC)
    sidplay2 1.15
foo_softplaylists.dll (2010-03-23 04:30:13 UTC)
    Soft Playlists 2009-12-30.2
foo_ui_columns.dll (2010-01-09 14:40:28 UTC)
    Columns UI 0.3.8.3
foo_ui_std.dll (2010-04-10 23:20:12 UTC)
    Default User Interface 0.9.5
foo_uie_bookmarks.dll (2009-12-24 02:42:30 UTC)
    Bookmarks 0.3.0
foo_uie_vis_peakmeter_spectrum.dll (2008-04-20 01:18:50 UTC)
    Peakmeter Spectrum Visualisation 0.2.0.0 beta
foo_uie_wsh_panel_mod.dll (2010-02-28 02:59:14 UTC)
    WSH Panel Mod 1.3.2
foo_unpack.dll (2010-04-10 23:18:56 UTC)
    RAR reader 1.3
    ZIP/GZIP reader 1.0
foo_vis_shpeck.dll (2009-09-28 16:32:16 UTC)
    Shpeck - Winamp vis plugins wrapper 0.3.7
foo_w7shell.dll (2010-01-17 10:09:20 UTC)
    Windows 7 integration 0.2.9.1
foo_wave_seekbar.dll (2010-04-20 03:16:48 UTC)
    Waveform seekbar 0.2.7
Title: foo_wave_seekbar
Post by: Zao on 2010-04-20 11:55:26
Did you submit a crash report? I can't find anything that's blamed on the current seekbar component. Is this CUI or DUI?
Also, try it on a fresh portable install without all the junk components.
Also, try running this redist test (http://www.acc.umu.se/~zao/CheckRedists.exe), as that does the same tests as my component does. You might be suffering from hooks from external applications or components. Something on your system is preventing the foobar2000 crash handler from activating.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-21 14:40:20
0.2.8 released, updating is strongly recommended as this fixes a rare crash bug when drawing detects a lost device.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-22 11:12:18
The 0.2.9 release is dedicated to all the idiots that consider themselves more competent at installing the DirectX runtime than the redist installer.
If you've been manually copying in d3dxN_NN.dll files, don't do that. That's bloody retarded and will lead to glorious explosions. Use the redist like everyone else, gaaaah.

*breathes*
0.2.9 also has a placeholder waveform with all possible channels present, and falls back to GDI more properly on frontend failure.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-04-22 11:53:31
Maybe there should be option to switch the component like - don't process items not in media library, or something like that

That has been suggested before and I will likely add a preferences toggle for that.


Any news on this?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-22 13:43:05
0.2.10 has an advanced preference to scan tracks not in the media library. It defaults to the current behaviour, which to analyse everything.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-04-22 14:15:13
All right, thanks
Long waited, very quickly implemented
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-22 14:43:31
Mmh,

why not "Don't store analysed tracks not in the media library" to still get waveform display but without storing them to the database?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-22 14:51:49
Because that's a completely different feature, which would require multiple backends to support the temporary in-memory one then.
That is something that is not trivially implementable, unlike the analysis filter here, which was just a dozen lines or so in one function.
Literally, if (skip_tracks_outside) if (not library->is_track_in_library(make_handle(location))) skip();
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-22 15:10:17
Ok, didn't know that. Just sounded more useful to me ;)

Don't actually need these options for me.
Title: foo_wave_seekbar
Post by: metalboy on 2010-04-22 17:23:47
It would be nice for the display to scale or have ability to scale per volume. Example all my files are mp3gain scanned so they all "look" narrow ranged or quiet, some of the lower volume tracks or portions of tracks appear as just a line. Scale based on db's would be great then one could set max at 89 db's and that should be close on the range. It would give some control over the look of the wave also. Not really a dynamic per track scale as a constant scale, does that make sense?
Title: foo_wave_seekbar
Post by: Falstaff on 2010-04-23 11:33:55
@Zao :

bug (according to me)

on playback STOP, the wave seekbar is still displayed, it shouldn't (no sense)

what about it ? could you fix it please ?

Thanx for feedback.

EDIT: i use latest version v0.2.10
Title: foo_wave_seekbar
Post by: Zao on 2010-04-23 17:46:45
I consider it to be a feature that the previous waveform persists, as otherwise you'd get annoying flicker on track changes.
Title: foo_wave_seekbar
Post by: Falstaff on 2010-04-23 18:00:17
weird, but it's your decision
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-23 18:07:17
I consider it to be a feature that the previous waveform persists, as otherwise you'd get annoying flicker on track changes.


I'm cool with that! I hate flickering.
Title: foo_wave_seekbar
Post by: za222 on 2010-04-23 18:30:54
I don't see what's wrong with that, either.

I'd rather see the waveform of the last track that was played instead of seeing nothing at all.
Title: foo_wave_seekbar
Post by: ExUser on 2010-04-23 19:33:25
I think Falstaff's suggestion is backwards, personally. I like it the way it is.
Title: foo_wave_seekbar
Post by: Falstaff on 2010-04-23 20:29:40
maybe i'm too binary
Title: foo_wave_seekbar
Post by: ExUser on 2010-04-23 20:54:02
maybe i'm too binary
Maybe you're just false.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-24 05:10:08
0.2.11 now has a shiny tooltip when seeking that indicates the target time.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-24 07:33:03
0.2.11 now has a shiny tooltip when seeking that indicates the target time.


Very nice. But it should get improved a bit.


I have foobar at upper right screen corner. Dragging (seeking) mouse cursor out of screen (say above foobar in this case) causes tooltip going out of screen too. Tooltip should switch position to stay in foobar window. Same when dragging to the rightmost screen edge -> tooltip should switch position to the left of the mouse cursor to stay in screen. Also when dragging mouse cursor very far away from the foobar window (so that even the seek cursor gets hidden) doen't hide the tooltip. So you can move the tooltip around the whole screen via mouse drag. Should be avoided.
Title: foo_wave_seekbar
Post by: bb10 on 2010-04-24 12:32:58
Very nice. But it should get improved a bit.


I have foobar at upper right screen corner. Dragging (seeking) mouse cursor out of screen (say above foobar in this case) causes tooltip going out of screen too. Tooltip should switch position to stay in foobar window. Same when dragging to the rightmost screen edge -> tooltip should switch position to the left of the mouse cursor to stay in screen. Also when dragging mouse cursor very far away from the foobar window (so that even the seek cursor gets hidden) doen't hide the tooltip. So you can move the tooltip around the whole screen via mouse drag. Should be avoided.

Already reported and fixed internally.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-24 12:45:29
Cool, thanks!
Title: foo_wave_seekbar
Post by: bb10 on 2010-04-24 13:16:19
Sorry, I somehow didn't underline the part I was talking about.
Title: foo_wave_seekbar
Post by: teohhanhui on 2010-04-24 21:04:25
Just wondering... Is Direct2D incapable of the same effects as Direct3D in this case? What are the advantages/disadvantages?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-24 21:27:38
I could make the Direct2D mode push the exact same pixels as the GDI mode, but then there would be no need for it.
The Direct2D look is the way it is because it's different and does something (smooth splines) that would be hard to do in the other two frontends.
This is why I do not bundle the Direct3D10 frontend anymore, it doesn't add any value over the Direct3D9 one.
Title: foo_wave_seekbar
Post by: Steve Forte Rio on 2010-04-28 09:39:25
Hello and thank you for the great work.
I have an idea: could you add normalizing of waveforms? It can be very useful for signals with very low peaks
Title: foo_wave_seekbar
Post by: Kobs on 2010-04-29 11:07:46
Hi Zao,

Thank you for this great component!

I use it since a long time but actually i have found a problem when tagging a file, short time after start playing :

Message:
'Could not update tags (Sharing violation) on: "<musicFileName>"'

I have installed a fresh foobar with foo_wave_seekbar only, same problem.
Hope it can help you resolving this. 
Title: foo_wave_seekbar
Post by: Dandruff on 2010-04-29 11:37:31
I have foobar at upper right screen corner. Dragging (seeking) mouse cursor out of screen (say above foobar in this case) causes tooltip going out of screen too. Tooltip should switch position to stay in foobar window. Same when dragging to the rightmost screen edge -> tooltip should switch position to the left of the mouse cursor to stay in screen.

This still happens with 0.2.12!


Also when dragging mouse cursor very far away from the foobar window (so that even the seek cursor gets hidden) doen't hide the tooltip. So you can move the tooltip around the whole screen via mouse drag. Should be avoided.

This is fixed in 0.2.12, thanks!
Title: foo_wave_seekbar
Post by: Nii2 on 2010-04-29 13:04:20
Hi,

thanks for this component. I would like to come back to 0.2.10 version. Where can I download it please?
Title: foo_wave_seekbar
Post by: ExUser on 2010-04-29 13:35:25
What do you dislike about the new version?
Title: foo_wave_seekbar
Post by: Nii2 on 2010-04-29 13:58:11
It's just visually. It doesn't render the same thing, I'd rather the 0.2.10 (I didn't test the 0.2.11) for this point.
Title: foo_wave_seekbar
Post by: Zao on 2010-04-29 16:07:16
I have an idea: could you add normalizing of waveforms? It can be very useful for signals with very low peaks


It's deep in the todo somewhere, along with ReplayGain adjustment.

Message:
'Could not update tags (Sharing violation) on: "<musicFileName>"'


Known, but the fix is tricky and not robust. If I behave properly, any other component that tries to concurrently access the file will break it the same way.

I have foobar at upper right screen corner. Dragging (seeking) mouse cursor out of screen (say above foobar in this case) causes tooltip going out of screen too. Tooltip should switch position to stay in foobar window. Same when dragging to the rightmost screen edge -> tooltip should switch position to the left of the mouse cursor to stay in screen.

This still happens with 0.2.12!

Also when dragging mouse cursor very far away from the foobar window (so that even the seek cursor gets hidden) doen't hide the tooltip. So you can move the tooltip around the whole screen via mouse drag. Should be avoided.

This is fixed in 0.2.12, thanks!


The former needs querying of monitor rectangles and finding out the dimensions of the tooltip window itself. That requires effort, so I've put it on the mythical todo.
Hiding the tooltip on the other hand, is trivial and thus, it's done already.
Normally, the changelog tells the whole truth about what's in a release, unless I forget some minor fix or tweak.

Hi,

thanks for this component. I would like to come back to 0.2.10 version. Where can I download it please?


As far as I know, the components site only keeps the latest version, as it should.

It's just visually. It doesn't render the same thing, I'd rather the 0.2.10 (I didn't test the 0.2.11) for this point.


What frontend do you use, have you've rescanned the files with the later version?
What's different, scale, form, foot-tappityness?
Title: foo_wave_seekbar
Post by: Kobs on 2010-04-29 19:27:01
It's deep in the todo somewhere, along with ReplayGain adjustment.

Message:
'Could not update tags (Sharing violation) on: "<musicFileName>"'


Known, but the fix is tricky and not robust. If I behave properly, any other component that tries to concurrently access the file will break it the same way.




Ok ! Thanks Zao!
Title: foo_wave_seekbar
Post by: Nii2 on 2010-04-29 21:23:57
Ok, I'm gonna try to explain clearly with my poor english :S
I use Direct3D and I didn't rescan the files.
In previous version, I just had only one waveform for both channel display selected (right and left channel). Now, with 0.2.12, I have 2, and with my samll config it's not very nice. So, I would like to return to only one waveform. The other (minor) thing is the foreground color with latest version. It doesn't render the same nice "effect" with the same RGB adjustement than in the version 0.2.10. It's white instead of blue..
Here it is, I hope this is understanding.

Anyway, a suggestion, would it be possible to have tooltip indicating target time when focus with mouse on waveform seekbar?
Title: foo_wave_seekbar
Post by: Zao on 2010-04-29 22:00:34
There is an option in the configuration for the element to downmix to just one channel. You just have to have the Center (mono) channel enabled and it will be just like before.
Title: foo_wave_seekbar
Post by: jeremija on 2010-05-01 12:58:09
I'm experiencing 50% CPU Usage (guess this is 100% on one of two cores) while using Direct3D 9.0c on this system:

AMD Athlon II X2 250
2 GB RAM
Windows XP 32bit
ATI Radeon HD 4600 Series (latest drivers)

Using foobar2000 v1.0.3 DUI (didn't try in CUI)
Waveform seekbar 0.2.12

On other system with Win7 64bit this doesn't happen.

Also, when I switch to GDI, cpu falls down to 0%.
Title: foo_wave_seekbar
Post by: Zao on 2010-05-01 18:07:24
Run Process Explorer, find the thread that is consuming a whole core, copy a few representative stack traces, or create a minidump and upload it somewhere.
Title: foo_wave_seekbar
Post by: jeremija on 2010-05-01 20:01:32
Zao,

here is the screenshot of both foobar2000 and processexplorer in DUI,

(http://img683.imageshack.us/img683/5543/dui.th.png) (http://img683.imageshack.us/i/dui.png/)

and this is what happens when I use this plugin in CUI (direct3d only, GDI is good): no significant CPU usage, but it displays just this fixed glitched image:
(http://img204.imageshack.us/img204/3950/cui.th.png) (http://img204.imageshack.us/i/cui.png/)

Thank you for your time!
Title: foo_wave_seekbar
Post by: Zao on 2010-05-01 21:07:56
I would blame ATI drivers. It's convenient, and wouldn't surprise me much.
Is that stack trace always the same, or does it vary a lot?
Title: foo_wave_seekbar
Post by: jeremija on 2010-05-02 07:12:09
Could be that it's due to the ATI drivers... I've had problems with ATI cards before. I recently bought a GeForce and wouldn't go back to ATI for nothing (and on that PC this doesn't happen).
Title: foo_wave_seekbar
Post by: mjb2006 on 2010-05-03 08:20:33
Quoting the 1st post:

Extract the archive into the foobar2000 directory (so that the effects directory is directly in your foobar2000 directory and not inside the components directory

I think you need to update these installation instructions. As of the 0.2.12, the distribution .zip contains only one file: the .dll, which apparently goes in the components directory.

Effects will only be loaded from profile directory now, if you have the effects directory in the application directory, move it to the profile directory (somewhere in the roaming application data, to get there, use the hidden [hold shift] »Browse configuration folder« command on the file menu).

That hidden command doesn't exist in my version of foobar2000 (1.0.3).
Maybe recommend this instead: Start > Run > %APPDATA%\foobar2000\effects
Also consider adding to this post something about the fact that seekbar.fx exists, and what it is?

Add UI element to the Default UI or Columns UI as normal

Took me a while to figure out that after doing this (in Columns UI), it was there, just collapsed. I had to drag the edge of the caption a bit to get the actual window to appear. Is this how it was for everyone, or does it depend on the existing layout?

Suggestion: If in the advanced prefs you have unchecked 'Analyse tracks not in the media library', and you attempt to manually extract a seekbar signature, write some kind of message to the console.

Anyway, thanks for the work you put into this component. It's awesome!
Title: foo_wave_seekbar
Post by: Zao on 2010-05-03 17:15:15
Yay, feedback!
The changes in this version were mostly to conform to component site guidelines, so I changed the code and archive and didn't pay much attention to boring things such as documentation.
I've got a branch where I'm removing the .fx files completely, where the effect instead is stored in per-instance configuration. That would allow you to export your whole configuration cleanly as .fth or .fcl (I guess, don't use Columns).

As for your Columns UI snafu, it's probably due to the layout you're in, or my component not advertising a recommended size or something if there's such a thing in Columns.
In my world Columns is a second-tier platform, as I do not use it and rely on people on IRC who do to report misbehavior.

I've been blessed with a HA Wiki account recently, so I'll probably put some more structured information there eventually.
Title: foo_wave_seekbar
Post by: Axon on 2010-05-04 16:27:33
FWIW, here's what I've done with my effect... plot is a 30 dB scale instead of linear; the plot is normalized to the track peak; orange=maxval, blue=minval, dark gray=rms.

(http://img175.imageshack.us/img175/3503/fb2kpic1b4may10.png)
Title: foo_wave_seekbar
Post by: Zao on 2010-05-04 20:39:56
Cute. A bit too jaggy for my taste, but still.
Title: foo_wave_seekbar
Post by: MarkSeymour on 2010-05-08 16:18:31
I have had this problem ever since using older versions of foo_wave_seekbar.
When using Direct2D mode on Windows 7 (x64, ATI Mobility Radeon HD 3650), the waveform appears outlined, while GDI is filled.
(http://i41.tinypic.com/5yccib.png)
Title: foo_wave_seekbar
Post by: Zao on 2010-05-08 16:49:49
The Direct2D frontend intentionally looks different. If it looked the same, there would be no need to have it.
Title: foo_wave_seekbar
Post by: Zao on 2010-05-09 17:50:16
A taste of future freedom:
(http://www.acc.umu.se/~zao/effect-editor02-t.png) (http://www.acc.umu.se/~zao/effect-editor02.png)
It will have a fallback effect if you make errors, it stores per-instance effects, and has live preview and error reporting.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-05-09 18:07:38
Cool!
Title: foo_wave_seekbar
Post by: Slimbob on 2010-05-11 08:18:11
I feel pretty stupid but I've looked through a lot of this thread and it seems like I am the only one with this problem.
I can't figure out how to make the bar horizontal. It's stuck in the vertical position for me.

EDIT 1: Woo I figured it out. I think.
Title: foo_wave_seekbar
Post by: Zao on 2010-05-11 11:59:25
It automagically detects whether it should be vertical or horizontal from the size of the element. It will be orientated such that the bar follows the longest dimension. It used to be a configuration toggle.
Title: foo_wave_seekbar
Post by: Slimbob on 2010-05-11 14:15:01
It automagically detects whether it should be vertical or horizontal from the size of the element. It will be orientated such that the bar follows the longest dimension. It used to be a configuration toggle.


Ah that explains it. I ended up making a horizontal splitter doodle to rest it on. It made the demons in my head stop.
Title: foo_wave_seekbar
Post by: Axon on 2010-05-11 23:00:26
Cheezy pixel-shader-magnifying-glass effects, anybody?

Code: [Select]
float4 evaluate(float2 tc, float2 d, float x0)
{
    float xd=tc.x-x0,
          y=(1/2-1),
          u=-(2*xd/0.01)*(2*xd/0.01),
          E=exp(u/2);
   
    float4 minmaxrms = tex1Dbias(sTex, float4(
        tc.x + xd*y*E,
        0, 0,
        log2(2048*d.x * (1 + y*E*(1+u)))
        ));
       
// alpha 1 indicates biased texture
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
...

Zao, I've noticed when mucking around with LOD bias/mipmap levels that min/max levels are being averaged at lower LOD levels. As I understand the effect code, this isn't as much of a big deal with the default effect, because well, it completely ignores LOD and thus has massive aliasing issues of its own. But how possible do you think it would be to manually populate the mipmaps, by computing the max/min of the higher resolution texture samples, instead of letting DirectX average samples together?

And for the ultimate nitpick: Could you populate the .g value of minmaxrms with rms^2, so that sample averaging at lower LOD levels is meaningfully accurate?
Title: foo_wave_seekbar
Post by: Zao on 2010-05-12 11:26:09
I compute my own mipmaps. They are however just averaged as you noticed.
As for the default effect, as far as I know, sampling should pick a suitable miplevel according to size.
Title: foo_wave_seekbar
Post by: Purple Monkey on 2010-05-12 14:15:17
Getting to grips with HLSL a bit, after much math I realised that it should excel at vectors. An update to the seekbar.fx (http://www.hydrogenaudio.org/forums/index.php?act=attach&type=post&id=5901) I posted in the CUI appearance thread.

To change the hue difference, change the number at 187,
Code: [Select]
c = hueshift(c,4.0);
If you want two particular hues, use the colour picker to find the hue values, subtract them and divide by 38.2.
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-05-13 08:15:36
Getting to grips with HLSL a bit, after much math I realised that it should excel at vectors. An update to the seekbar.fx (http://www.hydrogenaudio.org/forums/index.php?act=attach&type=post&id=5901) I posted in the CUI appearance thread.

To change the hue difference, change the number at 187,
Code: [Select]
c = hueshift(c,4.0);
If you want two particular hues, use the colour picker to find the hue values, subtract them and divide by 38.2.


I would like to make it so that my waveform is gray (or whatever the foreground color is), however, I want the played color to highlight it according to the selection color.  I can sort of get the opposite of what I want if I change your effect to grayscale.  Is there any easy way to modify it to get this effect?  Thanks.
Title: foo_wave_seekbar
Post by: Purple Monkey on 2010-05-13 14:14:42
On line 165 under the played function change:
Code: [Select]
    if (pos > tc.x)
to
Code: [Select]
    if (pos < tc.x)
Title: foo_wave_seekbar
Post by: teohhanhui on 2010-05-13 21:02:59
seekbar.fx is not extracted when the file does not exist but the "effects" folder already exists in the profile folder.
Title: foo_wave_seekbar
Post by: Zao on 2010-05-13 21:27:14
That's not what my source code says, but in any way, it's largely moot.
The next version will not use files at all. I expect to release it in June or so.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-05-14 00:06:09
The next version will not use files at all.


Sounds nice! Thanks!
Title: foo_wave_seekbar
Post by: Anomalous on 2010-05-14 04:31:13
Here's a version of the RMS effect which uses the highlight colour instead of just grey-scaling it. http://pastebin.com/rVfuCDgy (http://pastebin.com/rVfuCDgy)

(http://i42.tinypic.com/4utgti.jpg)
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-05-14 05:22:22
On line 165 under the played function change:
Code: [Select]
    if (pos > tc.x)
to
Code: [Select]
    if (pos < tc.x)


Thanks.  This was really obvious, I really should have noticed that.


So, I've been trying to play around with the seekbar.fx file, but I'm really not sure what does what in the code.  First off, what language is this written in (and where can I find some basic documentation on the syntax)?  Also, is there any form of documentation for this code specifically?  I'm having a hard time trying to determine what each variable in the code corresponds to, and how to use them.  Finally, is there any way to print a variable's value to the console for debugging?  Thanks.
Title: foo_wave_seekbar
Post by: Anomalous on 2010-05-14 05:51:33
From what I've read here it's High level shader language (http://en.wikipedia.org/wiki/High_Level_Shader_Language), there's documentation by Microsoft here (http://msdn.microsoft.com/en-us/library/bb509638%28VS.85%29.aspx).
Title: foo_wave_seekbar
Post by: Zao on 2010-05-14 10:19:11
Printing is something that is very hard to achieve in shaders.

One fundamental concept that tends to confuse people used to normal languages is that the PS function (pixel shader) runs on each and every pixel of the display, in parallel.
Thus, you can't really return anything or affect anything outside that pixel, like some mythical console or so.
I find that one of the easier ways to output values is to set the output colour component to values you're interested in and estimate the value based on that, with the caveat that only colour components between 0 and 1 are representable.

Documentation should be available on MSDN as Anomalous linked, and you ought to be able to find decent information on post-processing elsewhere online too.
After all, this is the language that shaders for most games are written in.

As for documentation on my functions, they should hopefully be reasonably obvious based on their usage and parameters. Heh.
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-05-14 11:07:32
Thanks to both of you, that's helped a lot.
Title: foo_wave_seekbar
Post by: teohhanhui on 2010-05-14 13:11:07
Here's a version of the RMS effect which uses the highlight colour instead of just grey-scaling it. http://pastebin.com/rVfuCDgy (http://pastebin.com/rVfuCDgy)

Thanks! That's exactly what I wanted but failed to achieve after trying for many hours...
Title: foo_wave_seekbar
Post by: IvoP123 on 2010-05-19 10:38:41
My seekbar doesn't highlight played part of the song. Is this a bug or is it something wrong with my foobar (i use it in ubuntu with wine)?
Title: foo_wave_seekbar
Post by: Quærendo Invenietis on 2010-05-24 18:06:35
Is there any feasible way to acquire Direct2D without having to install Vista SP2?
Title: foo_wave_seekbar
Post by: Zao on 2010-05-24 18:28:47
No. None whatsoever. You need SP2 and the platform update.
Title: foo_wave_seekbar
Post by: Quærendo Invenietis on 2010-05-26 22:59:33
Ah, I see. After trying to install SP2 on my system at least seventeen times, and after finally installing the Platform Update, and after finally trying Direct 2D out, I have come to the conclusion that I prefer GDI over Direct 2D. At least I have the option to switch between the two now. (I still prefer Direct 2D over Direct 3D.)

Thanks for the component, Zao. It's easily amongst my favorites.
Title: foo_wave_seekbar
Post by: MDMA on 2010-05-27 11:48:14
Anyone have any idea how I can pad the wave seekbar, so that there are a few more extra pixels of background around the wave? Thanks :-)
Title: foo_wave_seekbar
Post by: Zao on 2010-05-27 15:11:56
You can either scale down the texcoords somewhat, or fade to black when near the edge of the waveform, or something similarly sneaky.

That's all for the D3D one, of course. With GDI and D2D, you're out of luck.
Title: foo_wave_seekbar
Post by: MDMA on 2010-05-27 21:29:45
No idea how to do what you just said  Some further help may be necessary! and yes I am using D3D
Title: foo_wave_seekbar
Post by: louiswain on 2010-06-02 13:38:25
Hi
I'm trying to use your component but i cannot get it to work.
How can i activate the component so it appears in my foobar window?
I'm using winxp sp3 and i have an nforce4 gfx card, directx9 is installed too..
Please help. thank you!


update: already sorted out..
thanks for the neat plugin!
Title: foo_wave_seekbar
Post by: entsyymi on 2010-06-05 17:46:24
Anyone have any idea why my seekbar goes like this at times:

(http://pic.leech.it/i/27cea/6287ec6asd.jpg)

It just stays still, doesn't react to anything, and I have no idea what causes it. Im using Windows 7 and the newest version of fb2k.
Title: foo_wave_seekbar
Post by: Zao on 2010-06-05 23:04:16
Not even clicking/dragging? Or resizing the element?
In other news, I'll be going home for summer, so I won't have any decent machine to develop on. After all my taunting of people who have GMA cards, now I have one of my own
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-06-06 08:20:23
I don't understand some of above talk, so hope not to repeat, but is it possible to script frequency range roughly in HSL space?

sine sweep:
(http://img294.imageshack.us/img294/8122/11bramsweeplogw.png)

some track:
(http://img339.imageshack.us/img339/26/09vaihtujaflacw.png)

I found this when looking for some command line spectrogram script here (http://soundviewer.svn.sourceforge.net/viewvc/soundviewer/svt.py?view=markup&pathrev=1), which btw turned nice and fast for batch processing, and it also had option for generating such waveforms
Title: foo_wave_seekbar
Post by: Zao on 2010-06-06 11:16:39
Any such analysis would probably be much better suited in another component using my storage, and even then it would require some extensive rewiring. If I were interested in doing it, which I'm not, I'd need at a minimum a proper existing algorithm to implement.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-06-06 17:36:08
ok, Zao thanks for answering

for the record if you are referring to the linked code, as said it's fast, it uses numpy (all known lapack) for processing, and libsnd for reading audio, PIL for picture output. other is readable I guess
Title: foo_wave_seekbar
Post by: Zao on 2010-06-06 20:14:58
That code is GPL licensed. I won't touch that with a ten foot pole.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-06-06 20:22:20
I know what you mean + I'm replying as seems funny that libsnd author is known here: http://www.hydrogenaudio.org/forums/index....showtopic=36153 (http://www.hydrogenaudio.org/forums/index.php?showtopic=36153)
Title: foo_wave_seekbar
Post by: sPeziFisH on 2010-06-10 11:14:49
Zao, Thx for this nice component.

Are the plans for adding a 2-step-update of visualization, i.e. if tracks are longer than x secs then the first y secs are displayed and the vis gets updated after the scan fully completed?
I recognize that with longer tracks the complete scan still takes its time (of course) and display is blank fot that time.

Maybe the whole seekbar-display and jumping-info gets added a state-variable/complete-variable, boolean, 0 for scanresult1 and 1 for scan-result2 (complete track-display), sort of this.

Btw, I am using seekbar only with on-the-fly-scanning as its a nicier way of displaying the track-position to me, Im no fan of extra-operations for more-or-less temporary-infos as storage of those signatures is of no use to me.


edit: btw
Title: foo_wave_seekbar
Post by: Zao on 2010-06-10 11:29:42
Incremental updates has been suggested in the past.
The current architecture doesn't lend itself well to such things, even after the big rewrite for 0.2.
It might be doable with lots of effort, but I consider it not worth it, considering that tracks nominally scan in just a few seconds.

I'd rather focus my energy on things that matter, like the known crashes and bugs.
Title: foo_wave_seekbar
Post by: evil roy on 2010-06-12 02:40:34
First of all great work on this component, Zao!!  I'm always amazed at the hard work done by people to make FB2K the best media player evar.

Now, of course, comes the bad part--not a waveform seekbar question per se, but for some reason I do not get the D3D option in the configuration window, only GDI and D2D.

Here is a screenie of my dxdiag (DX 11) which clearly states that D3D is enabled.  Any ideas?

(http://img822.imageshack.us/img822/332/dxdiag.jpg)

Thanks in advance . . .
Title: foo_wave_seekbar
Post by: jano on 2010-06-12 03:05:21
...
The Direct3D 9.0c mode requires installation of the DirectX February 2010 runtime redistributable (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en).
The Direct2D 1.0 mode requires Windows Vista SP2 and the Platform Update (http://support.microsoft.com/kb/971644).
...

Have you installed the "DirectX February 2010 runtime redistributable"?
Title: foo_wave_seekbar
Post by: evil roy on 2010-06-12 05:32:21
...
The Direct3D 9.0c mode requires installation of the DirectX February 2010 runtime redistributable (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en).
The Direct2D 1.0 mode requires Windows Vista SP2 and the Platform Update (http://support.microsoft.com/kb/971644).
...

Have you installed the "DirectX February 2010 runtime redistributable"?



Maybe I'm reading the download page wrong, but this looks like an update for directx 9.0c.  I am running directx 11.
Title: foo_wave_seekbar
Post by: teohhanhui on 2010-06-12 06:32:57
...
The Direct3D 9.0c mode requires installation of the DirectX February 2010 runtime redistributable (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en).
The Direct2D 1.0 mode requires Windows Vista SP2 and the Platform Update (http://support.microsoft.com/kb/971644).
...

Have you installed the "DirectX February 2010 runtime redistributable"?



Maybe I'm reading the download page wrong, but this looks like an update for directx 9.0c.  I am running directx 11.

It updates DirectX components which are not only limited to DirectX 9. And do note that foo_wave_seekbar uses Direct3D 9.0c.
Title: foo_wave_seekbar
Post by: evil roy on 2010-06-12 06:53:51
It updates DirectX components which are not only limited to DirectX 9. And do note that foo_wave_seekbar uses Direct3D 9.0c.


Does this mean that I can't get 3D3 functionality (for tweaked seekbar.fx's ala foosion et al)with DX11?
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-06-12 07:04:06
you can press "add reply" button instead quoting "reply" - back posts look silly

download the update setup file, it's a small file, and run it - it'll update what needs updating
if after that you have problems post again
Title: foo_wave_seekbar
Post by: evil roy on 2010-06-12 07:51:16
you can press "add reply" button instead quoting "reply" - back posts look silly


Will do.

Sorry, I couldn't resist.
Title: foo_wave_seekbar
Post by: 2E7AH on 2010-06-12 08:12:55


what a joker
Title: foo_wave_seekbar
Post by: omnimodis78 on 2010-06-12 17:30:18
Spectacular!  Thanks a lot! 
Title: foo_wave_seekbar
Post by: Zao on 2010-06-12 19:21:33
It is always safe to install newer DirectX updates, which will install and update any DirectX components in need of updating.
It is also safe to install older DirectX updates when a game or application attempts to do it, as it will never downgrade anything.

As for DirectX versions, they all coexist side-by-side. Older D3D versions tend to be emulated through newer ones as time passes, of course, but that's a driver implementation detail.
Title: foo_wave_seekbar
Post by: suaff on 2010-06-14 12:53:01
hi,

Thank you for nice plugin! My suggestion is seeking using the mouse-wheel (like standard seekbar can do that). Is it hard to implement?
Title: foo_wave_seekbar
Post by: Zao on 2010-06-14 14:10:07
Maybe. It depends on how much effort I need to make to honor the "scroll applies to focused window" contract.
Title: foo_wave_seekbar
Post by: dhromed on 2010-06-21 20:54:09
I just had this weird idea where, instead of a waveform, it would display RG power, perhaps for some configurable resolution.

I don't know how feasible that is, though, given the CPU requirements of RG scanning.

The cause of this idea is that the waveform intensity often doesn't (completely) match my experienced intensity (which is why we have RG in the first place, obviously).
Title: foo_wave_seekbar
Post by: YoG on 2010-06-26 12:41:53
awesome plugin.. thanks for coding this man!!
Title: foo_wave_seekbar
Post by: er_or on 2010-06-27 21:09:33
1. I extract  foo_wave_seekbar.dll  into "components" directory
2. right click on track "extract seekbar signature", but nothing happens

I have XP SP3
What I'm doing wrong?
Title: foo_wave_seekbar
Post by: Case on 2010-06-28 20:31:49
That option only forces the component to process the file(s) you selected. To see the results you need to enable layout editing mode and add the component to your layout. Also manual extraction isn't required normally. It will automatically do its thing for the files you play and to the next track in advance when possible.
Title: foo_wave_seekbar
Post by: er_or on 2010-06-29 04:15:55
That option only forces the component to process the file(s) you selected. To see the results you need to enable layout editing mode and add the component to your layout. Also manual extraction isn't required normally. It will automatically do its thing for the files you play and to the next track in advance when possible.


I search though preferences, but there is no "layout editing mode". How can I enable it?
Title: foo_wave_seekbar
Post by: Andreasvb on 2010-06-29 06:39:22
View > Layout.
Title: foo_wave_seekbar
Post by: er_or on 2010-06-29 21:25:31
View > Layout.


ok, thx
Title: foo_wave_seekbar
Post by: evil roy on 2010-07-02 04:32:54
Okay, I installed the DirectX February 2010 runtime redistributable.  I created a file named seekbar.fx containing the code from HERE (http://www.hydrogenaudio.org/forums/index.php?showtopic=77490&st=525&p=705262&#entry705262) and placed it in C:\Program Files\foobar2000\effects.  Still am not getting the RMS effect just a monochromatic wave from that looks like this: (http://usera.ImageCave.com/evilroy/form.jpg)

Configged thusly: (http://usera.ImageCave.com/evilroy/config.jpg)

Any ideas?
Title: foo_wave_seekbar
Post by: Zao on 2010-07-02 07:08:50
The effects directory lives in your foobar2000 profile now, instead of in the application directory. There should (probably) exist one there already.

(This will change in the next release of the seekbar, as it has a built-in shader editor then, no more files).
Title: foo_wave_seekbar
Post by: evil roy on 2010-07-02 21:59:56
Beautiful!! All is right with the world.  Thanks, Zao for you help and your hard work.
Title: foo_wave_seekbar
Post by: frogworth on 2010-07-03 14:59:46
The effects directory lives in your foobar2000 profile now, instead of in the application directory. There should (probably) exist one there already.

(This will change in the next release of the seekbar, as it has a built-in shader editor then, no more files).


Cool. For those of us using a specially edited effects file to add customized RMS shading, will this then be doable via the built-in editor somehow? I've done a few things (make the location indicator narrower; change the colour of the RMS part, etc)...
Exciting! This is truly the awesomest foobar component
Title: foo_wave_seekbar
Post by: MarkSeymour on 2010-07-04 18:39:42
I am getting an error in my console for when I attempt to use Direct3D, and it falls back to GDI:
Code: [Select]
[14:35:13] Seekbar: taking Direct3D9 path.
[14:35:13] Seekbar: Direct3D: ERROR_MOD_NOT_FOUND(-2147024770) n/a
[14:35:13] Seekbar: frontend creation failed: Direct3D9: could not create effects.
[14:35:13] Seekbar: taking GDI path.


I am using the .fx file for generating the RMS waveforms using the highlight colour.

Computer: foobar2000 1.0.3 / Windows 7 Professional x64 / 4GB ram / ATI Mobility Radeon HD 3650 - atikmdag.sys 8.1.1.921
Title: foo_wave_seekbar
Post by: Zao on 2010-07-04 20:26:54
Ensure that you have the latest DX redist installed. Mixing and matching D3DX DLLs is not sufficient, nor recommended for anything.
Title: foo_wave_seekbar
Post by: MarkSeymour on 2010-07-04 21:04:33
Ensure that you have the latest DX redist installed. Mixing and matching D3DX DLLs is not sufficient, nor recommended for anything.

I installed the latest (June 2010) DirectX version. It appears to load without problems (in the console), however I only see single lines where the waveforms should be.
Title: foo_wave_seekbar
Post by: Zao on 2010-07-05 02:14:30
Can you upload your effect file zipped to some file hosting site?
Title: foo_wave_seekbar
Post by: MarkSeymour on 2010-07-05 04:08:21
Can you upload your effect file zipped to some file hosting site?

Here it is ? http://pastie.org/1030696 (http://pastie.org/1030696)
Title: foo_wave_seekbar
Post by: Anomalous on 2010-07-06 03:23:41
I installed the latest (June 2010) DirectX version. It appears to load without problems (in the console), however I only see single lines where the waveforms should be.

Do your tracks have replay gain data?
Title: foo_wave_seekbar
Post by: MarkSeymour on 2010-07-08 18:02:42
Do your tracks have replay gain data?

Well, now they do! Thanks.
Title: foo_wave_seekbar
Post by: dzid_ on 2010-07-14 00:58:07
I would like to see mouse wheel seeking 
Title: foo_wave_seekbar
Post by: dts350z on 2010-07-25 01:59:01
Would it be possible to display the decoded waveforms of DTS files, similar to how the Peak meter and VU meter display the decoded channel info?

Title: foo_wave_seekbar
Post by: kode54 on 2010-07-25 03:18:35
Yes, download my latest version of foo_input_dts. This particular feature will require foobar2000 1.1 or newer, beta included. Currently supports CDDA, WAV, FLAC, and WavPack.
Title: foo_wave_seekbar
Post by: mjb2006 on 2010-07-26 12:20:14
I used MP3Gain/AACGain to adjust global gain in my MP3s and M4As. In my FLACs I just have ReplayGain metadata. Therefore I'd like my seekbar.fx file to use ReplayGain album gain if available, falling back on ReplayGain track gain, and if neither of those are available, then RMS (actually RMS multiplied by a reasonable value?).

I attempted to merge the seekbar.fx files posted earlier in this thread by using some branching in the evaluate function, but it doesn't work; I just get the flat line for every file:

Code: [Select]
float4 evaluate( float2 tc, float border )
{
    // alpha 1 indicates biased texture
    float4 minmaxrms = tex.Sample(sTex, tc.x);
    // scale by album gain or track gain or RMS
    if (replayGain.r) {
        minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2;
    } else if (replayGain.g) {
        minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 2;
    } else {
        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);
}


Thanks to anyone who can help!
Title: foo_wave_seekbar
Post by: Anomalous on 2010-07-27 11:51:52
It looks like the replay gain values are set to -1000 when it's not present (wouldn't NaN make more sense?), so i think what you want is:
Code: [Select]
    float4 minmaxrms = tex.Sample(sTex, tc.x);
    if (replayGain.r != -1000) {
        minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2; //use album gain
    } else if (replayGain.g != -1000) {
        minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 2; //use track gain
    }
    minmaxrms.rgb -= 0.5 * minmaxrms.a;
    minmaxrms.rgb *= 1.0 + minmaxrms.a;
Title: foo_wave_seekbar
Post by: Hamallainen on 2010-07-28 21:57:44
Hello
    Since april i have had 6 crash due to foo_wave_seekbar (according to crash report) while foobar playing in the background.
    Is there anything i can do or try to help solve this problem ?
    Thanks 
   
   
Code: [Select]
Illegal operation:
    Code: C0000005h, flags: 00000000h, address: 019FEFD8h
    Access violation, operation: read, address: 00007277h
   
    Call path:
    entry=>app_mainloop=>main_thread_callback::callback_run
   
    Code bytes (019FEFD8h):
    019FEF98h:  C7 04 3B 5D 08 75 A1 5E 5B 8B C7 5F 5D C3 CC CC
    019FEFA8h:  CC CC CC CC CC CC CC CC 55 8B EC 6A FF 68 18 DD
    019FEFB8h:  AD 01 64 A1 00 00 00 00 50 51 53 56 57 A1 18 AC
    019FEFC8h:  B4 01 33 C5 50 8D 45 F4 64 A3 00 00 00 00 8B F1
    019FEFD8h:  8B 46 08 85 C0 0F 84 2E 01 00 00 89 75 F0 E8 85
    019FEFE8h:  63 FE FF 83 7E 08 00 75 3F C7 45 FC FF FF FF FF
    019FEFF8h:  B8 00 00 00 80 8B CE F0 0F C1 01 A9 00 00 00 40
    019FF008h:  0F 85 03 01 00 00 3D 00 00 00 80 0F 8E F8 00 00
   
    Stack (0012FB04h):
    0012FAE4h:  00000000 00000000 00000000 00000000
    0012FAF4h:  00000000 00000000 00000000 00000000
    0012FB04h:  9DC8B4AD 08294578 0802B538 00000000
    0012FB14h:  0000726F 0012FB5C 01ADDD18 FFFFFFFF
    0012FB24h:  0012FB34 01A0480C 080147C0 07D7D61C
    0012FB34h:  0012FB68 01A03F3F 0012FB8B 9DC8B4E1
    0012FB44h:  080147C0 02724B1C 00000000 0046117F
    0012FB54h:  080147C0 07D7D61C 0012FB8C 01ADE42B
    0012FB64h:  00000001 0012FB98 01A039A3 0012FB8B
    0012FB74h:  9DC8B411 02724B18 00578988 0057964C
    0012FB84h:  06188E38 01000022 0012FBC8 01ADE4B8
    0012FB94h:  00000004 035B3A04 01A05099 035B3A00
    0012FBA4h:  004673C9 0012FC68 0012FC00 000004B1
    0012FBB4h:  00000000 00000001 035B3A00 02724B18
    0012FBC4h:  00000013 0012FBF0 0052C3F1 00000001
    0012FBD4h:  00467561 00000000 0012FC68 004674D0
    0012FBE4h:  00000000 0012FBDC 0012F728 0012FC84
    0012FBF4h:  0052A220 0055F610 00000000 0012FC2C
    0012FC04h:  7E398734 0002013A 000004B1 E976E5FE
    0012FC14h:  3704AEC1 004674D0 DCBAABCD 00000000
   
    Registers:
    EAX: 0012FB18, EBX: 00000000, ECX: 0000726F, EDX: 094A0001
    ESI: 0000726F, EDI: 08294578, EBP: 0012FB24, ESP: 0012FB04
   
    Crash location:
    Module: foo_wave_seekbar
    Offset: 4EFD8h
    Symbol: "boost::archive::detail::iserializer::load_object_data" (+1AA18h)
   
    Loaded modules:
    foobar2000                      loaded at 00400000h - 005BA000h
    ntdll                            loaded at 7C910000h - 7C9C9000h
    kernel32                        loaded at 7C800000h - 7C906000h
    COMCTL32                        loaded at 77390000h - 77493000h
    msvcrt                          loaded at 77BE0000h - 77C38000h
    ADVAPI32                        loaded at 77DA0000h - 77E4C000h
    RPCRT4                          loaded at 77E50000h - 77EE2000h
    Secur32                          loaded at 77FC0000h - 77FD1000h
    GDI32                            loaded at 77EF0000h - 77F39000h
    USER32                          loaded at 7E390000h - 7E421000h
    SHLWAPI                          loaded at 77F40000h - 77FB6000h
    DSOUND                          loaded at 73E60000h - 73EBC000h
    ole32                            loaded at 774A0000h - 775DD000h
    VERSION                          loaded at 77BD0000h - 77BD8000h
    WINMM                            loaded at 76AE0000h - 76B0F000h
    UxTheme                          loaded at 5B090000h - 5B0C8000h
    SHELL32                          loaded at 7C9D0000h - 7D1F5000h
    shared                          loaded at 10000000h - 1002B000h
    imagehlp                        loaded at 76C40000h - 76C68000h
    dbghelp                          loaded at 5D3F0000h - 5D491000h
    COMDLG32                        loaded at 76340000h - 7638A000h
    IMM32                            loaded at 76320000h - 7633D000h
    LPK                              loaded at 62DC0000h - 62DC9000h
    USP10                            loaded at 753C0000h - 7542B000h
    serwvdrv                        loaded at 5D0A0000h - 5D0A7000h
    umdmxfrm                        loaded at 5B3C0000h - 5B3C7000h
    MSCTF                            loaded at 74690000h - 746DC000h
    RTSUltraMonHook                  loaded at 00DA0000h - 00DCE000h
    WINTRUST                        loaded at 76BE0000h - 76C0E000h
    CRYPT32                          loaded at 779E0000h - 77A77000h
    MSASN1                          loaded at 77A80000h - 77A92000h
    wdmaud                          loaded at 72C70000h - 72C79000h
    msacm32                          loaded at 72C60000h - 72C68000h
    MSACM32                          loaded at 77BB0000h - 77BC5000h
    midimap                          loaded at 77BA0000h - 77BA7000h
    msctfime                        loaded at 75140000h - 7516E000h
    foo_audioscrobbler              loaded at 00F40000h - 00F73000h
    foo_input_std                    loaded at 00FA0000h - 010EC000h
    foo_ui_columns                  loaded at 01110000h - 0129E000h
    gdiplus                          loaded at 4EB80000h - 4ED2B000h
    foo_queuecontents                loaded at 012C0000h - 0137D000h
    OLEAUT32                        loaded at 770E0000h - 7716B000h
    foo_rgscan                      loaded at 013A0000h - 013EF000h
    foo_autoupdate                  loaded at 01410000h - 0145C000h
    POWRPROF                        loaded at 74A40000h - 74A48000h
    foo_dsp_std                      loaded at 01470000h - 014B9000h
    foo_input_monkey                loaded at 014E0000h - 01528000h
    foo_input_tak                    loaded at 01550000h - 01594000h
    tak_deco_lib                    loaded at 015B0000h - 015D0000h
    foo_fileops                      loaded at 016E0000h - 01728000h
    foo_burninate                    loaded at 01750000h - 01790000h
    foo_uie_console                  loaded at 017B0000h - 017CA000h
    foo_rg_trn                      loaded at 017F0000h - 01814000h
    foo_scheduler                    loaded at 01840000h - 0191E000h
    foo_uie_albumlist                loaded at 01940000h - 01983000h
    foo_wave_seekbar                loaded at 019B0000h - 01B7A000h
    WS2_32                          loaded at 719F0000h - 71A07000h
    WS2HELP                          loaded at 719E0000h - 719E8000h
    MSIMG32                          loaded at 76310000h - 76315000h
    foo_playcount                    loaded at 01BA0000h - 01BD0000h
    foo_uie_vis_channel_spectrum    loaded at 01BF0000h - 01C2D000h
    foo_freedb2                      loaded at 01C50000h - 01C92000h
    foo_ui_std                      loaded at 01CC0000h - 01DCE000h
    foo_cdda                        loaded at 01DF0000h - 01E3E000h
    foo_whatsnew                    loaded at 01E60000h - 01EA0000h
    foo_uie_playlists_dropdown      loaded at 01EC0000h - 01EFC000h
    foo_jesus                        loaded at 01F20000h - 01F48000h
    foo_converter                    loaded at 01F60000h - 01FD2000h
    foo_run                          loaded at 02000000h - 0205F000h
    CLBCATQ                          loaded at 76F80000h - 76FFF000h
    COMRes                          loaded at 77000000h - 770D4000h
    RTSUltraMonHookRes              loaded at 04C90000h - 04C93000h
    xpsp2res                        loaded at 05400000h - 056DA000h
    dciman32                        loaded at 73B10000h - 73B16000h
    mslbui                          loaded at 60970000h - 60979000h
    mswsock                          loaded at 71990000h - 719D0000h
    KsUser                          loaded at 73E30000h - 73E34000h
    DNSAPI                          loaded at 76ED0000h - 76EF7000h
    rasadhlp                        loaded at 76F70000h - 76F76000h
    imon                            loaded at 20B00000h - 20B2F000h
    WSOCK32                          loaded at 71A10000h - 71A1A000h
    NTMARTA                          loaded at 77650000h - 77671000h
    SAMLIB                          loaded at 71B50000h - 71B63000h
    WLDAP32                          loaded at 76F10000h - 76F3D000h
    hnetcfg                          loaded at 62E40000h - 62E99000h
    rsvpsp                          loaded at 72FD0000h - 72FED000h
    wshtcpip                        loaded at 719D0000h - 719D8000h
    netapi32                        loaded at 6FEE0000h - 6FF35000h
    appHelp                          loaded at 77B50000h - 77B72000h
    ieframe                          loaded at 40D30000h - 417C4000h
    iertutil                        loaded at 40B40000h - 40D28000h
    urlmon                          loaded at 45180000h - 452B3000h
    SETUPAPI                        loaded at 778E0000h - 779D8000h
    WININET                          loaded at 404A0000h - 40586000h
    Normaliz                        loaded at 04F90000h - 04F99000h
   
    Stack dump analysis:
    Address: 01ADDD18h (foo_wave_seekbar+12DD18h), symbol: "boost::serialization::singleton
    Address: 01A0480Ch (foo_wave_seekbar+5480Ch), symbol: "boost::archive::detail::iserializer::load_object_data" (+2024Ch)
    Address: 01A03F3Fh (foo_wave_seekbar+53F3Fh), symbol: "boost::archive::detail::iserializer::load_object_data" (+1F97Fh)
    Address: 0046117Fh (foobar2000+6117Fh)
    Address: 01ADE42Bh (foo_wave_seekbar+12E42Bh), symbol: "boost::serialization::singleton
    Address: 01A039A3h (foo_wave_seekbar+539A3h), symbol: "boost::archive::detail::iserializer::load_object_data" (+1F3E3h)
    Address: 00578988h (foobar2000+178988h)
    Address: 0057964Ch (foobar2000+17964Ch)
    Address: 01000022h (foo_input_std+60022h)
    Address: 01ADE4B8h (foo_wave_seekbar+12E4B8h), symbol: "boost::serialization::singleton
    Address: 01A05099h (foo_wave_seekbar+55099h), symbol: "boost::archive::detail::iserializer::load_object_data" (+20AD9h)
    Address: 004673C9h (foobar2000+673C9h)
    Address: 0052C3F1h (foobar2000+12C3F1h)
    Address: 00467561h (foobar2000+67561h)
    Address: 004674D0h (foobar2000+674D0h)
    Address: 0052A220h (foobar2000+12A220h)
    Address: 0055F610h (foobar2000+15F610h)
    Address: 7E398734h (USER32+8734h), symbol: "GetDC" (+6Dh)
    Address: 004674D0h (foobar2000+674D0h)
    Address: 004674D0h (foobar2000+674D0h)
    Address: 7E398816h (USER32+8816h), symbol: "GetDC" (+14Fh)
    Address: 004674D0h (foobar2000+674D0h)
    Address: 7E3C048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
    Address: 7E3C048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
    Address: 7E398830h (USER32+8830h), symbol: "GetDC" (+169h)
    Address: 7E3989CDh (USER32+89CDh), symbol: "GetWindowLongW" (+127h)
    Address: 004674D0h (foobar2000+674D0h)
    Address: 7E3991C6h (USER32+91C6h), symbol: "GetMessageW" (+0h)
    Address: 7C91FE30h (ntdll+FE30h), symbol: "RtlRestoreLastWin32Error" (+0h)
    Address: 7E3991C6h (USER32+91C6h), symbol: "GetMessageW" (+0h)
    Address: 7E3C048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
    Address: 7E3989F0h (USER32+89F0h), symbol: "GetWindowLongW" (+14Ah)
    Address: 7E398A10h (USER32+8A10h), symbol: "DispatchMessageW" (+Fh)
    Address: 7E39929Bh (USER32+929Bh), symbol: "PeekMessageW" (+0h)
    Address: 0046485Bh (foobar2000+6485Bh)
    Address: 01000811h (foo_input_std+60811h)
    Address: 00465614h (foobar2000+65614h)
    Address: 00547AFCh (foobar2000+147AFCh)
    Address: 00547AFCh (foobar2000+147AFCh)
    Address: 0055A354h (foobar2000+15A354h)
    Address: 00400000h (foobar2000+0h)
    Address: 0055A338h (foobar2000+15A338h)
    Address: 7C9201DBh (ntdll+101DBh), symbol: "RtlAllocateHeap" (+117h)
    Address: 0051F60Ch (foobar2000+11F60Ch)
    Address: 0051B1D0h (foobar2000+11B1D0h)
    Address: 0051F60Ch (foobar2000+11F60Ch)
    Address: 0051D5F4h (foobar2000+11D5F4h)
    Address: 7C92027Fh (ntdll+1027Fh), symbol: "RtlAllocateHeap" (+1BBh)
    Address: 00517EF2h (foobar2000+117EF2h)
    Address: 100027AAh (shared+27AAh), symbol: "uPrintCrashInfo_OnEvent" (+B0h)
    Address: 0054F384h (foobar2000+14F384h)
    Address: 00537F97h (foobar2000+137F97h)
    Address: 0054F384h (foobar2000+14F384h)
    Address: 00465857h (foobar2000+65857h)
    Address: 00400000h (foobar2000+0h)
    Address: 00517BEFh (foobar2000+117BEFh)
    Address: 005420B8h (foobar2000+1420B8h)
    Address: 0057F060h (foobar2000+17F060h)
    Address: 0053FE30h (foobar2000+13FE30h)
    Address: 00415116h (foobar2000+15116h)
    Address: 0051B1D0h (foobar2000+11B1D0h)
    Address: 00517BEFh (foobar2000+117BEFh)
    Address: 00517C03h (foobar2000+117C03h)
    Address: 0053FE30h (foobar2000+13FE30h)
    Address: 0053839Dh (foobar2000+13839Dh)
    Address: 00519036h (foobar2000+119036h)
    Address: 00400000h (foobar2000+0h)
    Address: 0051B1D0h (foobar2000+11B1D0h)
    Address: 7C817077h (kernel32+17077h), symbol: "RegisterWaitForInputIdle" (+49h)
    Address: 7C839AD8h (kernel32+39AD8h), symbol: "ValidateLocale" (+2B0h)
    Address: 7C817080h (kernel32+17080h), symbol: "RegisterWaitForInputIdle" (+52h)
    Address: 005190A1h (foobar2000+1190A1h)
    Address: 0057005Ch (foobar2000+17005Ch)
    Address: 004E0049h (foobar2000+E0049h)
    Address: 004F0044h (foobar2000+F0044h)
    Address: 00530057h (foobar2000+130057h)
    Address: 0057005Ch (foobar2000+17005Ch)
    Address: 01C8B5AEh (foo_freedb2+3B5AEh)
    Address: 004B0063h (foobar2000+B0063h)
    Address: 00530022h (foobar2000+130022h)
    Address: 00500069h (foobar2000+100069h)
    Address: 00500069h (foobar2000+100069h)
    Address: 00410072h (foobar2000+10072h)
    Address: 00540079h (foobar2000+140079h)
    Address: 00430022h (foobar2000+30022h)
    Address: 00490057h (foobar2000+90057h)
    Address: 0044004Eh (foobar2000+4004Eh)
    Address: 0057004Fh (foobar2000+17004Fh)
    Address: 0053006Eh (foobar2000+13006Eh)
    Address: 00530078h (foobar2000+130078h)
    Address: 004D005Ch (foobar2000+D005Ch)
    Address: 004D005Fh (foobar2000+D005Fh)
    Address: 0057002Eh (foobar2000+17002Eh)
    Address: 0047002Eh (foobar2000+7002Eh)
    Address: 004D002Eh (foobar2000+D002Eh)
    Address: 00500069h (foobar2000+100069h)
    Address: 0044002Eh (foobar2000+4002Eh)
    Address: 01C8B5AEh (foo_freedb2+3B5AEh)
    Address: 0044002Eh (foobar2000+4002Eh)
    Address: 00410072h (foobar2000+10072h)
    Address: 00540079h (foobar2000+140079h)
    Address: 0057005Ch (foobar2000+17005Ch)
    Address: 004E0049h (foobar2000+E0049h)
    Address: 004F0044h (foobar2000+F0044h)
    Address: 00530057h (foobar2000+130057h)
    Address: 0057005Ch (foobar2000+17005Ch)
    Address: 0044002Eh (foobar2000+4002Eh)
    Address: 004D002Eh (foobar2000+D002Eh)
    Address: 0044002Eh (foobar2000+4002Eh)
    Address: 0052002Eh (foobar2000+12002Eh)
    Address: 01C8B5AEh (foo_freedb2+3B5AEh)
    Address: 0052002Eh (foobar2000+12002Eh)
    Address: 00410072h (foobar2000+10072h)
   
    Environment:
    App: foobar2000 v1.0.3
    OS: Windows 5.1.2600 Service Pack 3 x86
    CPU: Intel® Pentium® 4 CPU 2.66GHz, features: MMX SSE SSE2
    Audio: Périphérique son SB Live!; Lecture sur modem n° 1 (émulé)
    UI: Columns UI 0.3.8.7
   
    Components:
    Core (2010-04-29 14:43:38 UTC)
        foobar2000 core 1.0.3
    foo_audioscrobbler.dll (2010-06-04 07:27:04 UTC)
        Audioscrobbler 1.4.7
    foo_autoupdate.dll (2010-04-19 23:21:14 UTC)
        Automatic Updater 1
    foo_burninate.dll (2010-01-18 21:10:44 UTC)
        Audio CD Writer 3.0.2
    foo_cdda.dll (2010-04-29 12:35:30 UTC)
        CD Audio Decoder 3.0
    foo_converter.dll (2010-04-29 12:35:08 UTC)
        Converter 1.4.1
    foo_dsp_std.dll (2010-04-29 12:35:48 UTC)
        Standard DSP Array 1.0
    foo_fileops.dll (2010-04-29 12:34:40 UTC)
        File Operations 2.1.2
    foo_freedb2.dll (2010-04-29 12:34:40 UTC)
        freedb Tagger 0.6.2
    foo_input_monkey.dll (2009-05-01 12:40:52 UTC)
        Monkey's Audio Decoder 2.1.4
    foo_input_std.dll (2010-04-29 12:35:34 UTC)
        Standard Input Array 1.0
    foo_input_tak.dll (2010-01-09 18:11:58 UTC)
        TAK Decoder 0.4.4
    foo_jesus.dll (2010-04-20 20:59:46 UTC)
        Autosave & Autobackup 9
    foo_playcount.dll (2009-04-29 18:09:32 UTC)
        Playback Statistics 2.1.9
    foo_queuecontents.dll (2010-05-20 08:18:58 UTC)
        Queue Contents Editor 0.3.9
    foo_rg_trn.dll (2010-01-13 23:01:01 UTC)
        ReplayGain override 0.1.3
    foo_rgscan.dll (2010-04-29 12:35:12 UTC)
        ReplayGain Scanner 2.0.9
    foo_run.dll (2009-06-07 13:15:18 UTC)
        Run services 0.3.7
    foo_scheduler.dll (2010-07-18 19:37:36 UTC)
        Scheduler 4.05
    foo_ui_columns.dll (2010-06-17 20:49:12 UTC)
        Columns UI 0.3.8.7
    foo_ui_std.dll (2010-04-29 12:35:56 UTC)
        Default User Interface 0.9.5
    foo_uie_albumlist.dll (2009-06-13 22:49:19 UTC)
        Album list panel 0.3.5
    foo_uie_console.dll (2009-08-29 16:06:24 UTC)
        Console panel 0.4
    foo_uie_playlists_dropdown.dll (2009-09-23 22:44:46 UTC)
        Playlists Dropdown 0.7.6
    foo_uie_vis_channel_spectrum.dll (2008-05-18 01:02:12 UTC)
        Channel Spectrum panel 0.17.2
    foo_wave_seekbar.dll (2010-04-24 22:35:42 UTC)
        Waveform seekbar 0.2.12
    foo_whatsnew.dll (2008-08-30 13:45:00 UTC)
        Feature Watcher 1.0.6
   
    Recent events:
    Audioscrobbler: Submission succeeded.
    Opening track for playback: "Z:\S\Skinny Puppy\1992. Last Rights\09. Circustance.mpc"
    Audioscrobbler: Submitting track...
    Audioscrobbler: Submission succeeded.
    Opening track for playback: "Z:\S\Skinny Puppy\1992. Last Rights\10. Left Hand Shake.mp3"
    Audioscrobbler: Submitting track...
    Audioscrobbler: Submission succeeded.
    Opening track for playback: "Z:\S\Skinny Puppy\1992. Last Rights\11. Download.mpc"
    Audioscrobbler: Submitting track...
    Audioscrobbler: Submission succeeded.
   
Title: foo_wave_seekbar
Post by: r0lZ on 2010-07-29 12:27:14
Not sure that little bug has already been reported.  I'm too lazy to search the thread!

The seekbar shows nothing when the current track is encoded in MP3 Mono.  (I haven't tried with other file types.)

I have not ticked the option to store the signatures in mono.

As far as I know, everything else works flawlessly! 
Title: foo_wave_seekbar
Post by: Purple Monkey on 2010-07-29 14:44:40
Have you got "Front Centre (mono)" ticked under the "Channel display order" option?
Title: foo_wave_seekbar
Post by: r0lZ on 2010-07-29 17:54:52
Have you got "Front Centre (mono)" ticked under the "Channel display order" option?

Yes, the 6 first channels types are ticked.  (I think I have not changed that.)
Title: foo_wave_seekbar
Post by: r0lZ on 2010-07-29 18:49:20
Bizarre!  I have checked my other mono MP3 files, and they are OK.  So, I've tried to clean the bad one, and I removed the tags and rebuilt the stream and the header.  No change.  Then I've tried to cut a part of the file with MP3DirectCut to upload it somewhere, and that part was OK!  But if I leave a relatively long part, the problem persists.  So, it might be related to the length of the track (11:30).

I've uploaded the original file here (http://www.4shared.com/audio/kiWtMnNu/12_-_interstellar_overdrive__l.html), so you can have a look.  But don't worry too much: as far as I know, only that file exhibits the problem.
Title: foo_wave_seekbar
Post by: Zao on 2010-07-29 23:27:57
Your console should have a message along the lines of «Wave cache: track with mismatching channels, bailing out on "12 - interstellar overdrive (long mono version).mp3».
At 8m40s or so, the number of channels changes from 1 to 2 and stays at 2ch for the remainder of the track.
The analysis process is able to handle any combination of channels as long as they stay constant during the whole track, it can't and won't do is tracks where the channel count changes between chunks.
(http://www.acc.umu.se/~zao/seekbar41_t.png) (http://www.acc.umu.se/~zao/seekbar41.png)
The 8:40 mark is at the discontinuity where it suddenly goes near-silent.
Title: foo_wave_seekbar
Post by: Zao on 2010-07-30 00:13:34
Hello
    Since april i have had 6 crash due to foo_wave_seekbar (according to crash report) while foobar playing in the background.
    Is there anything i can do or try to help solve this problem ?
    Thanks


From your crash dumps, I gather that you're using the "do not scan tracks that are not in media library" feature.
The crash above is known and has been improved in the trunk, but has not been released. You might want to allow indiscriminate scanning.
(Preferences -> Advanced -> Tools -> Waveform Seekbar -> [X] Analyze tracks not in media library)

Furthermore, the codebase is not in shape for a release currently, as I don't have time to support the inevitable bugs that will arise.
Title: foo_wave_seekbar
Post by: Hamallainen on 2010-07-30 02:55:09
Allright, i will try that. Thanks.
Title: foo_wave_seekbar
Post by: r0lZ on 2010-07-30 13:17:42
Thanks for your fine analysis, Zao.  I did not know that the file was badly encoded, but I suspected something like that.  The next time, I'll watch the console.
Title: foo_wave_seekbar
Post by: bunaa on 2010-08-07 13:01:40
dumb question maybe....

I can't manage to get the seekbar displayed.
Would be great if somebody can help me out.

@Creator:
An info at the first post and the documention page might help others, too!


It's nothing about an error message, it's more like I don't know how to place the bar (columns ui).
Title: foo_wave_seekbar
Post by: Zao on 2010-08-07 18:56:34
Quote
- Add UI element to the Default UI or Columns UI as normal

You just add it like any other CUI panel.
Title: foo_wave_seekbar
Post by: bunaa on 2010-08-08 12:34:05
I finally managed to get it displayed ...after a long trial and error period...

The Problem wasn't that I doesn't know that I've just to place it as any other panel - it was about how to place a panel at all!
I'm using foobar some time now, but the Quick Setup always was enough.


Maybe it's still worth to mention for other "beginners" like me!
Title: foo_wave_seekbar
Post by: r0lZ on 2010-08-09 00:35:49
Maybe this time I've really found a bug.

I did some tests to convert 5.1 AC3 to Pro-Logic with foo_dsp_downmix. (BTW, it crashes when it is used to convert with F2K v1.0, but it seems to work well for playback.)  Anyway, your seekbar is handy to see what channels are really present (and not empty) in the AC3 file.  So, currently, I have two seekbars at the same time: a small mono seekbar that I use, well, as a seekbar, and a wide seekbar with all channels, usually hidden in a teb, that I use when I need to see what I'm currently playing or converting.

To set everything up, I downloaded this small test file: http://www.lynnepublishing.com/surround/ww...rround_test.ac3 (http://www.lynnepublishing.com/surround/www_lynnemusic_com_surround_test.ac3)

The bug: in the wide seekbar, I can see the 6 channels (although the LFE channel is hard to see).  But in the mono seekbar, the Rear Right channel is not present.  When I untick the Downmix Display To Mono option, the RR channel becomes visible immediately, so it's not a problem with the channels configuration.  (I have the 6 first channels ticked.)

Forcing the component to regenerate the waveform signature doesn't solve the problem.

I have also a question.  When there are two seekbars, I've noticed in the console that the two seekbars generate the same waveform signature at the same time.  Is it a risk of conflict?  Can I safely use several seekbars at the same time?
Title: foo_wave_seekbar
Post by: Zao on 2010-08-09 23:47:30
The bug: in the wide seekbar, I can see the 6 channels (although the LFE channel is hard to see).  But in the mono seekbar, the Rear Right channel is not present.  When I untick the Downmix Display To Mono option, the RR channel becomes visible immediately, so it's not a problem with the channels configuration.  (I have the 6 first channels ticked.)


My downmixing code may very well be botched. It "worked" on whatever test file I had at the time.

I have also a question.  When there are two seekbars, I've noticed in the console that the two seekbars generate the same waveform signature at the same time.  Is it a risk of conflict?  Can I safely use several seekbars at the same time?

It is perfectly safe. The only thing that happens is that it'll throw away some redundant results, or overwrite them, can't quite remember which.

In any way, my SVN server and my development machines are offline until the fall semester starts again, so I can't even look at my code to tell what I'd done and what I need to do.

Thankfully you people don't have too many horrible crash bugs. Remember to submit crash reports if you get new kinds of crashes, as I look at the reports occasoinally.
Title: foo_wave_seekbar
Post by: r0lZ on 2010-08-10 09:39:05
Thanks for the confirmation.  I'm glad I can use the two seekbars at the same time.

My downmixing code may very well be botched. It "worked" on whatever test file I had at the time.

When you will have access to your code, please try the AC3 sample.  The problem is obvious.

And BTW, I have never had real crashes with your seekbar.  :-)
Title: foo_wave_seekbar
Post by: Dandruff on 2010-08-19 18:23:22
Why do I get double "Wave cache: finished analysis of" messages in the console?

Code: [Select]
Watching: D:\Music
Startup time : 0:00.154195
Seekbar: taking Direct3D9 path.
Seekbar: Frontend initialized.
Opening track for playback: "D:\Skream.mp3"
Wave cache: finished analysis of "D:\Skream.mp3"
Wave cache: finished analysis of "D:\Skream.mp3"
Opening track for playback: "D:\Benji B.mp3"
Wave cache: finished analysis of "D:\Pursuit Grooves.mp3"
Opening track for playback: "D:\Pursuit Grooves.mp3"
Wave cache: finished analysis of "D:\Benji B.mp3"
Opening track for playback: "D:\Skream.mp3"
Title: foo_wave_seekbar
Post by: Zao on 2010-08-19 18:28:11
Why do I get double "Wave cache: finished analysis of" messages in the console?

It's probably normal, as the analysis process doesn't actively avoid scanning multiple times, it just discards results if not needed.
As for what may trigger an analysis, the list is something like: playing a track, changing playback order, advancing tracks.
I may of course have messed up one of the above, sometime in the future I might add in diagnostics to the source of an analysis and whether it's user-initiated or best-effort.
Title: foo_wave_seekbar
Post by: Dandruff on 2010-08-19 21:30:16
Alright. Thanks!
Title: foo_wave_seekbar
Post by: jsalmont on 2010-08-21 00:49:02
As I understand it, this is a nice plugin.  Seeing the waveform is like hooking up Predator heat vision gear.

HOWEVER.

I have no f@#$% idea how to setup this plugin.  It's one of the things I dislike about Foobar, the UI customization.  True, I haven't spent 3 straight hours figuring it out, and maybe someone will explain and I'll feel like an idiot.  Until then, I can't use this plugin.  Why is this so difficult?

Usage:
- Add UI element to the Default UI or Columns UI as normal

= not enlightening.

I looked around and it really wasn't obvious to me.  Apologies for the pissy tone, I know you guys work hard.

Regards,
.l
Title: foo_wave_seekbar
Post by: Hitchhiker427 on 2010-08-21 01:10:44
Assuming that you're using the Default UI, here's the wiki page on customizing the layout:

http://wiki.hydrogenaudio.org/index.php?ti...ut_Editing_Mode (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Layout_Editing_Mode)

It's not really the responsibility of every component developer to rehash the same information that's easily accessible from the wiki.  Changing the Default UI is standard operating procedure (as is changing the Columns UI), and doesn't really differ component to component.  You should really read the documentation before trying to customize your software.
Title: foo_wave_seekbar
Post by: oaqm on 2010-08-23 03:09:59
Zao, many thanks to you & your 'trusty team of madmen™' for this brilliant component.
Title: foo_wave_seekbar
Post by: juglesh on 2010-08-24 17:40:13
Firstly, please flame my stupid ass if there *is* a 'search within thread' function here... 

I would love to see a 'ruler' or some such along the bottom of the waveforms, so you can see on the waveform what time you are at, and more quickly jump to the time you want.
Title: foo_wave_seekbar
Post by: Andreasvb on 2010-08-24 17:52:36
There is, at the bottom with the Reply-buttons.

And you can hold down the mousse-button to see the time, not as easy maybe, but it's a start.
Title: foo_wave_seekbar
Post by: Zao on 2010-08-24 20:52:19
I haven't quite needed such exact indications, I just glance at the status bar for the duration and click roughly, or go by the waveform.
Both tickmarks and hover-for-time has been suggested in the past, and probably resides in the todo list on the offline server somewhere.
Title: foo_wave_seekbar
Post by: jsalmont on 2010-08-24 22:55:55
Agreed.  Turns out it's pretty straightforward once you read the wiki.  Thanks for the link.

.l



Assuming that you're using the Default UI, here's the wiki page on customizing the layout:

http://wiki.hydrogenaudio.org/index.php?ti...ut_Editing_Mode (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Layout_Editing_Mode)

It's not really the responsibility of every component developer to rehash the same information that's easily accessible from the wiki.  Changing the Default UI is standard operating procedure (as is changing the Columns UI), and doesn't really differ component to component.  You should really read the documentation before trying to customize your software.

Title: foo_wave_seekbar
Post by: ExtremeHunter on 2010-08-26 10:05:21
Hey Zao any chance to add the transparent background option (pseudo transparency) to future release?
Then it will be perfect
Title: foo_wave_seekbar
Post by: Zao on 2010-08-26 11:12:46
What would be behind the UI element?
I've experimented with abysmal things like Panel Stack Switcher before, and it was a trainwreck. You need proper compositing for that, which can really only be emulated by a separate floating window with D3D9Ex and prayer.

You can modify the shader to use any kind of texture for your background, if you want to make it fit in over gradients or whatever.
Title: foo_wave_seekbar
Post by: ExtremeHunter on 2010-08-26 11:58:18
Thanks for your reply. Yes i use panel stack splitter and want to add some bakground image for wave seekbar.
I have no idea how to modify the shader to achive that?
Can you point me to some shader example.
Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2010-08-26 13:57:29
There's a commented out section that loads files as textures in the default shader. You can uncomment that and use tex2D in the PS function to sample your texture in any way you want, really.
Like say:
(http://www.acc.umu.se/~zao/seekbar26_t.png) (http://www.acc.umu.se/~zao/seekbar26.png)
Title: foo_wave_seekbar
Post by: ExtremeHunter on 2010-08-26 15:00:06
Ok i get it. Now i go and play with it some more
Thanks a lot!
Title: foo_wave_seekbar
Post by: kruji on 2010-08-28 12:19:44
would it be possible to store the effects in the user-components\foo_wave_seekbar directory?
Title: foo_wave_seekbar
Post by: lvqcl on 2010-08-28 14:03:02
would it be possible to store the effects in the user-components\foo_wave_seekbar directory?


So foobar2000 will delete these effects during component upgrade? 
Title: foo_wave_seekbar
Post by: Zao on 2010-08-28 16:31:04
Effects will not be stored in the filesystem at all in the next version. There will be a fancy per-element configuration dialog for the effect contents.
As for how it's currently, it'll look in the profile for the effect file.
Title: foo_wave_seekbar
Post by: ExtremeHunter on 2010-09-03 15:11:24
Hey Zao!

I'm using  0.2.12 Waveform seekbar in foobar 1.1 on 64bit Seven and all drivers and directx updated and good CPU and GPU,
but there is very large CPU usage (almost 100%) while wave is updating when playing 6 Channel files like DTS or A-DVD
and no matter what is selected on Frontend settings.

Is this normal?
Title: foo_wave_seekbar
Post by: Zao on 2010-09-03 20:33:53
Try looking at the threads with a recent (>12.00) Process Explorer and see which threads are consuming much CPU.
A processing task takes a file, decodes it all, collects statistics on the fly per channel and chunk, and in the end mangles that into a signature.

There shouldn't be anything significantly different between a 2ch file and a 6ch file, really.
Title: foo_wave_seekbar
Post by: ExtremeHunter on 2010-09-04 17:10:48
Seems that the problem was in my OS! It was acting weird lately, so reinstalled OS and now all is ok. 

PS. When we can expect update? 
Title: foo_wave_seekbar
Post by: Zao on 2010-09-05 11:57:09
That - only the almighty longcat knows.

To be honest though, I don't know really. The code is a bit unreadable to me after a few months of inactivity, and I've got a couple of crash bugs I ought to fix some day.
The primary thing holding it up is that I'm dreading the day when I need to merge the effect-rewrite branch to the main trunk.
That, and of course the overall cruftyness of a codebase that has evolved rather been designed.
Title: foo_wave_seekbar
Post by: Chronial on 2010-09-20 20:03:06
I have feature request that would make this component even more awesome than it already is .

If I am not mistaken, the loudness levels are currently only calculated by summed output power. The result of this is, that in songs with bass it's mostly the lower frequencies that define the waveform. If you'd run the sound through the Fletcher-Munson curves, that represent the level at which the human ear actually hears the sound (this is also what replaygain does). This would give the waveform a way more "realistic" form.

Form the replaygain specifications:
Quote
The human ear does not perceive sounds of all frequencies as having equal loudness. For example, a full scale sine wave at 1kHz sounds much louder than a full scale sine wave at 10kHz, even though the two have identical energy. To account for this, the signal is filtered by an inverted approximation to the equal loudness curves (sometimes referred to as Fletcher-Munson curves).


Implementation of this should be rather easy, as sourcecode is readily available from every replaygain implementation (e.g. http://forums.winamp.com/attachment.php?at...p;d=1159455163) (http://forums.winamp.com/attachment.php?attachmentid=37967&d=1159455163)).

(Also you don't need to understand your sourcecode to implement that . I'd guess the sound processing part is rather simple or at the least the point at which you'd plug in those calculations should be simple enough to find ^^)
Title: foo_wave_seekbar
Post by: Zao on 2010-09-20 20:17:32
You have clearly not seen the hackfest that is my analysis code. Some day I'll make some private DSPs and feed my data through those instead of the ad-hoc madness I current have.
I don't suppose that you as a component developer happens to sit on the secret of how to keep interest in a component after it's reasonably mature? 
Title: foo_wave_seekbar
Post by: Chronial on 2010-09-20 20:22:03
Quote
I don't suppose that you as a component developer happens to sit on the secret of how to keep interest in a component after it's reasonably mature?

No - I have the same problem . I stopped development on every component I created, once it became reasonably mature ^^. The only minor helpful tip I have is to write such bad code, that you have to do a major rewrite before the component is mature. That way you will at least be able to understand your code later on .

But it would still be awesome if you would manage to get you interest up and develop this component a bit further. But on the other hand I'd be lying if I'd say it's not good as it is .
Title: foo_wave_seekbar
Post by: herojoker on 2010-09-28 06:35:06
I just have a little suggestion for this great component:
Let the user define some image that will be shown while no waveform is shown.
This might happen for example if tracks outside of the media library are played and the corresponding option is unticked.
Support for transparent PNGs and centering the image would be ideal 
Title: foo_wave_seekbar
Post by: Zao on 2010-09-28 15:40:19
Generic transparency is impossible for D3D, as that would require control over the toplevel window and its backbuffer, as well as D3D9Ex.
The problem with showing a placeholder is that you've got a lose-lose tradeoff of having it flicker into existence for a moment between tracks, and delaying the placeholder, resulting in a gap where nothing shows and lots more implementation pain.

I'm unsure if I expose the playing state to the shader, but it would probably be possible to do it all shader-side, assuming that the texture loading hasn't broken while I looked away.
Title: foo_wave_seekbar
Post by: larryfine on 2010-09-28 23:43:29
Great plugin, thank you! A little slow when seeking lossless data but all work fine!

(http://ezpicshare.com/images/foobar2892.png)
Title: foo_wave_seekbar
Post by: Zao on 2010-09-29 00:17:05
Complain at or optimize the decoder for your files then.
Title: foo_wave_seekbar
Post by: larryfine on 2010-09-29 16:38:13
Complain at or optimize the decoder for your files then.


Excuse me, but my english is very limited. What did you mean with "complain at or optimize blah..." ?
Title: foo_wave_seekbar
Post by: Zao on 2010-09-29 22:31:30
The plugin uses whatever file format plugins you have installed. If it seems slow, it's because your decoder (in this case OptimFrog) is slow, or the files are encoded with a mode that is costly to decode.
Looking at the speed charts on the OF site, it seems like a rather expensive format to decode in general, compared to Wavpack and FLAC.
Another source of slowness might be if your disk or storage cannot take the load of several processes decoding a track at once. If that is the case, there is a setting in advanced preferences to restrict the number of concurrent analysis threads.
Title: foo_wave_seekbar
Post by: larryfine on 2010-09-29 23:34:10
Thank you for your reply. You're right. The Optimfrog decompression is a little slow when stracting seekbar signature. It doesn't bother me. Unfortunately, the Optimfrog project is frozen since 2006.
Thank you, Zao! You made a pretty component.
Title: foo_wave_seekbar
Post by: herojoker on 2010-10-03 02:39:05
Yet another suggestion: Create an option and/or hotkey to show the waveform of the currently selected track.
Title: foo_wave_seekbar
Post by: CmdRobot on 2010-10-17 16:52:28
Hey Guys,
this is my first post at this forum, I follow it for more than a year now and always solved my problems without writing something myself.
But I think I need help with this one.

The Waveform Seekbar is the only component I added to my Foobar in the past months. It's really handy and looks great!

Only problem is that I have Windows 7 (64 bit) with no DirectX 9. I don't wanna install it so I get to pick between GDI and Direct2D. That's fine, I like the simple b/w-GDI-look. But as people tell that GDI uses a lot more CPU-power I wanted to switch to D2D. Problem is I really don't like the D2D look, the white bachground, black waveform with a white core.

Now here is my question: I don't have an effects folder, no seekbar.fx and I don't see any option to change the whole look of D2D.
Am I missing something here? I read through the whole thread but most of the people are talking about D3D so I didn't get to solve this.

Can anyone help?

Thanks a lot!

Here is my Foobar with the GDI look. (http://www.dropbox.com/gallery/7136456/1/Mix?h=e772c3)
Title: foo_wave_seekbar
Post by: Purple Monkey on 2010-10-17 18:00:51
The shader only affects the D3D path. If you only want to adjust colours of the seekbar; you can right click -> configure, otherwise you need to install the DirectX Runtimes and use D3D. There is not really any reasons why installing the runtimes would be bad.
Title: foo_wave_seekbar
Post by: Zao on 2010-10-17 18:56:17
The D3D9 mode should run on anything that has DX9 drivers and some kind of SM2.0 support. It has been shown to work on cards as low as the Geforce FX series, as well as most Intel GMA cards.

As for "no Direct3D9", you always have DirectX installed in the OS. The things you are missing are the D3DX libraries I use, which come with a new version a couple times per year.

That's all that will be installed if you install the runtime.

As for configuring the GDI and D2D frontends, they are rather restricted aside from the usual color/channel configuration.
Title: foo_wave_seekbar
Post by: CmdRobot on 2010-10-18 10:03:17
Thanks for the fast replies!

I'm sorry, I don't really get this D3D 9, runtimes, libraries stuff because I don't even know what DirectX does... I think I have DirectX 10 or even DX 11 preinstalled on Windows 7. But your seekbar needs DirectX 9, right? So I have to install it as well. I know it's not possible to uninstall DX9 once it's on a computer. Thats why I don't really wanna put it on mine. Because installing a multi-mb programm just for the seekbar to look nicer is not worth it for me.

I'm afraid it is something like with the windows media player. My girlfriend installed it once just because she didn't know what she was doing and it turned out it's just not possible to uninstall it in any way without damaging your system.
Title: foo_wave_seekbar
Post by: Andreasvb on 2010-10-18 10:27:57
Read the first post, links to the required runtimes.
Title: foo_wave_seekbar
Post by: Zao on 2010-10-18 14:34:57
Windows Seven has support for all DirectX versions up to 11.
If I didn't use the functions from the D3DX helper libraries, it would run just fine out of the box on a fresh install of Seven.

Now, as I'm not masochistic, I use functions from the D3DX version from February 2010 instead of reinventing the wheel, so the DirectX redistributable from February 2010 needs to be installed.

Additionally, the installer (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en) linked from the first post is a web installer, so it will only install the bits required for your system.

As for installing it unnecessarily, it's not a big dependency, and it tends to be common among games or multimedia applications.

You cannot destroy anything irreversibly by installing a DirectX redistributable, it only installs any components that do not already exist.
Title: foo_wave_seekbar
Post by: CmdRobot on 2010-10-20 10:14:08
You cannot destroy anything irreversibly by installing a DirectX redistributable, it only installs any components that do not already exist.


Alright, I did it. I launched the Webinstaller, switched to D3D and everything looks like with GDI but runs a lot smoother. Nice! Thanks again for this wonderful component, Zao!

One last thing though: I would love to see the waveform getting scaled by replay gain. Some of my songs have a very low volume and the waveform's amplitude is really low.
I downloaded some guys seekbar.fx, it scaled the waveform just fine but changed to colors and look of it as well. As I said, I really like the simple white bachground, black wave look. So I tried for like one hour to understand whats going on in seekbar.fx but I didn't understand anything.

So maybe somebody could post a seekbar.fx with replay gain scaling...?

Thanks!
Title: foo_wave_seekbar
Post by: Anomalous on 2010-10-20 11:26:14
If you're talking about the one I posted here (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=705262), you can right click the seekbar, select configure, and change the colours to something you like.

Or if you prefer the look of the default seekbar here's the fx file with replay gain scaling. http://pastebin.com/5Fv4kZDR (http://pastebin.com/5Fv4kZDR)
Title: foo_wave_seekbar
Post by: CmdRobot on 2010-10-20 11:48:52
Or if you prefer the look of the default seekbar here's the fx file with replay gain scaling. http://pastebin.com/5Fv4kZDR (http://pastebin.com/5Fv4kZDR)


This is exactly it!
Merci beaucoup!

Now let's see if I can live with a perfect config or if I start tweaking again in a couple of days...
Title: foo_wave_seekbar
Post by: djchristian on 2010-11-02 12:33:09
How much does this plug-in wear on the harddrive?
Title: foo_wave_seekbar
Post by: Zao on 2010-11-02 12:47:55
When analysing a track, as much as decoding it normally would do, as well as writing out a few kilobytes to the database, with whatever overhead that might have.

When changing tracks, reading said kilobytes from the database.

And oh, when exiting fb2k with jobs in queue, writing those job descriptions to the database, as well as reading them in when starting up again.
Title: foo_wave_seekbar
Post by: CmdRobot on 2010-11-02 12:59:06
I have around 4500 mp3s on my computer (20GB). Not all of them already have seekbar waveforms but at least 50%, some of them are pretty long DJ mixes. And my wavecache-file weights 30MB at the moment. That's not much!
Title: foo_wave_seekbar
Post by: frogworth on 2010-11-03 08:27:17
I have around 4500 mp3s on my computer (20GB). Not all of them already have seekbar waveforms but at least 50%, some of them are pretty long DJ mixes. And my wavecache-file weights 30MB at the moment. That's not much!


I have around 270GB of music on my computer, which is admittedly quite a lot. I couldn't possibly have seekbar waveforms for anything approaching 50% of these - there's no way I've listened to that much of my music since installed this component. Nevertheless, my wavecache.db file is about 417MB, which is quite big... especially since I sync my foobar folder every day (in fact it's in my Dropbox folder, so I can have the same config at work and at home).

OK, I ran "Compact Waveform Database" and it's now 400MB
Title: foo_wave_seekbar
Post by: Zao on 2010-11-03 09:37:20
If you're interested in exact metrics, you can open wavecache.db with the sqlite3.exe command line client and run the query select count(1) from wave;
That will give you the number of waveforms currently stored. The memory usage per waveform is roughly (channels * 5 * 2048 * 4), with compression on top.
If you've moved your music around, you might have a bunch of dead waveforms lying around. You can clean those out via the Remove Dead Waveforms command on the menu.
Title: foo_wave_seekbar
Post by: Anomalous on 2010-11-03 10:24:21
On a somewhat related matter, would it be possible to add a %wave_seekbar% field? I'm not sure if there's anything useful which could be put in it, but it'd be nice to have so you could search for tracks without a signature.
Title: foo_wave_seekbar
Post by: Zao on 2010-11-03 11:06:44
Quite probably technically possible 
Title: foo_wave_seekbar
Post by: zooliat on 2010-11-17 16:29:24
Hi, what an awesome component! There is any way i can set the resolution of teh waveform ? I mean, i use it but keep it very small, and i figure there is no need that the waveform to be rendered and stored at high resolution. Is there a setting for that ? If not, is it hard to implement ? Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2010-11-18 14:09:16
Each waveform is stored at a resolution of 2048x5 floating point numbers. As such, each waveform uses around 40 kilobytes prior to compression. That 2048 width is implicitly used all over the code base, as it's a very reasonable size.

The reason why I chose that size is on one side it's a texture dimension that is very commonly supported by even the worst graphics cards, while if I would go for 4096, there would be cards that would complain, while only providing any benefit at all to people with horizontal resolutions above 2048.

As for storing less, no, that will not happen.
Title: foo_wave_seekbar
Post by: Anomalous on 2010-11-20 02:51:10
I've found a problem with the database. Paths are stored and selected case sensitive, but the remove dead waveforms command seems to be case insensitive.

To test:
Code: [Select]
CREATE TABLE file2 (fid INTEGER PRIMARY KEY NOT NULL,location TEXT NOT NULL COLLATE NOCASE,subsong INTEGER NOT NULL,UNIQUE (location COLLATE NOCASE, subsong))
INSERT OR REPLACE INTO file2 (location, subsong) SELECT location, subsong FROM file

In my foobar2000 library: 7775 items
In the file table: 8036 items
In the file2 table: 7741 items

I guess you could just make it clean up waveforms properly but it might be better to make the path case insensitive, although I think NOCASE only works for ascii so you'd have to make your own collation function. Now to find those missing 34 waveforms...
Title: foo_wave_seekbar
Post by: Zao on 2010-11-20 16:37:16
I've got a %waveform_channel_count% in my trunk, sounds like a %waveform_channel_count% MISSING query would suit you well, if I ever get around making a release again.

As for the queries, a GET is:
Code: [Select]
        shared_ptr<sqlite3_stmt> stmt = prepare_statement(
            "SELECT w.min, w.max, w.rms, w.channels, w.compression "
            "FROM file AS f NATURAL JOIN wave AS w "
            "WHERE f.location = ? AND f.subsong = ?");

while a remove-dead is:
Code: [Select]
        sqlite3_exec(backing_db.get(), "DELETE FROM file WHERE file_exists(file.location) IS NULL", 0, 0, 0);

where file_exists uses the SDK filesystem::g_exists function.

As such, case semantics are all up to what g_exists does, as I treat locations as opaque things I can throw at fb2k to get files.
As such, I do indeed treat locations differing in case to be different locations, as they very well may be (consider case-sensitive filesystems).
If you've managed to get fb2k to mutate case for a location, then it's not the same file in my world.

I'm not going to use something else than g_exists to test for file existence, as that would just lead to not being able to support things like archives and all.
I'm reluctant to change my locations to ignore case, as down that line lies amusing horribleness with case-sensitive filesystems and collation breakage with oddball locales like the turkish one.
Title: foo_wave_seekbar
Post by: Test_12 on 2010-11-28 12:54:29
Thank you very much for such a beutiful plugin like this!
This is the only Waveform viewer plugin for a player that I could found.

Strangely, I think some musics' waveform are shown as wrong. It's too high... I don't know how to explain it.
D2D mode shows more realistic... But it still has some problems. e.g @2:00,  music slows down but the plugin shows it almost the same speed.

How to make it more sensitive?

Trackitdown Waveform:
(http://img502.imageshack.us/img502/8158/ekranalnts2.png)

D3D:
(http://img543.imageshack.us/img543/8745/d3d.png)

D2D:
(http://img833.imageshack.us/img833/4981/ekranalnts40.png)

GDI:
(http://img593.imageshack.us/img593/5426/gdi.png)

Thanks...
Title: foo_wave_seekbar
Post by: Zao on 2010-11-28 13:15:34
I have never heard of whatever program that is you showed an image from, but it might use some other metric than min/max amplitude. I compute some kind of RMS power as well, which there exists effect files to visualize in D3D mode.

Feel free to come up with some more mathemagically rigorous analysis. I've never had any need for anything else than amplitude, only adding RMS because some people wanted me to.
Title: foo_wave_seekbar
Post by: Test_12 on 2010-11-28 13:25:34
Trackitdown is not a program, it's a music store website. In addition, you can listen to the track.
For me, the waveform feels like it doesn't fit.
Here's another example:

Trackitdown:
(http://img339.imageshack.us/img339/8827/ekran33.png)

Foobar:
(http://img152.imageshack.us/img152/4161/ekranalntsc.png)

I think it needs to be resized :S

EDIT:

Nevermind, I solved the problem...
Title: foo_wave_seekbar
Post by: Andreasvb on 2010-11-28 14:25:44
What was the problem?
Some DSP or gain?

Could be good to know if someone else might have same issue in the future.

Thanks.
Title: foo_wave_seekbar
Post by: technicaltitch on 2010-12-01 16:39:58
Could the 'Extract seekbar signature' command please remove any existing signature if found? Currently if it finds one it does nothing.

I produce music and mixes and use the seekbar to check peak levels etc. As a result I'll recreate an mp3 tens or hundreds of times as I develop the track or mix. Currently to get the signature extracted each time I have to give the file a different name, or the signature for the previous version of the track is used. It would be SO useful if 'Extract..' could replace any existing signature.

Or is there another way?

Thanks, brilliant brilliant extension!
Chris
Title: foo_wave_seekbar
Post by: Zao on 2010-12-01 17:34:04
It could probably be added as an advanced setting, or possibly as some kind of media library monitoring hook.

Of course, that's rather moot, as the codebase is not in any shape suitable for a release, due to experimentation in the wrong branch.
Title: foo_wave_seekbar
Post by: technicaltitch on 2010-12-01 19:15:51
It could probably be added as an advanced setting, or possibly as some kind of media library monitoring hook.

Thanks. My need is so unusual I doubt it is worth the trouble of a setting, but would it need to be a setting? I can't think when someone would click 'Extract..' if the signature was already in the db.

experimentation in the wrong branch

Ouch! Pretend I didn't mention it then and good luck! Just realised I can delete the file, remove dead waveforms then re-add.
Title: foo_wave_seekbar
Post by: Zao on 2010-12-01 20:21:00
Before I added the titleformatting hooks for testing if a waveform existed, my usual routine for adding any missing waveforms was to select a lot of tracks and Extract, knowing that it wouldn't do any excess work.

In the fabled Next Version, there'll be something like %waveform_channel_count% one can use to filter out any tracks missing waveforms.
Title: foo_wave_seekbar
Post by: technicaltitch on 2010-12-01 22:32:40
Before I added the titleformatting hooks for testing if a waveform existed, my usual routine for adding any missing waveforms was to select a lot of tracks and Extract, knowing that it wouldn't do any excess work.

In the fabled Next Version, there'll be something like %waveform_channel_count% one can use to filter out any tracks missing waveforms.

Of-course sorry you're right - I imagine plenty of people select a number of tracks and click 'Extract..' and wouldn't want it to re-scan everything. I'll go back to my corner.

Thanks HUGELY for this extension - there's nothing like it for super-fast reviews of mixes, tracks, etc.
Title: foo_wave_seekbar
Post by: Zao on 2010-12-02 00:34:46
There seems to be something fishy with this code. According to my revision history, it should rescan any tracks if the user explicitly does an Extract action. Why this doesn't happen, time will hopefully explain.
Title: foo_wave_seekbar
Post by: CmdRobot on 2010-12-03 09:29:18
I support doubleclicking on the waveform starts playback from the clicked region.

But still it's perfect the way it is.
Title: foo_wave_seekbar
Post by: maitreya on 2010-12-10 13:15:53
first, thank you for this great component.

I've a problem.
I click too quickly on "extract seekbar signature" on all my collection.

Is there a way to stop this, my computer becomes crazy and very hot! Also "wavecache.db" start to be > 700,000 bytes...

thanks for help
Title: foo_wave_seekbar
Post by: Zao on 2010-12-10 18:14:27
Exit foobar2000.
Download the sqlite3 shell (http://www.sqlite.org/sqlite-shell-win32-x86-3070400.zip), unpack somewhere.
Then drag the wavecache.db onto the sqlite3.exe to launch it.
Finally type the command DELETE FROM job;

That will purge all pending scan jobs from the seekbar.
Some day in the far future, I might add in that functionality into the GUI, but as it involves creating new UI, it's quite low priority. Something else I've been considering is adding a menu item to remove signatures.
Title: foo_wave_seekbar
Post by: maitreya on 2010-12-13 06:59:23
Thank you Zao, it works
Yes maybe when you'll have time you can add an entry like "Delete pending jobs" in the "Waveform seekbar" menu.
best
Title: foo_wave_seekbar
Post by: phunkydizco on 2010-12-21 14:11:14
When I listen to internet radio suddenly my custom background color turns to gray. How can I fix this?
Title: foo_wave_seekbar
Post by: Zao on 2010-12-21 16:32:27
When I listen to internet radio suddenly my custom background color turns to gray. How can I fix this?

When a stream is playing, it shows an empty waveform of 1s duration. As such, it fills up quickly with shaded background colour. If you want to avoid that, you can disable the "shade background" setting.
Title: foo_wave_seekbar
Post by: Marsu42 on 2010-12-21 22:38:30
Well, I know these types of I-don't-want-to-read-the-whole-thread type remarks are bothersome, but here's one anyway:

I really like this component, but the problem is that a large part of the library I'm using is on a network share - only a smaller often accessed part is attached to a local disc. Everything is included in the library for searching etc. purposes, but the building the waveform db kills our network - It is stressed enough as it is with reading the meta tags.

It would be nice to have a blacklisting option, maybe a simple "don't analyse the files under path xyz" or even better a custom evaluation that skips the files if true (like $strstr(%path%,M:\) or something else).
Title: foo_wave_seekbar
Post by: Zao on 2010-12-23 10:43:26
The only filtering you have available for now is to exclude anything that is not in the media library. The problem with implementing your suggestion is that it requires making some UI for specifying the paths, which is something I loathe.
Title: foo_wave_seekbar
Post by: phunkydizco on 2010-12-23 14:18:10
When I listen to internet radio suddenly my custom background color turns to gray. How can I fix this?

When a stream is playing, it shows an empty waveform of 1s duration. As such, it fills up quickly with shaded background colour. If you want to avoid that, you can disable the "shade background" setting.


That seems to work. But a want to use shade played. In a stream the length of the track is 0. Perhaps you could only use the normal background color in this case.
Title: foo_wave_seekbar
Post by: Zao on 2010-12-23 18:49:51
If it wasn't for whiny finns, you'd have something like this (http://www.acc.umu.se/~zao/seekbar14.png) for tracks without information. 
Title: foo_wave_seekbar
Post by: Marsu42 on 2010-12-24 12:01:02
The problem with implementing your suggestion is that it requires making some UI for specifying the paths, which is something I loathe.


I don't know the SDK, but there shouldn't it be rather easy to add a "Blacklist Path" or "Blacklist query" text field option under Preferences->Advanced->Tools->Waveform seekbar? Many other components do it this way, and the problem i described unfortunately really is a showstopper for using your component with a slow network setup.
Title: foo_wave_seekbar
Post by: Zao on 2010-12-24 12:49:28
Sure, it's reasonably "simple". The bothersome bit is exposing the ability to blacklist more than one thing, and whether I should intermingle this with the existing banned protocols or not.

And of course, the codebase is in no shape to be released, due to some accidental merges from an experimental branch. Maybe in the next year, when I'm on something more powerful than a netbook that cries if you load VS10.
Title: foo_wave_seekbar
Post by: adam777 on 2011-01-04 18:26:15
Hello Zao,
I've been using the component for quite some time and found it very useful and very well done.
I do have one problem - suppose a file have a waveform stored in the DB, if I change the file to a different file with the same name (overwrite), the waveform used is the one extracted for the old file.
(Not sure that's exactly what happens, but some sort of waveforms mixup).
A possible solution would be to add a time stamp for the extraction and if the file date is newer (as in "introduced to the media library later"), rescan (I think the media library has some mechanism for tracking when files are introduced to the media library, file date is not something you can count on).
Another possible (though pretty damn, I must admit), is to not store waveforms at all, and rescan every file on launch.

Once again, thanks for the component, Adam.
Title: foo_wave_seekbar
Post by: Zao on 2011-01-04 20:20:21
Responding to media library notifications is already in my todo. As for file date, that will fail rather spectacularly for things like CUE sheets.
Title: foo_wave_seekbar
Post by: adam777 on 2011-01-04 23:10:31
Dunno about CUE sheets, I split them files right away
Thanks, Zao.
Title: foo_wave_seekbar
Post by: fillip on 2011-01-06 17:35:39
Might have been on the last 20something pages ... but you need a function to clean the wavecache.db from dead entries
Title: foo_wave_seekbar
Post by: Zao on 2011-01-06 19:07:49
You mean the one in Library -> Waveform Seekbar -> Remove Dead Waveforms? 
Title: foo_wave_seekbar
Post by: fillip on 2011-01-07 20:40:49
You mean the one in Library -> Waveform Seekbar -> Remove Dead Waveforms? 


Oh I'm sorry, didn't see it there ... just looked into the options. And now I see it's also mentioned in the documentation =)
Title: foo_wave_seekbar
Post by: Zao on 2011-01-09 04:59:48
Sorry about that, thought you were talking about my component, heh.
For what it's worth for you regular users, I've added support in my development build to restrict the update rate even further.
Title: foo_wave_seekbar
Post by: dunego on 2011-01-24 21:49:21
Hey Zao, first of all thanks for that. I´m a music producer and that component is just great, really useful.

If I´m not asking for too much, is possible to put a zoom tool so we can zoom in and out the waveform as the cursor follow it, or even an option to follow or not follow cursor like on music production apps ? This could be useful cause sometimes if the music is too long, the waveform will become a brickwall.
Title: foo_wave_seekbar
Post by: Zao on 2011-01-25 08:32:25
Zooming is something that the current architecture doesn't handle well at all.
The way it works is that it as an offline step analyses the whole audio stream collecting results into a finite set of buckets (2048 or so). As such, almost all the data I have stored is visible in a typical window size. If you zoom 2x, any window wider than 1024 would have to interpolate the results, already having hit the resolution of my data.

Allowing zoom would require on-the-fly analysis and generation of data, something which the current architecture is not designed for. This is coincidentally why stream waveforms are not in there either.
Title: foo_wave_seekbar
Post by: Xyzzy on 2011-01-28 13:44:49
Hello

First, thanks to Zao for useful and elegant component. Zao, have you ever thought of making volume-handling component with aesthetics similar to the Seekbar? I would use it from the day one.

Second, could anyone share an .fx file that makes the tracing bar a bit wider?

TIA
Title: foo_wave_seekbar
Post by: Zao on 2011-01-28 18:06:28
You should be able to change that width yourself, look for the variables seekWidth and positionWidth in the PS function. They are 2.5px by default.
Title: foo_wave_seekbar
Post by: Xyzzy on 2011-01-28 23:59:14
You should be able to change that width yourself, look for the variables [font= "Courier New"]seekWidth[/font] and [font= "Courier New"]positionWidth[/font] in the [font= "Courier New"]PS[/font] function. They are 2.5px by default.


Thanks. Should there be any default file created somewhere? I don't see any 'effects' folder created.
Title: foo_wave_seekbar
Post by: Zao on 2011-01-29 00:05:44
It should be in the foobar2000 directory of your user profile, as is proper, as it's per-user data.
Title: foo_wave_seekbar
Post by: Xyzzy on 2011-01-31 09:34:48
It should be in the foobar2000 directory of your user profile, as is proper, as it's per-user data.


OK, it's there. No idea why I haven't noticed earlier.
Title: foo_wave_seekbar
Post by: mzso on 2011-04-06 16:24:41
Hello!

I think this component might be leaking memory. I experienced growing memory from foobar. When I listened all day long to music foobar would reach 600 MB of memory usage. This plugin and some others became suspicious. So I removed this and I didn't seem to experience the kind of memory growth. And now I also made a test. I kept tapping the random track hotkey for a few minutes (on a playlist that had all of the songs cached) with and without waveform seekbar and the memory usage became significantly higher with waveform.
(http://i55.tinypic.com/2zzrp7l.jpg)
The first is with with waveform. And the second is after removing it.

Made another test:
(http://i51.tinypic.com/a9ofa0.jpg)

This time I added 13 waveform seekbar panels and (a menubar) to columns UI. Foobar started with about 376 MB memory (gues this is normal) and after a few minutes and about 400 random file opens it ended up with 957 MB.
Title: foo_wave_seekbar
Post by: Zao on 2011-04-06 19:06:48
I'm innocent!  I'd guess that I've got some circular smart pointers keeping each other alive.
Does this happen for any of the frontends or just a single one of D3D9/D2D/GDI? It'd help in tracking down where it might be.

I've reproduced this locally with 0.2.12.
Title: foo_wave_seekbar
Post by: mzso on 2011-04-06 21:01:54
I'm innocent!  I'd guess that I've got some circular smart pointers keeping each other alive.
Does this happen for any of the frontends or just a single one of D3D9/D2D/GDI? It'd help in tracking down where it might be.

I've reproduced this locally with 0.2.12.

Now I tried it with all three frontends. Memory increase seems to happen with all. Although GDI is much slower so I couldn't exactly try the same thing as with the other two. Also interestingly foobar starts with a lot less memory when GDI is selected. (55 MB compared to the 566 MB and 158 MB for Direct3d and direct2d).
Title: foo_wave_seekbar
Post by: Zao on 2011-04-07 03:32:49
It's likely fixed in my development trunk now. If it's what I think it was, it was due to storing and mishandling corrupt data in the database.
I've got no idea if it's possible to make a release though, the codebase is in a horrible shape.
Title: foo_wave_seekbar
Post by: mzso on 2011-04-07 10:49:59
It's likely fixed in my development trunk now. If it's what I think it was, it was due to storing and mishandling corrupt data in the database.
I've got no idea if it's possible to make a release though, the codebase is in a horrible shape.

I suppose its not worse than it was at the last release. A bug fixed is still a bug fixed. Anyway, if you decide not to release it "officially" maybe you could share it here for people like me to try?
Title: foo_wave_seekbar
Post by: Zao on 2011-04-08 01:02:17
The problem is that I've got lots of half-arsed changes in there, due to some version control misuse.
I've got a visual shader editor that kind of works. I've got per-instance effects for the D3D case. I've stopped using a filesystem file for the effects. It has each frontend (almost) in a separate DLL.
It will require you to rescan all your tracks again (due to the malformed data problem).

But sure, if you feel adventurous - 0.2.13 here (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.13.zip).
Do let me know how it works, I haven't tried deploying it to anyone outside my circle of insane testers.

Make sure to backup the configuration, as I've never meant it to be downgradable.
Title: foo_wave_seekbar
Post by: mzso on 2011-04-08 10:25:10
The problem is that I've got lots of half-arsed changes in there, due to some version control misuse.
I've got a visual shader editor that kind of works. I've got per-instance effects for the D3D case. I've stopped using a filesystem file for the effects. It has each frontend (almost) in a separate DLL.
It will require you to rescan all your tracks again (due to the malformed data problem).

But sure, if you feel adventurous - 0.2.13 here (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.13.zip).
Do let me know how it works, I haven't tried deploying it to anyone outside my circle of insane testers.

So far I had no problems. I can confirm that the memory doesn't increase anymore. As for the new features I wouldn't know how to try them. (Well, I could change stuff per panel and use the new mirror option, and noticed the "frontend settings" which I have no clue what is for)
Title: foo_wave_seekbar
Post by: Zao on 2011-04-08 16:57:53
0.2.13.1 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.13.1.zip) should be slightly more accepting of old shaders, if someone's affected by that.
Remember, it's still not production quality.
Title: foo_wave_seekbar
Post by: Anomalous on 2011-04-09 04:14:00
Wooo progress 

Some things I've noticed so far:
The last two may have been due to the malformed data problem, with a new database "%waveform_channel_count% MISSING" appears to work .

EDIT: first crash after making an autoplaylist of missing waveforms, extracting some, and then watching it flicker in EsPlaylist for a bit.
Title: foo_wave_seekbar
Post by: rol on 2011-04-09 08:54:37
When I'm trying to replace old version with it I got startup error:

Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.


foobar 1.1.5
Title: foo_wave_seekbar
Post by: Zao on 2011-04-09 09:25:05
Anomalous:
The effect editor is miserably inconsistent and pitiful, so don't expect it to be working that well at all.
As for the crashes you have, I've probably botched something with %waveform_channel_count% as it's been a bit spuriously visible here.
I should probably force a database purge next to ensure that any old incompatible data is really gone.

rol:
It is now out of necessity built against the dynamic VC10 runtime, so you need this redistributable (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c32f406a-f8fc-4164-b6eb-5328b8578f03) installed.
Title: foo_wave_seekbar
Post by: cameron on 2011-04-10 08:19:43
Hi Zao,
thanks for this great add-on.

Can I offer a few trivial suggestions, as long-time user of foobar, but one who has never bothered with add-ons in the past.

It would have saved me a bit of time and confusion if there was a bit more detail in the instructions.
Example: for the DX runtime, add the explicit statement that "this is required for all systems, including Window-7."
As was apparent in recurrent posts to the forum, it is not clear to ordinary users that this provides extra features not present in the standard DX-11 installation.
In addition, the linked page is now dated November-2010 for the web installer, although the offline download is labelled as the June 2010 update. Perhaps just calling it the "latest version" would be simpler.
I think part of the confusion, at least for me, lies in Microsoft's obscure naming system.  As far as they are concerned the "Direct-X runtime" is already installed with the OS. This extra installation is the "Direct-X end-user runtime", although I am baffled as  to how I am supposed to tell them apart with names like that.

For the DX2D you could say the Platform Update is "not required for Win-7."
Title: foo_wave_seekbar
Post by: Zao on 2011-04-10 17:42:35
In a perfect world, users would take the instructions at face value and stop making assumptions.
Title: foo_wave_seekbar
Post by: adam777 on 2011-04-12 10:56:42
Hi Zao,
Nice to see updates regarding the component again.
Any update about media library notifications integration (automatically re-scan on file change under the same name etc.).
Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2011-04-12 21:03:57
The only Media Library-related functionality I have currently is a setting to avoid scanning tracks that are not present in the Media Library at all.
It's on the suggestion list, somewhere.
Title: foo_wave_seekbar
Post by: theratcheteer on 2011-04-12 21:18:47
Hi Zao! Great plugin, and works perfectly for me!

Feature request, though: normalize the waveform so that it's as tall as the seekbar.

Again, this plugin is kickass!
Title: foo_wave_seekbar
Post by: adam777 on 2011-04-13 07:46:17
The only Media Library-related functionality I have currently is a setting to avoid scanning tracks that are not present in the Media Library at all.
It's on the suggestion list, somewhere.


Thanks for the quick reply, Zao.
Glad to hear it's still being considered 
Any idea when you might have time to implement new features such as this one?
Title: foo_wave_seekbar
Post by: Zao on 2011-04-13 09:52:47
Somewhere between Duke Nukem Forever and the heat death of the universe. As usual, I'm completely bogged down with work. I'm not really actively developing, I just dedicated some procrastination time to fixing the memory leak above.
Title: foo_wave_seekbar
Post by: adam777 on 2011-04-13 13:00:56
Somewhere between Duke Nukem Forever and the heat death of the universe. As usual, I'm completely bogged down with work. I'm not really actively developing, I just dedicated some procrastination time to fixing the memory leak above.


  appreciated.
Title: foo_wave_seekbar
Post by: aum on 2011-06-11 11:40:17
Nice plug! Thanks!
Please add a pseudo-transparent background option!
Title: foo_wave_seekbar
Post by: Zao on 2011-06-11 12:01:01
A good while ago the D3D backend supported loading arbitrary textures you could sample from in the effect file.
That functionality may still be alive, I haven't looked at that part of the code in ages.
(http://www.acc.umu.se/~zao/seekbar26_t.png) (http://www.acc.umu.se/~zao/seekbar26.png)

It is (essentially) impossible to attain proper transparency (in panel stacker or so) in the D3D case, and nothing I have bothered implementing in GDI or D2D.
Title: foo_wave_seekbar
Post by: CmdRobot on 2011-06-11 12:29:35
Hi forum!
I love waveform seekbar. Thanks a lot for that component, Zao!

A while ago, I asked for a seekbar.fx file, that scales with replay-gain information, so that all waveforms have the same size. I have absolutely no idea how he did it, but some nice guy uploaded me this file:
http://dl.dropbox.com/u/7136456/seekbar.fx (http://dl.dropbox.com/u/7136456/seekbar.fx)

It worked perfectly. If a waveform was too flat (because the track volume was too low), I scaned the file and the volume and wavform were raised.
That has changed now. Don't know why, but when I replay gain-scan my files, the waveforms get smaller now. They're all set to 3/4th of the size of my waveform seekbar. I want full 4/4th!

Can anybody help?
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-06-12 19:22:08
0.2.13.1 turned my foobar really sluggish. After switching 4 or 5 songs foobar would just freeze for a couple of seconds. I had to go back to 0.2.12
Title: foo_wave_seekbar
Post by: SASN on 2011-06-13 17:04:04
What a nice contribution to my Foobar2k setup!

I use it borderless and in mono mode. Perhaps this seekbar can hint at what songs are subject to overdriven compression in the mixing/mastering.

Question: Does this seekbar have some kind of 3D display function?

The configuration has a 2D and a 3D option for the rendering. I just cannot tell if the difference is that great.
Title: foo_wave_seekbar
Post by: mjb2006 on 2011-06-14 10:58:49
What actually gets rendered isn't quite the same from mode to mode, but no, nothing is 3D! Windows has different APIs for drawing things on the screen. GDI+, Direct3D, Direct2D ... the component can use whichever of these is available. The difference is mainly how much CPU usage they take... GDI+ requiring the most effort.
Title: foo_wave_seekbar
Post by: Zao on 2011-06-14 11:05:18
SASN: I had no idea that you had edited your message with a question, as the forum only notifies me on new posts.
As mjb2006 says, there's no "3D" mode as far as drawing some kind of geometry, I only use Direct3D to get cheap rasterisation of the waveform image, as that is a task that programmable shaders excels at.
It _would_ be possible to write something fancy if I had bothered to expose the waveform API to other components, but there's no such thing currently.
Title: foo_wave_seekbar
Post by: herojoker on 2011-06-25 03:49:16
A little suggestion: Please make it possible to display the channel names in the seekbar. For example common 4 channel audio might yield FL, FR, SL, SR and usual stereo tracks may yield L and R.
Title: foo_wave_seekbar
Post by: Zao on 2011-06-25 15:02:51
Maybe for the future. I thought that I exposed the channel number for the D3D mode as a semantic, but it seems that it's not present.
As for actually drawing text, that would be a bit painful, and wouldn't be remotely customizable, as that involves way too much UI.
Title: foo_wave_seekbar
Post by: djchristian on 2011-06-27 17:04:51
Exit foobar2000.
Download the sqlite3 shell (http://www.sqlite.org/sqlite-shell-win32-x86-3070400.zip), unpack somewhere.
Then drag the wavecache.db onto the sqlite3.exe to launch it.
Finally type the command DELETE FROM job;

That will purge all pending scan jobs from the seekbar.
Some day in the far future, I might add in that functionality into the GUI, but as it involves creating new UI, it's quite low priority. Something else I've been considering is adding a menu item to remove signatures.


Why is it necessary to download the dll? Just throw the seekbar data file in the trash manually. It would be great if there's were a option to manually enter how the cache behave in seekbar.

Title: foo_wave_seekbar
Post by: Zao on 2011-06-27 18:35:04
Exit foobar2000.
Download the sqlite3 shell (http://www.sqlite.org/sqlite-shell-win32-x86-3070400.zip), unpack somewhere.
Then drag the wavecache.db onto the sqlite3.exe to launch it.
Finally type the command DELETE FROM job;

That will purge all pending scan jobs from the seekbar.
Some day in the far future, I might add in that functionality into the GUI, but as it involves creating new UI, it's quite low priority. Something else I've been considering is adding a menu item to remove signatures.


Why is it necessary to download the dll? Just throw the seekbar data file in the trash manually. It would be great if there's were a option to manually enter how the cache behave in seekbar.

I said to download an EXE, and the purpose was not to get rid of all the data, but to selectively remove jobs that for some reason are stuck.

As for an option to control what it stores and where, it's been on the todo for a good while, but it's something that has wide ramifications if it goes wrong, and adds lots of complexity, both configuration-wise and code-wise.

Currently, there's limited support to ignore things not in the media library. It might degrade decently if you scan the music you want and then write-protect the database file as a stopgap measure.
Title: foo_wave_seekbar
Post by: grimes on 2011-06-28 12:23:24
Thanks for great component.

As a ColumnsUI user i would like to use your component in toolbar (as simple seekbar replacement).

I think only minor changes are needed for CUI-panel:

type_panel -> type_toolbar

in this case normal panel is still available (type_toolbar = toolbar + panel)

Title: foo_wave_seekbar
Post by: tedych on 2011-06-28 13:44:20
A killer component!
Actually I'm pretty new to foobar2000 in the first place, and having played around with it for a night, I thought how good it would be if I had a waveform seekbar much like the waveform view in most sound editors.
Guess the surprise I ran into when I found this component.
It works fine under my Win7 x64.
I have a minor question though.

Why I don't see the DirectX 9.0c option under the available frontends? Only GDI and Direct2D 1.0.
I use Win7 x64 Enterprise SP1 and all recent WUpdates (last updated maybe 2 months ago). I haven't installed any DX redistributables and such. Could it be the reason?
Title: foo_wave_seekbar
Post by: fuflo on 2011-06-28 14:31:43
win7 doesn't have dx9 by default. you have to install it separately.
Title: foo_wave_seekbar
Post by: Zao on 2011-06-28 15:26:44
Why I don't see the DirectX 9.0c option under the available frontends? Only GDI and Direct2D 1.0.
I use Win7 x64 Enterprise SP1 and all recent WUpdates (last updated maybe 2 months ago). I haven't installed any DX redistributables and such. Could it be the reason?

Yes, you need the right DX redistributable. The console in your foobar probably mentions this in a nicely phrased message.
There's no DX runtimes deployed via Windows Update, the software vendor (game, application) are supposed to bundle them with their installer. As foobar components are installer-less, I do not bundle the runtime, instead instructing people to download them themselves.

win7 doesn't have dx9 by default. you have to install it separately.

That's not quite accurate. Windows 7 ships with core runtimes for at least D3D9 up to D3D11.
What it doesn't have out of the box are the release-specific libraries provided in the redistributables. The core of a Direct3D version has always been mostly the same, what differs between the SDK and runtime releases are the auxillary libraries like D3DX and XAudio.
Title: foo_wave_seekbar
Post by: tedych on 2011-06-28 16:18:30
Thanks for the clarifications. I don't mind using GDI, it works fine and as expected.
And as no software currently (1/2 year since I'm with Win7) alerted me about DX9, I don't plan installing it. I do not play games on this OS.

A small feature request:
An option to limit the wave database cache (the cache .db file indirectly) would be nice so we have some control over it's growth in size. Maybe a maximum number of cached waveforms (50-100-200 as default? ) especially for people who often need to preview large collections. And using a FIFO principle for the cache maybe.
Title: foo_wave_seekbar
Post by: Zao on 2011-06-28 18:04:52
[a href="http://www.acc.umu.se/~zao/seekbar45.png" target="_blank"]
D2D looks horrible squished down that small though, probably could use a line width relative the window size or some downsampling.
Title: foo_wave_seekbar
Post by: grimes on 2011-06-28 18:19:22
I do not think about stereo mode, just replacement of "standard" seekbar in toolbar:

(http://www.abload.de/img/2011-06-2819-11-13u8h2.png) (http://www.abload.de/image.php?img=2011-06-2819-11-13u8h2.png)

(This is a one-line panel simulation of seekbar-toolbar)
Title: foo_wave_seekbar
Post by: Zao on 2011-06-28 18:26:40
It's as full-featured as the panel-kind seekbar, so you can downmix it into mono, change the look, and all that perfectly fine.
Well, except for the crashes I seem to suffer whenever I add/remove it from the toolbar, that is.

Edit: I might add, that you should not expect a release any time soon, I'm, as usual, horribly busy.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-06-28 21:13:24
I don't get where I am supposed to copy the 2 DX dlls, for some reason ver 0.2.13.1 doesn't need them in the component folder but version 0.2.13 does


Is anyone else experiencing lag in the waveform seekbar when playing short tracks (like 0:50 minute long tracks) using D3D 9.0c render?
Title: foo_wave_seekbar
Post by: marc2003 on 2011-06-28 21:17:27
i have no idea what you're on about so i'll just post the relevant part of the OP that you didn't read.

The Direct3D 9.0c mode requires the DirectX end-user runtime dated earliest February 2010, which can be installed through use of the DirectX end-user Runtime Web Installer (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en) (make sure to not accidentally install the Bing Bar they try to force on you).
Note that the DirectX redistributable is required on all OSes no matter whether you think you "have DirectX installed already, lol" or not.
Title: foo_wave_seekbar
Post by: Zao on 2011-06-28 22:52:58
I don't get where I am supposed to copy the 2 DX dlls, for some reason ver 0.2.13.1 doesn't need them in the component folder but version 0.2.13 does


Is anyone else experiencing lag in the waveform seekbar when playing short tracks (like 0:50 minute long tracks) using D3D 9.0c render?

You're not ever supposed to copy the runtime DLLs yourself anywhere. You should run the installer and install them system-wide, assuming that you have rights to do so.

If you do not have the rights to do so, the main foobar2000 directory might be a decent bet, as there's some search path shenanigans going on when loading components. The difference you see is probably due to moving out the frontends into separate DLLs instead of having them in the main component.

As for "lag", you've got to elaborate further on that.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-06-29 02:30:42
Oh, I had already installed the DX redistributables, but the dlls inside the rar mislead me, haha, sorry for that.

About the "lag", I mean the progress bar, it goes kinda skippy. Like if you were playing a video game and had low FPS, you know what I'm saying?
Title: foo_wave_seekbar
Post by: Zao on 2011-06-29 08:06:51
You shouldn't ever need to open the archive yourself. Just drag it onto the components box of foobar2000 and it will install properly.

As for stuttery updates, the GDI and D2D modes have lower update rates than the D3D mode. There's a tuning parameter in Advanced in Preferences where you can bump it up if you feel like burning some more power.
Title: foo_wave_seekbar
Post by: tedych on 2011-06-29 10:30:19
In GDI mode there is no stuttery behavior of the wave seekbar, even for tracks below 0:40 in length.

"There's a tuning parameter in Advanced in Preferences where you can bump it up "
- Where is this, I don't seem to find it there.
Although I wonder why prefer Direct* than GDI anyway, this seekbar is not graphics intensive in the first place and in GDI mode I don't seem to see any jumps above 0-1% CPU usage for foobar2000.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-06-29 14:01:49
As for stuttery updates, the GDI and D2D modes have lower update rates than the D3D mode.

For me, GDI works kinda like D3D, but D2D works the smoothest

Quote
There's a tuning parameter in Advanced in Preferences where you can bump it up if you feel like burning some more power.

I saw that but I don't really understand what they are for. I changed them a few times and saw no difference :/

- Where is this, I don't seem to find it there.

Foobar > advanced settings > tools > Waveform seekbar
Title: foo_wave_seekbar
Post by: tedych on 2011-06-29 14:24:11
...
Foobar > advanced settings > tools > Waveform seekbar

I've already been there, thats why I asked. The only performance parameter there is the number of concurrent threads (defaults to 3). By the way using the available processor cores is a good idea to speed up the waveform generation by fast decoding of the track - usually just a second for noncached tracks here.
Title: foo_wave_seekbar
Post by: Zao on 2011-06-29 15:56:15
I could've sworn that that was in a released build, I probably misremembered. Anyway, what kind of GPU (or lack of GPU) do you have there, and do you have proper drivers installed?

As for the core count, performance tests show that for more than three cores, you're pretty much completely disk-bound. The setting is there if the default of min(core_count,limit) is not suitable for you.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-06-29 22:44:34
I have an onboard card (geforce 6150), latest drivers and I'm on a dualcore cpu (athlon X2), but I can play some games with higher detail than the wavebar. That's why I didn't think my GPU could be the culprit.
Title: foo_wave_seekbar
Post by: mayer on 2011-07-02 11:35:16
hi, Zao!
is the seekbar compatible with fb2k 1.1.7?
i have many versions of vcredist installed and it still doesn`t works (Win7 x64)
do i need older version of player?
great job anyway, thank you :)
Title: foo_wave_seekbar
Post by: frogworth on 2011-07-02 12:12:44
hi, Zao!
is the seekbar compatible with fb2k 1.1.7?


Works fine for me. My work computer is Win7 x64.
Title: foo_wave_seekbar
Post by: Case on 2011-07-02 14:47:10
i have many versions of vcredist installed and it still doesn`t works (Win7 x64)

Perhaps you missed these instructions:
The Direct3D 9.0c mode requires the DirectX end-user runtime dated earliest February 2010, which can be installed through use of the DirectX end-user Runtime Web Installer (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en) (make sure to not accidentally install the Bing Bar they try to force on you).
Note that the DirectX redistributable is required on all OSes no matter whether you think you "have DirectX installed already, lol" or not.
Versions over 0.2.12 require the Visual Studio 2010 SP1 (x86) runtime (http://www.microsoft.com/download/en/details.aspx?id=8328).

Title: foo_wave_seekbar
Post by: mayer on 2011-07-02 15:03:14
oh, hell yeah!
all of vcredist was x64 version, that`s the problem, thank you
Title: foo_wave_seekbar
Post by: Zao on 2011-07-02 15:37:18
To clarify for future consumption, the bitness of the vcredist is referring to the bitness of the applications you want to run, not the OS bitness you're on.
Title: foo_wave_seekbar
Post by: tedych on 2011-07-03 13:28:35
Zao. I found a memory leak in your component. Unfortunately I'll have to remove it from my foobar.
I reproduced it on several installations, with 1.1.6 and 1.1.7.
With every played song your component seems to leak about 50-100KB or something like that.
I just noticed this yesterday, when after 3 days of uptime my foobar2000 totalled 120+MB of RAM. I spent much time troubleshooting this until I found a pattern, and after tried removing the next suspect (the seekbar), it was finally and instantly Ok.
I start foobar and play with Prev/Next few tens/hundreds of times and it easily eats 30-40MB more after just few minutes of doing this. If I continued, it eventually ate more than 100MB in a matter of 10 minutes. After deleting the component, everything is Ok even after 20 minutes playing around with Nex/Prev song controls.
This on 3 different OSes and foobars. I want a stable player accross months of uptime, so I'll wait for a fixed version of waveform seekbar since it is so great.

Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2011-07-03 13:33:47
Which version is this, 0.2.12? There's a interim release (0.2.13.1 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.13.1.zip)) with discussion about the leak a page or so ago which fixes this, but is generally unpolished.
Title: foo_wave_seekbar
Post by: tedych on 2011-07-03 13:52:16
Yes, the latest stable 0.2.12.
The new 0.2.13.1 completely refuses to play with foobar. At startup it says it was not for this version of foobar or something like that (1.1.6), I test on another machine where I have tried 1.1.6 some time ago, I installed 1.1.7, and the installation told me similar things, the component not installed correctly, or not meant for this version of foobar...
Quote
Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.

The stable version at least worked to start.
Anyway, I'm forced to wait for a stable release though. Not bound to alpha versions of any software I use.

(I just saw few pages ago a discussion about the same problem as you mentioned  ). The new alpha version is about 500KB smaller, and since it is not working for me, I'g guess you made many other changes to it (apart from the additional 2 dlls involved). Is there a version where just this bug was fixed?
Title: foo_wave_seekbar
Post by: Andreasvb on 2011-07-03 14:06:51
@tedych: http://www.hydrogenaudio.org/forums/index....st&p=751354 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=751354)
Title: foo_wave_seekbar
Post by: Zao on 2011-07-03 14:19:22
As the first page of the thread says, and as the post where the new version is introduced, it now depends on the VC++ 2010 SP1 (x86) runtime, due to it being a build from my work-in-progress sources at the time.
The reason for it is moving out the optional frontends (D3D, D2D) into separate DLLs, necessitating the use of a dynamic runtime to avoid massive restructuring.

And no, there is no bugfix release with just that bugfix, due to some version control accidents.
Title: foo_wave_seekbar
Post by: tedych on 2011-07-03 14:35:07
I apologize  .
I tested it on my own system now, and it seems to work. I have VS2010 here in fact and that seems to have helped. Or some other software installed it as part of its installation.
The interesting part is now I see the DX 9.0c frontend and I haven't installed any additional DX redistributables (as I mentioned before).
Hoping it is stable enough not to crash on me on everyday music listening.
Thanks.
Still waiting for a stable release  .

EDIT: Nevermind, it seems under GDI foobar eats less memory, and it seems after the initial memory increase, foobar stabilizes, even with the component.
Title: foo_wave_seekbar
Post by: tedych on 2011-07-05 10:42:23
Still, after 2 days the player ate another about 20-25MB, I don't know whether waveform seekbar is at fault again. Totalling 60MB. The process is slower this time but still eating memory for some reason.
Title: foo_wave_seekbar
Post by: mzso on 2011-07-05 13:15:20
Still, after 2 days the player ate another about 20-25MB, I don't know whether waveform seekbar is at fault again. Totalling 60MB. The process is slower this time but still eating memory for some reason.

Is it really an issue? My foobar instance starts with ~90 MB of ram and stabilises at 130-140MB.
Title: foo_wave_seekbar
Post by: tedych on 2011-07-05 13:30:09
Yes, it is an issue. Still not sure if this is caused by the seekbar. I'll wait for few days to see at what level it would stabilize.
140MB of RAM is way too much for a simple player as this one. I have 8 gigs of ram, but there are many other things hungry for ram, and also many other small ones (like the player) that are small enough but useful to not geting in the way in any way.
Again, I used winamp with 40 megs so far, and I found foobar to have better playlist management and display. Other than that I don't find any other thing that would have helped with the switch away from Winamp. Only the playlist management and the wider volume control (and this seekbar of course). If this player proves a resource hog (4-5 times more ram than w/amp), I'll sacrifice these things, honestly.
In our local forums here, I pointed out the problem, and many people responded they notice the same thing. It was supposed to be much lighter than other players, namely winamp. Was a nice try though. This time I will try without wave seekbar to see the ram consumption.
Title: foo_wave_seekbar
Post by: mzso on 2011-07-05 13:43:24
Yes, it is an issue. Still not sure if this is caused by the seekbar. I'll wait for few days to see at what level it would stabilize.
140MB of RAM is way too much for a simple player as this one. I have 8 gigs of ram, but there are many other things hungry for ram, and also many other small ones (like the player) that are small enough but useful to not geting in the way in any way.
Again, I used winamp with 40 megs so far, and I found foobar to have better playlist management and display. Other than that I don't find any other thing that would have helped with the switch away from Winamp. Only the playlist management and the wider volume control (and this seekbar of course). If this player proves a resource hog (4-5 times more ram than w/amp), I'll sacrifice these things, honestly.
In our local forums here, I pointed out the problem, and many people responded they notice the same thing. It was supposed to be much lighter than other players, namely winamp. Was a nice try though. This time I will try without wave seekbar to see the ram consumption.

Ridiculous. With 8 gigs you worry about foobar taking up 60+ megs, and you even have extra panels...
Anyway. The more stuff you use the more memory is needed especially with visual stuff.

By the way. This is anything but a simple player.
Title: foo_wave_seekbar
Post by: Zao on 2011-07-05 13:58:32
Leaks should not exist, no matter if you have gobs of memory or not. I wish I had time to comb through the component and clean up ownership issues. In the end, in deployed software, I'd rather err to the side of leaking than to use dangling objects as they tend to be very painful to debug, especially if mutated after their death.

I had a very elusive memory clobber bug a good while ago that only occured in very special configurations, where an ATL window frame suicided (delete this) and modified a member afterwards.

Back to the issue at hand though - address space is a very limited resource, particularly in such a rich client as foobar2000, which is very limited in this regard as it is a 32-bit application. At best we get four gigs of address space on x64 Windows, with chunks eaten up by libraries, graphics APIs, and so on. Every little bit counts, particularly as leaks love to fragment the heaps.
Title: foo_wave_seekbar
Post by: orchid on 2011-07-05 15:52:50
140MB of RAM is way too much for a simple player as this one. I have 8 gigs of ram...

Unused RAM is wasted RAM. With 8 GB you won't notice a difference, unless running some heavy image/video editing processes. And yeah foobar isn't exactly a "simple" player.
Title: foo_wave_seekbar
Post by: Zao on 2011-07-05 17:04:14
The OS will ensure that it's very rare that physical memory is completely unused. If it's not populated by data pages from working sets, it will use it for assorted caching (including filesystem cache.
What you will end up wasting if you're leaking, assuming that no part of a leaked page is hot, is that your swap file will accumulate dead pages. If you're one of those strange people that disable swap files because "you have enough memory, lol" you're doing your machine a disservice as you will force cold pages to stay resident in physical memory.

Please avoid derailing this thread with the pros and cons of the memory system. Mark Russinovich has some lovely articles if you want to educate yourself.
Title: foo_wave_seekbar
Post by: tedych on 2011-07-05 19:29:19
Zao, thanks.
Still, I will leave the player with your component active for few weeks and will watch the memory. If it goes too much up, I'll remove it and test for another week or so.

Yes, the OS is taking care of the free memory as of Vista and 7, effectively. No need to talk about why I have 8GB (which is somewhat not that much already), most of the time I have 120+ processes, and 3.5 to 4+GB actively taken and used. I use virtual machines extensively, easily going up to 7.5 used GBs. The cache itself is beyond 3GB most of the time. Strangely enough I keep 12GB of swap, totalling 20GB virt. memory, but as long as I have HD space, won't decrease it.
Anyway, that was not the point, the point was that every MB counts after a point when such a program passes. Maybe the 100MB limit is the psychological one for me.
Memory leaks are one of few things I'm most afraid of. Not to mention the security implications they might have on the system.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-07-13 22:24:13
I'm having a problem. Every time I play a song that hasn't already been scanned by wave seekbar, after 1 second it produces a skip in the music, which corresponds with the seekbar showing up. So that means that the plugin scanning and finally displaying the seekbar produces a skip in the song. I am using 13.1
Title: foo_wave_seekbar
Post by: mzso on 2011-07-13 22:42:19
Somekind of length limit would be nice. A few days ago I tried playing a DTS file. It appeared to be six hours lon (erroneously though because it was a two hour movie). Anyway foobar ended up maxing the cpu for a long time. After I got fed up I restarted switched to another file restarted again, but I still had max cpu usage. After I deleted the wave cache it was working normally again.
Title: foo_wave_seekbar
Post by: Zao on 2011-07-14 13:58:17
Such a time limit would backfire on real-world files.
I have several single-file mixes that are well over four hours. They scan in way less than a minute, as the analysis is essentially decoder-bound in speed.

I would recommend not adding non-music files, or wait for the day in the far future when I implement blacklists.
The reason why it restarted the scan when you restarted foobar2000 is because it remembers the jobs it had pending when shutting down and restores them from the database on startup. If you've got some job you don't want, you can open the database and clear out the job table.
Title: foo_wave_seekbar
Post by: Zao on 2011-07-14 14:05:39
... after 1 second it produces a skip in the music, which corresponds with the seekbar showing up ...

Which frontend are you using? Have you've messed with the buffering amount or priority of foobar's playback?
Even if I'm blocking something, there should be quite enough audio data buffered up to ensure glitchless playback.
The Direct2D backend should do all updating in a background thread, and there shouldn't be anything overly expensive going on in the Direct3D frontend.
The D3D and GDI ones do do things in the main thread (out of necessity for the former, and laziness for the latter).
Title: foo_wave_seekbar
Post by: mzso on 2011-07-14 19:00:06
Such a time limit would backfire on real-world files.
I have several single-file mixes that are well over four hours. They scan in way less than a minute, as the analysis is essentially decoder-bound in speed.

I would recommend not adding non-music files, or wait for the day in the far future when I implement blacklists.
The reason why it restarted the scan when you restarted foobar2000 is because it remembers the jobs it had pending when shutting down and restores them from the database on startup. If you've got some job you don't want, you can open the database and clear out the job table.

Yeah, blacklisting would be nice. Or an easy way to cancel the problematic job.

How do I open the database by the way?
Title: foo_wave_seekbar
Post by: Zao on 2011-07-14 20:57:09
It's a SQLite3 database file, so you need to download sqlite3.exe (http://www.sqlite.org/sqlite-shell-win32-x86-3070701.zip) and invoke it like sqlite3 D:\apps\foobar2000\wavecache.db without foobar2000 running.
In there, you can DELETE FROM job; to destroy all pending jobs or SELECT * FROM job; to list all the pending jobs.
You can also get rid of particular waveforms by removing entries from the file table.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-07-18 15:37:16
... after 1 second it produces a skip in the music, which corresponds with the seekbar showing up ...

Which frontend are you using? Have you've messed with the buffering amount or priority of foobar's playback?
Even if I'm blocking something, there should be quite enough audio data buffered up to ensure glitchless playback.
The Direct2D backend should do all updating in a background thread, and there shouldn't be anything overly expensive going on in the Direct3D frontend.
The D3D and GDI ones do do things in the main thread (out of necessity for the former, and laziness for the latter).

I am currently seeing if the culprit actually was foo lyrics and not waveforme seekbar. Right now I am pretty sure it was the lyrics or a combination of both (or some fucked up setting in my config).
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-07-19 19:11:50
Ok, both waveform seek bar and foo_uie_lyrics2 make the CPU go to 100% and that is what produces the crackles in the music. I tried disabling one and then other one and both separately produce cpu spikes, then I removed both and cpu doesn't go over 50% when changing tracks. I tried all renders in Waveform, no change.
Title: foo_wave_seekbar
Post by: Edgar Grey on 2011-08-21 07:55:58
Can't get 0.2.13.1 to work. Win XP SP3. DirectX end-user runtime and Visual Studio 2010 SP1 (x86) runtime are installed.

Message in console: UI Element instantiation failure: boost::filesystem::directory_iterator::construct:

What am I missing?
Title: foo_wave_seekbar
Post by: Zao on 2011-08-21 10:40:24
Do you have your foobar2000 profile in some strange place, with non-ASCII characters in the path perhaps? I see you're russian, so that's probably the case.
Title: foo_wave_seekbar
Post by: Edgar Grey on 2011-08-21 11:09:20
Do you have your foobar2000 profile in some strange place, with non-ASCII characters in the path perhaps? I see you're russian, so that's probably the case.


Yeah, I have Russian word in the path. But the older version of this plugin (0.2.12) works perfectly with the same path.
Title: foo_wave_seekbar
Post by: Zao on 2011-08-21 11:38:31
It's a known bug. I moved out the frontends (d2d, d3d) into separate DLLs. The function that looks for the companion DLLs is broken on most locales if you use non-ASCII codepoints in paths, and on more exotic locales, probably completely broken. It is fixed in my personal builds, but I haven't made any release of it yet.
Title: foo_wave_seekbar
Post by: Edgar Grey on 2011-08-21 11:57:15
Thanks for help. Just tried Portable Mode with different path and it works.
Title: foo_wave_seekbar
Post by: Zao on 2011-08-21 14:31:47
Could you (with proper backups of your profile and components) try 0.2.13.6 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.13.6.zip)? It's a preview release, not tested enough to be a properly released.
Title: foo_wave_seekbar
Post by: mzso on 2011-08-21 14:33:13
Could you (with proper backups of your profile and components) try 0.2.13.6 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.13.6.zip)? It's a preview release, not tested enough to be a properly released.

Any other change than the character fix?
Title: foo_wave_seekbar
Post by: Zao on 2011-08-21 15:21:30
That depends on which version I last linked in public. Squinting at the commit history since 0.2.13.1:

There's probably more in there that's not covered by commit messages.
Title: foo_wave_seekbar
Post by: Edgar Grey on 2011-08-21 15:25:40
It works!
Title: foo_wave_seekbar
Post by: eddi5 on 2011-08-22 13:27:11
great job of seek bar wave, I use it for a long time foobar, Hair of the scrambled audio as inthe clipboard not work for me ..All DLLs are in the same folder as user foobar components .. or have a different location each? use the 0.2.13.6. danks
Title: foo_wave_seekbar
Post by: Zao on 2011-08-22 13:44:38
You should not need to extract it manually at all. Just drag the ZIP onto the Components pane in Preferences and it installs for you.
If you really really want to install it manually, everything should be in the user-components\foo_wave_seekbar directory of your foobar2000 profile.

What did you mean by "Hair of the scrambled audio as inthe clipboard not work for me"?
Title: foo_wave_seekbar
Post by: eddi5 on 2011-08-22 14:15:16
Hallo..:-)
wanted to know if you can drag a selection of audio, as I read before, or got it wrong:
"Holding the control key while dragging on the seekbar decodes the region to the clipboard for pasting into audio editors."

That would be great ..jej  since I work with sound effects, and that in foobar, and that would be fine in foobar ..
Title: foo_wave_seekbar
Post by: mzso on 2011-08-22 14:27:30
Hallo..:-)
wanted to know if you can drag a selection of audio, as I read before, or got it wrong:
"Holding the control key while dragging on the seekbar decodes the region to the clipboard for pasting into audio editors."

That would be great ..jej  since I work with sound effects, and that in foobar, and that would be fine in foobar ..

You can. There is just no feedback visually. You just see the cursor moving
Title: foo_wave_seekbar
Post by: Zao on 2011-08-22 14:51:57
As mzso said, the copy functionality has no visible UI and is quite unpolished. It will also not copy anything longer than a few minutes as a safeguard against accidentally copying a five hour megamix. I made it by request from some lad on ICQ earlier this summer. (Hi Gleb!)
The set of applications that understand clipboard audio seems to be a bit limited. Adobe Audition understands it, while Audacity doesn't.

Hold Ctrl, press down the mouse cursor where you want to start copying from.
Drag it (without any visual showing) to where you want to stop copying.
Release and the data should be on your clipboard.
Title: foo_wave_seekbar
Post by: eddi5 on 2011-08-22 20:58:19
thanks to everyone, the installation of the componet was not really the problem, after several attempts I managed to have an audio on the clipboard, and I've taken two audio editors. the few seconds to get enough sample, It works! ;-)
Zao, they really appreciated the componet ... thanks
Title: foo_wave_seekbar
Post by: mjb2006 on 2011-08-26 08:16:13
When I play some tracks for the first time, they get analyzed once. When I play other tracks for the first time, they gets analyzed twice. That is, sometimes the console will say Wave cache: finished analysis of "(whatever)" two times in a row (after the same delay and CPU spike) instead of just once.

I haven't figured out why this happens or how to make it happen consistently, but it happens so often, it's causing me grief when I play very long tracks. During the analysis of a long track (90-minute DJ set or whatever) my laptop's CPU gets pegged, and then to prevent overheating, the CPU is being throttled. The throttling just trades one problem for another; the CPU temp doesn't drop, it just holds steady while the analysis runs that much longer, and the longer it goes, the more likely the temperature is to creep up past whatever the threshold is that makes the OS go to sleep. When it tries to go to sleep as the CPU is throttled and overheating, the computer is useless for 15 minutes.

Even if I set the concurrent threads to 1, that just causes the analyses to be done in series instead of in parallel; it's not really much help.

Is there anything that can be done?
Title: foo_wave_seekbar
Post by: Zao on 2011-08-26 08:50:07
Have you've considered fixing the underlying cause - the computer that can't handle some load? 
On a more serious note though, I could probably add an advanced preference that inhibits pre-emptive scanning of the next track and implicit scanning of tracks you're just starting to play.

As for dual scanning, I can't quite pinpoint what would cause it, but it might be a benign race in queuing the track and attempting to retrieve the waveform, or it might be related to the next-track functionality.
Title: foo_wave_seekbar
Post by: mjb2006 on 2011-08-26 09:54:06
I've definitely been looking into ditching this laptop (HP Pavilion dv4-1125nr), but it's my only option at the moment.

The dual scanning doesn't seem to be related to the scanning of the next track. I mean, it happens even if there's no next track.
Title: foo_wave_seekbar
Post by: Dandruff on 2011-08-26 11:22:59
I've definitely been looking into ditching this laptop (HP Pavilion dv4-1125nr), but it's my only option at the moment.

The dual scanning doesn't seem to be related to the scanning of the next track. I mean, it happens even if there's no next track.



Older reply from Zao: http://www.hydrogenaudio.org/forums/index....st&p=719090 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77490&view=findpost&p=719090)
Title: foo_wave_seekbar
Post by: Zao on 2011-08-26 20:06:30
Seems like the internet has a better memory than I do 
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-08-28 19:17:02
Could you (with proper backups of your profile and components) try 0.2.13.6 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.13.6.zip)? It's a preview release, not tested enough to be a properly released.

Trying it at the moment.

By the way, do you remember my problems with tracks skipping at the beginning until the waveform was scanned. Well, I think I narrowed it to this component as I am not using that buggy lyrics component any more. Let's see if this new version has fixed the problem.
Title: foo_wave_seekbar
Post by: mzso on 2011-08-30 09:23:24
Hi!

Just noticed (with ati tray tools osd) that the waveform seekbar runs at ~11 fps. Why is that? I wouldn't think that moving a line on a static background would use considerable processing power. And its rather stuttery when shorter songs play.
Title: foo_wave_seekbar
Post by: Zao on 2011-08-30 17:55:34
The update rate is tuned as to not consume excessive resources for no discernible gain for typical songs.
If you wish to adjust the update rate, there's an advanced preferences setting where you can bump it up to 200%.
Title: foo_wave_seekbar
Post by: mzso on 2011-08-30 19:47:45
The update rate is tuned as to not consume excessive resources for no discernible gain for typical songs.
If you wish to adjust the update rate, there's an advanced preferences setting where you can bump it up to 200%.

Where? How?
Title: foo_wave_seekbar
Post by: Andreasvb on 2011-08-30 20:15:35
Preferences > Advanced > Tools > Waveform Seekbar.
Title: foo_wave_seekbar
Post by: grimes on 2011-09-08 17:10:00
I've tested version 0.2.13.6, and i want to report a bug with this preliminary test version

I've installed a CUI toolbar and a normal panel. After a while foobar2000 doesn't close cleanly.
Here the message:

(http://www.abload.de/thumb/2011-09-0318-41-34_err0k4l.png) (http://www.abload.de/image.php?img=2011-09-0318-41-34_err0k4l.png)
Title: foo_wave_seekbar
Post by: bwsilverbolt on 2011-09-09 09:07:43
Using 0.2.13.7, just wondering if it's normal to see "Memory - Commit Size" go from 90MB to 480MB when you play one track, then to 860MB when you play a second track. Great components, cheers.
Title: foo_wave_seekbar
Post by: mzso on 2011-09-09 09:51:30
Using 0.2.13.7, just wondering if it's normal to see "Memory - Commit Size" go from 90MB to 480MB when you play one track, then to 860MB when you play a second track. Great components, cheers.

Yeah, but it tops off at that value.  Anyway, I can confirm that it leaks pretty badly. Rather unfortunate, that it was introduced with the released stable version. of which I didn't know because it wasn't announced in this forum.
Title: foo_wave_seekbar
Post by: Zao on 2011-09-09 15:01:13
I cache away one LZMA encoder for each analysis thread to avoid recreating them constantly. Apparently they keep a whole lot of state.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-09-09 15:45:35
Latest version is a leaker. This is how ram consumption evolved in my case (MEMORY - COMMIT SIZE, both in MB)
Foobar startup: 114 - 160
Track 1: 196 - 555
Track 2: 200 - 560
Track 3*: 331 - 1.315
and it seems to stick there

* this track was scanned for the first time ever.
Title: foo_wave_seekbar
Post by: Zao on 2011-09-09 16:03:02
It seems that I can go all the way down to level 1 compression and still retain the same compression rate. I'll remove the cached encoder as it doesn't have too much of a beneficial effect.
The benchmark results following are for decompressing and recompressing the first 500 tracks of my collection with LZMA2.

Code: [Select]
Benchmark completed in 2.481 seconds. Level 1 - cached encoder.
Benchmark completed in 6.16 seconds. Level 1 - fresh encoder.
Benchmark completed in 45.396 seconds. Level 6 - cached encoder.

lzma min/max/rms: μ=10649.8,σ=1932.82 / μ=10616.3,σ=1930.87 / μ=13211.4,σ=733.734
zlib min/max/rms: μ=11989.2,σ=1867.41 / μ=11990.4,σ=1856.33 / μ=14207.1,σ=552.998
Title: foo_wave_seekbar
Post by: Zao on 2011-09-09 16:13:19
0.2.13.8 should solve this "leak".
Title: foo_wave_seekbar
Post by: herojoker on 2011-09-09 17:15:31
In 0.2.13.8 the current position marker doesn't run smoothly when Direct3D 9.0c is being used. GDI runs better, Direct2D 1.0 yields perfect results.

Another little bug: The button "Frontend settings…" is active when opening the preferences even when having chosen GDI or Direct2D 1.0 (but it gets deactivated when choosing one of those options).

Requests:
Title: foo_wave_seekbar
Post by: Zao on 2011-09-09 17:58:54
Does the unsmoothness change if you adjust the advanced preference "Tools -> Waveform Seekbar -> Percentage of base display rate"?

Fixed for the future:
It seems that D3D accidentally updates at 10Hz instead of the intended 100Hz.
Frontend settings button now behaves.
Extract/Remove is now under Utilities.

I'm deferring the "drop target" part, as I don't have a clue how to implement one of those, nor what to call in foobar to pass the track on.
Not to mention, I'm not quite sure that it's a good thing to make arbitrary UI elements accept things they don't really care about. Especially as this limits me from ever doing anything on my own with dropped things.
Title: foo_wave_seekbar
Post by: White_Shadow on 2011-09-09 18:18:25
I agree (with Dexter_prog's issue)! The memory usage is now (after about 2 hours) at 250MB. Before updating this component, it sticked at about 35MB.

[Edit:] Oh! I missed one update. Now it's better. After 3 tracks my memory is still at about 60MB.
Title: foo_wave_seekbar
Post by: herojoker on 2011-09-09 20:50:45
Indeed that setting betters the stuttering to a certain degree.
Title: foo_wave_seekbar
Post by: mzso on 2011-09-09 21:25:00
Does the unsmoothness change if you adjust the advanced preference "Tools -> Waveform Seekbar -> Percentage of base display rate"?

Fixed for the future:
It seems that D3D accidentally updates at 10Hz instead of the intended 100Hz.
Frontend settings button now behaves.
Extract/Remove is now under Utilities.

I'm deferring the "drop target" part, as I don't have a clue how to implement one of those, nor what to call in foobar to pass the track on.
Not to mention, I'm not quite sure that it's a good thing to make arbitrary UI elements accept things they don't really care about. Especially as this limits me from ever doing anything on my own with dropped things.

Cool! Like the newly smooth position marker.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-09-09 22:25:45
Working fine for me now.

Tack så mycket
Title: foo_wave_seekbar
Post by: Dandruff on 2011-09-10 14:59:33
0.2.13.9 seems to have a serious issue here.


I'm getting this error message for a file:

Code: [Select]
Startup time : 0:00.216576
Seekbar: taking Direct3D9 path.
Watching: D:\Music
Seekbar: Frontend initialized.
Opening track for playback: "D:\Downloads\Damaged_Minds_Dubstep_Mix_09_11.mp3"
Properties dialog refresh: 0:00.000035
Properties dialog display refresh: 0:00.000566
Wave cache: generic exception (bad allocation) for "D:\Downloads\Damaged_Minds_Dubstep_Mix_09_11.mp3"
Wave cache: generic exception (bad allocation) for "D:\Downloads\Damaged_Minds_Dubstep_Mix_09_11.mp3"



No waveform appearing too

Never had this with version 0.2.12!



Edit: With manually "Extract seekbar signature" and restarting foobar2000 1.1.7 I now got the waveform displayed. Why this problem?
Title: foo_wave_seekbar
Post by: Zao on 2011-09-10 19:37:23
Reproduced the badalloc, after hunting down the file in question on the internet (http://soundcloud.com/chrisdamage/damaged-minds-dubstep-mix-09).
The cause is that my code partially trusts the length reported by foobar2000 (three hours), which leads to it trying to generate a few gigs of silence when the file is unexpectedly cut short.
Title: foo_wave_seekbar
Post by: Northtech on 2011-09-10 19:59:32
SciLexer update - v.2.28 (now 2.26)

http://www.scintilla.org/ScintillaHistory.html (http://www.scintilla.org/ScintillaHistory.html)


p.s.: can be done showing the time when where position you hover (as in mpc-hc seekbar)?
(http://img11.imageshack.us/img11/442/foowaveseekbar.png)


english is not my native language
Title: foo_wave_seekbar
Post by: Zao on 2011-09-10 20:25:36
I strongly recommend against dropping in a binary build of SciLexer, at least until I remember if I build mine in any special way.
Title: foo_wave_seekbar
Post by: NullString on 2011-09-11 03:37:58
Hey! I updated to the latest version just now. I was using the one of last april or something like that.

When I click the "Frontend settings..." button, nothing happens.

I've installed the vs2010 SP1 dependency that appeared on the "Links" section in the first post, as well as the directX runtime.
The component was installed by the select component dialog from foobar2000.

I  also tried manually copying the DLL's "frontend_direct3d9", "frontend_direct2d", "SciLexer" to the foobar2000 root (and then restarted fb2k), but nothing happened.

Title: foo_wave_seekbar
Post by: Zao on 2011-09-11 04:22:10
You should not move the companion DLLs out of the user-components/foo_wave_seekbar directory. All that will achieve is that the component will not find those frontends, and fall back to the GDI one.
Title: foo_wave_seekbar
Post by: Zao on 2011-09-11 05:44:25
0.2.13.10 should fix the bad_alloc exception when analysing large broken files.
Title: foo_wave_seekbar
Post by: NullString on 2011-09-11 20:35:53
You should not move the companion DLLs out of the user-components/foo_wave_seekbar directory. All that will achieve is that the component will not find those frontends, and fall back to the GDI one.

I tried installing the component with fb2k before doing that, and the frontend settings dialog didn't open.

The console doesn't say nothing, and there is no window that "opens and closes". The button  (apparently)  just doesn't do anything.
If it's of any help, I'm running Windows 7 x64, with an nvidia card.
DirectX and nvidia drivers are up to date, as well as the OS.
Title: foo_wave_seekbar
Post by: Zao on 2011-09-11 21:00:42
Note that "frontend settings" only does things when the Direct3D9 frontend is selected and used. There was some previous versions that accidentally had it enabled for non-Direct3D frontends.
When reporting something, don't say "latest version". I've released a handful in the last few days alone.
Title: foo_wave_seekbar
Post by: JoSch on 2011-09-11 22:27:51
I get crashes using wave_seekbar since yesterday. I didn't change anything on purpose. Tried a update to the newest Version and foobar2k v1.1.8 beta 6, but still crashes.
Here is a crashdump: http://mir.cr/0WRDPBNV (http://mir.cr/0WRDPBNV)
If I just remove foo_wave_seekbar, it works.
Title: foo_wave_seekbar
Post by: Zao on 2011-09-12 01:14:18
JoSch: What DirectX redist do you have installed - june 2010, february 2010? Have you've done something silly like deployed D3DX DLLs manually or renamed them? Is this the default effect, or one you've customized or gotten from elsewhere?
You seem to be on an ATI graphics card. Try fiddling with your cats.
Title: foo_wave_seekbar
Post by: JoSch on 2011-09-12 01:51:47
I have the June 2010 Runtime, just tried reinstalling it with no success.
dxwebsetup also says I have got the newest version.
I have done nothing like that, as far as I remember.
It is the default effect. It also happens if i remove the foobar2000 folder in %APPDATA% and create a new one. As soon as I add the seekbar anywhere, it crashes. Here is a crashdump with only this component, apart from the default ones: http://mir.cr/1GCPNMDU (http://mir.cr/1GCPNMDU)

My Graphics card is a Radeon HD 4870 and I have the newest driver (11.8).
The strange thing is, it was working for some time and I don't remember changing anything related to DirectX/3D before it failed. (Windows wouldn't boot and I had to decrypt the whole HD and then run the boot repair tool, but that shouldn't change anything)
All other 3D Applications/Games I use run fine.
Title: foo_wave_seekbar
Post by: NullString on 2011-09-12 02:26:54
Note that "frontend settings" only does things when the Direct3D9 frontend is selected and used. There was some previous versions that accidentally had it enabled for non-Direct3D frontends.
When reporting something, don't say "latest version". I've released a handful in the last few days alone.

I have the Direct3D frontend selected.
Previously I had a seekbar.fx effect that I was using, but it got "overriden" with the current installed wave seekbar version 0.2.13.10, but I can't edit because of the problem I mentioned earlier.
You sound a little bit "angry" or something. I'm just trying to report that small problem. The rest of the component has been working flawlessly for a long time now, and no known crashes so far.
Title: foo_wave_seekbar
Post by: Dandruff on 2011-09-12 08:05:31
0.2.13.10 should fix the bad_alloc exception when analysing large broken files.


Confirmed. Thanks!
Title: foo_wave_seekbar
Post by: Zao on 2011-09-12 10:33:55
You sound a little bit "angry" or something.

Nah, it's just a bit annoying to not have the information at hand needed to diagnose something, especially if I cannot reproduce it on any of my machines.
Are you using CUI or DUI? Is there any difference if a track is playing or not?
Title: foo_wave_seekbar
Post by: ExUser on 2011-09-12 19:10:16
You sound a little bit "angry" or something.

u mad bro?

FTFY
Title: foo_wave_seekbar
Post by: Alexa on 2011-09-13 20:16:12
just updated, and now I get this message:

Code: [Select]
Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.


I checked the component folder, and it's there... I see 4 files in it

I have directx 11 btw and windows 7...
Title: foo_wave_seekbar
Post by: Andreasvb on 2011-09-13 20:22:24
just updated, and now I get this message:

Code: [Select]
Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.


I checked the component folder, and it's there... I see 4 files in it

I have directx 11 btw and windows 7...

Read the first post and get all required files.
Title: foo_wave_seekbar
Post by: White_Shadow on 2011-09-14 08:24:34
@Alexa

Have you installed the Visual Studio Redistributable and the DirectX Redistributable as explained here (http://www.hydrogenaudio.org/forums/index.php?showtopic=77490&view=findpost&p=677147)? (Scroll up to "Links")

Ah... Andreasvb was faster. Missed that. Sorry for spamming.
Title: foo_wave_seekbar
Post by: tedych on 2011-09-15 00:34:18
Just to mention (a bit of offtopic). Still using an "interim" release 0.2.13.1 since July when I encountered a leak with the previous "stable" one, and so far so good with weeks of uptime.
I won't bother upgrading as long as it works with no issues for me. I see many pages of posts since then, I hope there isn't some critical fix in the meanwhile I might have missed..
Title: foo_wave_seekbar
Post by: Dandruff on 2011-09-15 13:04:16
What does "Always rescan track if requested by user" mean exactly? Why shouldn't a track be rescanned if requested by user?


Also wouldn't it be more useful to call the display rate "fps" rather than "percentage of base display rate"?
Title: foo_wave_seekbar
Post by: Zao on 2011-09-15 13:45:53
"Always rescan" is there to be disabled for people who like to select their whole library and "extract waveform", skipping any tracks that already have a waveform.
Edit: it seems to be completely unused in the source, heh. It does nothing currently.

The reason for the name is because it's not a refresh rate. It's a percentage modifier to the per-frontend refresh rate. A value of 100 uses the rate as-is, 200 doubles it, etc.
Title: foo_wave_seekbar
Post by: Dandruff on 2011-09-15 14:33:16
Alright, thanks!


This "Holding the control key while dragging on the seekbar decodes the region to the clipboard for pasting into audio editors." feature is missing in 0.2.13.10 too, right? At least I can't get any audio copied into REAPER 4.02 http://www.reaper.fm (http://www.reaper.fm) ...
Title: foo_wave_seekbar
Post by: Zao on 2011-09-15 14:48:55
The set of audio editors that actually support audio on the clipboard is miserably small. The only editor I succeeded with was Audition, as Audacity failed. The "clipboard" of most sound tools is mostly internal-only.
You should be able to see that there's data on the Windows clipboard with a decent clipboard viewer.

There might be some other method one should use, but I couldn't find anything documented at all apart from the usual standard "put a wave file with header and all in there" approach I used.
Title: foo_wave_seekbar
Post by: Dandruff on 2011-09-15 14:54:46
Ok. So the feature is in 0.2.13.20. Maybe you should mention it in the changelog?

Which format does land in the clipboard? 32bit float WAV?
Title: foo_wave_seekbar
Post by: Zao on 2011-09-15 16:17:31
Yes, it seems to be 32-bit float.

As for mentioning it in the changelog, I've mentioned it in passing in the forum, and I don't want to advertise it as a feature until it's solid.
Title: foo_wave_seekbar
Post by: Dandruff on 2011-09-16 10:27:12
Alright, thanks!
Title: foo_wave_seekbar
Post by: NullString on 2011-09-16 21:10:22
You sound a little bit "angry" or something.

Nah, it's just a bit annoying to not have the information at hand needed to diagnose something, especially if I cannot reproduce it on any of my machines.
Are you using CUI or DUI? Is there any difference if a track is playing or not?


I'm using DUI on Windows 7 Ultimate x64.
I also tried deleting the component settings.cfg file and restarting foobar, but it didn't work.
Here are some pictures that show you that the seekbar visualization indeed works with direct3d, the frontend gets initialized well (as the fb2k console says), also there's a picture of the advanced settings screen, and the installed dependencies on "add/remove programs" and "dxdiag".
http://imgur.com/a/nKsY2#TJglt (http://imgur.com/a/nKsY2#TJglt)

I still find it weird that the frontend settings dialog doesn't open. it doesn't blink & close, or anything like that. Nothing gets logged to the console regarding that issue too.

I know that you can't recreate the problem, and I have no crash dump to provide. So, I can't see you getting to a solution pronto. I can still scan and visualize waveforms so that's cool 
Title: foo_wave_seekbar
Post by: mzso on 2011-09-20 13:10:05
What's the most likely dll I'm missing if I uninstalled catalyst/all amd stuff and switched to an nvidia card?

Nevermind. Looks like the catalyst installer thought that its a good idea to remove the Visual C++ libs.
Title: foo_wave_seekbar
Post by: Zao on 2011-09-20 13:35:34
Nevermind. Looks like the catalyst installer thought that its a good idea to remove the Visual C++ libs.

That's ... bad.
Title: foo_wave_seekbar
Post by: Elevory on 2011-09-24 21:42:02
Is texture loading still supported? I'm having some trouble getting it working. I read the entire thread and I don't think it was ever explicitly mentioned how to load images properly. I have a 074.jpg and seekbar.png in my effects folder, is that the right directory?

Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2011-09-24 22:12:20
No, it's not currently supported (https://github.com/zao/foo_wave_seekbar/issues/9).
I'm a bit unsure where you'd put your files if it worked, probably somewhere relative to the foobar2000 profile directory.
Title: foo_wave_seekbar
Post by: Elevory on 2011-09-24 22:21:29
Ah, I should've checked the github page. Sorry.

Anyway, it's too bad they aren't working. Hope to see the feature make a return at some point in the future. Either way, thank you for such a wonderful component.
Title: foo_wave_seekbar
Post by: John Listener on 2011-09-26 20:39:28
fb2k 1.8, fwsb 0.2.13.11, Direct3d

Configure>Frontend settings...>Load default

Entering any character causes an immediate crash.

Listener
Title: foo_wave_seekbar
Post by: Zao on 2011-09-26 20:49:31
Turns out that my trusted team of test simians didn't exercise the Direct3D configuration dialog enough.
Reproduced.
Title: foo_wave_seekbar
Post by: John Listener on 2011-09-26 21:16:02
Turns out that my trusted team of test simians didn't exercise the Direct3D configuration dialog enough.
Reproduced.


Oh noes... Not test simian failure. Alas. Alak. <sound of rending of garments> Must not have fed them enough beer.

Listener
Title: foo_wave_seekbar
Post by: grimes on 2011-09-26 21:16:48
Want to report a crash.

fb2k1.1.8 Waveform Seekbar 0.2.13.11

with Popup Panels (foo_popup_panels.dll)

and View | Popup panels |  New panel | Waveform seekbar

crash under not exact reproducible conditions on popup close.

crashlog submitted.
Title: foo_wave_seekbar
Post by: Zao on 2011-09-27 01:36:50
John Listener: Could you please try 0.2.13.12 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.13.12.zip)?
Title: foo_wave_seekbar
Post by: John Listener on 2011-09-27 01:38:15
Same versions as above on Win XP.

FWS seems to be having problems with wma files.

Wave cache: generic exception (bad allocation) for "L:\wma\Blues\Michael Bloomfield-Al Kooper -Steve Stills\Super Session\07 Season of the Witch.wma"
and
Wave cache: generic exception (bad allocation) for "L:\wma\Jazz\Bob Berg\Enter the Spirit\10-Angles.wma"

Mp3s render fine as do flacs.

Best,

Listener
Title: foo_wave_seekbar
Post by: Zao on 2011-09-27 01:47:37
fb2k1.1.8 Waveform Seekbar 0.2.13.11
View | Popup panels |  New panel | Waveform seekbar
crash under not exact reproducible conditions on popup close.


Crashlog claims it's 0.2.13.10, and as for what it's doing differently, I've got no idea, as the crash stack is utterly useless.
I haven't really tested it with any of the non-typical CUI hosts, so I'd reckon that the popup host is either doing something silly or something unexpected.
Title: foo_wave_seekbar
Post by: John Listener on 2011-09-27 16:20:48
John Listener: Could you please try 0.2.13.12 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.13.12.zip)?

Solves the config editor problem perfectly, but still not rendering waveforms for wma files.

Best,

Listener -- who really likes this component!
Title: foo_wave_seekbar
Post by: White_Shadow on 2011-09-29 07:33:47
Getting Bad Allocs for MP3's:

Code: [Select]
Wave cache: generic exception (bad allocation) for "C:\Musik\Red Hot Chili Peppers\Californication\Red Hot Chili Peppers [Californication #04] - Emit Remmus.mp3"
Wave cache: generic exception (bad allocation) for "C:\Musik\The Blues Brothers\The Blues Brothers Complete\The Blues Brothers [TBBC (1) #06] - SFI''B.mp3"


I've very long filenames... Probably wavecache has problems with that...?

Ah Sorry...
f2k 1.1..8
WaveCache 0.2.13.12
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-09-29 20:30:47
I'm getting crashes with foobar since I installed the latest version

edit:oops, was using .11. Let's see if .12 does the same.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2011-09-29 22:25:21
hmm, no crashes so far but some tracks are not getting scanned :/
Title: foo_wave_seekbar
Post by: Zao on 2011-09-30 06:35:36
All the bad-allocs should be solved with 0.2.13.13. *knocks on wood*
Title: foo_wave_seekbar
Post by: White_Shadow on 2011-09-30 07:33:09
Great Zao!

Works with my two reported files... 
Title: foo_wave_seekbar
Post by: suaff on 2011-09-30 15:18:12
Pleeeease: seeking using the mouse-wheel (like standard seekbar can do that)...
Title: foo_wave_seekbar
Post by: John Listener on 2011-09-30 18:06:10
All the bad-allocs should be solved with 0.2.13.13. *knocks on wood*


Everything seems to be good here.

Thanks for a fab component.

Listener
Title: foo_wave_seekbar
Post by: czesiu on 2011-10-02 13:22:58
so... I accidentally clicked "Extract Seekbar Signature" in Album List and now foobar2000 sits @90%CPU on both cores... 
I've removed foo_wave_seekbar for now. Is there any way to tell it to stop scanning the whole library? (as this is what it's probably doing)

[oh and I think a warning ("Do you really want to scan gazillion files?") would be appropriate when a user tries something like this  ]
Title: foo_wave_seekbar
Post by: Zao on 2011-10-02 15:07:03
Run sqlite3 wavecache.db
Execute delete from job;

I haven't really seen any point for a warning when initiating a scan for a lot of files. It's a reasonably common use case.
In any way, you can always restrict it to only using one core in advanced preferences. They should not affect your performance in any significant way, as they run with idle priority.
Title: foo_wave_seekbar
Post by: czesiu on 2011-10-02 15:23:44
Run sqlite3 wavecache.db
Execute delete from job;

I haven't really seen any point for a warning when initiating a scan for a lot of files. It's a reasonably common use case.
In any way, you can always restrict it to only using one core in advanced preferences. They should not affect your performance in any significant way, as they run with idle priority.

thx, it worked
Title: foo_wave_seekbar
Post by: s_PLASH on 2011-10-10 02:05:01
thank you once again for updating the component. still i wished you could add the option shade played "non-transparent". also if played waveform could be coloured separately, it would be awsome. don't you want it too, sometimes? =) i so hope you do^^
Title: foo_wave_seekbar
Post by: Anomalous on 2011-10-10 02:59:53
thank you once again for updating the component. still i wished you could add the option shade played "non-transparent". also if played waveform could be coloured separately, it would be awsome. don't you want it too, sometimes? =) i so hope you do^^

I'm not entirely sure what you're saying, do you mean like this?

Here's a version of the RMS effect which uses the highlight colour instead of just grey-scaling it. http://pastebin.com/rVfuCDgy (http://pastebin.com/rVfuCDgy)

(http://i42.tinypic.com/4utgti.jpg)

Title: foo_wave_seekbar
Post by: s_PLASH on 2011-10-10 03:08:02
YES! how do you do that? i got Direct3D 9.0c and "Frontened settings..." button below. but i cant activate it / click doesn't seem to work. why??

UPDATE: with Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) it it didn't work on my x64 win 7  now, with x64 Package, a click on "Frontened settings..." button opens a "Seekbar configuration: Direct 3D"-window. i loaded defaulf by clicking on it..

whats next stept to do for non-transparency?
Title: foo_wave_seekbar
Post by: Anomalous on 2011-10-10 05:19:30
Paste in the code (here's a slightly updated version (http://pastebin.com/1mN12wNf)) and click apply.
Title: foo_wave_seekbar
Post by: s_PLASH on 2011-10-10 05:43:08
thank you! now i miss only two small things: 1) how do i disable that 2nd, inner waveform? and 2) is it possible to get a a fine line for selection (as it was in GDI mode)?

also it would be great to see how you do it.. maybe with some coloured parts in a code posted right here? ^^
Title: foo_wave_seekbar
Post by: Anomalous on 2011-10-10 06:46:39
I don't really know how to use this language, but I've figured out how to do what you want.

how do i disable that 2nd, inner waveform?
Change line 94
Code: [Select]
float factor = insideRms ? (1.0 - 0.5 * saturate(factorRms / border / 2)): 1.0;
to
Code: [Select]
float factor = 1.0;


is it possible to get a a fine line for selection (as it was in GDI mode)?
Change line 114
Code: [Select]
float positionWidth = 2.5 * dx;
to
Code: [Select]
float positionWidth = dx;
Title: foo_wave_seekbar
Post by: s_PLASH on 2011-10-10 13:01:55
thank you 
maybe there is one last thing left, which ist not possible for now:
(http://www.abload.de/thumb/capture27j4q.png) (http://www.abload.de/image.php?img=capture27j4q.png)
(Highlight background color only/separately)
Title: foo_wave_seekbar
Post by: Anomalous on 2011-10-10 13:19:40
You're right that wasn't possible, here's an updated version which sets the background colour to the highlight colour if "shade played" is disabled. http://pastebin.com/q6qLaQ18 (http://pastebin.com/q6qLaQ18)
Title: foo_wave_seekbar
Post by: Zao on 2011-10-10 13:19:58
Highlight only (http://ideone.com/ZXZb3) for s_PLASH.
The colors may be the wrong way around, check played() if it's the wrong way. There's very little you can't do with HLSL, it's just pure awesome math.
Beaten to the punch by Anomalous - bah.
Title: foo_wave_seekbar
Post by: s_PLASH on 2011-10-10 13:39:51
thanks you both  your effort is appreciated! i can't even find the differences yet
here is my new seekbar
(http://www.abload.de/img/wfsbiqxk.png) (http://www.abload.de/image.php?img=wfsbiqxk.png)

EDIT
Quote
There's very little you can't do with HLSL

i think here it is. you need 5 colours for real separation of front- and background. maybe its possible without "Colors" menu, just by editing the "Effect source" script. but i'm not the one to edit in any way.
(http://www.abload.de/img/capture2crmg.png) (http://www.abload.de/image.php?img=capture2crmg.png)

your last script ignores "Foreground color" selection, as you wanted obviously. but that way it provides only 3 colours to chose from.
(http://www.abload.de/img/capture3hqmm.png) (http://www.abload.de/image.php?img=capture3hqmm.png)
Title: foo_wave_seekbar
Post by: RAZOR87 on 2011-10-10 16:29:37
Zao,
Thank you so much for the plugin, is it possible for him to make support for DSD?
Title: foo_wave_seekbar
Post by: Zao on 2011-10-10 20:07:05
That depends entirely on what you mean by DSD. If it's an input plugin, it's not currently banned like CDDA is. If it's a DSP, no, I do not support or intend to support any DSPs.

I might add, CDDA and similar formats are banned because random access of a CD is a very bad idea.
Title: foo_wave_seekbar
Post by: RAZOR87 on 2011-10-11 10:24:03
I mean, SACD and are extracted from the DSD stream, for example (http://www.datafilehost.com/download-63c8b90f.html).
Title: foo_wave_seekbar
Post by: Zao on 2011-10-11 11:34:59
That track scans perfectly fine with foo_input_dsdiff 1.4 here.
Title: foo_wave_seekbar
Post by: RAZOR87 on 2011-10-11 12:50:27
I just meant another plug-in "foo_input_sacd (http://sourceforge.net/projects/sacddecoder/files/)".
Title: foo_wave_seekbar
Post by: Zao on 2011-10-11 20:57:42
I do not have any source material to test that input. If it's not broken, it should work out of the box.
You still haven't said what fails, nor given any relevant console info.
Title: foo_wave_seekbar
Post by: Dr_Colossus on 2011-10-11 21:32:28
Is there an upper limit on how many samples you scan? Because I have noticed that long podcasts will not scanned (a behavior I like) because of length so I think his sacd files may not be scanned because they are above the sample limit. For instance the file he posted has 504 908 544 samples total.
Title: foo_wave_seekbar
Post by: Zao on 2011-10-11 22:10:57
The file he posted decodes perfectly fine with foo_input_dsdiff, and I've scanned 12 hour mp3s before.
The data types involved are much larger (64-bit ints), so there should be no problems in that area.
Title: foo_wave_seekbar
Post by: Zao on 2011-10-11 23:51:03
His file decodes properly with foo_input_sacd as well. Ensure that you're using a sufficiently new seekbar.
Title: foo_wave_seekbar
Post by: RAZOR87 on 2011-10-12 12:55:00
Thank you for your answers.

Perhaps you have not deleted the old plugin foo_input_dsdiff so foo_input_sacd and does not work. There exists a pattern of output frequency is set in the plugin settings foo_input_sacd depends on how much will be displayed in seconds, your plugin (44100 Hz - 5 sec, 88 200 Hz - 10 sec, 176 400 Hz - 20 sec, 352 800 Hz - 40 sec).
Title: foo_wave_seekbar
Post by: Zao on 2011-10-12 12:58:47
No. These are completely different foobar2000 installations, so there is no plugin order dependencies.

Please explain in plain text what the problem you observe is, and what you expect to see. I still don't know what is wrong for you.
If the amount of displayed waveform is wrong, the component lies about the sample rate and/or track length.
Title: foo_wave_seekbar
Post by: RAZOR87 on 2011-10-12 13:08:07
I checked on the standard pure foobar2000 and assemblies, shows the first few seconds of the track.

(http://img854.imageshack.us/img854/8643/thumbgof.png) (http://img856.imageshack.us/img856/3014/screenshot20111012001.png)
Title: foo_wave_seekbar
Post by: eevan on 2011-10-12 14:18:00
Indeed, there are some problems with seekbar and SACD ISO images.
I'm using Waveform seekbar version 0.2.13.13 and Super Audio CD Decoder version 0.3.9 in foobar v1.1.8.

It seems that the track length reporting is wrong, so the complete waveform of a track is horizontaly (and verticaly) scaled to the certain fixed length, independently of real track length.

Here are the two screenshots that show this behaviour. The first track (highlighted in the screenshot) is 5:37, and the second is 1:48, and the corresponding waveforms occupy the same horizontal space in the seekbar component.

(http://img5.imageshack.us/img5/3513/tr1ja.th.png) (http://img5.imageshack.us/i/tr1ja.png/)aaa(http://img844.imageshack.us/img844/3774/tr2i.th.png) (http://img844.imageshack.us/i/tr2i.png/)

Cheers
Title: foo_wave_seekbar
Post by: Zao on 2011-10-12 15:13:29
Apart for multipass scanning, I have no way of knowing the true length of a track.
I trust the metadata they provide to me, and here, it seems that they blatantly lie.
Title: foo_wave_seekbar
Post by: s_PLASH on 2011-10-14 16:54:56
(http://www.abload.de/img/captureiyem.png) (http://www.abload.de/image.php?img=captureiyem.png)
(http://www.abload.de/img/capture29lmh.png) (http://www.abload.de/image.php?img=capture29lmh.png)
(http://www.abload.de/img/capture3jzf4.png) (http://www.abload.de/image.php?img=capture3jzf4.png)
there are no waves in the form for some segments. is it possible to correct it?
Title: foo_wave_seekbar
Post by: Zao on 2011-10-14 17:02:59
That depends entirely on what those images are supposed to illustrate, and what graphics card you have.
The analysis phase records full-scale floating point values, and if you have floating point textures, the shader will recieve those exact values.
Title: foo_wave_seekbar
Post by: s_PLASH on 2011-10-14 17:40:15
the images illustrate that the wave seem to be to big for the box it is in so there is no wave to see.
here is my gpu
(http://www.abload.de/img/capturei66d.png) (http://www.abload.de/image.php?img=capturei66d.png)
Title: foo_wave_seekbar
Post by: Zao on 2011-10-14 19:28:56
The default effect fits the range -1.0 through 1.0, so if your decoded audio is outside of that range, it will not fit into the window.
You can always scale the visual in there, or use a RG-aware effect.
Title: foo_wave_seekbar
Post by: s_PLASH on 2011-10-15 03:15:40
where can i find those options?
Title: foo_wave_seekbar
Post by: Zao on 2011-10-17 23:32:31
0.2.14 released, previous versions apparently tried to create debug factories with Direct2D, resulting in mysterious failure to load that frontend.
Title: foo_wave_seekbar
Post by: ExUser on 2011-10-18 07:13:59
Been playing with a new shader that supports ReplayGain and provides a basic estimate of compression via the relationship between RG track peak and RG track gain. This isn't "perfect", but it works pretty great so far! I'm sleepy and done with playing for the night now tho.

Here's an action-shot of a somewhat-compressed (ie. RG of -8dB or so at a peak of 1) track:
(http://i51.tinypic.com/2jg2l4g.png)

The peak/RMS rendering is still jaggy but the ReplayGain functionality is the fun part anyhow.

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 faded_bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show, float vert_from, float vert_to )
{
float dist = abs(pos - tc.x);
float fluff = smoothstep(vert_from, vert_to, abs(tc.y));
float4 c = show
? lerp(fg, bg, max(fluff, smoothstep(0, width, dist)))
: bg;
return c;
}

// #define BORDER_ON_HIGHLIGHT

float4 played( float pos, float2 tc, float4 fg, float4 bg, float alpha)
{
float4 c = bg;
float2 d = 1 / viewportSize;
if (pos > tc.x)
{
#ifdef BORDER_ON_HIGHLIGHT
if (tc.x < d.x || tc.y >= (1 - d.y) || tc.y <= (2 * d.y - 1))
c = selectionColor;
else
#endif
c = lerp(c, fg, saturate(alpha));
}
return c;
}

float4 evaluate( float2 tc )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex1D(sTex, tc.x);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;

#if 1
float4 bgColor = backgroundColor;
#else
float a = viewportSize.x / viewportSize.y;
float2 aspect = horizontal ? float2(a, 1) : float2(1/a, 1);
float2 tcBg = float2(tc.x, -tc.y / 2 + 0.5) * aspect;
float4 bgColor = tex2D(sTexBg, tcBg);
#endif

float4 wave = outside
? bgColor
: lerp(bgColor, textColor, 7.0 * factor);

return saturate(wave);
}

float4 peak( float2 tc, float4 bg )
{
float4 minmaxrms = tex1D(sTex, tc.x);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
if(replayGain.a>0)minmaxrms.rgb /= replayGain.a;
float below = (tc.y - minmaxrms.r);
float above = (tc.y - minmaxrms.g);
//float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
float4 wave = outside ? bg : textColor;
return saturate(wave);
}

float4 rms( float2 tc , float4 bg )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex1D(sTex, tc.x);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
//minmaxrms.rgb -= 0.5 * minmaxrms.a;
//minmaxrms.rgb *= 1.0 + minmaxrms.a;
if(replayGain.a>0)minmaxrms.rgb /= replayGain.a;
float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;

float4 bgColor = backgroundColor;
float4 wave = inside_rms ? selectionColor : bg;
return saturate(wave);
}

float4 rg( float2 tc , float4 bg )
{
float gain=pow(10,replayGain.g/20);
float dist=abs(abs(tc.y/replayGain.a)/gain);
float maxdist=abs(1/replayGain.a)/gain;
bool end=(dist/replayGain.a)>1;
//bool end=tc.y>0;
return lerp(bg,backgroundColor,saturate((dist-1)/(maxdist-1)));

}
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 = seekWidth;//2.5 * dx;

float4 c0 = backgroundColor;

c0 = peak(input.tc, c0);
c0 = rms(input.tc, c0);
c0 = rg(input.tc, c0);
c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible);
c0 = bar(seekPos,  input.tc, selectionColor, c0, seekWidth,    seeking      );
if (shade_played) c0 = played(cursorPos, input.tc, backgroundColor, c0, 0.5);
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();
}
}
Title: foo_wave_seekbar
Post by: andrew_berge on 2011-10-18 16:40:47
Huh. I can get a basic waveform to display, but i can't customize it in any way.
I've installed everything suggested in the original post (as far as i can tell).

There is no effects folder or seekbar.fx file anywhere on my computer, and clicking "Frontend settings..." in Foobar doesn't do anything, no window, no nothing.

One thing, though, i don't know if my graphics card supports "PS2.0" (What is that, anyway?).

Running Windows 7 Home premium, 64bit
Intel Core 2 Duo T5750 at 2GHz, 3GB RAM.
ATI mobility Radeon HD 3400 series graphics.
System properties say i'm running DirectX 10.
Title: foo_wave_seekbar
Post by: frogworth on 2011-10-19 05:38:14
System properties say i'm running DirectX 10.


If you scroll through much of this thread you'll note what's sort-of warned about in the original post too: having DirectX 10 does not mean having the functionality of DirectX 9.0c or whatever. They're different. You explicitly need Directx 9.0c as linked from the front post.

Try that. You wouldn't have an effects folder with the latest version - that's what the frontend editing should do, but try the really correct version DirectX first.
Title: foo_wave_seekbar
Post by: Zao on 2011-10-19 05:53:46
A bit of clarification here might help.
The "DirectX version" that your OS tells you is rather unhelpful nowadays, as it roughly tells you the max core level the OS supports.
This component requires more than the core library, it requires the D3DX and D3DCompiler components from February 2010.

In order to get those, you've got to install a redistributable that's at least as new as that. When a game or program asks you to install a particular redistributable, install it. You are typically not capable of determining whether it's needed or not, and it will never be a mistake to install one, as they will only install the bits that are not already present.

As for the settings dialog not opening, not quite sure about that. Ensure that you've got all four DLLs in your users-components/foo_wave_seekbar directory, and haven't messed around with them.
PS 2.0 or SM 2.0 is a level of shader capability of a GPU, which you should exceed by far with your HD3400 card as it claims to be a DX10.1 part, thus having SM 4.1, assuming you have proper drivers installed.
Title: foo_wave_seekbar
Post by: Dandruff on 2011-10-19 07:31:14
@Zao: Small suggestion: Direct3D and Direct2D entries should be removed from the driopdown menu if the related DLLs are not found in the components folder.
Title: foo_wave_seekbar
Post by: Zao on 2011-10-19 07:33:12
There shall be no reason really to erase them really. Are you so strapped for disk space you can't have a stray half meg?
Do you go removing integral parts of random applications to see what happens? 

As for handling it in the settings, it's tricky. The code there is fairly brittle already, especially as it's pretty much impossible to detect whether a frontend is usable until you attempt to use it.
Title: foo_wave_seekbar
Post by: Dandruff on 2011-10-19 08:06:23
Ok. No big problem
Title: foo_wave_seekbar
Post by: andrew_berge on 2011-10-19 13:42:33
Thanks frogworth and Zao, i'm going to try all that out when i get back home today
Title: foo_wave_seekbar
Post by: andrew_berge on 2011-10-19 21:47:42
The problem is fixed, thank you very much!

Sorry for the double post, by the way... i can't find the edit button anywhere.
Title: foo_wave_seekbar
Post by: ExUser on 2011-10-19 22:01:57
The edit button disappears after a while due to past abuse. Don't worry about the double-posting.
Title: foo_wave_seekbar
Post by: ledge on 2011-10-29 05:00:20
I'm having the same issue with the frontend settings button doing nothing.

The dlls are in the directory and everything is installed.

I know a couple of other people have run into this problem and seemed to fix it, can they give me any ideas please?
Title: foo_wave_seekbar
Post by: Andreasvb on 2011-10-29 06:27:32
Are you using the latest version (0.2.14) and Direct3D?
Title: foo_wave_seekbar
Post by: ledge on 2011-10-30 22:06:51
Sure am. Everything works fine except bringing up the frontend settings, so I can't alter the waveform code, which makes me sad.
Title: foo_wave_seekbar
Post by: Jac74 on 2011-11-08 01:17:58
Apart for multipass scanning, I have no way of knowing the true length of a track.
I trust the metadata they provide to me, and here, it seems that they blatantly lie.


Zao, I've detected the same problem as eevan & RAZOR87. When I use foo_input_sacd with an .iso file (or .dff) together with a .cue file.

When I play the first song (or any other) I only get 11 seconds of the waveform. I wouldn't say it's a reporting problem, since the properties of that song show the correct duration and number of samples:

General
-------------------------------------------------
Duration: 3:03.000 (516 499 200 samples)
Sample rate: 2822400 Hz
Channels: 2
Bits per sample: 24
Bitrate: 5645 kbps
Codec: DSD64
Encoding: lossless

Same happens with DST64 encoding (losslessly compressed DSD). Any chance you take a look into this?

BTW, I'm using foo_wave_seekbar 0.2.14, foo_input_sacd 0.4.1 and fb2k 1.1.7. Great component!

Regards
Title: foo_wave_seekbar
Post by: lvqcl on 2011-11-08 14:18:20
I wouldn't say it's a reporting problem, since the properties of that song show the correct duration and number of samples:

General
-------------------------------------------------
Duration: 3:03.000 (516 499 200 samples)
Sample rate: 2822400 Hz

Yes, but it outputs 32 281 200 samples with 176400 Hz samplerate.
Title: foo_wave_seekbar
Post by: Zao on 2011-11-08 16:24:40
There's several places to look for information about a track, including dynamic and static metadata. I've got no idea which fields are the "right" ones for your kind of input, as I do not have access to any source media for this format. Whatever free .DSD files I tested with before generated proper waveforms.
Title: foo_wave_seekbar
Post by: Zao on 2011-11-08 22:28:14
The file scans properly with kode54's DSDIFF component. Consider using that, until I can bother to determine why the (apparently redundant) SACD one misbehaves.
Title: foo_wave_seekbar
Post by: BASGTA on 2011-11-09 01:22:31
I don't mean to look like a noob, but where can I download the latest?  I have 0.2.12 atm.
Title: foo_wave_seekbar
Post by: Zao on 2011-11-09 07:39:51
As with any component in the official repository - on its component page (http://www.foobar2000.org/components/view/foo_wave_seekbar) or through the update functionality inside of foobar2000 itself.
Title: foo_wave_seekbar
Post by: Jac74 on 2011-11-10 23:12:15
I wouldn't say it's a reporting problem, since the properties of that song show the correct duration and number of samples:

General
-------------------------------------------------
Duration: 3:03.000 (516 499 200 samples)
Sample rate: 2822400 Hz

Yes, but it outputs 32 281 200 samples with 176400 Hz samplerate.


176400 Hz is a samplerate when DSD (or DST) is transformed into PCM for playback. In any case, 32 281 200 samples / 176 000 samples / sec = 183 s, which is equal to 3.03 min for the duration. I tend to agree with Zao in that the problem might be in which field the duration is looked for (which I don't know which they are, BTW, except what fb2k reports).

@Zao,

If you have any free DSD file that can be shared, I'd gladly give it a try and report what happens if that's helpful.

Regards,
Title: foo_wave_seekbar
Post by: Zao on 2011-11-11 00:02:24
The files I tried with are the ones under special formats on 2L (http://www.2l.no/hires/index.html).

In any way, a solution has already been presented, which is to use the dsdiff component instead of the SACD component, as no-one has yet to enlighten me why they keep sticking with a component that doesn't work properly. If there's a concrete reason to use the SACD input component, then I'll bother investigating why it feeds me bogus values.
Title: foo_wave_seekbar
Post by: Jac74 on 2011-11-14 21:39:13
The files I tried with are the ones under special formats on 2L (http://www.2l.no/hires/index.html).

In any way, a solution has already been presented, which is to use the dsdiff component instead of the SACD component, as no-one has yet to enlighten me why they keep sticking with a component that doesn't work properly. If there's a concrete reason to use the SACD input component, then I'll bother investigating why it feeds me bogus values.


Zao, I'll try with these files to see what happens. I don't think this is about enlightening anybody, and I use foo_input_sacd since I like it better and it has many more options for the decoding (and didn't have any issue regarding sound quality, btw). If you want to take a look at this issue, then great! If you don't have enough time or don't want to spend your time solving this issue, it's also OK. I never meant anything else than collaborate and make all components work together. I just found something that didn't work as expected and reported it.

Regards
Title: foo_wave_seekbar
Post by: Zao on 2011-11-14 22:42:19
Try 0.2.14.1 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.14.1.zip), see if it does the right thing.

foo_input_sacd gives me a quite useless raw sample rate when queried statically and a more correct sample rate while decoding. When using the correct sample rate, I get correct waveforms but with roughly half the amplitude compared to DSDIFF.
Title: foo_wave_seekbar
Post by: DarkScythe on 2011-11-15 05:14:16
Hello everyone,

First off, thank you Zao for this great seekbar.
I upgraded from XP to Win7 and decided to give my foobar a facelift while I was at it, and I love your seekbar component.

I'm using v0.2.14 with foobar 1.1.9 and CUI 0.3.8.8 and no bugs to report as of yet.

However, I spent some time browsing this thread for some way to make the waveform look a bit nicer, and came across people sharing code for what used to be the seekbar.fx file (but it seems it's not needed anymore?)
I'm using some code from many pages back that allowed multiple channels plus replaygain. However, it also changed the highlighting. While I'm not necessarily annoyed at having only a grayscale and sepia option, I do miss the "original" seekbar behavior that highlighted the entire bar as it was progressing (though seemingly somewhat transparent) while leaving the waveform colors alone. Is there any way to combine these two things?

I've tried to do it myself, but every code snippet is different, so I'm having a heck of a time figuring it out. If there's a snippet of code I can simply drop in, that would be great. I'm still trying to figure out how to modify these colors and such from the existing code. I don't know if I should post the code I'm currently using though, as it's from like 20 pages ago, so I'm not sure if there's a more updated/configurable version of it now. (Mainly because I compared with a more recent link and the replaygain handling seemed completely different.)

Thanks!
Title: foo_wave_seekbar
Post by: Anomalous on 2011-11-15 05:27:35
If you mean the script foosion posted back on page 4 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77490&st=75&p=677800&#entry677800), I made some modifications which might suit your needs.

http://pastebin.com/q6qLaQ18 (http://pastebin.com/q6qLaQ18)
Title: foo_wave_seekbar
Post by: DarkScythe on 2011-11-15 05:33:12
Thanks for the quick response!

I believe your code was actually the last one I checked, and why I said it seemed the replaygain check (among other things) changed drastically. I wasn't using foosion's but rather the one someone updated a few pages later of foosion's to support multiple channels, instead of only mono.

However, your code changes the waveform itself to the highlight color which is not quite what I was looking for. (I set my highlight color to pure green, 0,255,0.) With the default behavior (if I click on load default) this green is somewhat transparent and not as neon/radioactive, covers the entire bar, and leaves the waveform color alone (though tinted slightly green.) I tried looking through the default effect code, but I couldn't find anything that called for the highlight color, so I was unable to copy it over.
Title: foo_wave_seekbar
Post by: Zao on 2011-11-15 08:10:11
Here's the contents of the played() function in my source:
Code: [Select]
float4 played( float pos, float2 tc, float4 fg, float4 bg, float alpha)
{
    float4 c = bg;
    if (pos > tc.x)
    {
            c = lerp(c, fg, saturate(alpha));
    }
    return c;
}

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

Here, I interpolate between the highlight color passed in and the computed waveform image (including background), with the factor 'alpha'. A lerp(a, b, v) is a linear interpolation on the form (b*v + a*(1-v)), that is, when v is 0, it's all a, when v is 1 it's all b, when v is 0.3 it's 0.7*a and 0.3*b.

Compare that with the function in foosion's source:
Code: [Select]
float4 played( float pos, float2 tc, float4 bg, float factor)
{
        float4 c = bg;
        if (pos > tc.x)
        {
                if (shade_played)
                        c = evaluate(backgroundColor, highlightColor, factor);
                else
                        c = evaluate(highlightColor, textColor, factor);
        }
        return c;
}

{
        float4 c0 = evaluate(backgroundColor, textColor, factor);
        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;
}


While I compute the waveform up-front and then tint it, foosion computes two different things based on whether we're in the shaded area or not.
Title: foo_wave_seekbar
Post by: Jac74 on 2011-11-15 09:41:20
Try 0.2.14.1 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.14.1.zip), see if it does the right thing.

foo_input_sacd gives me a quite useless raw sample rate when queried statically and a more correct sample rate while decoding. When using the correct sample rate, I get correct waveforms but with roughly half the amplitude compared to DSDIFF.


Works as a charm! It gives the complete waveform for the .dff files. I can't try the .cue/.iso files till the weekend, but it seems that the issue is nailed. I'll let you know.

Thanks for your prompt response!

Regards
Title: foo_wave_seekbar
Post by: DarkScythe on 2011-11-15 16:30:01
Thanks, Zao!
I didn't expect the two functions to be so completely different, so I guess that's what threw me off.

After a bit of trial and error, I've managed to get it working. I took Anomalous' latest version to use as a base.

I ended up replacing the entire played() function
Code: [Select]
float4 played( float pos, float2 tc, float4 bg, float factor)
{
        float4 c = bg;
        if (pos > tc.x)
        {
                if (shade_played)
                        c = evaluate(backgroundColor, highlightColor, factor);
                else
                        c = evaluate(highlightColor, textColor, factor);
        }
        return c;
}


With the original code.
I ran into an odd situation trying to insert the c0 thing as it complained about converting from float2 to float4, but I noticed the existing line was very similar, so I made a quick change
Code: [Select]
c0 = played(cursorPos, input.tc, c0, factor);
Became:
c0 = played(cursorPos, input.tc, highlightColor, c0, 0.3);


It started working immediately!

I made a few other changes while I was at it using tips throughout this thread; switched RG mode to album gain, changed 0.3 to 0.15 for a lighter highlight, made the vertical bar thinner, and added the faded bar as per this post (http://www.hydrogenaudio.org/forums/index.php?showtopic=77490&st=150&p=678690&#entry678690).

The faded bar gave me a bit of trouble, but it seems it was due to a small typo; the function is set as fade_bar, but then it tries to call faded_bar. Removing the extra 'd' worked.

I tried to add a border around the shaded region outlined in this post (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=681165), but it gave me an error saying there were too many arithmetic functions (66 out of an allowed 64 or something.) I guess it's not a big loss, but in either case, thank you both of you for the help, and keep up the great work!

At some point I may try to merge in the code from foosion's effects script just to have more options available if I change my mind.

For now though, I'm quite happy with it.
Title: foo_wave_seekbar
Post by: Zao on 2011-11-15 16:42:23
The number of instructions available are governed by what shader model your effect is compiled as. In the technique section of your effect you can change the pixel shader model by replacing ps_2_0 with ps_2_a or ps_3_0, assuming that your graphics card supports those shader models.

They have much higher minimal limits on instruction count, the reason that the default is SM2.0 is because some of the graphics cards I target do not support anything higher, and the default effect is crafted to fit within the limits of 2.0.
Title: foo_wave_seekbar
Post by: DarkScythe on 2011-11-15 17:25:16
Thank you for the tip, Zao!
I have an 8800GT so it should support everything up to pixel shader 4. I'll give it a shot when I get home since I'm at work right now.
Title: foo_wave_seekbar
Post by: Zao on 2011-11-15 19:57:06
Note that the reason I stopped at SM3.0 is because that's the highest supported in Direct3D 9. For SM4.0 you need Direct3D 10.0; SM4.1 needs Direct3D 10.1; SM5.0 needs Direct3D 11.0.
Title: foo_wave_seekbar
Post by: DarkScythe on 2011-11-15 23:45:02
Ah, that's great to know.

Changing the pixel shader version to ps_3_0 (and I thought I'd bump vs to vs_3_0 while I was at it) worked like a charm.
Replaced the played() code with the snippet to add the border and it added them without changing the highlights.
A quick experiment showed that changing the number "1" would change the thickness of the borders, so I've set it to 0 for now until I have more time to muck with it.

Only thing I can say now is Process Explorer is tracking 20% CPU utilization while the seekbar is displayed, regardless of it playing a track or not. Switching to another layout without it drops CPU back to idle, but am I safe to assume this is simply the seekbar passively scanning the other tracks in my playlist? I don't have any library set up yet since I'm still tweaking everything.
Title: foo_wave_seekbar
Post by: colagen on 2011-12-02 19:45:35
I wanted to share my use of this component with the developer, thanks to him, my foobar look good (and is easy to use)
(http://i39.tinypic.com/5x7no1.jpg)
(I would like to go further with skinning, but that's too harsh for me, i had to stop somewhere)
Title: foo_wave_seekbar
Post by: ExUser on 2011-12-03 14:23:00
That's a rather attractive skin, colagen. Props.
Title: foo_wave_seekbar
Post by: San_dr on 2011-12-04 14:30:37
I like this component. Refreshing design. Thank You.
(http://savepic.net/2164712.png)
(http://savepic.net/2204650.png)
Code: [Select]
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 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 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);
output.tc = float2((input.tc.x + 1.0) / 2.0, input.tc.y);
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)
{
if (shade_played)
c = evaluate(1.2*selectionColor, .5*highlightColor, factor);
else
c = evaluate(highlightColor, textColor, factor);
}
return c;
}
float RMSfactor( float2 tc, float border )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(sTex, tc.x);
if (replayGain.g != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 2; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2; //use album 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 ? (- 18* saturate(factorRms / border)): 0.7;
factor = insideWave ? factor / saturate(factorWave / border /4) : 0.2;
return factor;
}
float4 PS( PS_IN input ) : SV_Target
{
float dx, dy;
dx = 1/viewportSize.x;
dy = 1/viewportSize.y;
float seekWidth = 1.5 * dx;
float positionWidth = 1.5 * dx;
float factor = RMSfactor(input.tc, 2.5 * dy);
float4 c0 = evaluate(backgroundColor+.2*selectionColor, textColor, factor);
c0 = played(cursorPos, input.tc, c0, factor);//selectionColor textColor highlightColor
c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible);
c0 = bar(seekPos,  input.tc, highlightColor, 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();
}
}
Title: foo_wave_seekbar
Post by: White_Shadow on 2011-12-06 16:30:37
Hey Zao!

There's probably another memory leak in Waveform Seekbar 0.2.14.1. After updating to this version I caught f2k once requiring about more than one GB of RAM. Today it's about 200 MB, although foobar lasts at about 70 MB. (Win 7x64, foobar2000 v1.1.10, 4 GB RAM)

Could you please check that? I'm sorry, that I cannot provide you more information.

Regards,
White_Shadow
Title: foo_wave_seekbar
Post by: colagen on 2011-12-06 19:28:41
That's a rather attractive skin, colagen. Props.

Thanks ! But now, it is really attractive, at least for me  I finally take some hours to learn how to hide the scrollbars and others things. Next step for my next "what the f.. could i do this weekend" would be to learn how to do advanced things with WSH panel, but eh i've already fall too far into the foobar madness skinning.
With waveform + the two chanel spectrum panels i've add in the background (the big brown one is maybe hard to see in the screenshot), it seems that my foobar is now alive
(http://i40.tinypic.com/1zwnv44.jpg)
Title: foo_wave_seekbar
Post by: studio13 on 2011-12-13 14:44:14
sorry if this has been posted before BUT ..

the wave seekbar has stopped displaying some of my files. I have no idea why. I ran all the functions available in the waveform seekbar drop down menu and the missing waveform overviews are missing. How can I force the rebuild of the waveform for these files ? thanks
Title: foo_wave_seekbar
Post by: Zao on 2011-12-13 15:52:52
The context menu entry under Utilities named "Extract Seekbar Signature" should re-scan the file if run by the user.
What kind of file is this? Does the console say anything? Can you provide (privately) a file that is missing its waveform?
Title: foo_wave_seekbar
Post by: studio13 on 2011-12-13 17:29:54
The context menu entry under Utilities named "Extract Seekbar Signature" should re-scan the file if run by the user.

Sorry that didn't work for any of the files ..

What kind of file is this?

They are all .wav but a mix of stereo, mono, 44.1k, 48k, 16bit, 24bit and some are ADPCM. Some files show the waveform display other do not. Last week the same files all showed thier waveform display.


Does the console say anything? Can you provide (privately) a file that is missing its waveform?
I'm sorry I don't know what the console is. I'll zip up a file I can share and send it later today.
Title: foo_wave_seekbar
Post by: Zao on 2011-12-13 22:31:06
(http://zao.se/~zao/seekbar57.png)
Your sample file scans properly. Try some different frontends, see if there's any difference in whether it shows or not.
The console is accessible through View -> Console, and is a log of recent messages and errors.
Title: foo_wave_seekbar
Post by: studio13 on 2011-12-14 14:10:11
Oops ok I see the console now thanks I have set it to write a log file.

I've realized this morning the problem is limited to playlists. When I started out using foobar I was only creating playlists then just dragging and dropping files directly onto them. I had not set the Preference for my "Music Library" folder pathname yet. Now that I have my "Music Library" folder pathnames setup and the files have scanned over-night they all show up in the waveform seekbar just fine. As I review the playlists created over the past week or two I can see the waveform overviews are still missing. I am using the "Playlist Organizer" component ... could that be part of the problem ?? Anway overall things have improved as I can now search the library directly and the waveforms display no problem.

If you have the time I would really appreciate your advice with one more thing. The path I have set for my "Music Library" is a network disk with over 11,000 full resolution .wav files. Most are less than 60seconds long. over time I will end up auditioning each one of these files. I'm concerned that I have no idea how the waveform overviews are managed. Is there some hidden directory somewhere that stores the waveform overview? Am I filling up a local directory or is it writing back to the network disk ?? Is there a process for managing the overview files ?? Thanks
Title: foo_wave_seekbar
Post by: Zao on 2011-12-14 14:21:18
I've realized this morning the problem is limited to playlists. When I started out using foobar I was only creating playlists then just dragging and dropping files directly onto them. I had not set the Preference for my "Music Library" folder pathname yet. Now that I have my "Music Library" folder pathnames setup and the files have scanned over-night they all show up in the waveform seekbar just fine. As I review the playlists created over the past week or two I can see the waveform overviews are still missing. I am using the "Playlist Organizer" component ... could that be part of the problem ?? Anway overall things have improved as I can now search the library directly and the waveforms display no problem.

There's a setting somewhere for the waveform seekbar to allow analysis of files that are not in the Media Library. It is enabled by default, but you might have accidentally disabled it.

If you have the time I would really appreciate your advice with one more thing. The path I have set for my "Music Library" is a network disk with over 11,000 full resolution .wav files. Most are less than 60seconds long. over time I will end up auditioning each one of these files. I'm concerned that I have no idea how the waveform overviews are managed. Is there some hidden directory somewhere that stores the waveform overview? Am I filling up a local directory or is it writing back to the network disk ?? Is there a process for managing the overview files ?? Thanks

The backing storage for the component is a sqlite3 database file in your foobar2000 profile directory, named 'wavecache.db'. It stores the queue of pending scans (which persists over restarts) and it stores the waveforms as compressed binary blobs. A single stereo track takes around 20 KiB or so.

I've considered to have per-directory databases or so, but never really got a good use case to warrant implementing it.
Title: foo_wave_seekbar
Post by: studio13 on 2011-12-14 14:43:31
There's a setting somewhere for the waveform seekbar to allow analysis of files that are not in the Media Library. It is enabled by default, but you might have accidentally disabled it.


man I am so sorry yes this is exactly the problem I BROKE IT !! The setting is in the //Preferences/Advanced/Waveform Seekbar/Analise tracks not in the media library. I had disabled this feature .. duh ...

I really appreciate that you created and actively support this very useful foobar component it has been a great help to me !!
Title: foo_wave_seekbar
Post by: Zao on 2011-12-14 16:41:50
Nice to hear that for once, it was not my fault. 
Title: foo_wave_seekbar
Post by: Zao on 2011-12-14 18:09:40
Case found a bug in the mono downmixing of waveforms, which had the effect of completely ignoring the rear right and surround right channels and attenuating the LFE and center channels in the waveforms.
If you have any waveforms that were scanned with the advanced setting to downmix scan results to mono, you probably want to rescan those. Otherwise, just enjoy a slightly less broken product.

This was fixed in the just released 0.2.14.2, which should be live on the site and through the update functionality now.
Title: foo_wave_seekbar
Post by: studio13 on 2011-12-15 14:36:34
Just in case this info helps in the waveform seekbar right click / configuration window I have set
[blockquote]Frontend = Direct2D 1.0
Misc = Downmix display to mono set to YES[/blockquote]
Then in foobar Preferences/Advanced/Tools/Waveform Seekabar
[blockquote]Store analysed tracks in mono set to YES[/blockquote]
Title: foo_wave_seekbar
Post by: Zao on 2011-12-15 17:40:00
[blockquote]Store analysed tracks in mono set to YES[/blockquote]

If anyone has analysed 5.1 or 7.1 content with that setting enabled, I recommend that you should rescan those tracks, as some channels will be missing or attenuated in the waveform data.
Title: foo_wave_seekbar
Post by: CmdRobot on 2011-12-19 09:27:33
Hey guys,

I use these settings for my seekbar.fx:
http://pastebin.com/N6N1uCxJ (http://pastebin.com/N6N1uCxJ)

Someone from this thread gave them to me a year ago or so, I asked for code to scale the waveform with the replay gain. But I think it's not working correctly anymore. There are some tracks that are pretty loud due to replaygain, but the waveform is very tiny.

Can anybody help? I don't even slightly understand anything from this file...

Thanks for this awsome component!
Title: foo_wave_seekbar
Post by: Dandruff on 2012-01-16 14:03:32
Hi Zao,

I have a minor issue with version 0.2.14.2:

Example:


file = 16bit, 44.1 kHz

-> Waveform analysed and displayed fine


Then I lower the volume and save the new file under the same name and same folder with 32bit, 48kHz. Now WaveformSeekbar doesn't update automatically. Even if I'm using the "Extract Seekbar signature" command, the file still displays the wrong/old waveform. I have to use "Remove seekbar signature" in order to get the new waveform (lower volume) displayed.


Is there no way to do this automatically (computing hash for each file and if it differs then do a rebuild of the signature)?
Title: foo_wave_seekbar
Post by: Zao on 2012-01-16 14:35:36
Hashing a file is around the same magnitude of work as scanning a file, so that would be a rather significant performance hit for a common operation.

As for manual rescans, they should re-analyse the waveform properly unless I've managed to break that code yet again. The logic around there is ... tricky.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-01-16 14:43:05
"Always rescan track if requested by user" and "Analyze tracks not in the media library" are enabled here.
Title: foo_wave_seekbar
Post by: Zao on 2012-01-17 15:57:50
I seem to have fixed that bug in the 0.2.15. It turns out that the "always rescan" option wasn't wired up at all in the code.
Note that the UI will not be aware of the change in the waveform until it re-requests it from the backend, which will typically happen when you restart the track.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-01-18 07:33:49
Ok, with 0.2.15 the "Extract Seekbar signature" + foobar2000 restart does the trick. Thanks!


Still not perfect (as it needs user interaction). What about saving the file date/time (instead of a hash) along with the signature? If the file date/time differs from the saved one, rebuild signature. Could this be done?
Title: foo_wave_seekbar
Post by: Zao on 2012-01-18 07:51:15
That sort of information is not universally available from a playable location, especially not in the presence of cue sheets, archives and chapters.
I'd rather not make a half-arsed system that will require months of tuning to give occasionally better results.

Note that all you need to do is to restart the track, not the player.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-01-18 08:13:13
Ok. Thanks!
Title: foo_wave_seekbar
Post by: Zao on 2012-01-18 09:14:55
In particular, being opportunistic and rescanning a file as soon as it changes will have the ill effect of locking access to the file a lot, which already is a problem as we lock the file when scanning already, causing real problems.

There's some problem with scanning a new file while playing the old contents too, as the display will then mismatch what is heard.

I'd need to design this properly if I ever implement it, and need to rejigger a bit of notification.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-01-18 10:22:35
Alright :)
Title: foo_wave_seekbar
Post by: aeidein on 2012-02-03 03:47:01
• Would you consider implementing seeking via the mousewheel when mouseovered?
• I'm not sure if it's a limitation of Columns, but when the status bar is hidden/shown, the seekbar gets resized, even when locked.
Title: foo_wave_seekbar
Post by: Zao on 2012-02-03 15:53:08
#18 - Seek on mouse wheel motion (https://github.com/zao/foo_wave_seekbar/issues/18)

As for resizing, I've got no clue what Columns UI does, or how to make it less stupid. It's probably their fault. If the window area changes as an effect of removing/adding the status bar, they don't have much alternative but to either resize panels or resize the whole window. Sounds like they went with the former.
Title: foo_wave_seekbar
Post by: Geordietastic on 2012-02-03 22:17:22
That's a rather attractive skin, colagen. Props.

Thanks ! But now, it is really attractive, at least for me  I finally take some hours to learn how to hide the scrollbars and others things. Next step for my next "what the f.. could i do this weekend" would be to learn how to do advanced things with WSH panel, but eh i've already fall too far into the foobar madness skinning.
With waveform + the two chanel spectrum panels i've add in the background (the big brown one is maybe hard to see in the screenshot), it seems that my foobar is now alive
(http://i40.tinypic.com/1zwnv44.jpg)


Love to know how you did this please?
Title: foo_wave_seekbar
Post by: SmartOne on 2012-02-05 20:38:32
Is there an easy way to edit the HLSL making the waveform look sharp like in Audacity?

And maybe a way to show clipping as a different color, while you're at it.
Title: foo_wave_seekbar
Post by: Zao on 2012-02-05 21:01:38
That depends entirely on what "sharp like Audacity" means.
As for clipping, predicate the color for a column based on whether the min/max exceeds 1.0 or not.
Title: foo_wave_seekbar
Post by: SmartOne on 2012-02-05 21:14:50
Sharp as in the edges aren't faded.  I don't like fading on the waveform or the selection.
Title: foo_wave_seekbar
Post by: MDMA on 2012-02-07 19:56:22
what would I type in seekbar.fx to add a couple of pixels worth of vertical padding to the top and bottom of my seekbar? I'd like to give it more 'float' space
Title: foo_wave_seekbar
Post by: Zao on 2012-02-07 20:54:11
In the VS function, on the line before return output; you could add output.tc.y *= 1.2; which would make the range of the display from -1.2 to 1.2 (with 1.0 being full-scale).
Title: foo_wave_seekbar
Post by: SmartOne on 2012-02-08 18:55:26
I'm having trouble deciphering the purpose of each of the variables (comments?).  I also don't know HLSL (but who cares, right?).  What is tc?  How can I determine the value of the waveform at an arbitrary point and color it red when it hits the maximum amplitude (indicating clipping)?

After much tinkering, the waveform and seekbar are now sharp (no ugly fading).  That's the extent of my progress.
Title: foo_wave_seekbar
Post by: Zao on 2012-02-08 22:58:17
Comments? Those are for the weak, I hear. 

The x-component of tc indicates the position along the waveform. 0.0 is snugly against the left side of the window, 1.0 is to the far right of the window. In the PS (pixel shader), a tc.x of 0.25 would be 25% from the left side of the window.

The y-component of tc indicates at what absolute signal level the top and bottom of the window is at. The default of 1.0 makes the vertical range of the window from -fullscale to +fullscale.

The pixel shader function runs once for every pixel (fragment) of the window, with the parameters interpolated from the values set in the corners by the vertex shader.

The way the waveform is rasterised is that the x-component is used to sample the texture representing the amplitude data. The resulting data is then tested against the y-component to see if it's outside or inside the waveform, and coloured appropriately. If you get rid of the interpolations/smoothsteps at that border, you get an aliased sharp edge.

You can have a predicate picking a particular colour for the fragment if the sampled value (min/max) is larger than 1.0, instead of the default color. As for the exact place to do that, you've got to find on your own as I do not use the default shader anymore.
Title: foo_wave_seekbar
Post by: MDMA on 2012-02-08 23:13:25
In the VS function, on the line before return output; you could add output.tc.y *= 1.2; which would make the range of the display from -1.2 to 1.2 (with 1.0 being full-scale).


Thanks a lot for this but I am pretty clueless on scripting. Would it be possible to just add it in its own line at the end of the config?
Title: foo_wave_seekbar
Post by: SmartOne on 2012-02-09 03:26:35
Thank you for the help.  I think I figured it out (at least, it looks accurate):

Code: [Select]
float4 wave;
if(minmaxrms.y > 1.0){
bgColor.r = 1.0;
bgColor.g = 0.0;
bgColor.b = 0.0;
wave=bgColor;
}
else if(outside)
wave = bgColor;
else
wave = textColor;

return wave;

This replaces the if statement at the end of evaluate(), making clipping parts red.

MDMA, I think you need to add the line [font= \"Courier New\"]output.tc.y *= 1.2;[/font] to the end of VS().  The result should look like this:

Code: [Select]
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;

output.tc.y *= 1.2;
return output;
}
Title: foo_wave_seekbar
Post by: mforceew on 2012-02-10 20:28:41
Hello everyone. I'm newbie in foobar. How can i make waveform seekbar thinner? Thank you.
Title: foo_wave_seekbar
Post by: MDMA on 2012-02-10 20:31:27
Thanks, although I have added it in so it is like so:

Code: [Select]
if (horizontal)
        output.tc = float2((input.pos.x + 1.0) / 2.0, input.pos.y);
    else
        output.tc = float2((-input.pos.y + 1.0) / 2.0, input.pos.x);

    output.tc.y *= 1.2;
    return output;
}


and it doesn't seem to be doing anything. Is there a conflict from the output.tc = float lines? thanks
Title: foo_wave_seekbar
Post by: Zao on 2012-02-10 21:35:28
No, operations are done in sequence. It's probably due to how your PS function uses the texcoords. It does a difference in my shader, and as mentioned, I don't use the default effect anymore.
Title: foo_wave_seekbar
Post by: MDMA on 2012-02-10 23:15:27
No, operations are done in sequence. It's probably due to how your PS function uses the texcoords. It does a difference in my shader, and as mentioned, I don't use the default effect anymore.


Nor I, here is a copy of my current seekbar.fx config:
https://privatepaste.com/00c389b6a4 (https://privatepaste.com/00c389b6a4)
Title: foo_wave_seekbar
Post by: Dandruff on 2012-02-23 10:57:11
SciLexer.dll from http://prdownloads.sourceforge.net/scintil...03.zip?download (http://prdownloads.sourceforge.net/scintilla/wscite303.zip?download) is at version number 3.0.3.0 while Waveform Seekbar's is at 2.2.6.0. Can we use the 3.0.3.0 one?
Title: foo_wave_seekbar
Post by: lvqcl on 2012-02-23 11:18:36
http://www.hydrogenaudio.org/forums/index....st&p=768884 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=768884)
Title: foo_wave_seekbar
Post by: Dandruff on 2012-02-23 14:15:44
I strongly recommend against dropping in a binary build of SciLexer, at least until I remember if I build mine in any special way.


Why do you recommend avoiding the scilexer dll update? Just tried the 3.0.3.0 DLL and it seems to work fine with Waveform Seekbar 0.2.16!
Title: foo_wave_seekbar
Post by: enigmatik on 2012-02-23 20:44:47
Is it possible to move wavecache.db to some other location outside foobar's main directory?
Title: foo_wave_seekbar
Post by: Zao on 2012-02-23 21:07:16
Please don't modify things, even if it "seems to work fine". I've got enough pain in debugging crash dumps without people running things I have not built in unsupported configurations.
I have not seen any reason whatsoever to upgrade, and I don't see why I should change something that works properly for something that most probably is larger, has different semantics and comes with additional maintenance requirements, just because someone feels that "higher is better, lol".

In particular, I use the non-message interface to it, which couples the library built with and the library used at runtime more than the poor message interface.

It's not a matter of "why do you not upgrade",  it should be "why should I upgrade".
Title: foo_wave_seekbar
Post by: Zao on 2012-02-23 21:10:46
Is it possible to move wavecache.db to some other location outside foobar's main directory?

Known request, needs thinking.
Title: foo_wave_seekbar
Post by: Zao on 2012-02-24 23:00:50
Why do you recommend avoiding the scilexer dll update? Just tried the 3.0.3.0 DLL and it seems to work fine with Waveform Seekbar 0.2.16!

I've updated it in my sources for no reason what-so-ever. I redirect all blame for the pointless file size increase to you.

Also, yet again, I do not recommend against building against some particular version. I recommend against replacing DLLs you have no idea about how they are built or what customizations are in place.
Multi-module programming is hard enough without all the unknown variables you cause.
Title: foo_wave_seekbar
Post by: tribaljet on 2012-02-25 03:32:24
Hello. I've seen foo_wave_seekbar used on many different configs and themes, and I've decided to give it a try, being quite pleased at the result. But I have a small problem, which is being unable to find where seekbar.fx is located. I'm using a portable foobar2000 installation, but the file isn't located on the portable folder nor on the Appdata folder. Switching to a normal installation isn't an option for me, but what boggles my mind is that I did a full search on my HDDs and couldn't locate the file at all.

Can someone shed some light on this?

Thanks in advance
Title: foo_wave_seekbar
Post by: Zao on 2012-02-25 04:12:56
It was moved from being a file to being a per-instance setting many versions ago.
Add a seekbar, right click it to get the configuration dialog and hit the "Frontend settings..." button to get a text editor with the effect source.
This is the same in both portable and non-portable installs.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-02-25 16:59:56
Why do you recommend avoiding the scilexer dll update? Just tried the 3.0.3.0 DLL and it seems to work fine with Waveform Seekbar 0.2.16!

I've updated it in my sources for no reason what-so-ever. I redirect all blame for the pointless file size increase to you.

Also, yet again, I do not recommend against building against some particular version. I recommend against replacing DLLs you have no idea about how they are built or what customizations are in place.
Multi-module programming is hard enough without all the unknown variables you cause.


Other question: Can we delete the SciLexer DLL savely? I don't need to change the Direct3D Frontend settings here.
Title: foo_wave_seekbar
Post by: tribaljet on 2012-02-25 17:01:44
It was moved from being a file to being a per-instance setting many versions ago.
Add a seekbar, right click it to get the configuration dialog and hit the "Frontend settings..." button to get a text editor with the effect source.
This is the same in both portable and non-portable installs.


Thanks Zao. Another question. Is there a guide for editing Frontend settings? Because mine is currently empty and I'm not familiar with what I should add there.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-02-25 17:05:16
0.2.16 crashes here when switching from Direct3D to Direct2D mode while playing this internet stream: http://72.233.84.175 (http://72.233.84.175)

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 00EB19EDh
Access violation, operation: read, address: 00000000h

Call path:
entry=>app_mainloop

Code bytes (00EB19EDh):
00EB19ADh:  FC 00 C7 46 2C 03 00 00 00 E8 49 76 09 00 83 C4
00EB19BDh:  04 C7 85 C4 FE FF FF 32 00 00 00 89 5D FC B8 D1
00EB19CDh:  19 EB 00 C3 8B BD C4 FE FF FF 8B B5 BC FE FF FF
00EB19DDh:  8B CE E8 1C 08 00 00 8B 86 B8 00 00 00 8B 48 18
00EB19EDh:  8B 11 8B 42 18 6A FF FF D0 8B 86 B8 00 00 00 83
00EB19FDh:  78 18 00 74 64 89 BD C4 FE FF FF DB 85 C4 FE FF
00EB1A0Dh:  FF 6A 00 85 FF 79 06 DC 05 E0 77 FC 00 DC B5 98
00EB1A1Dh:  FE FF FF 8B 56 04 D9 BD BE FE FF FF 0F B7 85 BE

Stack (0012F8C0h):
0012F8A0h:  E145EAE8 00000001 00000000 00000150
0012F8B0h:  B223DC0C 00000001 00000006 B223DBCC
0012F8C0h:  3157539F 00000000 01084C48 00000000
0012F8D0h:  00000000 00000000 00000000 00000000
0012F8E0h:  00FB67E8 00000000 C47A0000 0012F8E0
0012F8F0h:  00000000 3FF00000 0108B160 00000001
0012F900h:  00FC6384 00000000 00000000 00000000
0012F910h:  00000037 01084C48 00000000 00000032
0012F920h:  0000011C 00000005 00000001 00000A28
0012F930h:  00000002 00650053 00760072 00630069
0012F940h:  00200065 00610050 006B0063 00330020
0012F950h:  00000000 00000000 00000000 00000000
0012F960h:  00000000 00000000 00000000 00000000
0012F970h:  00000000 00000000 00000000 00000000
0012F980h:  00000000 00000000 00000000 00000000
0012F990h:  00000000 00000000 00000000 00000000
0012F9A0h:  00000000 00000000 00000000 00000000
0012F9B0h:  00000000 00000000 00000000 00000000
0012F9C0h:  00000000 00000000 00000000 00000000
0012F9D0h:  00000000 00000000 00000000 00000000

Registers:
EAX: 0108B160, EBX: 0012FA4C, ECX: 00000000, EDX: 00EC4ED0
ESI: 01084C48, EDI: 00000032, EBP: 0012FA58, ESP: 0012F8C0

Crash location:
Module: foo_wave_seekbar
Offset: 219EDh
Symbol: "g_gdi_entrypoint" (+11F5Dh)

Loaded modules:
foobar2000   loaded at 00400000h - 005B6000h
ntdll loaded at 7C910000h - 7C9C9000h
kernel32 loaded at 7C800000h - 7C908000h
COMCTL32 loaded at 773A0000h - 774A3000h
msvcrt   loaded at 77BE0000h - 77C38000h
ADVAPI32 loaded at 77DA0000h - 77E4A000h
RPCRT4   loaded at 77E50000h - 77EE3000h
Secur32   loaded at 77FC0000h - 77FD1000h
GDI32 loaded at 77EF0000h - 77F39000h
USER32   loaded at 7E360000h - 7E3F1000h
SHLWAPI   loaded at 77F40000h - 77FB6000h
DSOUND   loaded at 73E70000h - 73ECC000h
ole32 loaded at 774B0000h - 775EE000h
VERSION   loaded at 77BD0000h - 77BD8000h
WINMM loaded at 76AF0000h - 76B1E000h
UxTheme   loaded at 5B0F0000h - 5B128000h
SHELL32   loaded at 7E670000h - 7EE91000h
zlib1 loaded at 5A4C0000h - 5A4D4000h
shared   loaded at 10000000h - 1002B000h
imagehlp loaded at 76C50000h - 76C78000h
dbghelp   loaded at 59DD0000h - 59E71000h
COMDLG32 loaded at 76350000h - 7639A000h
gdiplus   loaded at 4EBA0000h - 4ED4B000h
CRYPT32   loaded at 77A50000h - 77AE6000h
MSASN1   loaded at 77AF0000h - 77B02000h
IMM32 loaded at 76330000h - 7634D000h
msctfime loaded at 75250000h - 7527E000h
foo_dsp_std   loaded at 00D20000h - 00D68000h
foo_ui_std   loaded at 00D80000h - 00E65000h
MSIMG32   loaded at 76320000h - 76325000h
foo_wave_seekbar loaded at 00E90000h - 0102B000h
WS2_32   loaded at 71A10000h - 71A27000h
WS2HELP   loaded at 71A00000h - 71A08000h
foo_converter loaded at 01090000h - 0110C000h
foo_cdda loaded at 01130000h - 0117E000h
foo_out_asio loaded at 011A0000h - 011D2000h
foo_albumlist loaded at 01200000h - 0125C000h
foo_input_std loaded at 01280000h - 013DB000h
frontend_direct3d9   loaded at 01620000h - 01680000h
d3d9 loaded at 4FD50000h - 4FEF6000h
d3d8thk   loaded at 6DE80000h - 6DE86000h
d3dx9_42 loaded at 01690000h - 01875000h
CLBCATQ   loaded at 76F90000h - 7700F000h
COMRes   loaded at 77010000h - 770E3000h
OLEAUT32 loaded at 770F0000h - 7717B000h
xpsp2res loaded at 01AC0000h - 01D99000h
mswsock   loaded at 719B0000h - 719F0000h
hnetcfg   loaded at 66710000h - 66769000h
wshtcpip loaded at 719F0000h - 719F8000h

Stack dump analysis:
Address: 00FB67E8h (foo_wave_seekbar+1267E8h), symbol: "boost::serialization::singleton<std::set<boost::serialization::void_cast_detail::void_caster const *,boost:" (+445A8h)
Address: 00FC6384h (foo_wave_seekbar+136384h), symbol: "boost::serialization::singleton<std::set<boost::serialization::void_cast_detail::void_caster const *,boost:" (+54144h)
Address: 00FABB9Eh (foo_wave_seekbar+11BB9Eh), symbol: "boost::serialization::singleton<std::set<boost::serialization::void_cast_detail::void_caster const *,boost:" (+3995Eh)
Address: 00EE74E3h (foo_wave_seekbar+574E3h), symbol: "boost::archive::detail::iserializer<boost::archive::xml_iarchive,wave::color>::load_object_data" (+24B63h)
Address: 00EAB45Bh (foo_wave_seekbar+1B45Bh), symbol: "g_gdi_entrypoint" (+B9CBh)
Address: 00EABC47h (foo_wave_seekbar+1BC47h), symbol: "g_gdi_entrypoint" (+C1B7h)
Address: 00F7B0A0h (foo_wave_seekbar+EB0A0h), symbol: "boost::serialization::singleton<std::set<boost::serialization::void_cast_detail::void_caster const *,boost:" (+8E60h)
Address: 00EABE33h (foo_wave_seekbar+1BE33h), symbol: "g_gdi_entrypoint" (+C3A3h)
Address: 00EABB0Fh (foo_wave_seekbar+1BB0Fh), symbol: "g_gdi_entrypoint" (+C07Fh)
Address: 00EACFF0h (foo_wave_seekbar+1CFF0h), symbol: "g_gdi_entrypoint" (+D560h)
Address: 7E368734h (USER32+8734h), symbol: "GetDC" (+6Dh)
Address: 7E368816h (USER32+8816h), symbol: "GetDC" (+14Fh)
Address: 0048A7C9h (foobar2000+8A7C9h)
Address: 7E39048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E368830h (USER32+8830h), symbol: "GetDC" (+169h)
Address: 7E378EA0h (USER32+18EA0h), symbol: "DefWindowProcW" (+180h)
Address: 004792DAh (foobar2000+792DAh)
Address: 7E39048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E378EB0h (USER32+18EB0h), symbol: "DefWindowProcW" (+190h)
Address: 7E378EECh (USER32+18EECh), symbol: "DefWindowProcW" (+1CCh)
Address: 7C91E473h (ntdll+E473h), symbol: "KiUserCallbackDispatcher" (+13h)
Address: 7E378E53h (USER32+18E53h), symbol: "DefWindowProcW" (+133h)
Address: 7E3694D2h (USER32+94D2h), symbol: "GetWindowLongA" (+75h)
Address: 7E378F10h (USER32+18F10h), symbol: "DefWindowProcW" (+1F0h)
Address: 7E39048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E3689F0h (USER32+89F0h), symbol: "GetWindowLongW" (+14Ah)
Address: 7E368A10h (USER32+8A10h), symbol: "DispatchMessageW" (+Fh)
Address: 7E3774FFh (USER32+174FFh), symbol: "IsDialogMessageW" (+DBh)
Address: 00DF5CB6h (foo_ui_std+75CB6h)
Address: 0045848Ch (foobar2000+5848Ch)
Address: 7E37B19Ch (USER32+1B19Ch), symbol: "DestroyWindow" (+0h)
Address: 00514812h (foobar2000+114812h)
Address: 0045856Fh (foobar2000+5856Fh)
Address: 00459001h (foobar2000+59001h)
Address: 00538358h (foobar2000+138358h)
Address: 00538358h (foobar2000+138358h)
Address: 00537BB4h (foobar2000+137BB4h)
Address: 00541E54h (foobar2000+141E54h)
Address: 7C9201DBh (ntdll+101DBh), symbol: "RtlAllocateHeap" (+117h)
Address: 0050157Ah (foobar2000+10157Ah)
Address: 005080E6h (foobar2000+1080E6h)
Address: 00424730h (foobar2000+24730h)
Address: 00505570h (foobar2000+105570h)
Address: 005080E6h (foobar2000+1080E6h)
Address: 00505E05h (foobar2000+105E05h)
Address: 100027D8h (shared+27D8h), symbol: "uPrintCrashInfo_OnEvent" (+B1h)
Address: 00537E5Ch (foobar2000+137E5Ch)
Address: 00520E72h (foobar2000+120E72h)
Address: 0045926Eh (foobar2000+5926Eh)
Address: 00400000h (foobar2000+0h)
Address: 0050B287h (foobar2000+10B287h)
Address: 0056A600h (foobar2000+16A600h)
Address: 00504D7Ah (foobar2000+104D7Ah)
Address: 0050184Ch (foobar2000+10184Ch)
Address: 00501846h (foobar2000+101846h)
Address: 00529888h (foobar2000+129888h)
Address: 0052988Ch (foobar2000+12988Ch)
Address: 00526F81h (foobar2000+126F81h)
Address: 00505570h (foobar2000+105570h)
Address: 00501846h (foobar2000+101846h)
Address: 0052104Bh (foobar2000+12104Bh)
Address: 00502BB2h (foobar2000+102BB2h)
Address: 00400000h (foobar2000+0h)
Address: 00505570h (foobar2000+105570h)
Address: 7C817077h (kernel32+17077h), symbol: "RegisterWaitForInputIdle" (+49h)
Address: 7C839AD8h (kernel32+39AD8h), symbol: "ValidateLocale" (+2B0h)
Address: 7C817080h (kernel32+17080h), symbol: "RegisterWaitForInputIdle" (+52h)
Address: 00502C05h (foobar2000+102C05h)
Address: 0057005Ch (foobar2000+17005Ch)
Address: 004E0049h (foobar2000+E0049h)
Address: 004F0044h (foobar2000+F0044h)
Address: 00530057h (foobar2000+130057h)
Address: 0057005Ch (foobar2000+17005Ch)
Address: 01C8AA0Ah (xpsp2res+1CAA0Ah)
Address: 004B0063h (foobar2000+B0063h)
Address: 00530022h (foobar2000+130022h)
Address: 00500069h (foobar2000+100069h)
Address: 01CBF9B6h (xpsp2res+1FF9B6h)
Address: 00500069h (foobar2000+100069h)
Address: 00410072h (foobar2000+10072h)
Address: 00540079h (foobar2000+140079h)
Address: 00430022h (foobar2000+30022h)
Address: 00490057h (foobar2000+90057h)
Address: 0044004Eh (foobar2000+4004Eh)
Address: 0057004Fh (foobar2000+17004Fh)
Address: 0053006Eh (foobar2000+13006Eh)
Address: 00530078h (foobar2000+130078h)
Address: 004D005Ch (foobar2000+D005Ch)
Address: 004D005Fh (foobar2000+D005Fh)
Address: 0057002Eh (foobar2000+17002Eh)
Address: 0047002Eh (foobar2000+7002Eh)
Address: 004D002Eh (foobar2000+D002Eh)
Address: 00500069h (foobar2000+100069h)
Address: 0044002Eh (foobar2000+4002Eh)
Address: 01C8AA0Ah (xpsp2res+1CAA0Ah)
Address: 0044002Eh (foobar2000+4002Eh)
Address: 00410072h (foobar2000+10072h)
Address: 00540079h (foobar2000+140079h)
Address: 0057005Ch (foobar2000+17005Ch)
Address: 004E0049h (foobar2000+E0049h)
Address: 004F0044h (foobar2000+F0044h)
Address: 00530057h (foobar2000+130057h)
Address: 0057005Ch (foobar2000+17005Ch)

Environment:
App: foobar2000 v1.1.11
UI: Default User Interface 0.9.5

Components:
Core (2012-02-04 13:05:48 UTC)
foobar2000 core 1.1.11
foo_albumlist.dll (2012-02-04 13:04:12 UTC)
Album List 4.5
foo_cdda.dll (2012-02-04 13:03:52 UTC)
CD Audio Decoder 3.0
foo_converter.dll (2012-02-04 13:04:00 UTC)
Converter 1.5
foo_dsp_std.dll (2012-02-04 13:04:14 UTC)
Standard DSP Array 1.0
foo_input_std.dll (2012-02-04 13:05:10 UTC)
Standard Input Array 1.0
foo_out_asio.dll (2012-02-04 13:59:56 UTC)
ASIO support 2.1.1
foo_ui_std.dll (2012-02-04 13:04:08 UTC)
Default User Interface 0.9.5
foo_wave_seekbar.dll (2012-02-22 18:57:06 UTC)
Waveform seekbar 0.2.16

Recent events:
Startup time : 0:00.048498
Seekbar: taking Direct3D9 path.
Opening track for playback: "http://72.233.84.175/"
Seekbar: Frontend initialized.
Wave cache: skipping location "http://72.233.84.175/"
Wave cache: skipping location "http://72.233.84.175/"
Seekbar: taking Direct2D1 path.
Seekbar: frontend creation failed: unavailable frontend
Seekbar: taking GDI path.
Wave cache: skipping location "http://72.233.84.175/"


Machine specifications:
OS: Windows 5.1.2600 Service Pack 3 x86
CPU: Intel® Core™2 CPU   6700  @ 2.66GHz, features: MMX SSE SSE2 SSE3
Audio: HDSP9632 Analog (1+2); HDSP9632 SPDIF; HDSP9632 ADAT (1+2); HDSP9632 ADAT (3+4); HDSP9632 ADAT (5+6); HDSP9632 ADAT (7+8)
Title: foo_wave_seekbar
Post by: Zao on 2012-02-26 02:11:18
0.2.17 probably fixes the fallback crashes, but you should of course look into why you fall back to GDI in the first place.
Title: foo_wave_seekbar
Post by: tribaljet on 2012-02-26 02:21:50
Hopefully someone will post a tutorial on how to configure the Frontend Settings for those who aren't familiar with the code.
Title: foo_wave_seekbar
Post by: Zao on 2012-02-26 02:35:50
The Reset button ought to get you the default effect source in there.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-02-27 07:42:45
0.2.17 probably fixes the fallback crashes, but you should of course look into why you fall back to GDI in the first place.


Oh, of course - my fault. Crashed because I've deleted the frontend_direct2d.dll. Ok, 0.2.17 not crashing. Thanks!
Title: foo_wave_seekbar
Post by: Hotze on 2012-02-28 10:59:44
It would be nice that you could put the bar horizontally. That can't be difficult to programe, can it?
Title: foo_wave_seekbar
Post by: mzso on 2012-02-28 11:21:53
It would be nice that you could put the bar horizontally. That can't be difficult to programe, can it?

I'm sure you can. I think you only just need to have a panel that's height is bigger than its width.
Title: foo_wave_seekbar
Post by: Zao on 2012-02-28 13:41:01
Indeed.

If the bar is higher than it's wide, it flips the content diagonally. Crouching tiger hidden feature.
Title: foo_wave_seekbar
Post by: tribaljet on 2012-02-28 13:58:25
Seriously, can anyone help out on how to custom the code of the Frontend Settings?
Title: foo_wave_seekbar
Post by: Zao on 2012-02-28 14:17:09
It's in HLSL, the language used to write programmable shaders for 3D applications.

If you feel an urge to "customize" it, look at the PS function, which is invoked once per pixel and computes a color value from the waveform data and time.

If you do not feel capable of this, there's some existing custom effects spread around this thread and the Columns UI thread.
Title: foo_wave_seekbar
Post by: Hotze on 2012-02-28 15:57:42
Indeed.

If the bar is higher than it's wide, it flips the content diagonally. Crouching tiger hidden feature.


My fault! I didn't notice that behaviour before. I feel kind of dumb...
Title: foo_wave_seekbar
Post by: DarkScythe on 2012-02-28 16:25:03
Interesting little quirk I've discovered, but I'm not sure what exactly the cause is.

I haven't updated from 0.2.14 yet, because I haven't had any issues.
In any case, I noticed recently that I can no longer access the front-end settings.
I can go into the configuration window, but when I click on frontend settings (D3D9 mode) nothing happens. Not a huge deal because it's retained the settings I set last time, and I haven't felt the need to alter them, but it is curious.
(Foobar 1.1.9, Win7 x64; nothing's changed, really.)
Title: foo_wave_seekbar
Post by: tribaljet on 2012-02-28 16:59:15
It's in HLSL, the language used to write programmable shaders for 3D applications.

If you feel an urge to "customize" it, look at the PS function, which is invoked once per pixel and computes a color value from the waveform data and time.

If you do not feel capable of this, there's some existing custom effects spread around this thread and the Columns UI thread.


Thank you Zao. I'm not familiar with customizing HLSL, and the custom presets people made are very specific. I'm just looking for documents that might help me get started with customizing this exactly the way I want.
Title: foo_wave_seekbar
Post by: NullString on 2012-03-09 02:07:13
I had a problem regarding a "Nothing happens when I click Frontend settings", even though I had all the prerequisites installed. The problem got solved when I deleted the UI element, and added it again with the default settings. Now I can edit the frontend settings. =)
Title: foo_wave_seekbar
Post by: Dandruff on 2012-03-09 14:12:54
Bug in version 0.2.17:

-> start up foobar2000 (1.1.11) with empty playlist (no playback started)
-> try any of the Waveform Seekbar actions ("Remove Dead Waveforms" for example)

Result: Nothing happens.

Log only showing
Code: [Select]
Watching: D:\Music
Startup time : 0:00.045009
Seekbar: taking Direct3D9 path.
Seekbar: Frontend initialized.



-> start playback of any file
-> try any of the Waveform Seekbar actions ("Remove Dead Waveforms" for example)

Result: working


Why do we have to start playback in order to access the Waveform Seekbar functions?
Title: foo_wave_seekbar
Post by: Zao on 2012-03-09 14:17:35
Known behaviour.

It's an artifact of how the backing store cache is loaded. It's single-instance and loaded on demand. If no service needs it, it's not loaded at all.
The benefit of this is that it avoids doing things during application startup, resulting in a faster startup sequence and gets rid of a lot of scary limitations on what may be done during initialization.
The downside is that the context menu and menu commands seem to do nothing before the cache is brought to life.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-03-09 14:19:01
Ok, no big problem I think!
Title: foo_wave_seekbar
Post by: Zao on 2012-03-10 02:13:06
Version 0.2.18 should perform the delay-initialization for context and main menu commands, now.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-03-10 15:03:11
Thanks! Working fine!
Title: foo_wave_seekbar
Post by: adam777 on 2012-03-11 08:42:51
Hi Zao,
Now that development seems to be live again, I have a question.
A pretty long time ago you mentioned media library notifications integration (that is, automatically re-scan a file if changed, automatically remove dead files etc.) as something on the to-do list.
Is this feature still planned for the foreseeable future?
Thanks, Adam.
Title: foo_wave_seekbar
Post by: Zao on 2012-03-11 12:47:41
I wouldn't say live, as it's mostly looking at things that are either trivial or serious enough to warrant attention.
Larger features are a bit out of scope, unless they're interesting enough to take time from the things I ought to be working on.
Title: foo_wave_seekbar
Post by: ledge on 2012-03-11 22:28:48
I had a problem regarding a "Nothing happens when I click Frontend settings", even though I had all the prerequisites installed. The problem got solved when I deleted the UI element, and added it again with the default settings. Now I can edit the frontend settings. =)



Holy shit, this fixed the same problem for me, I should have thought about trying this.

Thanks for posting this rather than just keeping it to yourself
Title: foo_wave_seekbar
Post by: DarkScythe on 2012-03-12 00:35:25
I had a problem regarding a "Nothing happens when I click Frontend settings", even though I had all the prerequisites installed. The problem got solved when I deleted the UI element, and added it again with the default settings. Now I can edit the frontend settings. =)


Whoa, I somehow missed this post.

Does this preserve the settings in use before the element was removed?
I don't really have to change anything right now, as it's set up how I want it, but I don't believe I have any way of copying the settings somewhere before replacing the element.
Title: foo_wave_seekbar
Post by: adam777 on 2012-03-12 08:39:47
I wouldn't say live, as it's mostly looking at things that are either trivial or serious enough to warrant attention.
Larger features are a bit out of scope, unless they're interesting enough to take time from the things I ought to be working on.


Fair Enough 
Title: foo_wave_seekbar
Post by: Zao on 2012-03-13 00:12:55
Could one of you people that have the frontend settings trouble export a theme file (assuming you use the Default UI)?
That is, coincidentally, the sane way of preserving any settings.
Title: foo_wave_seekbar
Post by: DarkScythe on 2012-03-13 00:24:19
Could one of you people that have the frontend settings trouble export a theme file (assuming you use the Default UI)?
That is, coincidentally, the sane way of preserving any settings.


I don't think I can, since I use CUI. :/
Hopefully someone else can!
Title: foo_wave_seekbar
Post by: ledge on 2012-03-13 19:59:46
Could one of you people that have the frontend settings trouble export a theme file (assuming you use the Default UI)?
That is, coincidentally, the sane way of preserving any settings.


I could export my theme now, but I don't have the problem anymore.
Title: foo_wave_seekbar
Post by: NullString on 2012-03-14 00:01:29
I had a problem regarding a "Nothing happens when I click Frontend settings", even though I had all the prerequisites installed. The problem got solved when I deleted the UI element, and added it again with the default settings. Now I can edit the frontend settings. =)


Whoa, I somehow missed this post.

Does this preserve the settings in use before the element was removed?
I don't really have to change anything right now, as it's set up how I want it, but I don't believe I have any way of copying the settings somewhere before replacing the element.

When you insert an UI element from scratch it adds itself with its default properties, so you'll lose the effect you had set =\
Title: foo_wave_seekbar
Post by: Zao on 2012-03-14 00:12:42
In the Default UI, a roundabout way to make an export is to:


When you want to restore the element:


This may sound like more work than it is, but it really isn't. As for you strange people who use CUI, whatever methods there are to export themes or single panels there will work, assuming there are such ways.
Title: foo_wave_seekbar
Post by: Philip Goddard on 2012-03-16 16:59:51
Please bear with me for my technical ignorance, but I cannot get this Seekbar to work at all, despite having installed it correctly. Maybe this comes down to my not having the right hardware, but I could not make out for sure from the online documentation as to whether I had or hadn't got the right hardware for it to operate. I have a recently purchased Nofan A40-Z68 computer with Gigabyte Z68X-UD3H-B3 motherboard with Intel® Core™ i3-2125 CPU and on-board graphics described as Intel HD Graphics 2000 (GT2), and thus I have no dedicated graphics card. I'm running Win7 Home Premium x64 with the latest DirectX (11).

Although Waveform Seekbar is shown as installed in the list of Components, it shows no sign of operating - no pane, no option for it in the Toolbar drop-down right-click menu, and no error messages.  I do not know where to tell it to use one operating mode or another - i.e. if indeed any of its operating modes would work on my system. The only sign of its being installed, apart from its listing in the Components list is that there are relevant items in the Utilities submenu of the right-click menu on playlist items, and somewhere in Preferences there are a few Waveform Seekbar settings, but none that tell it which mode to operate in.

I would most appreciate any guidance as to how to get it operating, as it would be very useful.  -- Many thanks.
Title: foo_wave_seekbar
Post by: Zao on 2012-03-16 17:15:45
It is an UI element in the Default UI, and a panel in Columns UI (pretty much the same thing, but different terms).
As such, it's something you add to your layout, the menu items and preferences you've found are just peripheral ones.

The method of adding an UI element/panel depends on which user interface you use, but in the default UI there's a decent introduction (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Layout_Editing_Mode) on the wiki.
If you're using the Columns UI interface, there's some preferences page in Display -> Columns UI -> Layout that has some kind of interactive editor of the tree of UI panels.

As for you graphics card, it should be plenty capable of supporting any of the modes, which you can choose from the Configure context menu once you've managed to add the UI element/panel. I've gone through a fair amount of pain to ensure that it works on Intel chips way inferior than the one you're sporting.
Title: foo_wave_seekbar
Post by: Philip Goddard on 2012-03-16 20:01:26
Thank you indeed, Zao.  I've now investigated further, and have found why I couldn't get the seekbar to appear. I was using the simple playlist view, and even in layout editing mode I had no option to add UI elements, and only an option to replace one UI element - the playlist itself, which wouldn't have been helpful. So, I tried switching to Slim View +tabs, and then I was able to replace one of the visualization tabs with the Waveform Seekbar, which does indeed work. I also then removed other elements I didn't want, so effectively having my simple playlist view but with added, Waveform Seekbar. At no point, however, did I get a right-click menu option to add a new UI element - only to cut, paste or replace - but at least I managed to work round that absence by replacing an unwanted element.

One remaining point is that the waveform display is decidedly blurred - enough for me to assume that something really isn't right and needs changing. Is there anything that I could do to improve that?

Anyway, even as it is, this is a tremendous enhancement of Foobar2000 for my purposes, now making it much easier to assess individual sound files (actually of thunderstorms!) that I'm shaping up and organizing for making up a series of audio CDs. -- So, thanks again, Zao!
Title: foo_wave_seekbar
Post by: tpijag on 2012-03-16 20:18:28
FYI for your future configuration needs, there is nothing inherent about simple playlist view that does not allow full customization. You were using a layout with only one panel filled with the playlist. No place to add something without replacing what was there. What you would do to add a panel is temp replace the playlist with a splitter of your choice which would then give you multiple locations to add panels. Then add back the playlist in one panel and your seekbar in another.
Title: foo_wave_seekbar
Post by: Philip Goddard on 2012-03-16 21:07:52
FYI for your future configuration needs, there is nothing inherent about simple playlist view that does not allow full customization. You were using a layout with only one panel filled with the playlist. No place to add something without replacing what was there. What you would do to add a panel is temp replace the playlist with a splitter of your choice which would then give you multiple locations to add panels. Then add back the playlist in one panel and your seekbar in another.


Thanks, tpijag. That makes sense.

Zao, I got sharper though not fully sharp rendering of the waveform display by switching to Direct2D 1.0 mode, though I would prefer a fully sharp display of the solid black waveform that I get with Direct3D 9.0C mode. Anyway, great to have this feature, even with the display not being quite 100% yet.
Title: foo_wave_seekbar
Post by: SidEvolution on 2012-04-23 19:12:07
Hi!
I recently started to use waveform_seekbar and it, so far, seems pretty great. I've read a lot of what was said on here to figure out how to use it but I still have a few problems. That is, I tried to achieve the same look as Zao did in his first picture post of the component (the one that had only the edges of the wave color and the center was the background color). I couldn't figure out how to do that.
Secondly I wanted to know if it was possible to expand the waveform_seekbar, while in the CUI toolbar, to take up two rows. Just to assure clarification, what I mean by expand is that it expands vertically in the toolbar as opposed to the normal vertical expansion.
If these question were posted and answered within the 46 pages of the component I apologize for the repetition and hope not to enrage anyone.
Title: foo_wave_seekbar
Post by: Zao on 2012-04-23 22:17:13
I've got no idea how to do anything with the CUI toolbar, as I do not use it. If the toolbar supports vertical spanning, it probably works with whatever vertical spanning it has. If not, no.
Title: foo_wave_seekbar
Post by: grimes on 2012-04-23 22:50:01
Quote
Add it as a panel, not a toolbar element, then you can resize it to however you like.


http://www.hydrogenaudio.org/forums/index....showtopic=92816 (http://www.hydrogenaudio.org/forums/index.php?showtopic=92816)
Title: foo_wave_seekbar
Post by: SidEvolution on 2012-04-24 03:04:17
okay, thanks!

how about getting the colors in the actual wave to only have the edges of wave colored and the middle the color of the background?
http://www.acc.umu.se/~zao/seekbar19.png (http://www.acc.umu.se/~zao/seekbar19.png)

like the second one down that has the green highlight

and yea
I tried that before but wasn't to pleased with it so thats is why i asked again but thanks!
Title: foo_wave_seekbar
Post by: Zao on 2012-04-24 07:41:39
The second one uses the Direct2D frontend. They're intentionally different to get some variations in.
I wrote a Direct3D effect that renders a smoother line as well which I currently use - https://gist.github.com/2477148 (https://gist.github.com/2477148).
Title: foo_wave_seekbar
Post by: Milloflex on 2012-04-24 17:24:42
Love that this is even possible!! But I have some feedback.

I was hoping this would be fixed in an update, but I can see that you updated the plugin today.

My wish is to change the algorithm a bit to kinda reflect the same output as for example zippyshare does. Why? Because you really can't see where "things" happen in the music.

Take this track for example: http://www66.zippyshare.com/v/77531586/file.html (http://www66.zippyshare.com/v/77531586/file.html)
At 3m1s it gets brutal. But with your plugin you can't see that.

I also feel that the waveform isn't very detailed, or super detailed (depends on how you see it) instead of showing what's more interested. The waveform is "thick" all the way instead of showing the variations more brutally. Again, look at zippyshares for a reference.

Hope you can do anything about it. And keep up the good work! Love the idea and possibility to do this!! :-)
Title: foo_wave_seekbar
Post by: mzso on 2012-04-24 17:28:55
I just noticed the capture screenshot option. (It might be there for a while) What does it do? Other than the gui freeze I didn't notice anything.
Title: foo_wave_seekbar
Post by: Zao on 2012-04-24 20:30:19
I accidentally put the screenshot functionality in the latest (0.2.21) build as I rushed it out to fix a resume-from-hibernate/sleep crash.

The screenshot functionality is controlled via advanced preferences.
There's a size setting and a titleformat string for naming the file.
If the path is just a filename, it ends up as a PNG in My Pictures.
If it's a full path, it probably ends up in that location with that name.

This functionality only works with the Direct3D9 frontend, as I haven't been arsed to implement it for the other ones. Expect it to be unstable.
Title: foo_wave_seekbar
Post by: mzso on 2012-04-24 21:16:58
I accidentally put the screenshot functionality in the latest (0.2.21) build as I rushed it out to fix a resume-from-hibernate/sleep crash.

The screenshot functionality is controlled via advanced preferences.
There's a size setting and a titleformat string for naming the file.
If the path is just a filename, it ends up as a PNG in My Pictures.
If it's a full path, it probably ends up in that location with that name.

This functionality only works with the Direct3D9 frontend, as I haven't been arsed to implement it for the other ones. Expect it to be unstable.


It seems to work fine.
(http://www.abload.de/img/ironmaiden-01.whereeayyznb.png)
On thing that I miss is the auto renaming feature.
Title: foo_wave_seekbar
Post by: Zao on 2012-04-24 23:31:44
What auto renaming feature? You can use whatever titleformatting string you want (probably).
Title: foo_wave_seekbar
Post by: SidEvolution on 2012-04-25 00:42:21
Ah my problem was that for some reason all of the files weren't being read in correctly so I re-downloaded and copy pasted them back into the components folder and restarted foobar. It now recognizes a difference between the GDI, direct3 9 and the direct2
before, it was just rerouting to the GDI
Title: foo_wave_seekbar
Post by: White_Shadow on 2012-04-25 08:06:26
It seems to work fine.


For me, it always exports the same waveform, although I wanted to export another waveform. It simply generates another PNG with the Name of the target waveform but with the image of an earlier waveform.
Title: foo_wave_seekbar
Post by: Zao on 2012-04-25 11:36:38
Ah my problem was that for some reason all of the files weren't being read in correctly so I re-downloaded and copy pasted them back into the components folder and restarted foobar. It now recognizes a difference between the GDI, direct3 9 and the direct2
before, it was just rerouting to the GDI

Please do not attempt to install components manually, and definitely do not paste them into the 'components' directory.
Components have for a good while now been installable through the Preferences->Components page, either by dragging the archive directly onto that window, or by pushing the Install button there.
Manual installations are error-prone, as you might've noticed
Title: foo_wave_seekbar
Post by: Zao on 2012-04-25 11:37:38
For me, it always exports the same waveform, although I wanted to export another waveform. It simply generates another PNG with the Name of the target waveform but with the image of an earlier waveform.

Are you actually playing the track you're trying to export, or just selecting it? The dumper only dumps the one currently rendered.
Title: foo_wave_seekbar
Post by: White_Shadow on 2012-04-25 12:29:43
Yeah. I'm playing it. That's the way, I expected its behaviour.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-04-25 13:06:05
I accidentally put the screenshot functionality in the latest (0.2.21) build as I rushed it out to fix a resume-from-hibernate/sleep crash.

The screenshot functionality is controlled via advanced preferences.
There's a size setting and a titleformat string for naming the file.
If the path is just a filename, it ends up as a PNG in My Pictures.
If it's a full path, it probably ends up in that location with that name.

This functionality only works with the Direct3D9 frontend, as I haven't been arsed to implement it for the other ones. Expect it to be unstable.


Can you remove the "Capture screenshot" entry from the context menu when in GDI or Direct2D mode?
Title: foo_wave_seekbar
Post by: Zao on 2012-04-25 14:34:30
Can you remove the "Capture screenshot" entry from the context menu when in GDI or Direct2D mode?

Maybe. Haven't really determined whether I'm going to keep it in at all, really. It was not intended to be released, forgot to put it in a branch.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-04-25 14:42:46
Ok, thanks!
Title: foo_wave_seekbar
Post by: tribaljet on 2012-04-25 19:12:25
The second one uses the Direct2D frontend. They're intentionally different to get some variations in.
I wrote a Direct3D effect that renders a smoother line as well which I currently use - https://gist.github.com/2477148 (https://gist.github.com/2477148).


Would it be possible for you to add to the first post of the thread a few different presets like the one you posted on the quoted post? Having a tutorial on how to do it by ourselves would also be immensely useful.
Title: foo_wave_seekbar
Post by: derty2 on 2012-04-25 21:16:42
I'm using Win XP + foobar2000 v1.1.10 + Columns UI + Waveform Seekbar v0.2.15 with GDI in a Columns UI panel

The Waveform Seekbar does not render anything when I load and play Audio CD's; The panel is always blank !
I load an Audio CD into a fb2k playlist, right click on a track and go to 'Utilities -> Extract Seekbar Signature' ,
The CD Drive starts spinning out of control and will not slow down until I kill foobar2000.
Does this component have known limitations with Audio CD's ?

I have also noticed a few FLAC tracks which render most of the waveform except for the last 5-10 seconds !
Does this component have known limitations with some audio files ?
Title: foo_wave_seekbar
Post by: Zao on 2012-04-25 21:57:41
Does this component have known limitations with Audio CD's ?

Yes, it explicitly forbids CDDA and ignores it, among other formats. It should not attempt to read anything whatsoever from it. It's largely pointless to allow it to scan discs, at least automatically, as you cannot read a CD concurrently.
Your mad spinning might be a bug somewhere.

I have also noticed a few FLAC tracks which render most of the waveform except for the last 5-10 seconds !
Does this component have known limitations with some audio files ?

Your files may have incorrect metadata or be otherwise corrupted. Is the problem that the right side is not the end of the song, or that there's silence in the last few seconds?
Title: foo_wave_seekbar
Post by: derty2 on 2012-04-26 00:12:37
^ the right side is not the end of the song .

The last file I noticed with this error was a few days ago; I must say it was a FLAC file living on my filesystem for many years which I thought I had lost
and I have no information on the source; maybe you are right, it could be corrupted. But it plays just fine all the way to the end, except for the fact
that the Waveform Seekbar will not render the last 5 or so seconds.

Is there anything I can do to repair it?
Title: foo_wave_seekbar
Post by: Dandruff on 2012-05-02 16:03:43
Minor bug in 0.2.21 I think:

-> playback internet stream (http://205.188.215.225:8018 )


Result: after a while the shaded color becomes Grey

Doesn't happen in Direct2D or Direct3D mode. Backgound color always = Light Purple.


______________________
Windows XP SP3
Title: foo_wave_seekbar
Post by: Zao on 2012-05-02 16:48:06
When playing a stream or content without a size, the window represents an empty waveform of one second.
As such, the position indicator will quickly fly past and leave the shaded progress, if any.

I don't really have a decent idea about what to show for streams, this has sufficed thus far, as the presence of the indicator hints that it's actually playing, which I find useful.

Of course, you might've run into some fun bug with the GDI mode, haven't really touched that much at all since it appeared.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-05-02 16:53:30
When playing a stream or content without a size, the window represents an empty waveform of one second.
As such, the position indicator will quickly fly past and leave the shaded progress, if any.

I don't really have a decent idea about what to show for streams, this has sufficed thus far, as the presence of the indicator hints that it's actually playing, which I find useful.



I know. I don't have a problem with this. I just don't understand why the shaded color in GDI mode goes to Grey at some time instead of staying at Light Purple color like in the DirectX modes ...
Title: foo_wave_seekbar
Post by: BuzzOff on 2012-05-03 01:41:17
This is the feature I was always waiting for! This is the feature that makes foobar2000 the only right music player for me. This is the only cause that I registered here just to thank you for that!

Thank you! You're great! Keep it up and updated!
Title: foo_wave_seekbar
Post by: mzso on 2012-05-03 09:46:08
I don't really have a decent idea about what to show for streams, this has sufficed thus far, as the presence of the indicator hints that it's actually playing, which I find useful.

Real time moving waveform?
Title: foo_wave_seekbar
Post by: Zao on 2012-05-03 10:08:04
With the current and foresee-able future architecture - impossible.
Title: foo_wave_seekbar
Post by: mzso on 2012-05-03 15:48:54
With the current and foresee-able future architecture - impossible.

What do you mean by that? I'd think that Directx rendering is fast.
Title: foo_wave_seekbar
Post by: Zao on 2012-05-03 16:17:44
Display presentation rate is not the problem. The problem is that the whole component is designed around a storage of waveforms representing a track of known length, all pre-computed at the time of display.
Changing the waveform triggers relatively costly updates in frontends, which is acceptable as it only happens about once per time you play a track.

It's designed to work this way, and the structure of the codebase is not remotely pliable for dynamic updating of the waveform data, nor scrolling/zooming around interactively.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-05-04 07:43:54
But definitely the best idea. Same look as current waveform, just scrolling live.
Title: foo_wave_seekbar
Post by: Boiled Beans on 2012-05-17 18:08:12
After much tinkering, the waveform and seekbar are now sharp (no ugly fading).  That's the extent of my progress.


What did you change to make the waveforms sharp with no fading?
Title: foo_wave_seekbar
Post by: Boiled Beans on 2012-05-17 19:46:07
After much tinkering, the waveform and seekbar are now sharp (no ugly fading).  That's the extent of my progress.


What did you change to make the waveforms sharp with no fading?


Probably I should elaborate more on my question.
https://docs.google.com/open?id=0B0VzdFckXFt3WG9lY0VpRHZWS0U (https://docs.google.com/open?id=0B0VzdFckXFt3WG9lY0VpRHZWS0U)
The screenshot shows the Direct2D, Direct3D and GDI in order.

In the Direct2D and GDI, the peaks are clearly seen, while in Direct3D, the peaks are smoothened and reduced.

So firstly, is there any advantage to using Direct3D over Direct2D?

If Direct3D does really have an advantage, how can I remove the smoothened peaks, so it looks like Direct2D or GDI?
Title: foo_wave_seekbar
Post by: Zao on 2012-05-18 11:06:26
The fundamental difference is how I use the waveform data in the Direct2D frontend vs. the GDI and Direct3D ones.

The data used for a waveform is two sets of two thousand datapoints, equally spaced along the track.
Each point records the minimum and maximum amplitude in that region.

In the Direct2D mode, I tell the API to draw a spline with all the datapoints, even though there are too many to fit in the window and rely on it to do a half-arsed job antialiasing the curves.

In the other modes, the amplitude drawn is a mix of the two closest bins, so it has a tendency to remove single-bucket transients. If your window was >2k pixels wide, there wouldn't be as much of a difference.

The unfilled line outline shader (https://gist.github.com/2477148) takes a bit more information into consideration, so it might give you a reasonable effect. One could possibly adapt it to do more taps, but I'm unsure if there's enough instructions left to do that.
Title: foo_wave_seekbar
Post by: Boiled Beans on 2012-05-18 17:58:53
The fundamental difference is how I use the waveform data in the Direct2D frontend vs. the GDI and Direct3D ones.

The data used for a waveform is two sets of two thousand datapoints, equally spaced along the track.
Each point records the minimum and maximum amplitude in that region.


Thanks for your reply. This leads to another question.
If I choose Direct3D now, and decide to switch to Direct2D in future, would it be necessary to rescan all the files?
Title: foo_wave_seekbar
Post by: White_Shadow on 2012-05-18 18:22:29
@ Boiled Beans:

Of course not. The drawing mode decides only how to display the data in your waveform cache. The data won't be affected.
Title: foo_wave_seekbar
Post by: dts350z on 2012-05-25 20:52:01
Could we please have checksum or other method on the wavecache.db so that changes to the audio file are reflected in the waveform without having to delete the waveformcache.db?

Thanks!
Title: foo_wave_seekbar
Post by: Zao on 2012-05-25 22:38:42
Checksums are utterly useless for this. Computing the checksum on something costs the same magnitude as computing the waveform.
The feature you _should_ be nagging about is the one that does some kind of media library notifications.

Anyway, if you re-scan waveforms with the context menu, the waveform should be updated. You might have to frob the "Always rescan" advanced preference for this. The default is that tracks are to be considered forever immutable, because that's the norm.
Title: foo_wave_seekbar
Post by: dts350z on 2012-05-25 23:30:54
Checksums are utterly useless for this. Computing the checksum on something costs the same magnitude as computing the waveform.
The feature you _should_ be nagging about is the one that does some kind of media library notifications.

Anyway, if you re-scan waveforms with the context menu, the waveform should be updated. You might have to frob the "Always rescan" advanced preference for this. The default is that tracks are to be considered forever immutable, because that's the norm.



I checked "Always rescan if requested by user"

restarted foobar. Don't see any change in behavior. Don't see any change in right click in the waveform (still just configure) or right click on a track.

Am I looking for trackname --> right click --> utilities --> remove waveform seekbar signature?

That seems to work except I'd have to load the track, remove the signature and re load the track (to get the waveform to update).

Easier than deleting the whole database I guess.

Title: foo_wave_seekbar
Post by: Zao on 2012-05-26 13:20:14
The intended semantics with that option enabled is that Extract will rescan and overwrite the previous waveform and should display the new one on the next play.
Title: foo_wave_seekbar
Post by: xnamkcor on 2012-06-05 00:40:31
http://www.foobar2000.org/components/view/foo_wave_seekbar (http://www.foobar2000.org/components/view/foo_wave_seekbar)

The "Download" Link downloads a file called "foo_wave_seekbar-0.2.21.fb2k-component", which does not show up in the file browser opened by the "Install..." option.
It seems to be a PK zip file. If I extract it with 7zip and repackage it as a .zip file the "Install..." option sees it and it installs fine, but why the weird file extension?
Title: foo_wave_seekbar
Post by: White_Shadow on 2012-06-05 00:53:52
I'm confused... I've tested with my installation of f2k. The download dialog shows already the option to open directly in f2k and install the component. And the "install..." option works fine, too. Which version of foobar2000 are you using? See changelog (http://www.foobar2000.org/changelog), version 1.1.11:
Quote
New .fb2k-component file type extension for foobar2000 component packages.
Title: foo_wave_seekbar
Post by: Zao on 2012-06-05 01:04:57
You must be running a very old foobar2000 installation. They have supported .fb2k-component for a very long while now, and any new components will be released in this (renamed zip) format.
There are many gains, including the ability to associate the files and to filter/find them easier.
Title: foo_wave_seekbar
Post by: xnamkcor on 2012-06-05 01:22:25
I'm on 1.1.10.
For some reason the Changelog has no release dates for any version. Stange thing to omit from a log. I'll update. Thanks.
Title: foo_wave_seekbar
Post by: Peter on 2012-06-05 09:30:01
In case you're running an outdated foobar2000 version or a portable installation, instructions in http://wiki.hydrogenaudio.org/index.php?ti...all_a_component (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:How_to_install_a_component) still work (which is linked at the bottom of each component page for your convenience).
Title: foo_wave_seekbar
Post by: matt the cat on 2012-06-05 15:29:50
Is there any difference between Direct2D and 3D modes? Anything performance related or anything? Wondering which one I should use, you could think 2D as what its rendering is 2D.

Seems like Direct2D is the most accurate visually in depicting what the true waveform is like, GDI and 3D dont seem to show peaks properly, they seem "muffled" if you can say that of an image

Looks like 3D is the worst in rendering peaks, GDI is slightly better but 2D is the most accurate

The fundamental difference is how I use the waveform data in the Direct2D frontend vs. the GDI and Direct3D ones.

The data used for a waveform is two sets of two thousand datapoints, equally spaced along the track.
Each point records the minimum and maximum amplitude in that region.

In the Direct2D mode, I tell the API to draw a spline with all the datapoints, even though there are too many to fit in the window and rely on it to do a half-arsed job antialiasing the curves.

In the other modes, the amplitude drawn is a mix of the two closest bins, so it has a tendency to remove single-bucket transients. If your window was >2k pixels wide, there wouldn't be as much of a difference.

The unfilled line outline shader takes a bit more information into consideration, so it might give you a reasonable effect. One could possibly adapt it to do more taps, but I'm unsure if there's enough instructions left to do that.



Interesting, however there is a slight difference between GDI and 3D as well as I said above.
Title: foo_wave_seekbar
Post by: LosMintos on 2012-06-05 16:10:35
I very like the wave_seekbar, it's a great component! From the fist use I'm wondering: Can we have coloured waveforms respecting the frequency of the sound: bass = red, mid = green and treble = blue? You probably know it from many DJ applications. (I probably missed something. If so, it would be nice if someone points me into the right direction since my search here was without results.)
Title: foo_wave_seekbar
Post by: Zao on 2012-06-11 19:03:02
People have suggested moods, tempo, foot-tappityness and other metrics, but no, none of those are considered for inclusion.

By the way, 0.2.23 is out, with slightly less horrible downmixing for formats that are not mono, stereo, quad, 5.1, or 7.1.
Title: foo_wave_seekbar
Post by: DarkScythe on 2012-06-12 15:26:23
Could one of you people that have the frontend settings trouble export a theme file (assuming you use the Default UI)?
That is, coincidentally, the sane way of preserving any settings.


It's been a while, but I thought I'd pop back with a quick update.
I'm upgrading my PC again, and so I needed to backup my Foobar stuff.

I never actually did fix this problem, so I was unable to get to the frontend settings.
I tried exporting, but it kept failing to do so because of a missing panel. (It turns out it was WSH Panel that I had removed, but not from some test layouts I had.)

Anyway, I wound up with a last resort of updating the component to the latest version, then relaunched Foobar, and I was able to access the frontend settings again. This time I've copied it off into a text file.
Simple solutions.. go figure.
Title: foo_wave_seekbar
Post by: Pixel Eater on 2012-06-29 07:58:53
I could have sworn "Capture Screenshot" worked initially. I remember because I produced an image that was 1024 x 1024 and thought that looked really funny for a waveform. After reinstalling Windows and copying over my AppData/roaming profile, it no longer functions. Is there a way to do a clean install of Waveform Seekbar, where upon reinstallation it won't remember my configuration settings like color and position?

Also I ran into really strange issues after deleting wavecache.db one time. I thought "wow, so that's why my AppData folder got so huge, I'll just let foo_wave_seekbar start a new one. Well foobar was very wonky after that, taking several seconds to produce waveform images and skipping through songs. The problem actually got worse over a few days as I played more music. Luckily I found a backup.

I'm just hoping there's a way to do a true clean uninstall and reinstall, without affecting the rest of my configuration.
Title: foo_wave_seekbar
Post by: Zao on 2012-06-29 14:21:21
There's three places where the seekbar keeps state:

What codecs were the affected songs using, and roughly how many tracks did you have before destroying it?
Title: foo_wave_seekbar
Post by: Brand on 2012-07-05 09:56:28
What are the differences, if any, between using Direct2D, Direct3D and GDI in terms of performance, GPU usage?

My priority is low GPU heat and GPU/system stability. (Using Windows 7 and a very old ATI X1300 Pro with bad cooling.)

Thanks in advance!
Title: foo_wave_seekbar
Post by: Zao on 2012-07-05 10:36:28
GDI would win there, on virtue of not using the GPU. It might however be a bit expensive CPU-wise due to re-blitting the static waveform image repeatedly.
D3D would probably be decent if you lower the update rate in advanced properties some.
D2D I have no idea about, but it probably leverages some 3D tech in the background.

GDI and D2D both draw a static cached image with the position and shade overlaid, while D3D rerasterises everything.

Try them and see, Process Explorer's GPU utilization meter might give you some insight.
Title: foo_wave_seekbar
Post by: Brand on 2012-07-05 12:52:15
I tried now quickly with Process Explorer and it seems like GDI even uses very little CPU, comparable to D2D (which also uses a little bit of GPU).
D3D uses the most of both CPU and GPU.
Title: foo_wave_seekbar
Post by: l_0ver on 2012-07-12 08:09:33
[feature request] Could you add customizable (fields, font, transparency etc.) label over waveform?
Title: foo_wave_seekbar
Post by: Dandruff on 2012-07-18 12:59:31
I accidentally put the screenshot functionality in the latest (0.2.21) build as I rushed it out to fix a resume-from-hibernate/sleep crash.

The screenshot functionality is controlled via advanced preferences.
There's a size setting and a titleformat string for naming the file.
If the path is just a filename, it ends up as a PNG in My Pictures.
If it's a full path, it probably ends up in that location with that name.

This functionality only works with the Direct3D9 frontend, as I haven't been arsed to implement it for the other ones. Expect it to be unstable.


Can you remove the "Capture screenshot" entry from the context menu when in GDI or Direct2D mode?


Any chance? Still there in 0.2.27 ...
Title: foo_wave_seekbar
Post by: Zao on 2012-07-18 13:41:53
Out of sight, out of mind.

Quite tempted to just patch it out completely. It's not production-ready anyway.
Title: foo_wave_seekbar
Post by: Pixel Eater on 2012-07-19 17:27:20
What codecs were the affected songs using, and roughly how many tracks did you have before destroying it?


Not just a ton of tracks, I must have had it for 2 weeks and Wavecache was like ~70 MB at the time. Everything I listen to is pretty much FLAC.

By the way, why do waveforms look so different in GDI and DirectX 9 mode? Which do you recommend? FWIW I really would enjoy and use GDI screenshot capabilities, if it's doable later.
Title: foo_wave_seekbar
Post by: Zao on 2012-07-19 20:07:07
I recommend the one that pleases you the most. It's all lies.
Title: foo_wave_seekbar
Post by: Slamvan on 2012-08-08 22:27:40
Hi, please explain the beginner how to insert a picture into the background, or make it Standard tubing, transparent.
Now I use:
Code: [Select]
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 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 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 )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(sTex, tc.x);
if (replayGain.g != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 2; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2; //use album 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;

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

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();
}
}
Title: foo_wave_seekbar
Post by: Zao on 2012-08-09 01:34:58
Tubing?

Anyway, the functionality to load textures is probably not working, so even if I authored an effect that would do it, it wouldn't work.
Title: foo_wave_seekbar
Post by: Slamvan on 2012-08-09 07:07:18
I think many of my support, I would like to see this functionality.
Title: foo_wave_seekbar
Post by: Slamvan on 2012-08-09 08:43:57
I use a translator, sorry.
The background can be made ​​transparent?
Title: foo_wave_seekbar
Post by: Zao on 2012-08-09 10:47:42
It cannot be made to show a hole through the window to display the desktop or other windows.
It cannot be (sanely) made to show other child windows below it, in case you're using Columns UI with panel stack splitter or something.

It's just not within the reach of the current technical solution and the time I have to invest.
Title: foo_wave_seekbar
Post by: Slamvan on 2012-08-09 12:31:33
You do not understand me. We need to do
(http://alexey.shuksto.name/data/uploads/fb2k/foo_wave_seekbar_bg_border_bug.png)
I need a pseudo-transparency
http://www.hydrogenaudio.org/forums/index....st&p=680424 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77490&view=findpost&p=680424)
Title: foo_wave_seekbar
Post by: ianc on 2012-08-14 06:03:44
Hi,
I am using Foobar (version1.1.13) to convert 24 bit/48 khz WAV files to 24-bit FLAC files.  I am then trying to play these 24-bit FLAC files in Foobar with the Waveform Seekbar (version 0.2.27).  I'm finding that these 24-bit FLAC files will not display in the Waveform Seekbar; the seekbar just appears completely blank if I try to play a 24-bit FLAC file.  If I select "auto" bitdepth when converting WAV to FLAC, the Waveform Seekbar also comes up blank when I play the resulting FLAC files.  However, if I convert my WAVs to 16-bit FLAC, these files will play just fine in the Waveform Seekbar, as will 24-bit WAVs.  I would love to be able to view 24-bit FLAC files using the Waveform Seekbar, so I'd appreciate ay thoughts or recommendations. 

I have not used dither when converting from 24-bit WAV to 24-bit FLAC; I am unsure if I should use dither when performing this conversion?

Thanks,
Ian



Title: foo_wave_seekbar
Post by: Garf on 2012-08-14 07:02:35
I have not used dither when converting from 24-bit WAV to 24-bit FLAC; I am unsure if I should use dither when performing this conversion?


No need to use dither, in fact you should never when converting to a lossless format at the same bit-depth. Dither is useful when you're going 24->16 bit for example.
Title: foo_wave_seekbar
Post by: derty2 on 2012-08-14 11:14:27
I'm using foobar2000 v1.1.10 with Columns UI v0.3.8.8 and Waveform Seekbar v0.2.15.

My Waveform Seekabr is rendering all of these WAV and FLAC resolutions -regardless of dither- without any problems:
24/44 | 24/48 | 24/88 | 24/96 | 24/192 | 32/96 | 32/192
Title: foo_wave_seekbar
Post by: ianc on 2012-08-14 17:25:31
Thanks for the comments so far.  I should add that these are MONO 24-bit FLAC files giving me problems with Waveform Seekbar, in case that has any bearing on what the issue might be.
Title: foo_wave_seekbar
Post by: lvqcl on 2012-08-14 17:35:00
Quote
these are MONO 24-bit FLAC

which reminds me about this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=93037)
Title: foo_wave_seekbar
Post by: derty2 on 2012-08-14 18:10:50
You know, the 'problem' I had with 24-bit Mono FLAC in that thread does not seem to apply to my foobar2000 anymore !!!

Last week, a friend of mine was testing his vinyl ripping skills and ripped a few tracks from a Mono album and gave me a listen.
He uses an Apple MAC computer .
He packaged the files as 2-channel Mono .

Dragging the tracks into my foobar2000 Playlist Viewer, The track properties tell me: Encoder=TwistedWave | Tool=reference libFLAC 1.2.1 20070917 .
The tracks play perfect, and all Properties are showing correct info, and Waveform Seekbar renders without errors.

I then converted the tracks to 1-channel FLAC with DSP Processing "Downmix channels to mono", and I got perfect playback specs again.

So this leaves me a bit confused; since I posted that topic (see link posted by LVQL above) I don't seem to have the 24-bit FLAC Mono problem anymore !!??
I can't remember what -if anything- I may have changed.

Digging into my memory scraps and trying to remember what config changes I have applied in my foobar2000 since Jan 2012,
The major thing I have done is remove all rarely or never used used components; aiming for a minimum list of third-party items .
I also reviewed all Panels and UI elements and tried to remove Panels and UI elements which have duplicate or redundant functionality; aiming for a minimum list of items .
I also reviewed all WSH Scripts and Title-Formatting syntax to eliminate bad or redundant logic .

Is it possible that any/all of those config changes had some effect of "repairing" this Mono issue? ...or am I dreaming.
Title: foo_wave_seekbar
Post by: ianc on 2012-08-14 18:11:55
Quote
these are MONO 24-bit FLAC

which reminds me about this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=93037)


Success!  I had been using flac encoder version 1.2.1b.  Following a link in the thread above, I downloaded "flac_1.2.1_mod4".  Using mod4 to convert 24-bit WAV to 24-bit flac, the waveform seekbar displays the resulting flac files perfectly.

Thanks for the help.
Title: foo_wave_seekbar
Post by: derty2 on 2012-08-14 18:46:04
ianc, Did your problem also relate to the 4 GB size limit problem in standard FLAC builds?
I assume that is the main reason that modded build of FLAC was compiled.
These 24-bit Mono FLAC files which caused you problems, were they converted from +4 GB WAV files?
Title: foo_wave_seekbar
Post by: ianc on 2012-08-14 19:23:06
[quote name='derty2' date='Aug 14 2012, 17:46' post='805288']
ianc, Did your problem also relate to the 4 GB size limit problem in standard FLAC builds?
I assume that is the main reason that modded build of FLAC was compiled.
These 24-bit Mono FLAC files which caused you problems, were they converted from +4 GB WAV files?
[/quote

No, the original 24/48 WAV files were all under 0.1 GB (mostly < 5-minutes duration).  Interesting that this mod seems to do the trick.  Does anyone know if this mod will be built into the regular FLAC for windows package in the future? 
Title: foo_wave_seekbar
Post by: Zao on 2012-08-15 00:43:20
So the FLAC problem was not my fault. That's nice to hear. 
Title: foo_wave_seekbar
Post by: studio13 on 2012-08-16 21:20:25
If you have the time I would really appreciate your advice with one more thing. The path I have set for my "Music Library" is a network disk with over 11,000 full resolution .wav files. Most are less than 60seconds long. over time I will end up auditioning each one of these files. I'm concerned that I have no idea how the waveform overviews are managed. Is there some hidden directory somewhere that stores the waveform overview? Am I filling up a local directory or is it writing back to the network disk ?? Is there a process for managing the overview files ?? Thanks

The backing storage for the component is a sqlite3 database file in your foobar2000 profile directory, named 'wavecache.db'. It stores the queue of pending scans (which persists over restarts) and it stores the waveforms as compressed binary blobs. A single stereo track takes around 20 KiB or so. I've considered to have per-directory databases or so, but never really got a good use case to warrant implementing it.


Hey just wanted to report that my 'wavecache.db' is now over 1gig heading towards 1.5gig ... what happens when it gets this big ??? I'm scared ..
Title: foo_wave_seekbar
Post by: db1989 on 2012-08-16 22:34:05
Does anyone know if this mod will be built into the regular FLAC for windows package in the future?

The more relevant question is whether there is a future (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=96458&view=findpost&p=805075).
Title: foo_wave_seekbar
Post by: Zao on 2012-08-16 22:41:15
Hey just wanted to report that my 'wavecache.db' is now over 1gig heading towards 1.5gig ... what happens when it gets this big ??? I'm scared ..

The database library supports files up to 2 terabytes in size, so unless you're on FAT32, nothing ill ought to happen. Probably.
Title: foo_wave_seekbar
Post by: studio13 on 2012-08-23 20:28:44
The database library supports files up to 2 terabytes in size, so unless you're on FAT32, nothing ill ought to happen. Probably.
OK thanks I feel better now. I'm very grateful for your work on maintaining foo_wave_seekbar it's been a huge help to me.
Title: foo_wave_seekbar
Post by: muchnot on 2012-08-24 17:46:25
hi, is there any ui i can use say under the waveform that i can tag parts of a tune much like on soundcloud, but more for notes to self on structures of tunes, and if these notes could be then saved and recalled when i open a said tune? im a foobar noob who only started using strictly for the waveform display.
btw i dont use mac but there is a similar idea im looking for on this program http://itunes.apple.com/us/app/transitions...460127911?mt=12 (http://itunes.apple.com/us/app/transitions-player/id460127911?mt=12) 
im a music producer and this feature would be awesome Zao
Title: foo_wave_seekbar
Post by: Dandruff on 2012-09-15 10:25:20
foobar2000 1.1.5 Troubleshooter gives this:

Code: [Select]
foobar2000 troubleshooter
The following components found on your system are known to be problematic and should be either uninstalled or updated to their latest versions:

foo_wave_seekbar.dll : Waveform seekbar 0.2.27
Reason: Repeated crash reports.
Download the latest version...


Any serious issues with 0.2.27?
Title: foo_wave_seekbar
Post by: Zao on 2012-09-15 14:48:07
Any serious issues with 0.2.27?

Nothing I can recall off-hand, but I haven't looked at the crash dumps lately.
Sadly, many users of this component also use the unstable horrible skin-type components that has a nice tendency to ruin the stability of the process.
I blame everyone but me
Title: foo_wave_seekbar
Post by: Dario on 2012-09-16 11:53:55
Feature request: Remove waveforms of tracks not in the media library. Self-explanatory, I hope.
Title: foo_wave_seekbar
Post by: Zao on 2012-09-20 18:06:01
I'm looking at changing around the way the style of the seekbar is selected.

The current approach is having the three distinct frontends, where for the Direct3D one you happen to be able to provide effect source to customize that particular instance.

I instead suggest a preset system with styles that are easy to share and backup, which transparently would use whatever frontend needed to render it.
I'm a bit unsure as to how many of you that actually have customized effects, if you wrote them yourself from scratch, adapted the stock effect, adapted an effect from someone else, or just use an effect as-is from others.
I'm also curious as to how many use the GDI (software) and Direct2D 1.0 frontends.

Additionally, I'm a bit curious as to if there are any surviving XP users around. It's getting more and more bothersome to target XP and well as Direct3D 9. It would be very nice to know if it's finally possible to move on, as I do not have any machines running XP anymore to test the corner cases of the completely pants-on-head stupid device reset model that D3D9 has. Upstream compiler support for XP, D3DX and D3D9 is gone, and the OS itself will be properly EoS:ed Real Soon Now.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-09-20 18:20:14
I'm using GDI (less DLLs needed) on WinXP SP3.
Title: foo_wave_seekbar
Post by: mezenga on 2012-09-20 20:36:35
I´m using the stock effect with the GDI frontend on Win7.
Title: foo_wave_seekbar
Post by: Emerelle on 2012-09-20 21:10:08
Using D2D 1.0 on Windows 7 - I couldnt get the GDI version to run on my XP (main!) desktop computer and had to remove the component due to crashes.
My Windows 7 netbook only has some custom colours, nothing too complicated.
Title: foo_wave_seekbar
Post by: ledge on 2012-09-21 01:11:43
I'm using xp gdi on one and direct 3d on another. That said if I were you, I'd drop xp support. People like me can just stay with the current version. Both xp boxes are work machines. My home pc is windows 7.
Title: foo_wave_seekbar
Post by: Zao on 2012-09-21 01:54:45
I do most definitely not want anyone to stay on a version with known problems. The last thing I want is a repeat of the horde of people like the ones staying on ancient foobar versions due to their favorite SDK-violating or unmaintained component not surviving an API bump.

I wouldn't really say that 0.2.27 is in any state to be a viable long-term solution for anyone, and any new fixes wouldn't percolate down to it.

I wanted to get a feeling for where my userbase is at, due to not having any kind of telemetry data available at all. There'll always be some people refusing to migrate from their entrenched legacy operating systems like Wish, but at some point one has to cut the losses.

That point is probably not quite yet, but I'm getting really annoyed with the kind of people that make Microsoft chicken out on promises to euthanize the bloody OS.
Title: foo_wave_seekbar
Post by: tribaljet on 2012-09-21 02:30:07
I've used GDI, D2D and D3D, but I'm currently on D3D.

In any case, all have been on Windows 7, some friends of mine were still running Vista, and very little on XP.

If you feel the current version isn't a proper long term solution for legacy systems, then perhaps it would be best to release a final version with a few fixes that's still compatible with XP, then announce it will no longer be supported, allowing you to focus on Vista/7/8.
Title: foo_wave_seekbar
Post by: fuflo on 2012-09-21 06:02:07
gdi on win8 rtm. i would probably use d3d but with my custom effect which i would make, and which i'm too lazy to make - at least right now.
Title: foo_wave_seekbar
Post by: mudlord on 2012-09-21 07:38:08
gdi on win8. Why.
Use Direct2D or something.
Title: foo_wave_seekbar
Post by: foosion on 2012-09-21 10:39:20
D2D on Win7. I toyed with D3D and custom effects in the beginning but settled for D2D because I like the look.
Title: foo_wave_seekbar
Post by: Zao on 2012-09-21 11:16:40
If you feel the current version isn't a proper long term solution for legacy systems, then perhaps it would be best to release a final version with a few fixes that's still compatible with XP.

That's a bit of the problem right there - in order to find and fix the current set of crashes, I'd probably have to tear down and rejigger a fair bit of the core that happens to be stable for most of the user base. The architecture of this component wasn't designed in any way, it's mostly an organic growth of excellent and way less excellent ideas. It's a bit ... resistant to change.

The only reason I haven't made breaking changes is because I hate when people make breaking changes.
Title: foo_wave_seekbar
Post by: fuflo on 2012-09-21 15:39:15
gdi on win8. Why.
Use Direct2D or something.


GDI:


(http://i.imgur.com/QIxjn.png)

D2D:

(http://i.imgur.com/yftJY.png)




That's why. And personally i really don't like d3d due to it's smoothness. I need sharp peaks. Is it possible with custom shader?

Title: foo_wave_seekbar
Post by: Zao on 2012-09-21 16:23:50
That's why. And personally i really don't like d3d due to it's smoothness. I need sharp peaks. Is it possible with custom shader?


You've got all the data available in the shader, you just need to sample the input texture enough and construct a nice view of it.
There's a D2D-like line drawing effect out there, which does a piecewise linear curve, much like D2D.
It might be https://gist.github.com/1329609 (https://gist.github.com/1329609), I don't have a machine I can look at it with right now.
Title: foo_wave_seekbar
Post by: Boiled Beans on 2012-09-21 18:24:22
I use D2D on my Vista computer because I like sharp peaks, just like the post above.

On my XP, selecting the D3D option froze the computer completely. The GDI waveforms looked ugly, while the D2D waveforms could not render. So I removed the component from that computer. Probably the hardware couldn't handle it.

I'm alright with removing support for XP though.
Title: foo_wave_seekbar
Post by: Dandruff on 2012-09-21 18:26:57
I'm alright with removing support for XP though.


I'm not!
Title: foo_wave_seekbar
Post by: fuflo on 2012-09-21 19:04:55
You've got all the data available in the shader, you just need to sample the input texture enough and construct a nice view of it.
There's a D2D-like line drawing effect out there, which does a piecewise linear curve, much like D2D.
It might be https://gist.github.com/1329609 (https://gist.github.com/1329609), I don't have a machine I can look at it with right now.

Well you got me tinkering around...


The linked effect does provide exact d2d effect ( or at least it seems so to me )

And i started modifying it until foobar crashed due to d3d ( not sure, don't care - yet ). Anyway, then i saw that i only need to triple the 'factor' var in evaluate() in the default shader to get very sharp peaks. So i'm all set on that, now just need to modify played() so that only the waveform is shaded, not the background. Will probably play around tomorrow, when i'm sober  anyway, thanks for providing the interest

Title: foo_wave_seekbar
Post by: NullString on 2012-09-22 03:15:23
The architecture of this component wasn't designed in any way, it's mostly an organic growth of excellent and way less excellent ideas.


Dude.. I'm this close of making a t-shirt with that phrase!! you struck gold!
Title: foo_wave_seekbar
Post by: Zao on 2012-09-22 14:17:25
The linked effect does provide exact d2d effect ( or at least it seems so to me )

And i started modifying it until foobar crashed due to d3d ( not sure, don't care - yet ). Anyway, then i saw that i only need to triple the 'factor' var in evaluate() in the default shader to get very sharp peaks. So i'm all set on that, now just need to modify played() so that only the waveform is shaded, not the background. Will probably play around tomorrow, when i'm sober  anyway, thanks for providing the interest


Yup, the goal I had when writing it was to as close as possible model the Direct2D line list method, by computing the distance to sub-pixel line segments. It's not a perfect match, but mostly accurate.

The primary benefit of modelling it as many small line segments is that it deals much better with near-vertical lines.

As for the D3D9 crashing, that whole effect loading bits and error recovery is quite a mess and something I'd rather either remove or move out into a subprocess.

As it seems now, I'll stick with the VS10 toolchain for a while longer until legacy XP support is rolled out from MS HQ for VS11. Hopefully I've got a solution with styles that reduce the reliance on D3D9 for legacy users. I've also been toying with making the configuration GUI in Windows Forms from .NET, that would get rid of much of the shader editor instability.
Title: foo_wave_seekbar
Post by: tribaljet on 2012-09-22 14:21:55
Out of curiosity but is it possible for a preset system to be added to foo_wave_seekbar? There could be implementations of the 3 stock wavebars interchangeable between GDI, D2D and D3D as default, and user contributed presets (after being tested, of course) could then be added later to newer versions, or just be made available separately, being then usable through some form of preset import feature.
Title: foo_wave_seekbar
Post by: Zao on 2012-09-22 20:11:26
I've pondered this over time, but it would be quite tricky considering the significant difference in the frontends and what they allow.
Title: foo_wave_seekbar
Post by: tribaljet on 2012-09-23 03:27:55
That's a shame, as it's one feature I would certainly enjoy, and it would truly make customization far easier.

So, it might be too much work to make a newer version with most XP bugs fixed and setting it as the final XP version, focusing from there on to Vista, 7 and 8?
Title: foo_wave_seekbar
Post by: Zao on 2012-09-23 08:34:09
That assumes that I know what bugs there are, and know how to fix them. I've yet to dig properly into the crash reports I have for 0.2.27, where some at a glance seems to be related to the GDI fallback from D3D9, probably for a device reset after hibernation.

People have the strangest systems with odd graphics cards and drivers, not to mention tons of malware and shovelware... systems that still run XP tend to run the same install for ages.

Solving the crashes would require me to re-familiarize myself with how this abomination is supposed to work, and how it actually works. Those two concepts differ greatly in reality.

I would reckon that there's some major rejiggering needed to get that part into a stable state... I wouldn't want to release something that's worse than the current, stability-wise, particularly as a release tends to require lots of effort spent on seeing if there's fallout and handling renewed interest.
Title: foo_wave_seekbar
Post by: tribaljet on 2012-09-24 07:55:56
If XP systems seem to have that many issues with D3D9, what if D3D9 was removed from a XP version and only be available on Vista/7/8?
Title: foo_wave_seekbar
Post by: Dandruff on 2012-09-24 08:05:05
If XP systems seem to have that many issues with D3D9


No issues here with D3D9 on XP!
Title: foo_wave_seekbar
Post by: Zao on 2012-09-24 15:31:56
If XP systems seem to have that many issues with D3D9, what if D3D9 was removed from a XP version and only be available on Vista/7/8?

The reason for that is the same reason why I still target XP. There's some innocent people for whom it still works adequately, and by removing it I would just create incitements to stay on an inferior version of the component.
There's nothing worse than an entrenched user base on a perceived "better" version when you have to deploy a criticial fix.

D3D9 will still have the completely stupid device reset mechanics, no matter what OS you put it on.
It's just more painful on XP as it resets if you stare at it, while Vista and up just reset if you do more extreme things like remove the GPU, hibernate or similiar things.

I really don't want to be in this situation, but people like Wish refuse to leave XP and I will eventually have to crush the dreams of some. Bloody luddites.
Title: foo_wave_seekbar
Post by: tribaljet on 2012-09-24 16:50:54
The whole situation is honestly to be expected. Some people will stick to what they consider to be good or better than newer versions, which on some cases can be true. However, an OS like Windows 7 simply is better than Windows XP in most regards. But don't worry, considering how things are going, Windows 7 will become the new Windows XP.

Windows XP no longer gets bugfixes of any kind and its security updates still don't make that OS as secure as any of the newer Microsoft OSes, so regardless of personal preferences, people who stick with Windows XP are riding a dying horse and endangering everyone they connect to due to that hole filled kernel that's a virus haven.
Title: foo_wave_seekbar
Post by: mzso on 2012-09-24 17:04:21
The whole situation is honestly to be expected. Some people will stick to what they consider to be good or better than newer versions, which on some cases can be true. However, an OS like Windows 7 simply is better than Windows XP in most regards. But don't worry, considering how things are going, Windows 7 will become the new Windows XP.

Windows XP no longer gets bugfixes of any kind and its security updates still don't make that OS as secure as any of the newer Microsoft OSes, so regardless of personal preferences, people who stick with Windows XP are riding a dying horse and endangering everyone they connect to due to that hole filled kernel that's a virus haven.

When did security bother those who stick with obsolete OS-es?
Title: foo_wave_seekbar
Post by: Zao on 2012-11-12 14:28:47
Version 0.2.29 was released the other day, with some fixes for Direct2D rendering not updating after locking/suspending a Windows 8 machine.

The fix for it should be benign, but if you experience any form of deadlocks, honk.
Title: foo_wave_seekbar
Post by: mjb2006 on 2012-11-13 03:32:34
The current approach is having the three distinct frontends, where for the Direct3D one you happen to be able to provide effect source to customize that particular instance.


I gave the documentation in the wiki a much-needed update to explain where the shader effect can be customized, because it was still pointing people to an external seekbar.fx file, and didn't make it clear it was only applicable to Direct3D.

I wanted to test Direct3D mode to make sure it still works for me and is customizable (I normally just use Direct2D, ever since I got a Win7 machine). So I installed the DirectX end-user runtime and at first everything looked OK..the first files I tried looked as expected. But then some files wouldn't have anything rendered for them, just the flat line in the middle, even with the default shader effect. In fact it seems to happen more often than not, but I don't see any rhyme or reason as to which files render and which don't.

There's nothing unusual in the console...the wave is always analyzed and it works fine in Direct2D and GDI modes.

What could be going wrong? Let me know if you need more info.

fb2k 1.1.14a / Win7 64-bit / Waveform seekbar 0.2.29
Title: foo_wave_seekbar
Post by: Zao on 2012-11-13 11:30:24
I would make a wild stab at the presence or absence of replaygain information, if you've got a fancier effect.

There's some special values that end up with large sentinel values to signal the absence of one or the other form of replaygain info.

I can't quite recall which right now, it's probably documented in the default effect and/or source.
Title: foo_wave_seekbar
Post by: DragonQ on 2012-11-19 22:11:37
gdi on win8. Why.
Use Direct2D or something.


GDI:

(http://i.imgur.com/QIxjn.png)

D2D:

(http://i.imgur.com/yftJY.png)

That's why. And personally i really don't like d3d due to it's smoothness. I need sharp peaks. Is it possible with custom shader?

I get the same thing on Windows 8 with Direct2D. I use Direct3D but it certainly is less "detailed" than GDI in terms of peaks shown.
Title: foo_wave_seekbar
Post by: fuflo on 2012-11-20 18:01:54
I get the same thing on Windows 8 with Direct2D. I use Direct3D but it certainly is less "detailed" than GDI in terms of peaks shown.

Open 'Frontend Settings', load default effect. Go to line 107, and enter *3 or *4 at the end of min() function in that line. Sharp(er) peaks and you can adjust it by how much you multiply it


Title: foo_wave_seekbar
Post by: mzso on 2012-11-20 20:55:31
(http://www.acc.umu.se/~zao/seekbar19.png)


Probably a stupid question, but how does one get coloring like that? I mean that the "edges" are a different (orangish) color.
Title: foo_wave_seekbar
Post by: Zao on 2012-11-20 23:30:38
That effect goes from background color at the very edge, shooting through the text color a particular distance from the outline, and goes past by that delta, in this case ending up with white saturation.

The colors used is from one of the built-in themes:
Text: R 244, G 126, B 70
Background: R 33, G 35, B 31
Selection: R 171, G 163, B 154
Highlight: R 175, G 171, B 143

There might be some effect source in earlier threads, if whatever one is built-in nowadays doesn't reproduce it.
Title: foo_wave_seekbar
Post by: mzso on 2012-11-21 16:56:49
That effect goes from background color at the very edge, shooting through the text color a particular distance from the outline, and goes past by that delta, in this case ending up with white saturation.

The colors used is from one of the built-in themes:
Text: R 244, G 126, B 70
Background: R 33, G 35, B 31
Selection: R 171, G 163, B 154
Highlight: R 175, G 171, B 143

There might be some effect source in earlier threads, if whatever one is built-in nowadays doesn't reproduce it.

I don't have a text color option, but I have a foreground colour option. Anyway copying the values (adding the ones from thext ot the foreground option) I get something similar, but still quite different.
(http://www.abload.de/img/seekbar.orangetjsyf.png) (http://www.abload.de/image.php?img=seekbar.orangetjsyf.png)
Title: foo_wave_seekbar
Post by: Zao on 2012-11-21 17:00:09
Right, foreground.

You could either make that colour a bit brighter, or add some factor to the responsible lerp in the source - the end effect should be reasonably similiar. The differences are probably mostly because your waveform is lower amplitude than the one in my shot.
Title: foo_wave_seekbar
Post by: mzso on 2012-11-21 17:13:40
Right, foreground.

You could either make that colour a bit brighter, or add some factor to the responsible lerp in the source - the end effect should be reasonably similiar. The differences are probably mostly because your waveform is lower amplitude than the one in my shot.

Oh, ok.
Title: foo_wave_seekbar
Post by: protospork on 2012-11-22 17:33:59
You're right that wasn't possible, here's an updated version which sets the background colour to the highlight colour if "shade played" is disabled. http://pastebin.com/q6qLaQ18 (http://pastebin.com/q6qLaQ18)

I'm using a lightly modified version (https://gist.github.com/4132222) of this script (mainly I've just turned the inner form back on, iirc), but I'd like to replace the inner RMS waveform with just a straight centerline the same color as the background. I thought it'd be simple, just unplug something in RMSfactor, but this language is pretty opaque to me. Could someone help me out, please?
Title: foo_wave_seekbar
Post by: Dario on 2012-11-25 11:58:22
Can anyone tell me which part of the default settings to modify so that it takes ReplayGain into consideration?
Title: foo_wave_seekbar
Post by: robertcollier4 on 2012-11-25 20:16:33
This is fantastic, thanks. It is working for me in Direct3D 9.0c mode with Intel 965 Integrated Graphics chip. If this were incorporated into Foobar2000 as a standard base component I think it would increase the popularity of Foobar2000.

I have it set to just display the "Front right" channel - why spend extra computation cycles on 'downmixing display to mono' - for most music applications just showing one channel is adequate and should be the default.

Also - when I have it set to "Store analysed tracks in mono" it seems to be using much more CPU and taking much more time. Is it spending computation time on merging the Left+Right sound tracks? Is there any way I can set it to just store "Front right" and just display "Front right" -- not do any heavy left-right merging operations (I just need simple visual to seek around within DJ sets to find song boundaries).
Title: foo_wave_seekbar
Post by: robertcollier4 on 2012-11-25 20:45:02
The waveform is very nice and pretty - but it is taking quite a bit of CPU to create - for a 1 hour music set it takes around 20 seconds of 99% processor usage using two processors of a 2.2 Ghz Core 2 Duo Intel Machine.

Is there any way to have a less pretty, less-detailed, lower frequency, lower sample-rate version that is snappy and quick to create? Something like Soundcloud does. I feel the seekbar signature shouldn't take more than 1 second of CPU time to create. I feel the CPU does not need to sample so heavily to create such a detailed bar that is just going to be displayed in a small section of the screen anyways. Sampling at something like 5hz (5 times per second) should be way more than enough? What is the current sampling rate that is being used to build the seekbar signature?

Better yet - the sampling rate can reduce as the length of the track increases past certain thresholds. So if it is a 1 hour music set that is being indexed for seekbar signature - that is 3600 seconds to be displayed across the horizontal resolution of my screen. My screen only has 1600 pixels horizontally across anyways. So for something longer than 20 minutes - the sampling frequency can even be 1hz. 3600 bars to be displayed across 1600 pixels on an LCD screen sounds right for a 1 hr music set.

Also, I feel this could be done without requiring the DirectX end-user runtime which would open it up to much higher compatability.
http://gareus.org/wiki/sndfile-waveform (http://gareus.org/wiki/sndfile-waveform)
https://github.com/beschulz/wav2png (https://github.com/beschulz/wav2png)
http://www.schillmania.com/projects/soundmanager2/ (http://www.schillmania.com/projects/soundmanager2/)
Title: foo_wave_seekbar
Post by: lvqcl on 2012-11-25 21:00:09
So for something longer than 20 minutes - the sampling frequency can even be 1hz. 3600 bars to be displayed across 1600 pixels on an LCD screen sounds right for a 1 hr music set.


This plugin uses 2048 points which is even less than you propose: http://www.hydrogenaudio.org/forums/index....st&p=732029 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=732029)
Title: foo_wave_seekbar
Post by: robertcollier4 on 2012-11-25 21:36:12
Additionally, I'm a bit curious as to if there are any surviving XP users around. It's getting more and more bothersome to target XP and well as Direct3D 9. It would be very nice to know if it's finally possible to move on, as I do not have any machines running XP anymore to test the corner cases of the completely pants-on-head stupid device reset model that D3D9 has. Upstream compiler support for XP, D3DX and D3D9 is gone, and the OS itself will be properly EoS:ed Real Soon Now.


*Raises hand*. Lots of surviving XP users will remain - especially for music playing, lots of people (such as myself) use old laptops for music playing servers connected to speakers. You'll be glad to hear that foo_wave_seekbar is working perfectly for me with Direct3D 9.0c on Windows XP on a Thinkpad T61 with Intel 965 Integrated Graphics.

The reason is that there is simply no reason to upgrade. Only when I get an SSD will I upgrade to Win7 for the TRIM support. XP is better suited to old laptops and uses less memory and hard disk space than Win7.

Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2012-11-25 22:06:06
This is fantastic, thanks. It is working for me in Direct3D 9.0c mode with Intel 965 Integrated Graphics chip. If this were incorporated into Foobar2000 as a standard base component I think it would increase the popularity of Foobar2000.

Nothing stops anyone from recommending it on "top 10 components"-style lists, which probably gets better exposure than some strange unknown bundled UI element that no-one knows to look for.

I have it set to just display the "Front right" channel - why spend extra computation cycles on 'downmixing display to mono' - for most music applications just showing one channel is adequate and should be the default.

Also - when I have it set to "Store analysed tracks in mono" it seems to be using much more CPU and taking much more time. Is it spending computation time on merging the Left+Right sound tracks? Is there any way I can set it to just store "Front right" and just display "Front right" -- not do any heavy left-right merging operations (I just need simple visual to seek around within DJ sets to find song boundaries).

The mixdown is done after the analysis, and thus has no real impact whatsoever on the speed as it acts on at most a few thousand data points. Similarly, it shouldn't have any noticeable cost when preparing a waveform for display. It's just 2048*[1-8] averages, after all.

I dislike the notion of hiding information in a default setting. If you have needs to change it, it's mutable for a reason.

The waveform is very nice and pretty - but it is taking quite a bit of CPU to create - for a 1 hour music set it takes around 20 seconds of 99% processor usage using two processors of a 2.2 Ghz Core 2 Duo Intel Machine.

Is there any way to have a less pretty, less-detailed, lower frequency, lower sample-rate version that is snappy and quick to create? Something like Soundcloud does. I feel the seekbar signature shouldn't take more than 1 second of CPU time to create. I feel the CPU does not need to sample so heavily to create such a detailed bar that is just going to be displayed in a small section of the screen anyways. Sampling at something like 5hz (5 times per second) should be way more than enough? What is the current sampling rate that is being used to build the seekbar signature?

Assuming around 500x realtime decoding, an hour of audio takes around ten seconds to decode, let alone analyse.

Better yet - the sampling rate can reduce as the length of the track increases past certain thresholds. So if it is a 1 hour music set that is being indexed for seekbar signature - that is 3600 seconds to be displayed across the horizontal resolution of my screen. My screen only has 1600 pixels horizontally across anyways. So for something longer than 20 minutes - the sampling frequency can even be 1hz. 3600 bars to be displayed across 1600 pixels on an LCD screen sounds right for a 1 hr music set.

As linked, the analysis gathers audio linearly into 2k buckets per channel, resolving results as it goes.
If I were to seek and look at subparts of songs, it'd likely miss out on interesting features in the waveform, and would have some severe decoder seek costs.
Yes, the analysis might be "slow", but it's fast enough for the majority.

Also, I feel this could be done without requiring the DirectX end-user runtime which would open it up to much higher compatability.
http://gareus.org/wiki/sndfile-waveform (http://gareus.org/wiki/sndfile-waveform)
https://github.com/beschulz/wav2png (https://github.com/beschulz/wav2png)
http://www.schillmania.com/projects/soundmanager2/ (http://www.schillmania.com/projects/soundmanager2/)

First two are licensed under the GPL and are thus nothing I can't even look at.

As for the DirectX redist, that is solely for the use of the effect compiler and/or d3d_compiler. No matter how I spin it, if I want to compile effects, I need it present. If you use the D2D or GDI frontends, you don't need it.

I could swear I saw a mention of having to right-click, but I guess it was edited. It automagically scans (if enabled) the playing track and the next one to play, ahead of time.
Title: foo_wave_seekbar
Post by: Zao on 2012-12-01 20:21:05
I've done some ad-hoc benchmarking of a typical MP3 set, and I get around 8 seconds for a 1h20m track. Out of that, at most 2 seconds is from my code, the rest is in decoding and data shoveling.

In order to achieve any significant improvements, I'd have to decode less audio. This means that I'd have to seek, which is not remotely free. If we decide to analyze only some lumps of the track, we need to consider the implications.
Given a 1h track, we've got buckets of 1.75 seconds for each sample in the result. If we only decode half of this interval, we'll completely miss any energy and peak content of the other half. Lowering the scanned:unscanned ratio would possibly improve speed, but cause greater blindness.

In the end, the executive summary is: if you want higher speeds, use faster hardware/formats. Otherwise, do your scanning ahead-of-time or during other downtime. The analysis process is idle-priority, so it shouldn't really affect your normal operation in any way.
Title: foo_wave_seekbar
Post by: mudlord on 2012-12-02 01:43:03
You're right that wasn't possible, here's an updated version which sets the background colour to the highlight colour if "shade played" is disabled. http://pastebin.com/q6qLaQ18 (http://pastebin.com/q6qLaQ18)

I'm using a lightly modified version (https://gist.github.com/4132222) of this script (mainly I've just turned the inner form back on, iirc), but I'd like to replace the inner RMS waveform with just a straight centerline the same color as the background. I thought it'd be simple, just unplug something in RMSfactor, but this language is pretty opaque to me. Could someone help me out, please?

Thats not a script, its a pixel shader. Get your facts straight.
Title: foo_wave_seekbar
Post by: Zao on 2012-12-02 16:11:49
This means that I'd have to seek, which is not remotely free. If we decide to analyze only some lumps of the track, we need to consider the implications.


I did some quick speed tests, and seeking has a significant cost. For the Ogg Vorbis track I tried, decoding the whole track is equivalent in time to decoding 40% of the song with 2048 seeks.
The cutoff fraction for MP3 was somewhere around 85%, FLAC 65%.

All in all, the accuracy penalty isn't worth the miniscule improvement in analysis time.
Title: foo_wave_seekbar
Post by: robertcollier4 on 2012-12-10 14:38:02
Thanks. One more request. I am trying to save hard drive seeks by not scanning every single thing opened (some times I do not need the seekbar info, or am just opening something for a few seconds and then closing it).

I have unchecked "Analyze tracks not in the media library" - and the automatic signature building for everything has stopped (I don't use the Foobar2000 library anyways). But now it would be nice to be able to manually build some signatures via Right Click > Utilities > Extract Seekbar Signature. It seems that "Extract Seekbar Signature" does not work for tracks not in the media library when "Analyze tracks not in the media library" is unchecked. It would be nice if "Extract Seekbar Signature" would override "Analyze tracks not in the media library" so that there is an ability to manually choose which songs the signature will get built for and which for not. Or an option to turn off "automatic signature building" at times when the user wants to save hard disk activity -- and allow manual only operation via a button on the toolbar (the "Extract Seekbar Signature" menu item can already be added to the toolbar -- but it is missing an icon).
Title: foo_wave_seekbar
Post by: robertcollier4 on 2012-12-10 16:26:40
I figured another thing that was greatly slowing down signature creation. I had number of threads set to 2 and observed the filesystem activity with Sysinternals Process Monitor. It starts immediately creating the currently playing song in the 1st thread and the next song in the playlist in the second thread. So you have two threads which are requesting data from the hard drive at the same time. Process Monitor showed reading between File1 and File2 over and over again, switching rapidly back and forth - asking the filesystem to give it streams of two files at two different locations at the same time was causing a lot of disk thrashing.

I set the number of threads to 1 and now it is only reading one file at a time which has greatly reduced disk thrashing. Sequential read access on a single file is much faster on a spinning hard drive than random reads between two files at the same time. A huge bottleneck also is probably the rate at which the plugin can load the entire song into RAM for analysis.

Based on this - I would recommend that the # of threads be always set to 1. Parallel threads should only be run when working with in-memory objects.

Screenshot of Process Monitor with # of threads = 2:
(http://img819.imageshack.us/img819/6774/20121210220548.jpg)
Title: foo_wave_seekbar
Post by: Zao on 2012-12-10 17:43:22
The default cap for number of threads (3) is the cutoff point where a typical machine doesn't gain more from adding threads.

If your harddrives and/or file buffering characteristics are horrible enough to warrant crippling it to one thread, do so - it's configurable for a reason. What OS are you on that exhibits such horrible prediction?

I've considered fully buffering files, but that's either pointless (for small files) or unfeasible (for larger files or archives). Any solution with serial disk I/O will be pretty much equivalent to crippling yourself to a single thread anyway.
Title: foo_wave_seekbar
Post by: robertcollier4 on 2012-12-11 05:10:17
If your harddrives and/or file buffering characteristics are horrible enough to warrant crippling it to one thread, do so - it's configurable for a reason.

In my case - each of my "songs" are 1hr+ 120MB+ files so no filesystem cache is going to load two of these files fully into memory. For people using Foobar2000 with 5 min songs it is probably fine for them. Running with 1 thread with large 1hr songs fixes the problem and results in nearly sequential disk access behavior and the "thrashing" observed earlier from constantly blinking hard drive light and observed noise coming from hard disk head movement is now gone.
Title: foo_wave_seekbar
Post by: Dario on 2012-12-15 11:11:38
Can I get an answer regarding this?

Can anyone tell me which part of the default settings to modify so that it takes ReplayGain into consideration?
Title: foo_wave_seekbar
Post by: Zao on 2012-12-15 11:39:15
Can anyone tell me which part of the default settings to modify so that it takes ReplayGain into consideration?

Consideration for what area of the component?
The analysis process won't take RG into consideration in any way.
The display doesn't take RG into consideration unless you use the Direct3D frontend, where the RG parameters are available in the four-component REPLAYGAIN semantic.

Code: [Select]
float4 replayGain      : REPLAYGAIN; // album gain, track gain, album peak, track peak
Title: foo_wave_seekbar
Post by: Dario on 2012-12-15 13:17:07
Sorry for not being specific enough—I was talking about the display. I found some front-end setting that DOES take it into consideration while displaying, but the rest of it looks ugly. Guess I'll try to modify the default one myself...
Title: foo_wave_seekbar
Post by: robertcollier4 on 2012-12-26 09:56:34
My vote would still be for an option in Preferences to "Disable automatic scanning from playlist entries".

I like to load my songs into RAMDisk via the RAMDisk plugin. So I first load the song from Explorer - it loads in Foobar - then I click on "Send to RamDisk". then I click on "Send to Playlist" in the RamDisk window to send the Ramdisk file to the Playlist. This results in foo_wave_seekbar first scanning the file on the hard disk - and then again for the file on the RamDisk. I only want it to scan files that I load from my Ramdisk.

So another request (or another way of doing this) would be that there would be a path filter - "Exclude paths in pathexclude.ini". I could specify the paths from which I want foo_wave_seekbar to not scan. If I wanted to turn off automatic scanning all-together (and run in manual-only mode) - then I could specify "*" in pathexclude.ini. Otherwise I could specify specific directories from which foo_wave_seekbar should not engage in automatic signature creation.
Title: foo_wave_seekbar
Post by: mezenga on 2012-12-26 13:12:59
My vote would still be for an option in Preferences to "Disable automatic scanning from playlist entries".

Have you tried unchecking "Analyse tracks not in the media library" under "Preferences -> Advanced -> Tools -> Waveform seekbar" ?
Title: foo_wave_seekbar
Post by: Zao on 2012-12-26 14:27:03
That fails if he wants his HDD to be indexed by the media library but not scanned by the seekbar.

The "don't scan stuff not in library" setting is from a day where everyone and their mother wanted blacklists and whitelists of what to scan where. I implemented it as a trivial stopgap measure, as I didn't want to make the painful UI needed to customize location lists.

In general, the more UI a feature needs, the less I'm motivated to work on it.
Title: foo_wave_seekbar
Post by: mezenga on 2012-12-27 02:36:30
My vote would still be for an option in Preferences to "Disable automatic scanning from playlist entries".

Have you tried unchecking "Analyse tracks not in the media library" under "Preferences -> Advanced -> Tools -> Waveform seekbar" ?

I´ve just seen from early posts that you already knew this option.
I tried foo_ramdisk and found that it is mapped at the application level and can´t be added to Media Library so my suggestion wouldn´t work anyway.

The only other option I can think of is the use of a regular RAM disk.

The "don't scan stuff not in library" setting is from a day where everyone and their mother wanted blacklists and whitelists of what to scan where. I implemented it as a trivial stopgap measure, as I didn't want to make the painful UI needed to customize location lists.

Fair enough   
Title: foo_wave_seekbar
Post by: robertcollier4 on 2012-12-29 21:58:15
That fails if he wants his HDD to be indexed by the media library but not scanned by the seekbar.


When "Analyse tracks not in the media library" is unchecked - it disables all signature creation even if invoked manually. Manually right clicking on a song in playlist > Utilities > Extract Seekbar Signature - does not build the seekbar signature if "Analyse tracks not in the media library" is unchecked.

I don't use the media library at all.

Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2012-12-29 22:04:40
That's working as intended. If it's unchecked, all scanning, whether it's user-initiated or automatic is ignored on tracks that are not in the Media Library.
Title: foo_wave_seekbar
Post by: Evil Elf on 2013-01-05 15:49:23
Hi! I just registered to share my seekbar setup. I wanted to make something that looks like soundcloud's seekbar (https://soundcloud.com/lorn/on-the-ice).
I found a post from 2010 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=705262) from the user Anomalous, and edited his code a bit so it works with seekbar 0.2.29. Here's what I got:

(http://img16.imageshack.us/img16/3126/12008747.png) (http://imageshack.us/photo/my-images/16/12008747.png/)

and here's the code from frontend settings:
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(backgroundColor, highlightColor, factor);
        }
        return c;
}

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

        minmaxrms.rgb -= 0.5 * minmaxrms.a;
        minmaxrms.rgb *= 0.7 + 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.15 * saturate(factorRms / border / 2)): 1.0;
        factor = insideWave ? (factor * 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;
}

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();
    }
}
Title: foo_wave_seekbar
Post by: TuNk77 on 2013-01-06 17:37:18
I have a question, would it be possible to make foo_wave_seekbar not scan tracks rated 1?
I use foo_skip and tracks that is rated 1 is skipped and I usually have a large playlist, playing in random. So, sometimes a lot of skips, due to rating of 1, occur, leaving foo_wave_seekbar scanning many tracks in the background.
Title: foo_wave_seekbar
Post by: dinhjk on 2013-01-15 05:27:20
Hi, just registered to ask this:

Is it possible to cut the wave form in half? I do not mean to merge the two into a mono track. I like that already, but was wondering instead of the single track being a vertical mirror, if I could simply view the top half of this. To keep the baseline at the bottom, instead of the middle of the wave form.

If not, that's okay -- Just thought I'd ask. I tried searching through this thread but it is quite hefty and some parts quite old. Thank you!
Title: foo_wave_seekbar
Post by: Zao on 2013-01-15 12:13:37
If you're using the Direct3D frontend, you can kind of achieve a split in half by adding in the evaluate() function the line:
tc.y = tc.y * 0.5 + 0.5;
This will shift the waveform so that the center is along the bottom edge of that channel. It's not quite right as it discards the lower half of the track, but meh, close enough.

Historically there was an option for mirroring and halving, but it hasn't been in for many versions and can't really be retrofitted.
Title: foo_wave_seekbar
Post by: dinhjk on 2013-01-16 01:43:02
Hm, I'm not very good with code, but pasting that in my only evaluate function that I found, it produced an error.

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(backgroundColor, highlightColor, factor);
        }
        return c;
}

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

        minmaxrms.rgb -= 0.5 * minmaxrms.a;
        minmaxrms.rgb *= 0.7 + 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.15 * saturate(factorRms / border / 2)): 1.0;
        factor = insideWave ? (factor * 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;
}

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 got this from an earlier post, about sound cloud something. I placed it where it has

Code: [Select]
float4 evaluate(float4 bg, float4 fg, float factor)
{
        return saturate(lerp(bg, fg, factor));
}


and it came up with the error "error: (X3004): undeclared identifier 'tc'"
Title: foo_wave_seekbar
Post by: Zao on 2013-01-16 22:21:18
Unless you say otherwise, I have to assume you're using the default look.
Do it at the top of RMSFactor, I guess. Heaven knows what this shader does.
Title: foo_wave_seekbar
Post by: dinhjk on 2013-01-17 06:30:36
ah wow, you're a genius  that worked! good job and thank you xD
Title: foo_wave_seekbar
Post by: jamps on 2013-01-19 17:33:56
Hi!
Would it be possible to add scrollwheel function working on top of the waveform seekbar?
I like to use scrollwheel on top of the Seekbar, but it takes up space.
Thanks!
Title: foo_wave_seekbar
Post by: carpman on 2013-01-20 01:35:50
I'm a little confused how to get waveform seekbar to display what I want. I've played around with a few of the configs that have been posted here, and I'm happy with how it's displayed. But not with the amplitude of the display. To be clear the problem is not with the component (that's great), the problem here is me.

As far as replay gain is concerned my music library is divided into 2:
The player is set to play according to Album Gain. So the loose files play at their "native" volume; the Collection tracks play according to their Album Gain data.

What I want Waveform Seekbar to produce is a waveform that reflects the waveform I hear.

Here's my current config:


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 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 )
    {
            // alpha 1 indicates biased texture
    float4 minmaxrms = tex.Sample(sTex, tc.x);
    if (replayGain.g != -1000) {
        minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 2; //use track gain
    } else if (replayGain.r != -1000) {
        minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2; //use album 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;
         
            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 = 2.5 * dx;
            float positionWidth = 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;
    }
   
    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();
            }
    }
Any ideas how I achieve this?
EDIT: Currently the Collection tracks (via AlbumGain) are displayed so they look much louder than the no-replaygain (loose tracks).

Any help much appreciated.

C.
Title: foo_wave_seekbar
Post by: carpman on 2013-01-24 04:49:31
By the way - add me to the list of people who'd like to specify the location of wavecache.db.

C.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-01-25 09:55:13
By the way - add me to the list of people who'd like to specify the location of wavecache.db.


pretty sure you can do that yourself using the command line tool mklink which is built into windows (vista and newer).
Title: foo_wave_seekbar
Post by: carpman on 2013-01-25 10:27:38
pretty sure you can do that yourself using the command line tool mklink which is built into windows (vista and newer).

Done. Thanks for that. Learn something new every day.

C.
Title: foo_wave_seekbar
Post by: Zao on 2013-01-25 13:48:06
Yeah, if all you want is a single file elsewhere, a symlink will probably work, but it's nothing I've tested, so buyer beware and all that.

As for the lack of implementing movability in the component itself, it needs UI work, file move logic and of course, got intermingled with "having multiple databases all over the place".
Title: foo_wave_seekbar
Post by: carpman on 2013-01-26 00:07:31
Hi Zao,

It works fine for me, no problems with the symlink. I think it may introduce a very slight delay, but that could also be because fb2k is on an SSD and now the wavecache.db resides on a normal sata HDD.

By the way, any advice on the replay gain / display issue mentioned in post 1161 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=821273)?

C.
Title: foo_wave_seekbar
Post by: Zao on 2013-01-30 15:03:58
It's most likely quite trivial to achieve based on the contents of the four components of the replaygain variable. Do some branching, scale stuff, pray.

I took a short look at it but my shader editor is so horrible, I lost the work
Title: foo_wave_seekbar
Post by: silkcut on 2013-02-02 23:25:30
Does anyone know how to make the waveform a solid color?  I set the foreground color but it only affects the top and bottom edges of the waveform.

e.g.

(http://i.imgur.com/PXaE0fP.png) (http://imgur.com/PXaE0fP)

Why is the waveform still white with shades of the foreground color?  Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2013-02-03 01:31:09
Because the default effect interpolates from the background color outside the waveform, into the foreground color at the waveform border, and past inside. If you want a different behavior, you can always write your own effect.
Title: foo_wave_seekbar
Post by: silkcut on 2013-02-03 06:32:19
Okay and how do I do that?  Thank you.
Title: foo_wave_seekbar
Post by: mister.mabuse on 2013-02-04 16:29:01
Hi Zao,
thank you for the nice component. it really adds some nice eyecandy.
however i have a problem. when im playing computer games with foobar in the background
the cpu usage of foobar spikes and introduces lags in the game. this happens when the track
changes to a track without a cached waveform. is there a way to make waveform generation
less priorotized? i already have only one thread running.
Title: foo_wave_seekbar
Post by: Zao on 2013-02-04 19:10:04
The analysis threads are running at idle CPU priority already. I am not going to open the can of worms that is going conditionally for THREAD_MODE_BACKGROUND_BEGIN/THREAD_MODE_BACKGROUND_END on Vista and up, as that's likely to cause enough stalling and priority inversion to ruin the day.
Title: foo_wave_seekbar
Post by: mister.mabuse on 2013-02-04 19:53:46
Thank you, maybe it's something different that's slowing me down. thanks for the nice plugin still
Title: foo_wave_seekbar
Post by: EpicForever on 2013-02-04 20:45:01
I created playlist with about 1300 tracks/50GBytes, all from the same HDD. Maybe half of them were previously played and thus they could have their seekbars signatures already saved. I selected all of them and choose "extract seekbar signature". I changed coligation of foobar process to just single core (3,6 Ghz AMD Phenom). Whole procedure took about 20 or 30 minutes (I don't know exactly, I haven't noticed exact time). While seekbar signatures were extracted, foobar was normally playing music from that playlist. During whole this process CPU usage varied mainly from 12 to 17% and never went above 19%. Maybe there's something wrong with your HDD configuration (in BIOS or Windows?) - like slower transfer mode set?
Title: foo_wave_seekbar
Post by: Zao on 2013-02-05 04:29:45
Resource usage is more complicated than a single percentage of resources consumed.

I/O is a big silent thief in performance, it has a tendency to stutter and delay things subtly, which I referred indirectly to by the THREAD_MODE_BACKGROUND_* priorities. Those affect the I/O behavior of a thread, unlike the usual priorities that are mostly just about CPU scheduling.

I'm not eager to touch I/O priority though, as it may very well end up ruining it for everyone.
Title: foo_wave_seekbar
Post by: silkcut on 2013-02-05 16:47:58
Hi. Does anyone know how to script a wave with one color for the foreground and one color for the background?  Something like Sound Forge's default display....

I don't know how to code so any pointers on how to script this would be very much appreciated.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-02-07 10:14:11
In addition to my previous post in this thread ( http://www.hydrogenaudio.org/forums/index....st&p=823130 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77490&view=findpost&p=823130) ) when foobar wasn't colligated with only one core and it could use all six cores of my CPU, then average CPU usage by foobar2000 process was around 66% with maximum of  74%. Wave seekbar is configured to concurrently process 4 tracks (same is prevoius test, when foobar utilized only single core). CPU was quite hot before I speeded up my cooler (61*C)... Just for develeoper information
Title: foo_wave_seekbar
Post by: Pixel Eater on 2013-02-19 12:35:37
Are screenshots working now? I can't seem to find the files actually turning up anywhere. Certainly not in My Pictures or the song's directory.

EDIT: My bad, I just remembered this only works with Direct3D. Since I'm on a new Win 8 install it took me a minute to remember you literally have to install Direct X to enable this.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-03-21 13:06:57
I have one small sugesstion/request.

Zao - could you add another "display downmix" option? Currently we have "downmix display to mono" - could we have "downmix display to stereo (2ch)" additionally? It will be nice option for those, who often listen to multichannel tracks on headphones, and thus use "downmix multichannel to stereo" DSP plugin.
Title: foo_wave_seekbar
Post by: Zao on 2013-03-22 16:58:46
Version 0.2.30 released today should have a dropdown adding downmix-to-stereo. As a bonus unrelated change, it also scans tracks way faster than previous version.
Title: foo_wave_seekbar
Post by: lvqcl on 2013-03-22 17:11:37
http://www.foobar2000.org/components/view/foo_wave_seekbar (http://www.foobar2000.org/components/view/foo_wave_seekbar)

0.2.30, released on 2012-03-22
Title: foo_wave_seekbar
Post by: Zao on 2013-03-22 18:57:12
 The digest in my mailbox was confusing, as there's no formatting in those.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-03-22 19:40:50
Thanks Zao
I got one question... How procedure of downmix is prepared in your plugin? Why I am asking: stereo display of 6ch/24bit/48kHz FLAC files ripped from DVD-A tracks look on downmixed display like they were clipped during nearly whole track... Like 0 dBFS was reached at one point and held during 30 sec. for example. Foobar's Peak Meter shows the same thing. Peaks reach up to +6 dB... But audio doesn't sound like it was clipped at any point of time... Does it mean that both visualisation routines doesn't work properly or is there something that I miss about 5.1 downmixing or 24 bit FLAC decoding?
Title: foo_wave_seekbar
Post by: Zao on 2013-03-22 21:32:20
The coefficients used to mix-down can be found in the source code (https://github.com/zao/foo_wave_seekbar/blob/master/waveform_sdk/Downmix.h#L10) for that functionality.
They are scientifically taken from thin air, and might not quite match the "typical" downmix of many-channel content.
What it does is mix all the channels into left channel based on the coefficients, and similarly all the channels into the right channel. If mono is requested, the resulting stereo image is simply averaged.

What you have to realize is that you're asking for some sort of approximation of the original signal, and if you want to preserve energy in the mixdown, there's more energy in six channels than two. Feel free to contribute "better" mixdown matrices.
The following are the matrices for mixing from {mono, stereo, 4ch, 5ch, 5.1ch, 7.1ch} to stereo. The mono transformation is the same, but averaged at the end.

(http://www.acc.umu.se/~zao/mixdown.png)
Title: foo_wave_seekbar
Post by: Propheticus on 2013-03-22 23:03:39
I think above matrices are about right. A gain of 0.7 (root(1/2)=~0.7) is common.
My only concern is the 1 for LFE in both left and right downmixed channels. You're effectively doubling the low frequency channel, since normally this only gets fed to one sub-woofer.
I'd suggest completely ditching this channel all-together as normal stereo speakers/headphones can hardly produce sub-bass anyway. At the very least attenuate it by 3dB, cutting perceived volume in half to compensate for the fact you're using the LFE channel twice.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-03-22 23:30:28
Hmmm... Yes, coeffs are generally OK and conform with old ITU-R-BS775-1 for 6 ch (except LFE coeff - as noted by Propheticus). But something like "volume normalisation" should be used to avoid "clipping" on displayed waveform that isn't present in the reproduced sound. I mean that values of displayed waveform should be calculated as (raw values calculated from coefficients) divided by (maximal value calculated in whole file).
Title: foo_wave_seekbar
Post by: marc2003 on 2013-03-23 12:31:48
i was just listening to a song and i noticed the waveform was blank. previous and next tracks in the playlist were ok so i went back to the track with the blank seekbar and it still wouldn't show.

i went to close foobar for a restart, but it just hung. i checked with process explorer and found it eating all the CPU.

(https://dl.dropbox.com/u/22801321/2013/march/wave%20seekbar.png)

not sure if you can do anything because i've killed the process now but i thought i'd mention it. there's nothing special about the track. it's just FLAC encoded from a normal CD. using latest component/foobar2000 1.2.4beta3/windows 7 x64.

after the restart, it now displays fine.
Title: foo_wave_seekbar
Post by: Zao on 2013-03-23 14:13:21
There's min(cores,3) processing threads (by default) that act on tracks in a largely queue-like manner.
Files are added to it if:

The processing threads loop around (efficiently), picking tracks from the front(ish) of the queue, and once it has picked one, decodes and processes it from start to end.
They honor an abort callback raised at shutdown time whenever actively decoding, so your screenshot indicates that there's two threads that are stuck scanning some file(s), and these are most probably not the file that you're observing is missing a waveform, that's just a victim of a queue that never drains.
There's only one place in the analysis code where it could wedge like this, and it's one that I had to touch in the last speed optimization. Blargh.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-03-23 14:31:41
i'm guessing it's irrelevant but i forgot to mention i have downmix to mono enabled.

i've just been trying to abuse it by opening a playlist of files that are all 1-3 hours long and i'm skipping tracks/order and there is no problem at all.
Title: foo_wave_seekbar
Post by: Kasen on 2013-03-23 14:52:24
My waveform seekbar was working fine up until today, when I tried to change the colours. Now, when "Mix-down to mono" is selected the seekbar is just the blank background colour; with no waveform, current time bar or highlight. Changing to "Mix-down to stereo" or "Keep as-is" everything displays fine, but I want the mono display. I tried updating to the latest version (0.2.30) and it hasn't helped. I tried changing the colours back to what they were, no colour combination is working. Any ideas?
Title: foo_wave_seekbar
Post by: derty2 on 2013-03-23 15:22:42
I'm using foobar2000 v1.1.7 | foo_wave_seekbar 0.2.30 | OS: Windows XP SP3 | CPU: Intel Core 2 Quad Q9550 @ 2.83GHz | Memory: 4GB, 400MHz (DDR2 800)

I started playback of an album containing 11 tracks (24bit/96kHz FLAC)

Process Hacker (my task manager program) was showing red, indicating heavy CPU load caused by this process/thread:
(http://i.imgur.com/2J2EdlH.png)

I waited up to 10 minutes to see if CPU load would subside, but it did not!

CPU is continuing to hover at 25% even as I post this. This component has had plenty of time to scan and should not be using up 25% CPU indefinitely!

P.S. -- This waveform seekbar visualization lives in its own tab in my foobar2000, and the tab was not even active/showing when all the above was happening!

*EDIT*

30 minutes playback time has passed and 25% CPU usage continues . . . .
so I decided to click the "Stop" button, and track stopped playing . . . .
I then tried exiting fb2k by pressing the top right [X] button . . . . all foobar2000 exit functionality was immediately frozen and unusable!, in fact foobar2000 froze TOTALLY!, in fact other open windows are now being frozen and my desktop graphics are going to the dogs! . . . I am dragging an open notepad window around the desktop and it is leaving ghost images everywhere . . . I killed explorer.exe but it made no difference to the corrupted open windows . . . . BAD BAD CRASH! . . . I have one final quick look at foobar2000.exe process in Process Hacker before I "terminate" it . . .and CPU usage is frozen solid at 25% !!!!
Title: foo_wave_seekbar
Post by: Zao on 2013-03-23 15:39:23
Analysis is a background task, and takes the opportunity to analyse files it doesn't know about when it finds out about them.
If you're afraid of it stealing your precious cycles, it runs with idle priority so the scheduler will never preempt something else to perform it.

The problem here isn't that it's scanning, that's a natural state of existence. The problem is that the scan is slightly broken and never terminates for some tracks.
Title: foo_wave_seekbar
Post by: gundelgauk on 2013-03-23 15:51:11
I'm also having a problem with CPU load since updating to 0.2.30. With certain audio files no seekbar is displayed and at least one CPU core spikes to 100%, stays there and never finishes. The Foobar process then has to be stopped by force.

For me this has only occurred with FLAC files so far and not with mp3 or ogg (at least so far). Also, not all FLAC files show this problem, only certain ones. The screenshot shows the properties of one such file. Most other files of the same album do not have this problem, however, only some.
(http://i.imgur.com/T1IQuer.png)

I have also tried deleting the waveform database file but that didn't seem to help. Any way we can help finding the problem?
Title: foo_wave_seekbar
Post by: Zao on 2013-03-23 15:57:14
For you lads that get eternal scans, version 0.2.30.1 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.30.1.fb2k-component) should hackfix this.
Please test this and report back so I can push it live.
Title: foo_wave_seekbar
Post by: gundelgauk on 2013-03-23 16:18:44
Thank you, Zao, I've tried one problematic file with 0.2.30.1. I still get an eternal scan and 100% core usage with the file but I've noticed one difference: when the CPU spikes, foobar can now be closed normally without killing the process.

(http://i.imgur.com/2aOHPhS.png)

Is there any way we can get you more information that may help?
Title: foo_wave_seekbar
Post by: derty2 on 2013-03-23 16:29:15
Thanks for the prompt update Zao ++++++++++

I'm using the exact same configuration as (Post #1191) before . . . everything is running nicely! . . . CPU load is trivial now! . . . good fix +++++
Title: foo_wave_seekbar
Post by: marc2003 on 2013-03-23 17:48:49
thanks for the update.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-03-23 22:12:11
unfortunately it's still very broken. it's rarely displaying waveforms for anything now and the CPU is being munched as before. the only difference is that i can close foobar normally. same as gundelgauk above really.

edit: i note the problem seems to start with very quiet tracks. if i start foobar with a problematic file as the only entry in the playlist. there is no CPU usage. i then start playback and the CPU usage jumps to max but there is no mention of any attempt to scan the file in the console. if i restart foobar and start playing a louder track, it behaves as normal and shows what it is doing in the console.

an example of a track that won't scan and causes the silly CPU usage. http://www.youtube.com/watch?v=IA0cjNTHlro (http://www.youtube.com/watch?v=IA0cjNTHlro)

edit2: saying it's very broken was a bit harsh.  after some more testing i can confirm it's definitely quieter tracks causing the issue. after a restart, playing normal tracks is fine.
Title: foo_wave_seekbar
Post by: gundelgauk on 2013-03-23 23:49:36
marc2003, that seems to be an interesting discovery about quiet files, since my current test file is also rather quiet. However it gets a bit louder at the end (orchestra kicks in). Also, the track just before my problem file is even more quiet and does not show this problem. The waveform for it was generated very quickly with 0.2.30.1 and no noticeable CPU spike. So I'm not entirely convinced if the problem is only caused by quiet files, no offense meant.

Screenshot 1 is the waveform of the problem file.

(http://i.imgur.com/KJq7cTz.png)

Screenshot 2 is the waveform of the track before it on the same CD, which scans normally.

(http://i.imgur.com/KH0N48e.png)
Title: foo_wave_seekbar
Post by: Zao on 2013-03-23 23:56:00
As in that muxed MP4, or some rip of that track?
Title: foo_wave_seekbar
Post by: marc2003 on 2013-03-24 00:01:59
if that question is for me about the youtube clip, my original file is FLAC which i encoded myself from CD. i just searched youtube for the same song. its creation has nothing to do with me.

edit: 20 second sample here: https://dl.dropbox.com/u/22801321/2013/marc...ing%20More.flac (https://dl.dropbox.com/u/22801321/2013/march/04.%20Nothing%20More.flac) (1.9MB)

@ gundelgauk, it seems i was a bit premature with my theory. i'm still getting the odd "normal" track which won't scan but then does on a restart. it's all a bit random really.
Title: foo_wave_seekbar
Post by: gundelgauk on 2013-03-24 00:15:23
i'm still getting the odd "normal" track which won't scan but then does on a restart. it's all a bit random really.

I agree. While I was trying other files, I noticed that even files which scan and generate waveforms properly can cause one CPU core to spike and stay at 100% for me. This happens with MP3 and OGG as well as FLAC, at least for me. I also tried some "exotic" files like NSF and SID. Those cause more CPU cores to stay at 100% even though waveforms are generated, possibly because of multiple embedded tracks which are scanned in multiple threads (only speculation on my part)?

[EDIT]I tried your sample file. It does not generate a waveform with 0.2.30.1 and sends three cores through the roof for me.[/EDIT]
Title: foo_wave_seekbar
Post by: Zao on 2013-03-24 00:31:49
That sample reproduces the problem here indeed, it's related to the format and length of the file. It gets stuck in a twilight zone where the sample generator thinks it has emitted enough samples, while the consumer still lacks a few thousand samples.
Title: foo_wave_seekbar
Post by: derty2 on 2013-03-24 05:14:42
I tested the sample file from marc2003 . . .

Yes it breaks my foobar000 too. The waveform doesn't render and the CPU shoots to 25% and stays there permanently. The rest of foobar2000 is still usable and does not crash this time, however if I stop playing the marc2003 sample track and change playlists and start a new track, the CPU usage continues at 25% . . . . . . . in fact, I tried restarting foobar2000 and played a track, but CPU usage spiked to 25% again.

The offending sample needs to be permanently removed from any playlist to bring foobar2000 back to normal. . . . . Nope that doesn't work either! The offending track has caused foobar2000 CPU usage to permanently spike up to 25% no matter how many times I restart, no matter if I delete the track from all playlists.

Eventually, all went back to normal only when I did this: exit foobar2000, delete the track from my computer, start foobar2000.
Title: foo_wave_seekbar
Post by: Zao on 2013-03-24 06:42:32
derty2: In order to let you restart foobar2000 freely when there are background scans in progress, the component helpfully stores the pending scans in the database, and restores the queue on startup. Normally this is desired behavior, and if you really don't want a job, you can close foobar2000, delete the offending job in the database with some surgery, and restart. There is way too much work to make a scan queue management interface, when the normal usage pattern has nothing that needs one.

Anyway, I've just uploaded 0.2.31, which handles all known problem tracks properly, by taking some morning hours to rewrite the offending snake's nest of code.
Title: foo_wave_seekbar
Post by: gundelgauk on 2013-03-24 07:56:32
That's great work, Zao. I can confirm that for me the problem does not occur with marc's and my FLAC files. That also includes MP3 and OGG files which would generate a waveform but still cause permanent CPU usage. Thanks!

Some quick testing revealed that it still occurs with a SID (C64) file, however a NSF (NES) file works. But normal audio files seem to work perfectly. Thanks again!

[EDIT]Somehow I got foobar to crash by playing a midi file. Then after restarting foobar, it would crash on playing any file. Clearing the playlist in safe mode and deleting the waveform DB did not help. After uninstalling the component, deleting the DB and reinstalling the component it works normally again. I guess I just shouldn't play such strange files. [/EDIT]
Title: foo_wave_seekbar
Post by: EpicForever on 2013-03-24 07:58:16
I got exactly the same situation like derty2 with marc2003 sample... When I restart foobar it opens the handle for this file, despite it isn't on any playlist nor in Library, and it continuously uses 17% of my CPU. That's exactly 1/6 of six core Phenom... In a minute I will try 0.2.31 to check it.

EDIT:
At least with marc's FLAC iv. 0.2.31 works 100% OK. I haven't noticed any file from my own Library that exposed such behaviour, as I forced foobar some time ago to calculate all seekbar signatures at one time  . I went to a job, and foobar did the thing when I was out
Title: foo_wave_seekbar
Post by: marc2003 on 2013-03-24 09:36:59
rather bizarrely, the 20s sample still doesn't work for me. <<oops, i just remembered i have it configured not to scan waveforms outside my library. 

but the full length track does and that's all that matters. i've also tested the quietest track i can think of and that is also fine.

thanks for all your work Zao.
Title: foo_wave_seekbar
Post by: gundelgauk on 2013-03-24 09:51:57
I actually got very curious so I tried to compile the component myself to be able to debug it. But I'm inexperienced with VS and after installing boost I found out that VS Express does not have ATL so I'm kind of stuck. Too bad, it seemed like a very interesting problem.

It works well enough with the latest version, so thanks again for your work!
Title: foo_wave_seekbar
Post by: Zao on 2013-03-24 17:36:42
gundelgauk: Good luck with that, it was never planned for independent building, so it's kind of tied to my SDK directory and system-installed libraries.
I don't think I have modified the SDK or the Boost too much, but I can't be sure, my system install is shared between a bunch of projects.

The dependencies are pretty much:
In particular, June 2010 won't do, as there's bugs in the shader compiler.
The VS 2010 dependency is because all those filthy XP users won't stop crying if I migrate to 2012 and drop XP support 
Title: foo_wave_seekbar
Post by: lvqcl on 2013-03-24 18:56:31
AFAIK MSVS 2012 Update 1 does support Win XP
Title: foo_wave_seekbar
Post by: Zao on 2013-03-24 19:00:38
The v110_xp toolset is not usable in my world. For starters, Boost.Build will not ever target it, and it has lots of hidden caveats and is not as tested as a real compiler.
Not to mention that it doesn't _gain_ you anything but a slightly newer and untested mutilation of the toolchain. It's still using a bastardised WinSDK7.

To be really honest, I cannot trust a toolset that they put out in a hurry because people got their panties in a twist over not being able to target an EoL:d OS.
Title: foo_wave_seekbar
Post by: gundelgauk on 2013-03-24 19:15:03
Zao, thanks for elaborating. It looks like I won't be able to set up a build environment in a reasonable time then, especially with not much VS experience. As an alternative, would it be possible for you to include debug information in a build or something, so that we can get you more helpful info with a standalone debugger or something to that account? It's just that I used to be able to play anything in foobar with your waveform seekbar up until recently and now that I seem to have problems with some file types, I really miss it.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-03-24 19:56:26
Zao - as I said before I think that there should be "normalization" applied (division every point of seekbar waveform by maximal value calculated in whole file) to waveform when it's downmixed to stereo. If my file was looking really like this:

(http://img189.imageshack.us/img189/2522/mmmmmnx.png)

it would be absolutely unlistenable (especially at the end).

The same file, after conversion to 2ch FLAC with Converter and "Downmix 5.1 to stereo" DSP enabled gives completely different waveform:

(http://img585.imageshack.us/img585/3556/nnnnne.png)

And this is listenable... And This is how I expect to Waveform Seekar look in "Downmix to stereo" mode, when I play regular 5.1 version. Of course I understand that accuracy may be limited, but definitely it isn't diplayed properly at this time.
Title: foo_wave_seekbar
Post by: Zao on 2013-03-24 20:06:56
I will never normalize, as that destroys information as to the actual signal level of the waveform. If you want that, the best I can provide is a min/max parameter to the effects so that they may normalize.

The fundamental problem is two-fold.
The optimistic extraction means that I probably introduce some additional energy into the waveform.
I could try to use the standard DSP if present, but I doubt it'd do much good at this stage.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-03-24 20:31:24
Hmm... You are right about normalization performed on every waveform. This will destroy component functionality. Maybe it would be possible to trigger normalization only when there are 2 conditions met: source signal has more than 2 channels and user has chosen "downmix to stereo/mono" display mode? Or maybe it is possible to check how "Downmix 5.1 to stereo" DSP performs calculations of final track level, and use it to downmix final waveforms to resulting "downmixed" one ?

When I complain about functionalities of certain components I recall someone's forum signature... "This job would be great if it wasn't for the users." Haha... Peter is right. Good for me I am not programmer - I don't have to listen others complaints. Bad for me I am not programmer - I have to rely on others good will, free time and skills...
Title: foo_wave_seekbar
Post by: Zao on 2013-03-24 21:14:53
I cannot reproduce any failure to scan with the test files I have for MID, MOD, NSF.
Whoever fails to analyse these, please provide files.

Edit: I got a repro on SID, yay.
Title: foo_wave_seekbar
Post by: Zao on 2013-03-24 21:36:19
... include debug information in a build or something, so that we can get you more helpful info with a standalone debugger or something to that account ...

For a given release foo_wave_seekbar-X.fb2k-component, there's an archive of the debug symbols at http://www.acc.umu.se/~zao/foo_wave_seekbar-X-archive.fb2k-component, as an off-site backup. They should match the corresponding tag in the Github project.
Title: foo_wave_seekbar
Post by: Zao on 2013-03-24 21:46:39
For all you LFE lads, there's 0.2.32 now, which drops the LFE channel on the floor. If you want to see it, don't use downmixing.
This release also fixes an accident in RMS computation which I didn't spot as I don't visualise RMS myself.
Title: foo_wave_seekbar
Post by: gundelgauk on 2013-03-24 21:59:21
Wow, Zao, I don't know what you did but this is awesome. I just finished uploading some midi, mod and other files which caused crashes when I saw the new version. Now with 0.2.32, these crashes are gone and waveforms are generated normally. So far I could only find one file which still seems to cause high CPU load. It's a SID file, I'll send you a message with a link.

Thank you very much! It seems I can listen to all my weird stuff with waveform seekbars again!

Also, thanks for the hint about debug symbols.
Title: foo_wave_seekbar
Post by: Zao on 2013-03-26 13:15:39
This should probably resolve your SID issues, turns out that my component brings out the worst in others 

foo_sid version 1.30 highlights: Fixed a race condition which affected starting a batch of conversions or wave seekbar scans without starting a single track for playback first.
Title: foo_wave_seekbar
Post by: tiptoetan on 2013-03-26 21:06:15
hello and sorry for asking probably not something very very related - personally I found wave_seekbar really really useful - I use foobar + wave_seekbar to somewhat come closer to programs like vdj for basic dj-ing. there are various reasons for this and they are off-topic.. what I miss most and can't find any plugin to do is to insert custom mix points on the run - wave_seekbar helps to identify visually the place to start, and if you are fast enough, with long crossfade enabled you can skip lengths by clicking - but wouldn't it be great to be able to set track start point visually before activating it for play? I know this is quite beyond the reasons why wave_seekbar exists, and would probably call for another plugin entirely, possibly basing on wave_seekbar... but - was just wondering.. it would be interesting to hear your thoughts on the matter... thank you.
Title: foo_wave_seekbar
Post by: Dario on 2013-03-27 22:49:58
There is something terribly wrong with this component. It was undoubtedly caused by the recent updates. Waveforms disappear randomly, tracks display wrong waveforms (for example, the second track of an album, when player after the first, displays the waveform of the first track)...
Title: foo_wave_seekbar
Post by: Propheticus on 2013-03-27 23:08:40
Having no such problems here with the latest version. Maybe another component or settings causes this?
Title: foo_wave_seekbar
Post by: Manchesterer on 2013-03-28 06:48:51
+1 for problems with latest update (0.2.33) - files (mp3) added to the library after component update have no waveform, trying to extract seekbar signature manually also does not help. Some waveforms appear after few plays, only to disappear on the next play.
Title: foo_wave_seekbar
Post by: Zao on 2013-03-28 07:45:55
Dario, Manchesterer: Unlike in what version? 0.2.32? 0.2.31? 0.2.ancient? Kind of hard to pinpoint what might've gone wrong, if anything, if there's no baseline version to compare against. Give me something to work with here, previously working versions, OSes, components installed, frontend used, anything. Is the console so blank and boring that you both omitted it?

I'm not psychic, you know.

As for "second track displays the first waveform", the previous displayed waveform remains until the next one can be retrieved, IIRC.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-03-28 07:51:45
I got no problems with latest (.33) version of wave_seekbar even with files that are played through problematic foo_input_zxtune. Everything seems to be OK.
Title: foo_wave_seekbar
Post by: Manchesterer on 2013-03-28 08:07:04
Dario, Manchesterer: Unlike in what version? 0.2.32? 0.2.31? 0.2.ancient? Kind of hard to pinpoint what might've gone wrong, if anything, if there's no baseline version to compare against. Give me something to work with here, previously working versions, OSes, components installed, frontend used, anything. Is the console so blank and boring that you both omitted it?

I'm not psychic, you know.

As for "second track displays the first waveform", the previous displayed waveform remains until the next one can be retrieved, IIRC.

@Zao
- troublesome version is 0.2.33 (as stated in my previous post)
- previously working version - 0.2.29
- OS - Win 7 Pro 32 bit and Win XP Pro 32 bit
- frontend used: GDI
- console - nothing unusual:
  Opening track for playback: "D:\MUSIC\xxx\xxx.mp3"
  Wave cache: finished analysis of "D:\MUSIC\xxx\xxx.mp3"
- wavecache.db is 20 MB
- space on disk - a lot
- memory usage - 48 MB
- components installed:
Code: [Select]
Core (2013-02-13 11:26:10 UTC)
    foobar2000 core 1.2.3
foo_abx.dll (2009-06-07 21:25:26 UTC)
    ABX Comparator 1.3.4
foo_ac3.dll (2012-08-29 15:57:04 UTC)
    AC3 decoder 0.9.7
foo_cdda.dll (2013-02-13 11:24:22 UTC)
    CD Audio Decoder 3.0
foo_converter.dll (2013-02-13 11:24:22 UTC)
    Converter 1.5
foo_cuefilter.dll (2010-12-08 03:01:26 UTC)
    CUE Playlist Filter 0.1.7.0
foo_dsp_std.dll (2013-02-13 11:24:44 UTC)
    Standard DSP Array 1.2
foo_dsp_vlevel.dll (2012-07-16 15:18:22 UTC)
    VLevel 20080302.0
foo_fileops.dll (2013-02-13 11:23:12 UTC)
    File Operations 2.2
foo_flv.dll (2012-12-29 07:00:00 UTC)
    Flash Video Decoder 0.9.6
foo_input_amr.dll (2009-03-06 05:20:06 UTC)
    AMR input 1.1.1
foo_input_dvda.dll (2010-12-08 03:01:26 UTC)
    DVD-Audio Decoder and Watermark Detector 0.4.1
foo_input_la.dll (2010-12-08 03:01:26 UTC)
    Lossless Audio(La) decoder 0.01
foo_input_monkey.dll (2012-04-20 19:24:30 UTC)
    Monkey's Audio Decoder 2.1.6
foo_input_ofr.dll (2010-12-08 03:01:26 UTC)
    OptimFROG Lossless/DualStream Decoder 1.21b
foo_input_shorten.dll (2010-12-08 03:01:26 UTC)
    Shorten decoder 0.4.2.2
foo_input_std.dll (2013-02-13 11:23:54 UTC)
    Standard Input Array 1.0
foo_input_tak.dll (2012-09-25 17:04:20 UTC)
    TAK Decoder 0.4.5
foo_input_tta.dll (2010-12-08 02:57:36 UTC)
    TTA Audio Decoder 3.2
foo_jesus.dll (2011-04-18 18:34:28 UTC)
    Autosave & Autobackup 10
foo_lnk.dll (2010-01-08 02:57:56 UTC)
    Shell Link Resolver 1.3.1
foo_masstag.dll (2009-09-18 08:01:36 UTC)
    Masstagger 1.8.4
foo_menu_addons.dll (2010-01-16 09:18:34 UTC)
    Menu Addons 1.4.2
foo_midi.dll (2012-12-31 12:25:22 UTC)
    MIDI synthesizer host 1.186
foo_navigator.dll (2012-12-15 13:46:44 UTC)
    Navigator 0.8
foo_playcount.dll (2011-07-13 18:47:18 UTC)
    Playback Statistics 3.0.2
foo_quicksearch.dll (2012-10-30 16:50:06 UTC)
    Quick Search Toolbar 3.4
foo_rgscan.dll (2013-02-13 11:24:30 UTC)
    ReplayGain Scanner 2.1.2
foo_run.dll (2010-12-08 03:01:26 UTC)
    Run services 0.3.7
foo_shutdown.dll (2010-12-08 03:01:26 UTC)
    Foo Shutdown 0.9.3
foo_taskbar_playback_progress_bar.dll (2012-06-17 13:49:14 UTC)
    Taskbar Playback Progress Bar 1.1.3
foo_ui_columns.dll (2011-02-28 06:23:00 UTC)
    Columns UI 0.3.8.8
foo_ui_std.dll (2013-02-13 11:23:58 UTC)
    Default User Interface 0.9.5
foo_uie_albumlist.dll (2010-12-08 03:01:26 UTC)
    Album list panel 0.3.5
foo_uie_explorer.dll (2010-12-08 03:01:26 UTC)
    Explorer Tree 2.04.8
foo_uie_lyrics3.dll (2012-11-07 15:39:48 UTC)
    Lyric Show Panel 3 0.3.6 beta 5
foo_uie_panel_splitter.dll (2009-12-10 07:16:12 UTC)
    Panel Stack Splitter 0.3.8.3(alpha)
foo_uie_playlists_dropdown.dll (2009-09-24 07:44:46 UTC)
    Playlists Dropdown 0.7.6
foo_uie_vis_channel_spectrum.dll (2010-12-08 03:01:26 UTC)
    Channel Spectrum panel 0.17.2
foo_uie_vis_peakmeter_spectrum.dll (2010-03-07 17:24:48 UTC)
    Peakmeter Spectrum Visualisation 0.2.0.0 beta
foo_uie_wsh_panel_mod.dll (2012-10-16 00:45:20 UTC)
    WSH Panel Mod 1.5.6
foo_verifier.dll (2010-12-08 03:01:26 UTC)
    File Integrity Verifier 1.1
foo_wave_seekbar.dll (2013-03-25 23:47:50 UTC)
    Waveform seekbar 0.2.33
Title: foo_wave_seekbar
Post by: Zao on 2013-03-28 08:07:38
Remember when you update the component to never hand-pick any files from the archive, let the component preferences pane install it as a whole.

Also, how large are your wavecache.db files, and do you have sufficient space on that disk? What kind of memory usage do you have when running?
Title: foo_wave_seekbar
Post by: Zao on 2013-03-28 08:11:47
Manchesterer: Could you please try with each of the following versions, to see if there's one inbetween 0.2.29 and current that introduces the problem:
0.2.29 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.29.fb2k-component)
0.2.30 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.30.fb2k-component)
0.2.30.1 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.30.1.fb2k-component)
0.2.31 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.31.fb2k-component)
0.2.32 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.32.fb2k-component)
0.2.33 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.33.fb2k-component)
Title: foo_wave_seekbar
Post by: Manchesterer on 2013-03-28 08:27:47
Manchesterer: Could you please try with each of the following versions, to see if there's one inbetween 0.2.29 and current that introduces the problem:


0.2.29    OK
0.2.30    OK
0.2.30.1  OK
0.2.31    No waveform, console OK
0.2.32    No waveform, console OK
0.2.33    No waveform, console OK

- testing OS - Win XP Pro 32 bit
- all the rest - see my previous post
- installed via preferences pane
- wavecache.db deleted each time between installs
Title: foo_wave_seekbar
Post by: Zao on 2013-03-28 08:49:28
I would recommend you few that encounter this no-waveform problem should run 0.2.29 until I've gotten around identifying the root cause.
For you all that do not exhibit the problem, 0.2.33 should be the preferred version, as the ones in-between are in a bit of flux.

Note that in general there is no guarantee that a downgrade will work and retain your settings, as the settings code only assumes compatibility one way. If you're one of the few that needs to roll back temporarily, ensure that you set the Downmix Display setting to "as-is" or "downmix to mono" to avoid configuration parse problems with 0.2.29.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-03-28 12:44:53
One thing I just noticed: My waveform is working fine. I'm using the downmix to stereo option. Either this or the keep as-is option work fine. However, when I choose downmix to mono the waveform disappears. Maybe this info is helpful?

edit: @marc2003 Doh, that was the cause. Never mind the above...
Title: foo_wave_seekbar
Post by: marc2003 on 2013-03-28 12:49:40
^are you sure you have front center (mono) selected in the channel display order list?
Title: foo_wave_seekbar
Post by: EpicForever on 2013-03-28 13:36:45
Maybe others, who have problems with displaying also have selected "downmix to mono" and "center" unchecked    ?

I got some kind of idea. Just idea and, not the "feature request". How about possibility of storing created waveform into file's metadata? That would be something similar to metadata that is present in AIFF files from Beatport. All AIFF files from Beatport contain an image, which is just waveform of whole file. Maybe there's someone who would like to have possibility to add such image to their files? That would require just a checkbox in preferences ("add waveform image to file's metadata), 2 fields for setting resolution - that fields that currently are shown in Advanced Preferences, option to choose which type of embedded image should be used (front/back/disc/artist/icon) plus maybe option to set compression/type of image (.bmp/.png/.jpg).
Title: foo_wave_seekbar
Post by: Zao on 2013-03-28 16:10:51
Apart from the rather hardcoded "screenshot" functionality, I have not had any plans on doing anything of the sorts.
As for "storing things in the tags", I've pondered storing the actual waveform in them for consumption by external tools and by the seekbar itself, but it hasn't really been much of need for such a thing.
Title: foo_wave_seekbar
Post by: Decalicatan_Decalicatan on 2013-03-29 14:50:01
@Zao

About this no-waveform problem with version 0.2.33,  I don't know of this has already been said but when this happens (and it happens to me very randomly) , all I have to do is to select another frontend, then the waveform appears and to re-select my previous frontend (direct3D) and it's ok.
Maybe this can help to find the issue.

Anyway, thanks for this great component.
Title: foo_wave_seekbar
Post by: Zao on 2013-03-29 17:21:59
I assume that this is something else than the usual "won't see changes until a waveform is ready or you poke it with a stick" problem, which is a fundamental artifact of the architecture.
Title: foo_wave_seekbar
Post by: Decalicatan_Decalicatan on 2013-03-29 18:27:01
You assume right

Usually the waveform (for a song played for the first time, I mean) is ready in less than 1second.

The no-waveform issues I have met this week (for the first time), I become aware of them when I maximize foobar2000 to read infos about the now playing song and most of the time more than 1 minute has been played (enough for me to be curious about the song  )


Title: foo_wave_seekbar
Post by: balloonguy on 2013-03-29 20:41:50
Can you implement a selection cursor option that is negative color, like the text cursor in word?? On a song where theres a lot of white or black It's hard to see the cursor position even if I change it to another color. Thanks!
Title: foo_wave_seekbar
Post by: zooliat on 2013-03-29 22:06:39
i'm also having problems with the last update - no waveform is displayed (win7-x64, foobar 1.2.4)

Later Edit: After deleting the wavecache.db it displayed the waveform.

Later Edit: It seems that it selectively display the waveform. Reverted back to 0.2.30.1 - the same problem. back to 0.2.30 - OK

(http://i.imgur.com/uJ4S0E8.jpg)
Title: foo_wave_seekbar
Post by: Zao on 2013-03-29 23:57:03
Can you implement a selection cursor option that is negative color, like the text cursor in word?? On a song where theres a lot of white or black It's hard to see the cursor position even if I change it to another color. Thanks!

The sky is the limit if you use the Direct3D frontend, like in this ancient screenshot -- you just need to learn how to program shader effects 
(http://www.acc.umu.se/~zao/seekbar24.png)

As for finding and fixing the mystery of the ghostly waveforms, that's something that won't be solved until after the easter week, I'm way too stuffed with candy and relaxation (and not at my machine) to solve it.
Title: foo_wave_seekbar
Post by: extracampine on 2013-03-31 13:36:05
There is an option on the waveform seekbar to "shade played". I like this feature as you can see from a distance how far through the track you are.

The problem is, the shade is so close to the normal color that it is difficult to see how far along is it.

My question is, is it possible to darken the shade of the part played?
Title: foo_wave_seekbar
Post by: Andreasvb on 2013-03-31 13:47:02
My question is, is it possible to darken the shade of the part played?

Have you set the Highlight color?
Title: foo_wave_seekbar
Post by: extracampine on 2013-03-31 14:53:38
Thanks Andreas! That did it.
Title: foo_wave_seekbar
Post by: TomKure on 2013-04-01 04:56:21
I had the same problem as Dario described on page 49. The bug appeared after I updated from 0.2.29 (or .28, I don't know now) to 0.2.33. I fixed it by disabling the "Store analyzed tracks in mono" option in Preferences -> Advanced -> Tools -> Waveform Seekbar. I had the option enabled because I thought it would save me some HD space as I am using mono-downmixed waveforms anyway.
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-01 12:30:21
Zao

Your Waveform Seekbar (occasionally) fails to manage tracks which flow into each other without gaps.

Here is a failure from my foobar2000:
(http://i.imgur.com/kOZ1yCn.png)
Title: foo_wave_seekbar
Post by: Dario on 2013-04-01 14:16:17
I had the same problem as Dario described on page 49. The bug appeared after I updated from 0.2.29 (or .28, I don't know now) to 0.2.33. I fixed it by disabling the "Store analyzed tracks in mono" option in Preferences -> Advanced -> Tools -> Waveform Seekbar. I had the option enabled because I thought it would save me some HD space as I am using mono-downmixed waveforms anyway.

Hi Tom. I also store the waveforms in mono. I will update the component to the latest version, disable that setting (while still displaying a downmixed-to-mono waveform), and see if everything is alright. Thank you.

EDIT: Everything is working well now. Both downmixed and left as-is waveforms show no problems.
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-02 14:11:44
Zao

Your Waveform Seekbar regularly refuses to refresh its display when there are no gaps between one track and the next.
This problem only happens when using Direct 3D 9.0c; the problem does not exist when using GDI.

Post #1247 shows a screenshot of the (Direct 3D) problem.

Is there something you can do about this?
Title: foo_wave_seekbar
Post by: Dario on 2013-04-02 14:15:17
derty2, I just played Pink Floyd "The Dark Side of the Moon" and noticed no problems whatsoever. Please, make sure that "Store analyzed tracks in mono" is turned off under Preferences -> Advanced -> Tools -> Waveform Seekbar.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 14:16:41
Maybe.
I'm rejiggering a lot around waveform generation, notifications and fetching, which probably will solve many of these things.
Maybe.
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-02 14:31:16
>
> [derty2 @ Post #1249] Waveform Seekbar regularly refuses to refresh its display when there are no gaps between one track and the next.
> This problem only happens when using Direct 3D 9.0c; the problem does not exist when using GDI.
>
>
> [Dario @ Post #1250] I just played Pink Floyd "The Dark Side of the Moon" and noticed no problems whatsoever.
> Please, make sure that "Store analyzed tracks in mono" is turned off under Preferences -> Advanced -> Tools -> Waveform Seekbar.
>


SOLVED - Thankyou  Dario +++++++++++++

How in hell is a normal user supposed to know about this obfuscated behaviour?

On the subject of definitive solutions . . . . . I have one more question:

I always display one monolithic waveform and I play music in old skool hi-fi stereo/mono, i.e. I don't have anything to do with surround sound multi-speaker configs.
Which are the ONLY boxes I need to check in "Waveform Seekbar - Configuration"?
Thanks.
Title: foo_wave_seekbar
Post by: zooliat on 2013-04-02 14:32:37
Zao, version 0.2.30.1 causes some really high CPU usage even after playing stops, i had to go back to 0.2.29 (since 0.2.33 doesn't display waveforms for me)
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 14:35:25
How in hell is a normal user supposed to know about this obfuscated behaviour?

It's a workaround for a bug by users, for users, it's not the way things are supposed to be.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 14:39:35
Zao, version 0.2.30.1 causes some really high CPU usage even after playing stops, i had to go back to 0.2.29 (since 0.2.33 doesn't display waveforms for me)

Most of the versions released in the last few weeks has tons of fun bugs, discovered by friendly people like you all.
You're probably triggering the bug that's fixed by 0.2.31's change "Rewrite scan logic to cope with tracks having strange and unpredictable lengths, once and for all. (https://github.com/zao/foo_wave_seekbar/wiki/Changelog#0231-20130324)"

The changelog is always available at this Github wiki page (https://github.com/zao/foo_wave_seekbar/wiki/Changelog).
Title: foo_wave_seekbar
Post by: marc2003 on 2013-04-02 14:40:20
Which are the ONLY boxes I need to check in "Waveform Seekbar - Configuration"?


if you have downmix to mono enabled, just select front centre (mono)
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-02 15:26:14
   Thanks for replying marc, however I decided to check every box! . . . and I chose "Keep as-is" for the Downmix display field.

   For people with no interest in "Multi-Channel Super-Duper Surround Sound Technologies", all those checkboxes are a head f*ck! . . . What exactly is the official technical name for the two speakers used by a stereo afficionado?   Is it "Front Left/Front Right" or is it "Rear Left/Rear Right"?

   Having checked every box, the end result is two side-by-side waveforms in my fairly large panel. Looking at separate waveforms for each channel (if stereo) is not so bad and pretty informative so I thought I would live with this for a while . . . and play some tracks and see . . . .

   I then played/tested many tracks from many different playlists to see Waveform Seekbar display behaviour . . . . under normal circumstances one would expect a single waveform displayed for mono tracks and two SxS waveforms for stereo tracks . . . . however I discovered that Waveform Seekbar did not show consistent behaviour; sometimes it would display a single waveform when it should be showing two!

   So, am I dreaming about the problem I see here?
   Do other users notice inconsistencies with the workings of this component when display preference is "1 waveform(track is mono) or 2 waveforms(track is stereo)"?
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 15:37:04
If there's a waveform already stored in the database, it's used, no matter if it agrees with the "downmix on analysis" advanced-setting.

That waveform is temporarily downmixed based on the display setting.
If "keep as-is", it's untouched.
If downmix to mono, if it's mono, it's untouched.
If downmix to stereo, if it's mono or stereo, it's untouched.

After the possible downmixing, the checkboxes matter. The channels of the waveform is tested against the checkboxes.
For all channels that are checked _and_ are present in the waveform, those channels are displayed. The rest are silently dropped.

Does this make the behaviour of the settings clearer?

tl;dr -- if you've downmixed-on-scan before and that waveform is stored in the database, that's the waveform that will be used. The whole purpose of that setting is to let people that only ever will use the mono-display functionality to save disk space and processing time when displaying.
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-02 15:59:37
Thanks for explaining the workings of your component in layman's terms Zao +++++

If I were you, I would have added one final comment to my post:

> If a waveform for a particular track appears wrong, then refresh the display; right click the track(s) and choose "Utilities->Remove Seekbar Signature"
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-02 19:11:56
I am trying to change the size of the displayed waveforms relative to the panel size, specifically when using Direct 3D 9.0c and custom script . . .

How do I force EVERY displayed waveform to always fill the full width of the panel irrespective of the loudness of each track?

In my script, by changing this:  "minmaxrms.rgb *= 0.8 + minmaxrms.a;"  to this:  "minmaxrms.rgb *= 0.95 + minmaxrms.a;"  I have widened the loudest waveforms to fill the panel width.
However, I would like all tracks to do the same thing, even the quieter ones.

Does anybody here know the code for this effect? Thanks . . .  . the answer has got something to do with changing  "return factor;"  to  "if ... return <calculation> else ... return <calculation>;"



here is my complete script:
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(backgroundColor, highlightColor, factor);
      }
      return c;
}
 
float RMSfactor( float2 tc, float border )
{
      float4 minmaxrms = tex1D(sTex, tc.x);
 
      minmaxrms.rgb -= .1 * minmaxrms.a;

      //- - - - - CHANGES THE OVERALL WAVE SIZE IN THE PANEL - - - - - - - -
      //minmaxrms.rgb *= 0.8 + minmaxrms.a;  <<<<<backup original
        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);

      //- - - - - ENABLE/DISABLE THE INSIDE WAVE - - - - - - - - !!!!!!!!!!!!! actually I'm not sure about any of this stuff here !!!!!!!!!!!!
      //  [TO DISABLE:  bool insideRms = 0;]  [TO ENABLE:  bool insideRms = diffRms < 0;  <<<<<backup original]     
        //bool insideRms = diffRms < 0;
        //bool insideRms = (belowWave > 0 && aboveWave < 0);
          bool insideRms = (diffRms > 0 && diffRms < 0);
   
      //- - - - - CHANGES LOOK OF INSIDE WAVE - - - - - - - -
      //float factor = insideRms ? ( 1 + 0.2 * saturate(factorRms / border / 2)): 1.0;  <<<<<backup original
        float factor = insideRms ? ( 6 * saturate(factorRms / border / 20)): 10.0;
 
      //- - - - - CHANGES LOOK OF OUTSIDE WAVE & PANEL BACKGROUND - - - - - - - -
      //factor = insideWave ? (factor * saturate(factorWave / border / 1)) : 0.0;  <<<<<backup original
        factor = insideWave ? (factorRms * 6.0 + 0.8 * saturate(factorWave / border / 0.5)) : 0.0;
   
      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;
}
 
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();
  }
}



*********************************************
By the way,
for all you old school stereo heads who have nothing to do with surround-sound,
the ONLY things you need to check in 'Waveform Seekbar—Configuration' are these three items:
Front left | Front center (mono) | Front right
*********************************************
Title: foo_wave_seekbar
Post by: Propheticus on 2013-04-02 19:58:10
Using replaygain would help...

Try changing "minmaxrms.rgb *= 0.95 + minmaxrms.a;" to something like this:

Code: [Select]
if(replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2; //use album gain
}
else if(replayGain.g != -1000){
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 2; //use track gain
}
else {
minmaxrms.rgb *= 0.95 + minmaxrms.a;
}
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-02 20:20:10
Thanks Propheticus, but I do not use replaygain.
Does anybody here know what is the code for filling the full panel width for every waveform irrespective of replaygain?

Not that I really know what I'm doing, but . . .

In my script, if you change  "return factor;"  to  "return saturate(factorWave);"  then you get something like what I am asking for!!!
The internal wave takes over and fully fills the panel dimensions on every track! . . . however the waveform is blurry and the background has changed color.
But at least I got something positive there.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 20:30:16
Whether you apply ReplayGain or not when listening is a bit irrelevant. What matters is that there's a perfectly fine infrastructure for peak information and I don't see any point in reimplementing it, poorly.

If it's present, the component will provide it. If it's not, it will not.
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-02 20:39:37
Can you repeat all of that . . . Some of the things you are saying come across to me as waffle.

If I am to interpret what you said . . .
The code Phropheticus provided will do the job; the presence of replaygain is not relevant ... blah blah blah lazy English.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-04-02 20:42:01
You can scan your file for replaygain info and setup foobar2000 NOT to use this while playing the file (preferences -> playback -> replaygain setting at the top and set "source mode" and "processing" to "none").
This way the waveform can be adjusted to the peak info derived from replaygain.

It seems you're toying around with stuff you hardly understand the basics of.... All these questions start to be getting silly. Do some research of your own please.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 20:47:52
Well, I guess my post is not exactly accurate...

The point is, ReplayGain information is usually good enough to fit the waveform to the amplitude extents of the window.
It's still usable by things like my component, even if you've configured foobar2000 to not apply it to the song when playing. (Preferences->Playback->ReplayGain)
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 20:50:02
Would it be possible to think through your posts a bit before responding... edits do not show up on email, and they can often significantly change the meaning of the post.
As for editing things after someone has replied, even worse. There's probably a ToS against it, somewhere.

(yes, I do this occasionally, no need to point that out)
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-02 20:54:10
> All these questions start to be getting silly. Do some research of your own please.

You are not the gatekeeper of silliness; I don't want a morality lesson from you; if you want to flex your brain muscles and help solve the problem then please do. . . else don't let the door hit you on the way out. If nothing else, the purpose of all my previous posts WAS research?

Zao
I just re-read your edited posts above, thanks for clarifying.
So, in a nutshell, is it or is it not possible to change that code to achieve the result without any reference to replaygain whatsoever?
Title: foo_wave_seekbar
Post by: db1989 on 2013-04-02 21:12:57
Keep replies on-topic and useful whilst avoiding squabbling and baiting. I don’t want to have to throw out the useful portions of posts as collateral damage from quenching a flamewar.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 21:27:15
Zao
I just re-read your edited posts above, thanks for clarifying.
So, in a nutshell, is it or is it not possible to change that code to achieve the result without any reference to replaygain whatsoever?

As it currently stands, the only information about the global nature of the waveform (peaks, whatever) is the four pieces of RG info.
It would be possible with support from the frontend to have a parameter like TRACKMAGNITUDE and CHANNELMAGNITUDE to expose the "true" extents of the waveform, but that's nothing that works today.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-04-02 21:28:55
I'm sorry for my comment I made earlier, but I found similar replayGain code within a minute of googling. I'm glad to help out and find it interesting to find answers to some of the questions. However, I don't like helping out when I later find out the same info can be found by simply googling the problem for a few minutes.
Title: foo_wave_seekbar
Post by: db1989 on 2013-04-02 21:37:06
I wasn’t singling out you or anyone else: my comment was general. Your point about searching is valid, and I frequently make similar recommendations myself, but the way it was framed made it one of several recent comments, by various authors, that could possibly be read as being inflammatory. With all of those in close proximity, I saw potential for the thread to go rapidly downhill, and I want to avert that, as I’m sure everyone does.
Title: foo_wave_seekbar
Post by: Dario on 2013-04-02 22:30:02
It'd be awesome if the default front-end settings were documented. I'm still in high school and my knowledge is terribly limited, but damn it, I'd be more than eager to learn to learn the basics regarding shaders and mess around with it.

EDIT: If you have ReplayGain, you can also try:

minmaxrms.rgb *= (1.0 / replayGain.b); // 1.0 divided by the album peak
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 22:58:49
A taste of work in progress: incremental display and actual peak information for normalizing in the effect (http://youtu.be/hgMOu0VjNaA) (youtube).
(http://zao.se/~zao/seekbar71.png)
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 23:28:02
Turns out that it was less work than expected to finish this up.

0.2.34 has incremental feedback (https://github.com/zao/foo_wave_seekbar/commit/c73e1c5f7c84edef0250abe4fe803d7d2cb2d32b) (needs advanced setting, defaults to off) and exposes two semantics to an effect (https://github.com/zao/foo_wave_seekbar/commit/93571096bdb8502c2aa18039cb69a942a059a71d) for you normalizing people (CHANNELMAGNITUDE and TRACKMAGNITUDE, aptly misnamed as they're actually amplitudes).
See changelog at Github (https://github.com/zao/foo_wave_seekbar/wiki/Changelog#0234-20130403), as usual.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 23:36:20
It'd be awesome if the default front-end settings were documented. I'm still in high school and my knowledge is terribly limited, but damn it, I'd be more than eager to learn to learn the basics regarding shaders and mess around with it.

Most of the effects are based on one of my early abominations, so they're generally hacky, undocumented and inefficient, so I'm not overly surprised that one'd get lost in them. Heck, I get lost, most of the time.

In essence, the effect runs once per pixel. Most of the work is to determine where in the viewport that particular fragment is, and query the information available (waveform texture, parameters, colors).
In most of the effects, there's things like measuring "how many pixels are we above the upper side of the waveform", "how far below the low side are we", "are we occupying a position that needs part of a bar rendered". Once you have the numeric or logic facts, you can start combining them to get something that looks awesome.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-04-02 23:44:11
i like that incremental effect but most people will never see it as it's too fast. you need 1h+ long files at least.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-02 23:47:31
I had to use a debug build to tell if it was working at all while developing, as I couldn't be bothered digging up multi-hour files. There are formats that are quite costly to decode though, which is one of the purposes.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-04-02 23:50:44
so you can mimic the effect on files that don't need it? any chance that could be implemented?

edit: just seen your edit. i did not know about that.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-03 00:04:37
You could fake a smooth reveal of the data by looking at the ... odd, I could've sworn I had a "current-time" and "duration" semantic binding.
If I had semantics for those, you could look at the current time and the duration of the track, and do your own fades based on their relation, and other sweet-ass time-dependent effects, like sparkling and whatever
Title: foo_wave_seekbar
Post by: tedsmith on 2013-04-03 02:58:16
I had to use a debug build to tell if it was working at all while developing, as I couldn't be bothered digging up multi-hour files. There are formats that are quite costly to decode though, which is one of the purposes.

I have plenty of 60 or 80 min 24/88.2 and 24/96, etc. flac files.  The incremental display is great.
Title: foo_wave_seekbar
Post by: zooliat on 2013-04-03 14:03:43
Zao, version 0.2.30.1 causes some really high CPU usage even after playing stops, i had to go back to 0.2.29 (since 0.2.33 doesn't display waveforms for me)

Most of the versions released in the last few weeks has tons of fun bugs, discovered by friendly people like you all.
You're probably triggering the bug that's fixed by 0.2.31's change "Rewrite scan logic to cope with tracks having strange and unpredictable lengths, once and for all. (https://github.com/zao/foo_wave_seekbar/wiki/Changelog#0231-20130324)"

The changelog is always available at this Github wiki page (https://github.com/zao/foo_wave_seekbar/wiki/Changelog).



I updated to 0.2.34 and the high cpu usage is still up to 70% for a few seconds. Reverted back to .29, because it doesn't have this problem and the scanning runs smooth in the background (also being pretty fast)
Title: foo_wave_seekbar
Post by: Zao on 2013-04-03 23:20:49
A future release, probably 0.2.35, will have three additional float effect parameters to play with, TRACKTIME, TRACKDURATION and REALTIME, corresponding to the number of seconds elapsed, number of seconds in the track, and a second count from some point in time since the startup of the frontend.

An example video (http://youtu.be/BQWbUVI5fNk) of what one then can do with time-varying parameters, a cute wave:y position indicator.
Code: [Select]
float4 bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show )
{
    float y = tc.y - 0.3*sin(3.14*real_time) + 0.5*cos(1.1*real_time);
    float x_dist = abs(pos - tc.x);
    float y_dist = abs(y) * 0.005;
    float4 c = (show && x_dist < width)
        ? lerp(fg, bg, smoothstep(0, width, x_dist))
        + lerp(fg, float4(0, 0, 0, 0), smoothstep(1.0/200, 0, y_dist))
        : bg;
    return c;
}
Title: foo_wave_seekbar
Post by: matt the cat on 2013-04-03 23:25:39
Direct2D mode seems to be broken as of latest version, D3D and GDI works properly
Title: foo_wave_seekbar
Post by: Zao on 2013-04-03 23:47:05
I updated to 0.2.34 and the high cpu usage is still up to 70% for a few seconds. Reverted back to .29, because it doesn't have this problem and the scanning runs smooth in the background (also being pretty fast)

Could you please use Process Explorer when this happens and see what threads are consuming CPU, like shown in the following image?
The three threads that mention foo_wave_seekbar.dll are likely the waveform extraction threads, or possibly worker threads for GDI/Direct2D, if you use those frontends.
(http://zao.se/~zao/seekbar72.png)
Title: foo_wave_seekbar
Post by: Zao on 2013-04-03 23:52:33
Direct2D mode seems to be broken as of latest version, D3D and GDI works properly

Elaborate on "broken". Doesn't display, crashes and burns, disintegrates your pet food? On what OS? With what kind of GPU? What foobar2000 version?
Title: foo_wave_seekbar
Post by: zooliat on 2013-04-04 15:03:05
I updated to 0.2.34 and the high cpu usage is still up to 70% for a few seconds. Reverted back to .29, because it doesn't have this problem and the scanning runs smooth in the background (also being pretty fast)

Could you please use Process Explorer when this happens and see what threads are consuming CPU, like shown in the following image?
The three threads that mention foo_wave_seekbar.dll are likely the waveform extraction threads, or possibly worker threads for GDI/Direct2D, if you use those frontends.



It happens mostly on long files (dj sets or whole-file albums). Also 0.2.29 does it, so i guess it's the cpu needed to render the file. Although it would be nice to have a different approach on resolution/granularization for large files. Or, if possible to limit the amount of CPU it takes to scan.

(http://i.imgur.com/vzwX85i.jpg)
Title: foo_wave_seekbar
Post by: Zao on 2013-04-04 15:29:44
The majority of the scan cost is in actually decoding the file. My code accounts for maybe 10-20% of the time taken to analyse it.
If you don't want bursts of work while using the player normally, consider extracting the waveforms ahead-of-time through the context menu.

As for artificially taking more time, I don't really see much point in that. The analysis runs at idle priority already, so it shouldn't affect any competing processes adversedly. If anything, it'd make things worse as dynamic frequency scaling wouldn't kick in, or kick in erratically.

Do you have an actual adverse effect by this usage of a resource that's mean to be used as needed, or is it some kind of mindset of yours? There is work that needs to be done, and it doesn't do (much) excess work.

The only known problem is that the predictive analysis might cause the same track to be scanned multiple times if started while a scan is in progress, but that's about it.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-04-04 15:35:48
i have loads of 2-3 hour DJ sets and it's not adversely affected anything i'm doing while it's working. i did time my longest file (3h20m mp3) just for giggles and it took 36 seconds .... and i have a celeron as well.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-04 16:12:33
I have done some pondering on whether it's beneficial to seek and only decode equally spaced parts of the tracks, but it's very hard to beat the speed you get from pure decoding if you try to seek around.

If my memory is right, the cutoff point was somewhere around 30-50% content analysed if you did the seek-and-decode-chunks dance. This means that you gain nothing at all and lose over half of the information in the tracj, resulting in a significantly inaccurate waveform, and it only gets worse once you try to look at even less than that.

It's inevitable that you need to decode the whole track, so there's a base time cost I cannot get around.
Title: foo_wave_seekbar
Post by: zooliat on 2013-04-06 19:54:15
a little bug in 0.2.34: when shuffling, it displays the wave of the last played song for 1-2 seconds until it decodes the current one. Looks kinda weird and can be misleading on long files Also I got used to the blank screen from .29.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-06 20:15:30
Everyone has different feelings about blanking/flat/previous waveform when encountering a track that doesn't have a waveform. I don't really see much point in working anything out there, as there's a very simple solution.
Just scan your tracks ahead of time.
Title: foo_wave_seekbar
Post by: zooliat on 2013-04-06 21:13:39
Everyone has different feelings about blanking/flat/previous waveform when encountering a track that doesn't have a waveform. I don't really see much point in working anything out there, as there's a very simple solution.
Just scan your tracks ahead of time.


ok
Title: foo_wave_seekbar
Post by: EpicForever on 2013-04-06 21:18:27
Is there any place where I can still download valid v .29?

EDIT:
THX marc that was so easy, I feel like a dumb
Title: foo_wave_seekbar
Post by: marc2003 on 2013-04-06 21:23:35
0.2.29 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.29.fb2k-component)

Title: foo_wave_seekbar
Post by: r0lZ on 2013-04-09 11:30:55
Just to let you know, I have had the Direct3D Frontend Settings not opening any window problem reported by NullString here (http://www.hydrogenaudio.org/forums/index.php?showtopic=77490&st=800&p=768918&#entry768918).  There are however 3 important differences.  I had not the DirectX runtime installed, and I'm using CUI.  Also, after having selected Direct3D and started to play a track, I've noticed that WS reverted automatically to the GDI frontend.  Obviously, Direct3D was not working correctly on my machine.

After some searches, I've found that it is necessary to install the DX runtime, and I've installed it.  That solved the problem.  So, I guess that the DX runtime is not correctly installed on NullStream's machine.  And I suggest, if it's possible, to write an error message in the log when WS detects that the DX runtime is not installed or, more important, not working correctly.  (Maybe it's already the case, I haven't verified.)

I have also a question.  Currently, the frontend script is loaded via the window.  Does that means that the old effects directory in appdata is not used any more and that it can safely be deleted?  Thanks in advance.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-04-09 11:34:27
Yes the effects folder can safely be removed. It isn't used anymore.
Title: foo_wave_seekbar
Post by: r0lZ on 2013-04-09 11:41:45
Thanks for the confirmation. 
Title: foo_wave_seekbar
Post by: Zao on 2013-04-09 12:50:00
throw std::runtime_error("DirectX redistributable not found. Run the DirectX August 2009 web setup or later.");

Yes, there should be an error printed to the console, but it's inaccurate. The redist you need is February 2010 (or June 2010).

See the very first post in the thread for the requirements:
Quote
The Direct3D 9.0c mode requires the DirectX end-user runtime dated earliest February 2010, which can be installed through use of the DirectX end-user Runtime Web Installer (make sure to not accidentally install the Bing Bar they try to force on you).
Note that the DirectX redistributable is required on all OSes no matter whether you think you "have DirectX installed already, lol" or not.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-09 12:53:34
While it is possible to privately deploy the DLLs needed, I'm not going to do that. It'd bloat each and every release archive by 1.7 MiB and the installation by 3.91 MiB.

It's bad enough having to bundle the editor component already.
Title: foo_wave_seekbar
Post by: Snivets on 2013-04-10 09:01:41
Heyo! I've got an odd issue, not sure if anyone else has seen this yet. How come when I have foobar set to downmix recordings to mono in the Preferences > Advanced > Tools > Waveform Seekbar panel, waveforms get displayed half-width? As in, the seekbar functions normally, seeking to the right side of the pane scrolls to the appropriate part of the song, but the waveform appears scaled to only 50% of the window's width?
Title: foo_wave_seekbar
Post by: r0lZ on 2013-04-10 09:46:50
I've noticed that too, but only with Direct2D.

There are other problems with the other frontends: with GDI, the waveform is not drawn at all for many tracks (but not all), and with Direct3D, the result depends of the script, but scripts that work well with most tracks display nothing with other tracks.

Something has changed too.  Previously, when a track that has not already been scanned was selected, the display was originally blank, and after a few seconds, the right waveform was displayed.  Now, the waveform of the previous track remains in the display during the scanning of the new track, and often, it remains for ever, or it just disappears when the scan is finished.  Playing another track of the same album then again the track that does not shows up correctly does nothing: the waveform of the first track remains in the display.

Also, it seems that Rescan All Waveforms do not work any more.  I've tried to delete the wavecache.db file and rebuild all waveforms, just to be sure that the problem was not caused by a corrupted db, but I cannot do it.  Rescan All Waveforms does nothing and nothing appears in the log.

I have also tried to revert to v0.2.29 that I had in a backup, and it seems to work better, but the Rescan All Waveforms problem persists.

Not sure why I have so many problems.  I have never noticed that bugs previously, but I've installed Windows 8 x64 recently.  Could it be the reason?
Title: foo_wave_seekbar
Post by: matt the cat on 2013-04-10 15:34:35
Direct2D mode seems to be broken as of latest version, D3D and GDI works properly


Heyo! I've got an odd issue, not sure if anyone else has seen this yet. How come when I have foobar set to downmix recordings to mono in the Preferences > Advanced > Tools > Waveform Seekbar panel, waveforms get displayed half-width? As in, the seekbar functions normally, seeking to the right side of the pane scrolls to the appropriate part of the song, but the waveform appears scaled to only 50% of the window's width?


I've noticed that too, but only with Direct2D.

There are other problems with the other frontends: with GDI, the waveform is not drawn at all for many tracks (but not all), and with Direct3D, the result depends of the script, but scripts that work well with most tracks display nothing with other tracks.

Something has changed too.  Previously, when a track that has not already been scanned was selected, the display was originally blank, and after a few seconds, the right waveform was displayed.  Now, the waveform of the previous track remains in the display during the scanning of the new track, and often, it remains for ever, or it just disappears when the scan is finished.  Playing another track of the same album then again the track that does not shows up correctly does nothing: the waveform of the first track remains in the display.

Also, it seems that Rescan All Waveforms do not work any more.  I've tried to delete the wavecache.db file and rebuild all waveforms, just to be sure that the problem was not caused by a corrupted db, but I cannot do it.  Rescan All Waveforms does nothing and nothing appears in the log.

I have also tried to revert to v0.2.29 that I had in a backup, and it seems to work better, but the Rescan All Waveforms problem persists.

Not sure why I have so many problems.  I have never noticed that bugs previously, but I've installed Windows 8 x64 recently.  Could it be the reason?


This is the issue I am having.

Here's a screenshot to compate between GDI and D2D for me right now:

(https://i.minus.com/iTlFl0JLNult2.png)

System:
Windows 8 x64
latest stable fb2k
ATI Radeon HD 4870 X2 with 13.1 AMD legacy drivers (latest)
Title: foo_wave_seekbar
Post by: Zao on 2013-04-10 17:19:15
Curse you, exotic users with settings I don't use.

The best configuration to have as an end user is the one that I use. Anything else will get less testing, and as you've seen, more bugs 

Use CUI? More bugs.
Use D2D? More bugs.
Downmix-on-scan? More bugs.
Use media library? More bugs.
Not on my machine? Tons of bugs!

Direct2D is especially annoying, as I can't launch that from a debugger at all.
Title: foo_wave_seekbar
Post by: PeteG on 2013-04-10 18:32:21
Use media library? More bugs.

Could you elaborate on that?

Umeå! Home of Mats/Morgan. Nice.
Title: foo_wave_seekbar
Post by: matt the cat on 2013-04-10 19:34:46
Curse you, exotic users with settings I don't use.

The best configuration to have as an end user is the one that I use. Anything else will get less testing, and as you've seen, more bugs 

Use CUI? More bugs.
Use D2D? More bugs.
Downmix-on-scan? More bugs.
Use media library? More bugs.
Not on my machine? Tons of bugs!

Direct2D is especially annoying, as I can't launch that from a debugger at all.


Too bad D2D is the fastest so IMHO = best 

If you need anything, ask away.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-10 19:43:22
PeteG: I don't have enough structure in any of my music directories to benefit from the ML, so any code working with the ML is written against what's promised in the API documentation and may contain misconceptions or errors. I rely on my trusty team of pre-release testers to find bugs in the areas of the component that they give a hoot about.

As for all these bugs cropping up lately, the codebase is a stale legacy clusterhug of bad design and decisions which breaks miserably as soon as you try to change anything in it. It could use a good rewrite, but I don't really want to touch it too much while I'm still on the inferior compilers with XP support.

Long story short, XP compatibility requires me to use the VC++ 2010 compiler, which has plenty of legacy stupidity in it. (And no, v110_xp is not an alternative, due to lack of support in third party build systems like Boost's.)
Title: foo_wave_seekbar
Post by: Snivets on 2013-04-11 08:10:38
Yup, the D2D is definitely the root here. I haven't fiddled with any other FX or anything to make it look as simple and straightforward as I like it in my layout... so my temp fix works just fine for now.

Think you'll be dropping the XP support anytime soon, Zao?
Title: foo_wave_seekbar
Post by: Zao on 2013-04-11 08:54:15
Sadly no.

There will be a day where I cannot keep installing legacy compilers anymore. By that time, I hope to have a stable-enough version of the component that I can call "Classic", and make something more awesome to take its place.
Due to that I can't split the cache/scan logic out into a separate component is a bit annoying, as it's then impossible to reliably share it. I used to have it split out, but no-one was able to keep it up to date, insisting on running mismatched versions with amusing crashes as a result.
Title: foo_wave_seekbar
Post by: TomKure on 2013-04-12 20:52:19
Zao: then don't use Boost and program the required functionality by yourself!

BTW in .34 I still got problems when using D2D and storing stuff in mono (waveforms not changing, waveforms being half size)...

Can't someone just write a shader which would make D3D look like D2D (simple look, no fill in the waveform)?
Title: foo_wave_seekbar
Post by: Zao on 2013-04-12 21:28:18
I've got my own line effect that in my eyes looks better than the D2D look, as it's a bit more smoothed.

I make piece-wise linear segments out of the waveform samples around the current fragment and compute the closest distance to those line segments and color accordingly.
An early attempt at this (https://gist.github.com/zao/2477148) and my current personal effect (https://gist.github.com/zao/5374870) are available at your own risk.

You'd be surprised if you knew how many Boost libraries I've removed over the lifetime of the component. It's not much more than PropertyTree, SmartPointer and Asio left nowadays.
Title: foo_wave_seekbar
Post by: dts350z on 2013-04-14 02:09:35
Apologies if this has been covered but I can't seem to search for "windows 8" in this forum.

Today's project is bringing up a windows 8 machines (l need it to test my software on) and I installed waveform seekbar but it never shows any waveforms.

The blue highlight moves across the screen but there is no waveform shown.

One unusual thing I did was to copy my foobar theme.ftl file from another computer to bring the layout over.

On my windows 7 machine, waveform seekbar is set to direct 3D 9C. That setting won't stick, or allow config (i'm guessing there's no directX in windows 8). It's set on GDI and the frontend settings are grayed out.

It will also "stick" on  direct2d 1.0, but there is still no waveform showing.

Any ideas?
Title: foo_wave_seekbar
Post by: dts350z on 2013-04-14 02:16:21
Apologies if this has been covered but I can't seem to search for "windows 8" in this forum.

Today's project is bringing up a windows 8 machines (l need it to test my software on) and I installed waveform seekbar but it never shows any waveforms.

The blue highlight moves across the screen but there is no waveform shown.

One unusual thing I did was to copy my foobar theme.ftl file from another computer to bring the layout over.

On my windows 7 machine, waveform seekbar is set to direct 3D 9C. That setting won't stick, or allow config (i'm guessing there's no directX in windows 8). It's set on GDI and the frontend settings are grayed out.

It will also "stick" on  direct2d 1.0, but there is still no waveform showing.

Any ideas?


FYI windows 8 has directx 11 installed by default.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-04-14 03:01:25
from the opening post.

The Direct3D 9.0c mode requires the DirectX end-user runtime dated earliest February 2010, which can be installed through use of the DirectX end-user Runtime Web Installer (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en) (make sure to not accidentally install the Bing Bar they try to force on you).
Note that the DirectX redistributable is required on all OSes no matter whether you think you "have DirectX installed already, lol" or not.
The Direct2D 1.0 mode requires either Windows Vista SP2 or Windows 7 and up. For Vista SP2 it requires installation of the Platform Update (http://support.microsoft.com/kb/971644).


Title: foo_wave_seekbar
Post by: dts350z on 2013-04-14 05:55:23
"The Direct2D 1.0 mode requires either Windows Vista SP2 or Windows 7 and up"

So that should work, but it's not.

I downloaded from the "end-user runtime web Installer" link. Now I can it to stick on DirectX 9c, but it still doesn't work on any setting.

Title: foo_wave_seekbar
Post by: Case on 2013-04-14 09:14:19
Sounds like you have wrong channels enabled in the "Channel display order" configuration. IMO best look is obtained by setting "Downmix display" to "mix-down to mono", with this you only need to tick "Front center (mono)" channel. With other settings you need at least "Front left" and "Front right".
Title: foo_wave_seekbar
Post by: r0lZ on 2013-04-14 09:16:55
I have a similar problem with W8, but also with W7 (both x64).  See here (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=830710).
Title: foo_wave_seekbar
Post by: r0lZ on 2013-04-14 09:33:23
Also, it seems that Rescan All Waveforms do not work any more.  I've tried to delete the wavecache.db file and rebuild all waveforms, just to be sure that the problem was not caused by a corrupted db, but I cannot do it.  Rescan All Waveforms does nothing and nothing appears in the log.

I was wrong.  Rescan All Waveforms works, but it rescan only the waveforms that have already been scanned and are present in the wavecache.bd.  I thought it was supposed to scan all tracks of the library and add them in the db.
BTW, it would be nice to add the possibility to add a tool to verify if all tracks of the library are already in the db, and when it's not the case, scan them.  With a big library, that may take a while, but at least, after the operation, we'll sure that the waveform of any track will be displayed immediately.

I have tried to replace the current version of the plugin with a very old version (v0.2.12) I had with an old portable version of Foobar.  That version works well with all frontends, and I have none of the problems I have reported here (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=830710).  (That version still uses the "effect" folder, and has not the D3D script editor integrated in the GUI.)
Is it possible to download the old versions somewhere?  I would like to check in what version the bugs have been introduced.  That may help Zao to fix them, and anyway, I would prefer to use the most recent version that has not that bugs.  Thanks!
Title: foo_wave_seekbar
Post by: Zao on 2013-04-14 09:33:46
I'm quite aware of the assorted problems with Direct2D, but as long as I'm physically unable to debug them, I can't say I give too many hoots about resolving them.
Title: foo_wave_seekbar
Post by: r0lZ on 2013-04-14 09:48:09
Yes, but it might be easy to locate the bug by comparing what has changed in the first version that has introduced it.  I can check that for you if I can download the old versions.  Is it possible?
And there are bugs in D3D and in the way the waveform are displayed after a track change too.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-14 10:15:15
I haven't really touched the D3D and D2D frontends at all in the recent series of versions.
It's all side effects from changing the analysis and retrieval paths. The problem is that it has never really been correct, it just haven't happened to be visibly wrong for the majority in the past.
Title: foo_wave_seekbar
Post by: mostlyautumn on 2013-04-14 16:57:41
Previously, when a track that has not already been scanned was selected, the display was originally blank, and after a few seconds, the right waveform was displayed.  Now, the waveform of the previous track remains in the display during the scanning of the new track

I'm also seeing this. The waveform also stays after the playback has been stopped. Is it supposed to be like this or is it a bug?
Title: foo_wave_seekbar
Post by: dts350z on 2013-04-14 17:32:14
Sounds like you have wrong channels enabled in the "Channel display order" configuration. IMO best look is obtained by setting "Downmix display" to "mix-down to mono", with this you only need to tick "Front center (mono)" channel. With other settings you need at least "Front left" and "Front right".


No, but the whole windows 8 thing turned out to be a red herring. On my freshly installed windows 8 machine I didn't have any music, so I was using audio CDs. As soon as I checked out a flac file everything worked as normal.

I don't recall having the audio cd problem in windows 7 however.

By the way I work with surround music, and very much want to see all the waveforms, up to 7.1, so I wouldn't be using any mixdown.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-14 18:35:58
Audio CDs are on the ignore list, as they're not a format that isn't possible to scan in the background or concurrently. Be happy, as it'd kill your optical drive if it still was, not to mention that it would ruin your playback by eternal underruns.

Code: [Select]
return match_pi("(random|record):.*") ||
       match_pi("(http|https|mms|lastfm|foo_lastfm_radio|tone)://.*") ||
       match_pi("(cdda)://.*");


As for Windows 8, I've got several testers on it, and I run it as my primary OS. If there's any OS that will break, it's the ones before 7, as I don't have anyone running them.
Title: foo_wave_seekbar
Post by: dts350z on 2013-04-14 19:03:15
Audio CDs are on the ignore list, as they're not a format that isn't possible to scan in the background or concurrently. Be happy, as it'd kill your optical drive if it still was, not to mention that it would ruin your playback by eternal underruns.

Code: [Select]
return match_pi("(random|record):.*") ||
       match_pi("(http|https|mms|lastfm|foo_lastfm_radio|tone)://.*") ||
       match_pi("(cdda)://.*");


As for Windows 8, I've got several testers on it, and I run it as my primary OS. If there's any OS that will break, it's the ones before 7, as I don't have anyone running them.


OK, thanks for clearing that up!

And thanks for the great component!
Title: foo_wave_seekbar
Post by: Innomen on 2013-04-25 10:58:28
I love waveform seekbar.

Pursuant to a suggestion I received in this thread (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=100528&view=findpost&p=832221) I am suggesting/requesting (sort of) a spectrograph seek bar.

Many of my songs end up with near solid bars for waveform output as if they were white noise, but when viewed as a spectrograph their complexity is revealed.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-04-25 13:51:14
I'd suggest you try the direct3d frontend. If you scroll a few posts back you'll find custom frontends. You can either use a fixed height or the replaygain adjusted waveform.
I find this to display the wave more accurately than the blurry GDI frontend.
Title: foo_wave_seekbar
Post by: carpman on 2013-04-25 14:12:17
Propheticus, I use the direct3d frontend, but how do I get a fixed height?

Thanks,

C.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-04-25 14:41:58
This is what I'm using atm.
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(backgroundColor, highlightColor, 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 diffRms = abs(tc.y) - border - minmaxrms.b;
        float factorRms = abs(diffRms);
        bool insideRms = diffRms < 0;
     
        float factor = insideRms ? ( 1 + 0.17 * saturate(factorRms / border / 2)): 1.0;
        factor = insideWave ? (factor * 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;
}

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();
    }
}
Title: foo_wave_seekbar
Post by: carpman on 2013-04-25 15:40:11
Thank you Propheticus. I shall play around with that and see what happens. Looks pretty good though!

C.
Title: foo_wave_seekbar
Post by: derty2 on 2013-04-25 17:13:36
carpman

When you say "how do I get a fixed height", do you mean you want all waveforms to have maximum size in the panel, irrespective of the existence of replay gain values?
If so, you may also be interested in my waveform seekbar script for Direct3D . . .

View this screenshot:
(http://i.imgur.com/6zzSGI4l.jpg) (http://i.imgur.com/6zzSGI4.jpg)

Here is my script:
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 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 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);

  //- - - - - 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 -= .1 * minmaxrms.a;

      //- - - - - CHANGES THE OVERALL WAVE SIZE IN THE PANEL - - - - - - - -
      //minmaxrms.rgb *= 0.8 + minmaxrms.a;  <<<<<backup original
        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);

      //- - - - - ENABLE/DISABLE THE INSIDE WAVE - - - - - - - -
      //  [TO DISABLE:  bool insideRms = 0;]  [TO ENABLE:  bool insideRms = diffRms < 0;  <<<<<backup original]     
        //bool insideRms = diffRms < 0;
        //bool insideRms = (belowWave > 0 && aboveWave < 0);
          bool insideRms = (diffRms > 0 && diffRms < 0);
   
      //- - - - - CHANGES LOOK OF INSIDE WAVE - - - - - - - -
      //float factor = insideRms ? ( 1 + 0.2 * saturate(factorRms / border / 2)): 1.0;  <<<<<backup original
        float factor = insideRms ? ( 6 * saturate(factorRms / border / 20)): 10.0;
 
      //- - - - - CHANGES LOOK OF OUTSIDE WAVE & PANEL BACKGROUND - - - - - - - -
      //factor = insideWave ? (factor * saturate(factorWave / border / 1)) : 0.0;  <<<<<backup original
        factor = insideWave ? (factorRms * 6.0 + 0.8 * saturate(factorWave / border / 0.5)) : 0.0;
 
      //return factor;    <<<<<<backup original
        return insideWave - saturate(factorWave);
}
 
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;
}
 
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();
  }
}

BIG THANKS to Zao for updating his component to allow this "faux normalized" effect +++++++++++++++++++++++++++++++
Title: foo_wave_seekbar
Post by: carpman on 2013-04-25 18:00:59
@derty2, yes that's what I meant "faux normalized" like you say.
Thanks, I'll give it a go.

C.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-04-25 19:12:24
That faux normalized works pretty well, thanks for mentioning that! I think I'll be using that in my script too.
Title: foo_wave_seekbar
Post by: extracampine on 2013-04-25 22:33:13
Is there any way to get Foobar to show which files need to have their seekbar extraced? I.e. show only files where the seekbar has not yet been extracted?

I want to extract all the seekbars for my music but don't want to re-do the ones I have already done as it would take ages (3TB+, Atom D525 processor). 

Thanks!
Title: foo_wave_seekbar
Post by: marc2003 on 2013-04-26 15:06:31
^i don't think so.

IF you had playback statistics (http://www.foobar2000.org/components/view/foo_playcount) installed, you could make an assumption that anything with a %last_played% date after the db file was created, you'd have a waveform for it.

maybe there is some way to get the file paths out of the db but it probably isn't worth the effort.
Title: foo_wave_seekbar
Post by: Zao on 2013-04-26 15:35:10
Is there any way to get Foobar to show which files need to have their seekbar extraced? I.e. show only files where the seekbar has not yet been extracted?

I want to extract all the seekbars for my music but don't want to re-do the ones I have already done as it would take ages (3TB+, Atom D525 processor). 

Thanks!

I used to provide metadata hooks like %has_seekbar_signature% or such-like in the past, but I think I removed them as they weren't quite the thing that infrastructure was meant for.

If you want to query the database, open wavecache.db with sqlite3.exe, and run the following:
Code: [Select]
.output file-listing.txt
select location,subsong from file;


Combine that with outputting your whole library with foo_texttools or something, and you could probably ad-hoc a playlist file together with the missing entries.
Title: foo_wave_seekbar
Post by: mjb2006 on 2013-05-02 05:03:49
With the current version (0.2.34), I'm getting different waveforms for a FLAC than for the corresponding WAV. It doesn't matter what display mode I use (D2D, D3D, GDI; downmix doesn't matter).

The FLAC converted back to WAV looks the same as the original WAV from which the FLAC was made. The FLAC, though, looks slightly different.
(I'd post screenshots, but I can't figure out where they're being saved to... no info is in the console.)

Is something wrong?
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-02 09:15:51
I have question for Propheticus.
Propheticus, I want to use your code from Post #1329. If I'm not wrong your code provides 2 things, that I don't want to use - first is "fixed height" - which makes all waveforms of the same height, no matter what real amplitudes are in the file. Second is replaygain - I want "real" amplitudes, not replaygained. My question to you is : how should I modify your code to simply use D3D9, use your type of colouring, but without that 2 options?
Title: foo_wave_seekbar
Post by: Zao on 2013-05-02 11:59:25
With the current version (0.2.34), I'm getting different waveforms for a FLAC than for the corresponding WAV. It doesn't matter what display mode I use (D2D, D3D, GDI; downmix doesn't matter).

The FLAC converted back to WAV looks the same as the original WAV from which the FLAC was made. The FLAC, though, looks slightly different.
(I'd post screenshots, but I can't figure out where they're being saved to... no info is in the console.)

Is something wrong?

Maybe. Is this for any FLAC you've encoded or just some particular one? What encoder do you use?

Don't use the built-in screenshot functionality by the way, that has never been a supported feature. I don't remember how/if it's supposed to work and will be removing it in later versions.
Just use the Windows functionality and/or ShareX to capture screenshots.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-05-02 12:00:24
@EpicForever

The code I posted above has the replaygain part commented out, so it already uses the actual amplitude data. You can change the 0.8 value in the 'without replaygain' code to either prevent it running out of bounds/left and right overlapping or widen it. This is an overall width setting, not normalization. Only when you uncomment (remove /* and */) the part where I indicated it in the file, replaygain data will be used. I left both pieces of code in to leave the choice to the user whether or not to use replaygain compensation.

Long story short: It should already work like requested without editing anything.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-02 20:32:54
Many thanks Propheticus !!
Many thanks derty2 - your version is also nice

I have additional question. What if I like colouring from the default D3D9 script, but I want it to be as sharp as waveform displayed by Propheticus and derty2 scripts? Default script is as blurry on the edges as GDI. Which parts of code should be replaced in default script to achieve only sharpness, but leave default colouring intact?
Title: foo_wave_seekbar
Post by: mjb2006 on 2013-05-02 21:40:41
With the current version (0.2.34), I'm getting different waveforms for a FLAC than for the corresponding WAV. [...] Is something wrong?

Maybe. Is this for any FLAC you've encoded or just some particular one? What encoder do you use?

It seems to happen with all FLACs, and the encoder doesn't matter. (Flake, libFLAC). It doesn't matter if you start with a WAV and convert it to FLAC, or vice-versa.

(http://hyperreal.org/~mike/tmp/ha/waveform-seekbar-issue.gif)

That's for a 5-minute song. Now look at a 41-second clip:

(http://hyperreal.org/~mike/tmp/ha/waveform-seekbar-issue-2.gif)

Are you able to reproduce it? Just use a WAV and FLAC with same audio, and see if the waveforms are the same.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-02 21:50:57
Yes, I've reproduced it, and am trying to drill down into why two decodes considered equivalent by foo_bitcompare result in different signatures.

Unless I'm severely misusing the decoder interface and I'm missing some kind of flag, there's probably a bug in the bucket division code, or that the file formats generate chunks of varying sizes.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-02 23:02:11
Found the bug, a fix will appear whenever I manage to make a public build.
It turns out that if a chunk from the decoder straddled several analysis buckets, the trailing buckets didn't offset into the chunk, instead repeating the beginning of it.
Title: foo_wave_seekbar
Post by: mjb2006 on 2013-05-03 01:56:57
Thanks for checking into it! Glad it wasn't just me. We'll probably have to rebuild our databases, eh?
Title: foo_wave_seekbar
Post by: Aldem on 2013-05-03 05:27:09
It must be hard to code (I presume, I'm no dev.), but it'd be nice if there was an option that could show you in red where there's clipping, kinda like what Audacity does.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-03 07:39:52
In the shader code, test if the min sample is less than negative one, or if the max sample is above one. If so, just use a different color for the functions, or just early-out with solid red.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-03 07:50:38
Thanks for checking into it! Glad it wasn't just me. We'll probably have to rebuild our databases, eh?

You need to remove and recreate your waveforms if you want the subtle correctness improvement this provides, yes. I'll put a note in the changelog when it's released.
Sadly this affects pretty much any waveform generated this year.

As a side note, the upcoming release will be the first using Visual Studio 11's XP-compatible compiler, and it will also depend on the dynamic runtime, due to not being able to build my dependencies against the static runtime anymore.
(that is, the runtime for Visual Studio 2012 Update 1 (http://go.microsoft.com/?linkid=9815734))
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-03 09:35:47
Sorry for bothering while such important questions are discussed, but how about my question from my previous post?
http://www.hydrogenaudio.org/forums/index....st&p=833144 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=833144)  ?
Title: foo_wave_seekbar
Post by: Zao on 2013-05-03 10:13:41
Things added in edits do not show up in my email inbox, so they're extremely easy to miss.

The default effect does a linear interpolation (with the lerp function) from the background colour to the inside colour, like:
Code: [Select]
float4 wave = outside
  ? bgColor
  : lerp(bgColor, textColor, 7.0*factor);

The part after the ? is the colour to use for pixels outside of the waveform, while the part after the : is for pixels inside the waveform. No matter how you mess with these functions, you will still have the clear distinction between inside and outside fragments. It's just that the default look makes it approach the background colour from the inside. The factor parameter is related to the vertical distance from the edge, kind of.

You can bias this by twidding the interpolation parameter somewhat, like:
Code: [Select]
lerp(bgColor, textColor, 7.0*factor + 0.7)

This makes it not quite reach the background colour, but instead targets a colour inbetween as the boundary.

This is where artfulness and toying around comes in
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-03 11:07:23
Thank you so much Zao... This is exactly what I was looking for  . So, GDI interface will not be used here anymore.
I liked the idea of waveform seekbar since I have seen it on list of official components for the first time, but today I see how good component it is  . I wonder how others can use other software music players like iTunes for example... If for some reason foobar couldn't run on my PC anymore, then I would just stop listening to the music on PC. Or buy new one .
I am little bit scared that I have to run PC for whole day and night again, to let it extract new signatures... Does this recently found bug alters only FLAC, only lossless or just every kind of music files?
Title: foo_wave_seekbar
Post by: Zao on 2013-05-03 11:59:11
It affects everything, no matter what format the source is.

In my analysis, I split all the samples in the song up into 2048 partitions.
When I get audio from the decoder, it arrives in chunks of a few thousand samples.

Code: [Select]
[_partition #0_______________________][_partition #1_______________]...
[_chunk #0_____][_chunk #1__][_chunk #2______][_chunk #3___][_chunk #4____]...
abcdefghijklmnopabcdefghijklmabcdefghijklmnopqabcdefghijklmnabcdefghijklmno...

The problem occured when a chunk was part of more than one partition, like chunk #2 is in the example above. What ended up happening was that the beginning of the chunk was replicated into the second partition, instead of the remainder.

Code: [Select]
...________][_partit...
...[_chunk #2______]...
...abcdefghijklmnopq...
became
Code: [Select]
...________][_partit...
...[_chunk #2______]...
...abcdefghiabcdefgh...
, which irrecoverably lost the jklmnopq information contained in chunk #2's second half.

The only way to not have experienced this is if the chunk size of the decoder aligned perfectly with the partition boundary, but that's a lucky corner case and near impossible.

I hope this explains the underlying problem. If you're fine with the replication of a miniscule part of the samples and a loss of the samples it clobbers, you can continue using the waveforms you have. If you want perfection, regenerate them. Don't forget that the component remembers that you've told it to scan something, so it continues when you restart the player.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-04 00:09:14
So, 0.2.35 is a thing. It's also released.

New is that it's built with the v110_xp toolchain from Visual Studio 2012 Update 1, which probably shouldn't break too much. You XP-using people owe me back for a few days of facedesking.
Versions starting from 0.2.35 require the Visual Studio 2012 Update 1 (x86) runtime (http://go.microsoft.com/?linkid=9815734) installed. If you're the portable kind, you can probably put in the msvcr110.dll and msvcp110.dll from that installer manually in the foo_wave_seekbar directory.

It should fix the Direct2D shows a lengthwise squished waveform for mono-analysed tracks bug, and the chunk/bucket granularity issue.

You need to regenerate your waveforms if you feel you suffer from the small artifacts that they caused, or if you think your mono database is too large.

It also exposes three new semantics to the effect, namely TRACKTIME, TRACKDURATION and REALTIME. They are all floating point numbers in seconds, holding the current position and duration of the track, and seconds since some arbitrary reference point. You could use these to make time-dependent shimmer or some other snazzy effects.
Title: foo_wave_seekbar
Post by: olegausa on 2013-05-04 01:46:03
Just attempted to update from 0.2.34 to 0.2.35 from within foobar 1.25 but after restart got error message stating there is problem loading .dll because either dependency is missing or it was created for different version of program. Usinf Win 7 Pro 64 bit. Previous version was working OK
Title: foo_wave_seekbar
Post by: Zao on 2013-05-04 01:52:28
Quote
Versions starting from 0.2.35 require the Visual Studio 2012 Update 1 (x86) runtime (http://go.microsoft.com/?linkid=9815734) installed. If you're the portable kind, you can probably put in the msvcr110.dll and msvcp110.dll from that installer manually in the foo_wave_seekbar directory.
Title: foo_wave_seekbar
Post by: frogworth on 2013-05-04 03:40:09
(Oops, please ignore! I went and looked in C:\Windows\System32\ and lo and behold!)

Hey Zao, I've installed it so it's OK on my local computer, but wondering where to find the dlls for portable purposes?
I changed the extension of the VS installer to .zip but it's not an obvious folder structure inside. And I'm not sure where the dlls would be installed on my computer (XP, sorry!)
Title: foo_wave_seekbar
Post by: mjb2006 on 2013-05-04 03:51:54
Yeah it's not obvious on the Microsoft download site for the Visual Studio runtime update, but it's OK to install the x86 version, even if you are using a 64-bit version of Windows. It doesn't hurt to install the 64-bit version, but it won't help with the Waveform Seekbar because it's using the the x86 files.
Title: foo_wave_seekbar
Post by: olegausa on 2013-05-04 04:42:57
Thanks it works now and sorry for not paying attantion about new reqirement
Title: foo_wave_seekbar
Post by: Zao on 2013-05-04 13:56:18
olegausa: It's a tricky situation, as there's no way to communicate what went wrong from my component's side. It's inevitable that people will mistake it for a bug or miss the information. You made me smile a bit.

frogworth: If you're taking them from an existing 64-bit Windows installation, note that their system32 is 64-bit and syswow64 is 32-bit.

I put the two files needed for my component up at a reasonably permanent location (http://www.acc.umu.se/~zao/public/VisualStudio2012-Update2-x86-runtime.zip).
You can put them either in a directory you control in the PATH or in the foobar2000 application directory. Note that if you put them in user-components\foo_wave_seekbar, installing an update will remove them.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-05 09:11:26
Zao - I got a question about that required MSVC11 dlls. What are all possible localizations where I can put them to be properly recognized?
From previous post I am sure these 2 are OK:
1. main "foobar2000" directory
2. "user-components\foo_wave_seekbar"
but how about this:
3. "foobar2000\components" directory (when I'm installing all my components manually)?
Title: foo_wave_seekbar
Post by: marc2003 on 2013-05-05 14:51:03
surely trying it yourself would have been easier than typing out that post?
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-05 15:33:45
No as I have simply installed vc_redist_x86 2012 on my system a while ago as well as on my wife's laptop and I don't have any other computer to try it. Programmers mostly don't have to test such things - they just know it from practice or because they know they programming environment, so they can give such answer as quickly as I asked it.
Title: foo_wave_seekbar
Post by: derty2 on 2013-05-05 18:15:29
EpicForever,

Install a program named Process Hacker (free, open source - http://processhacker.sourceforge.net/)

Temporarily rename* . . .
C:\WINDOWS\system32\msvcp110.dll  to  C:\WINDOWS\system32\msvcp110.dll.bak
and
C:\WINDOWS\system32\msvcr110.dll  to  C:\WINDOWS\system32\msvcr110.dll.bak

Then manually copy . . .
msvcp110.dll  to  foobar2000\components\msvcp110.dll
and
msvcr110.dll  to  foobar2000\components\msvcr110.dll

Run foobar2000 and play a track . . .

Open Process Hacker main window . . . double-click foobar2000.exe in the list of processes . . . foobar2000.exe Properties window will open
Go to Modules tab, scroll down to msvcp110.dll and hover your mouse over it . . . a tooltip will pop up and display the working path of the DLL .
Do the same for msvcr110.dll

* path used in Windows XP; may not be the same in other Windows OS versions.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-05 19:27:03
Thanks for the tip derty  . OK, I had to temporarily shutdown some app to make renaming of dlls in syswow64 possible. But now I can say that all 3 locations work, for both foo_wave_seekbar and foo_bestversion
Title: foo_wave_seekbar
Post by: Zao on 2013-05-05 19:29:06
3. "foobar2000\components" directory (when I'm installing all my components manually)?

You should not modify the components directory. That's only for components bundled with the player itself.
Anything third party belongs in the user-components tree, even if you "install them manually". If you install anything manually for some mysterious reason, you should put them in an equivalent structure in the user-components tree like if it was installed through the player.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-05 19:47:29
The only safe place to put the runtime is either in the foobar2000 directory, or in a directory in your PATH.
If you put anything in components, foobar2000 will attempt to eject it into user-components and break multi-file components in the process.
If you put anything in user-components/foo_wave_seekbar, it will be destroyed whenever the component is upgraded or reinstalled.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-05 20:13:45
I install everything manually into foobar2000\components  - I just put them .dll files from unpacked components - everybody (currently just my wife) can use whatever I use in foobar.
While I tested putting MSVCP dlls into foobar2000\components directory nothing bad has happened. Foobar and both components depending on those MSVCP11 dlls worked as long as I manually quited it. And started again without problems when I started it again. There was no interruptions  and no dlls were moved or deleted.
Title: foo_wave_seekbar
Post by: frogworth on 2013-05-06 05:24:16
Hey Zao, thanks for the tips re the dlls - I've put 'em in the foobar application directory, so should be fine from now on.

One thing I've noticed with the latest version (using Direct3D) is that when I load a file that has no stored waveform (and, say, if I'm playing from an Audio CD where it won't autogenerate), the old waveform stays displayed.
It used to blank out the waveform, which of course is preferable to having an unmatching waveform to seek over.

Do I have a setting wrong, or is it a (minor) bug?
Title: foo_wave_seekbar
Post by: Zao on 2013-05-06 15:58:03
It's a known "bug". I need to move the eligibility testing out of the cache so that I can communicate a "nope, never will be a waveform for this".

It's a bit tricky, as you on one hand do not want a flicker of empty between tracks, but still want it to eventually go away.
Title: foo_wave_seekbar
Post by: nevets1219 on 2013-05-07 19:55:49
Maybe I'm doing something wrong but when I updated and restarted fb2k, it showed me: "Failed to load DLL: foo_wave_seekbar.dll, reason: This component is missing a required dependency, or was made for different version of foobar2000".

I then tried to manually extract the 4 files from .fb2k-component and place it into my components folder but no luck. I also tried un-installing and re-installing the component and the same message appears. Perhaps I forgot some step in the instructions?
Title: foo_wave_seekbar
Post by: Andreasvb on 2013-05-07 19:59:21
nevets1219, did you install this?

Quote
Versions starting from 0.2.35 require the Visual Studio 2012 Update 1 (x86) runtime (http://go.microsoft.com/?linkid=9815734)
Title: foo_wave_seekbar
Post by: carpman on 2013-05-07 20:05:00
AFAIK you can just put the 2 relevant dlls in your foobar2000 root directory (without installing the whole runtime -- is that correct?)
Zao put them up here (http://www.acc.umu.se/~zao/public/VisualStudio2012-Update2-x86-runtime.zip), presumably for that reason.

C.

EDIT: @ Zao -- thanks for sorting out the "color choice in configuration" issue. Great component!
Title: foo_wave_seekbar
Post by: Zao on 2013-05-07 20:39:11
I strongly suggest installing the real redistributable with the installer if possible. Putting it in your foobar2000 directory is an ultimate fallback and shouldn't really be done unless you truly don't have the rights to install it properly.
Title: foo_wave_seekbar
Post by: carpman on 2013-05-07 21:00:18
Thanks for clarification.

C.
Title: foo_wave_seekbar
Post by: nevets1219 on 2013-05-07 22:16:08
No, I haven't (it's possible that it is already installed but I don't know that for a fact). Strange that it would break the installation of the component like that, if that is the cause. I will install the runtime and try the component again. For some odd reason, foobar2k process is permanently stuck and it seems I have to restart.
Title: foo_wave_seekbar
Post by: nevets1219 on 2013-05-08 17:29:12
Just an update on my issue. I installed the suggested/required runtime and it's now working correctly. Strange that I still don't see anything related to this component in my fb2k's component folder.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-05-08 18:34:30
That's because components you install yourself are put in the user-components folder. The components folder is only for default components included in the standard Foobar2000 installation.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-08 22:15:15
In particular, user-installed components end up in your foobar2000 profile directory, which for a non-portable install (or a regular one without user profiles) isn't the same as the application directory.
There's one profile for each user that runs the shared foobar2000 installation, each containing an user-components directory.
You can access this mysterious profile directory by holding the shift key and clicking File -> Browse configuration folder.
Title: foo_wave_seekbar
Post by: nevets1219 on 2013-05-08 22:21:33
Thanks to both of you for the clarification and especially Zao for the component and the handy tip!
Title: foo_wave_seekbar
Post by: war59312 on 2013-05-09 13:42:15
Should add system requirements to http://wiki.hydrogenaudio.org/index.php?ti...o_wave_seekbar) (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Waveform_Seekbar_(foo_wave_seekbar)) .
Title: foo_wave_seekbar
Post by: TargetD on 2013-05-09 16:15:11
I have a portable install of the latest version of Foobar on Vista and all components are apparently up to date.

I have now installed both Visual Studio 2012 Update 1 (x86) & DirectX June 2011. I've copied the .DLL files to the Foobar application folder (\Foobar2000\) & have uninstalled and reinstalled the component.

But I'm afraid the seekbar has effectively disappeared for me... any idea on how to get it back?
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-09 18:26:24
Zao, I found something that is bit annoying for me. It is connected with playing CD-DA tracks. I understand why waveform seekbar isn't created for CD-DA tracks - that is perfectly OK. But why waveform isn't flushed and seekbar doesn't become empty when I play CD-DA track after some FLAC or mp3? It shows waveform of last played track from HDD instead... It's misleading. Especially because when I play all tracks from CD-DA, that waveform persists on all of them... I propose simply flushing waveform or adding some text label on seekbar like "CD-DA track detected - no waveform will be created". But simply flushing is also good resolution.
Info:
I am using last version of wave_seekbar (0.2.36.1) under the last version of foobar (1.2.6 final) under Win7 x64 SP1 MSDNAA PL, with several vc_redist packets installed (including that for 2012) and last DX9 redist package installed (June 2010, version 1974).
Title: foo_wave_seekbar
Post by: marc2003 on 2013-05-09 18:29:12
already reported just a few posts up. known bug.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-09 18:33:53
The reason for the CD-DA block is because scanning a physical CD will completely destroy real-time playback and scanning, and likely end up ruining the lifetime of the drive due to constant interleaved seeking. Considering that pretty much all CD-DA tracks are from a physical CD and not an ISO, it's utterly impossible to scan anything in the background from a disc while playing it.

Similarly, if I allowed scans of discs that are not currently played, the concurrent scans would end up doing the same constant-seeking problem.

As for waveforms remaining, yes, it's painfully known, and it's not trivial to add in rejection notifications of formats in the codebase.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-09 18:57:35
Should add system requirements to http://wiki.hydrogenaudio.org/index.php?ti...o_wave_seekbar) (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Waveform_Seekbar_(foo_wave_seekbar)) .

The nice thing about collaborative editing resources like that is that I'm not involved in it. Anyone with an account can and should edit it to closer reflect reality. It seems strongly out of date.
Title: foo_wave_seekbar
Post by: Blasphemy13 on 2013-05-11 12:25:43
... also had the issue with MS-Visual-Studio dependency.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-13 05:37:29
0.2.37 has some fancy new changes now.

First of all, I've started moving some stuff out of the UI element to make it a bit less fat and brittle, now sharing playback callbacks between multiple seekbar instances. This might cause some instabilities in corner cases, please report any new crashes.

I've implemented blanking of the waveform for unknown and forbidden/unscannable tracks, so whenever you play a stream or an unscanned track, the previous waveform will be hidden from view.

Finally, I've disabled the pre-emptive scanning of the next track in the playback order due to the aforementioned splitting out of playlist events, this should not be too noticeable.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-13 05:39:11
... also had the issue with MS-Visual-Studio dependency.

While it might be slightly inconveniencing for you all, it's a necessary thing for me if you all want me to keep targetting XP.

I've got to jump through more and more hoops to keep it building for the platform. Heck, I have to use a virtual machine now to build it using experimental Visual Studio updates. Reworking this to use the static runtime would be tons of work to get my dependencies to behave.
Title: foo_wave_seekbar
Post by: Propheticus on 2013-05-13 10:04:30
XP is very old... In my opinion it would be fair enough to label a 0.2 version which you deem stable enough as 'final'. Then from 0.3 you could drop XP (legacy!) support.

On a sidenote: for those running XP with the argument it runs better on low spec hardware...A win 7 install generally runs better (!) on old hardware than XP does. (see http://hardforum.com/showthread.php?t=1582487) (http://hardforum.com/showthread.php?t=1582487))
Title: foo_wave_seekbar
Post by: Zao on 2013-05-13 11:56:04
A 'classic' version has been on my mind occasionally, but I'd still have to maintain and patch it. There is no such thing as "stable enough" in the long run.

I'd have to make 0.3 something more than just "doesn't run on XP" too, as otherwise there's no reason to migrate to it. I'd also lose all the brand inertia and would not be able to automatically migrate existing users, as it can't be an auto-upgrade or force-deprecation. A proper v3 would have to be a superset of what the current bard does to be worth it.

I've got vague ideas of what features would be in a v3, but nothing that's properly thought out. Things that have crossed my mind is things like:

  Drop all the frontends, instead having a single element onto which logical layers of decoration can be added, in a seekbar-construction-kit kind of manner, to allow for things like time indicator ticks, labels with timepoints, without exploding the amount of things the configuration dialogue has to handle.

  Add more kinds of data sources, like spectrum data and other insane analysis methods existing in the wild, like song mood or feel, or whatever people feel they can deduce from a stream of PCM data.

  Not being a big honking pile of mud inside.
Title: foo_wave_seekbar
Post by: NullString on 2013-05-13 15:46:11
Drop all the frontends, instead having a single element onto which logical layers of decoration can be added, in a seekbar-construction-kit kind of manner, to allow for things like time indicator ticks, labels with timepoints, without exploding the amount of things the configuration dialogue has to handle.

That would be awesome! Maybe using a XAML template/user control, so you could avoid writing any layout parsing, and easily sharing different templates? Even the shader FX could be a parameter. As it currently is, editing the shader is an advanced feature, so editing it inside an XML file doesn't change much from editing it on a stand alone .fx file and it feels more natural for your code.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-13 15:57:23
XAML will never happen, not from me.
It's XML, it's flavor-of-the-year, and I'm trying to get less horrible vendor tie-in, not more.
Title: foo_wave_seekbar
Post by: nevets1219 on 2013-05-13 18:32:08
IMHO, XP support shouldn't be dropped because AFAIK fb2k still supports it (at least SP2 and up) but of course that is up to Zao. Seems like the current hoops Zao is jumping through is already enough, I doubt a separate branch would make it any easier.
Title: foo_wave_seekbar
Post by: fateswarm on 2013-05-14 17:08:13
I wish this would scroll [seek into the song] if the mouse wheel was turned above it, at least as an option.

edit: PS. and not a whole full minute like the default one 
Title: foo_wave_seekbar
Post by: mjb2006 on 2013-05-15 05:53:52
There's a minor issue where if DirectX9 is not installed, the Direct3D 9.0c frontend option is still available to be chosen. However, the Frontend settings button does nothing, and selecting Direct3D 9.0c button is actually enabling GDI mode; if you close and reopen the configuration window, GDI will be selected. Ideally, if Direct3D isn't going to work, it shouldn't be selectable at all.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-15 06:36:58
mjb2006: It's a proper rats nest of conditions around there. The current behavior you see is what I ended up with after plugging all the crashes and handling all the fallout from people who had D3D or D2D in their configurations and bringing the player to a new machine. While sure, it might be possible to improve it slightly, it comes at a major cost of sanity to touch anything related to GUI programming.
Title: foo_wave_seekbar
Post by: tedsmith on 2013-05-16 01:02:22
I've been keeping up with your waveform seekbar releases and appreciate your work, but I just noticed that apparently it uses all of my CPUs even if I have the "Number of concurrent scanning threads" set to 1.  I don't know if I misunderstand the intent of the option or not, but my goal was to keep the fan from coming on on my laptop while I am listening to music, even if I chance on a huge track (which is happening more and more these days  )
Title: foo_wave_seekbar
Post by: Zao on 2013-05-16 01:12:30
While I can constrain the number of threads that are used to scan tracks, I cannot control whether the decoder used is threaded in some way, which the new fancy ffmpeg-based ones probably are.
Please verify the number of threads that belong to the component, either by launching/attaching foobar2000 from the VS debugger or by using Process Explorer to enumerate the threads.

(http://zao.se/~zao/seekbar-threads.png)(http://zao.se/~zao/seekbar-threads2.png)

If you're using the D2D frontend subtract one as it uses a worker thread to prepare the display.
Title: foo_wave_seekbar
Post by: tedsmith on 2013-05-16 01:50:29
While I can constrain the number of threads that are used to scan tracks, I cannot control whether the decoder used is threaded in some way, which the new fancy ffmpeg-based ones probably are.
Please verify the number of threads that belong to the component, either by launching/attaching foobar2000 from the VS debugger or by using Process Explorer to enumerate the threads.

If you're using the D2D frontend subtract one as it uses a worker thread to prepare the display.

Good call.  It's foo_input_sacd that is the culprit instead.  Sorry. (In addition I tried a 2G flac and it only used one CPU.) Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-16 03:15:10
Good call.  It's foo_input_sacd that is the culprit instead.  Sorry. (In addition I tried a 2G flac and it only used one CPU.) Thanks.

If you really want to ensure that foobar2000 only ever uses one core you could find a tool to launch the program with a processor mask pinning the program to a single core.
Title: foo_wave_seekbar
Post by: Slinden on 2013-05-16 09:14:07
I just updated to the most recent version of Foobar (from 1.2.3) and then updated wave seekbar along with it.  It was working perfectly before but now it won't load when I try reinstalling it.  I get this:

"Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000."

Help, please?

*EDIT*
So right after I posted I thought "maybe I should read the OP in case there's something there."  Turns out there was and I installed the visual studio update.  Guess I should do that first, next time.

Great component, though!  When it wasn't working and I played music with the normal seekbar it felt like something was missing.  Great to have it back.

/edit
Title: foo_wave_seekbar
Post by: Zao on 2013-05-16 09:20:10
Quote
Versions starting from 0.2.35 require the Visual Studio 2012 Update 1 (x86) runtime (http://go.microsoft.com/?linkid=9815734) installed. If you're the kind of person who for some reason cannot run the installer, as a fallback solution you can put in the msvcr110.dll and msvcp110.dll from this download location (http://www.acc.umu.se/~zao/public/VisualStudio2012-Update2-x86-runtime.zip) manually in your PATH or in the foobar2000 application directory. Note that if you put them in the foo_wave_seekbar directory, they will be removed whenever the component is updated.

You're not the first, and will definitely not be the last
Title: foo_wave_seekbar
Post by: loiparty on 2013-05-18 16:48:03
Hello

First of all, thank you for this great plugin. I used it for over a year now and i was always fully satisfied.

But I began to apply the ReplayGain to the MP3s today and now I get very small wave forms.
Is there any way to "add" gain to the wave form?

I hope you understand what I mean.

Thanks in advance
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-19 09:04:10
loiparty - what frontend do you use? D3D9? If D3D9 what script do you use? If the one submitted in this thread by derty2, then you have to disable part responsible for applying ReplayGain to waveform. I use default script for D3D9 and all my tracks are RaplayGained and all waveforms are OK. By default, this component don't use ReplayGain and thus waveforms remain untouched, so they shouldn't be small.

EDIT:
@Andreasvb: OMG... I forgot about it... Irreversible mistake. But how he could do this with foobar? I RG'd all my mp3 files and I even don't know how to RG them permanently in other way than reencoding them with Converter - still after sucessful scanning and proper applying RG as tags...
Title: foo_wave_seekbar
Post by: Andreasvb on 2013-05-19 09:26:34
I guess he applied it to the MP3 data itself.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-19 09:58:37
Tools like MP3gain do a decent work of applying RG by mucking with frame attenuation or something, but I'd expect that the tool would obliterate or recompute actual RG tags if so.

loiparty: Do you have a sample pair of files (of some freely available content) which demonstrate the problem? It's hard to suggest a solution if we don't know what you've done to it and the tags.

I can't say I've ever heard of any temporary or permanent RG adjustment resulting in low amplitudes unless you've manually altered the reference level.
Title: foo_wave_seekbar
Post by: loiparty on 2013-05-19 11:12:05
Hi, thanks for the fast replies.


I altered the mp3 files like that: Right Click on the track (with RG info) -> ReplayGain -> Apply track ReplayGain to MP3 data

I use the newest version of the plugin and D3D with the standard source code.
Im sure there is a simple solution like adding 7dB or so, but i just dont find the method where i have to add it.

To the mp3 in this screenshot i added a RG of -8 dB
(http://image-upload.de/thumb/DEcFJ5/1711a8e3e2.png) (http://image-upload.de/image/DEcFJ5/1711a8e3e2.png)
Title: foo_wave_seekbar
Post by: Zao on 2013-05-19 11:22:21
Citing the commit for Expose peak information to effect (https://github.com/zao/foo_wave_seekbar/commit/93571096bdb8502c2aa18039cb69a942a059a71d)
Quote
The shader semantics "CHANNELMAGNITUDE" and "TRACKMAGNITUDE" are
float4:s representing the amplitude of the current channel and the whole
track.

R is the minimum amplitude, G is the maximum amplitude, B is the highest
RMS value, A is 1.0 if the data is present.

This can be used to rescale the vertical texcoord to display a scaled
and displaced range, ensuring that the edges of the display are
peak-to-peak.

In most effects, add something akin to the following at the top next to
all the other semantics:
float4 chan_mag : CHANNELMAGNITUDE;
float4 track_mag : TRACKMAGNITUDE;


Add something akin to the following in the main PS function:
input.tc.y = (input.tc.y + 1)/2 * (chan_mag.g - chan_mag.r) + chan_mag.r;

This will map the range [-1,1] to [min_peak,max_peak].

Other effects are possible, like a symmetric scale by the largest
absolute value:
input.tc.y = input.tc.y * max(abs(chan_mag.r), abs(chan_mag.g));

This will map the range [-1,1] to [-largest_peak,largest_peak].

This will scale the waveform to fit the window, regardless of the presence of RG values or not in the metadata.
If you want to adapt to replaygain, there's a different set of variables to adjust by.
Title: foo_wave_seekbar
Post by: loiparty on 2013-05-19 11:29:45
Thank you very much

I just found out myself 

New Screenshot
(http://image-upload.de/thumb/NRgczO/2da9b4caa4.png) (http://image-upload.de/image/NRgczO/2da9b4caa4.png)
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-19 16:40:00
loiparty - so you've made a mistake - you've altered data instead of adding a tag if I'm not wrong...
Title: foo_wave_seekbar
Post by: Zao on 2013-05-19 16:52:34
EpicForever: It's not always a mistake to do gain adjustments on MP3 frames. It's common if you have a portable player that does not understand ReplayGain and beats transcoding the content.

However, if all you use is players that understand ReplayGain, there's not much point in mutating the files themselves as the players can apply the gain on the fly when decoding if instructed to do so.
Title: foo_wave_seekbar
Post by: loiparty on 2013-05-19 17:40:23
What Zao said.

My car radio doesnt understand ReplayGain and I dont want to turn the volume up and down for every song
Title: foo_wave_seekbar
Post by: White_Shadow on 2013-05-19 19:44:53
I'm not quite sure, whether it's related to the new fb2k or the new waveform version, but today I recognized that the seekbar seems to ignore negative replay gain values (or, at least takes only its absolute value). As I'm scaling my waveform by replay gain values, the seekbar appears overscaled. (To be more precise: I'd like to display two waveforms over another, displaying the scaled and the original waveform, as well)

Here's the code of my seekbar.fx file which has worked fine before:

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 faded_bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show, float vert_from, float vert_to )
{
float dist = abs(pos - tc.x);
float fluff = smoothstep(vert_from, vert_to, abs(tc.y));
float4 c = show
? lerp(fg, bg, max(fluff, smoothstep(0, width, dist)))
: bg;
return c;
}

// #define BORDER_ON_HIGHLIGHT

float4 played( float pos, float2 tc, float4 fg, float4 bg, float alpha)
{
float4 c = bg;
float2 d = 1 / viewportSize;
if (pos > tc.x)
{
#ifdef BORDER_ON_HIGHLIGHT
if (tc.x < d.x || tc.y >= (1 - d.y) || tc.y <= (2 * d.y - 1))
c = selectionColor;
else
#endif
c = lerp(c, fg, saturate(alpha));
}
return c;
}

float4 evaluate( float2 tc )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex1D(sTex, tc.x);
float4 minmaxrms2 = tex1D(sTex, tc.x);

if (replayGain.g != -1000 && replayGain.g < -2.2)
{
float temp = pow(10,(replayGain.g + 2.2) / 20.0);
minmaxrms.rgb *= temp; //use track gain
        }
if (replayGain.g != -1000 && replayGain.g > -2.2)
{
float temp = pow(10, (replayGain.g + 2.2) / 20.0);
minmaxrms2.rgb *= temp;
}
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms2.rgb -= 0.5 * minmaxrms2.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
minmaxrms2.rgb *= 1.0 + minmaxrms2.a;
float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float below2 = tc.y - minmaxrms2.r;
float above2 = tc.y - minmaxrms2.g;
float factor = 1.5*min(abs(below), abs(above));
float factor2 = 1.5*min(abs(below2), abs(above2));
bool outside = (below < 0 || above > 0);
bool outside2 = (below2 < 0 || above2 > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;

#if 1
float4 bgColor = backgroundColor;
#else
float a = viewportSize.x / viewportSize.y;
float2 aspect = horizontal ? float2(a, 1) : float2(1/a, 1);
float2 tcBg = float2(tc.x, -tc.y / 2 + 0.5) * aspect;
float4 bgColor = tex2D(sTexBg, tcBg);
#endif

float4 wave = (outside && outside2)
? backgroundColor
: (wave = (!outside2 && outside)
? (replayGain.g < -2.2
? lerp(bgColor, selectionColor, 2.0 * factor2 )
: lerp(bgColor, highlightColor, 3.0 * factor2) )
: (replayGain.g < -2.2
? lerp(bgColor, textColor, 6.0 * factor )
: lerp(bgColor, textColor, 6.0 * factor) )
);
// lerp(bgColor, textColor, 5.0 * factor2);
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 = 1.5 * dx;
float positionWidth = 1.5 * dx;

float4 c0 = evaluate(input.tc);
c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible);
c0 = bar(seekPos,  input.tc, selectionColor, c0, seekWidth,    seeking      );
if (shade_played)
c0 = played(cursorPos, input.tc, highlightColor, c0, 0.3);
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_3_0 PS();
}
}
Title: foo_wave_seekbar
Post by: carpman on 2013-05-19 20:18:14
Same issue for me.
As I'm scaling my waveform by replay gain values, the seekbar appears overscaled.

Only occurred in the latest release.

C.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-19 21:03:28
The worst thing about being the sole developer on a project is that you don't have anyone else to blame but yourself. 
Should be fixed in 0.2.38, it turns out that I forgot to call the function I had moved the RG update code to.
Title: foo_wave_seekbar
Post by: carpman on 2013-05-19 21:17:53
The worst thing about being the sole developer on a project is that you don't have anyone else to blame but yourself. 

Zao, get one of these (https://en.wikipedia.org/wiki/Whipping_boy). 

C.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-05-19 23:54:24
The worst thing about being the sole developer on a project is that you don't have anyone else to blame but yourself. 


to be fair, your update didn't kill any kittens and if people are that unhappy, they can always ask for a refund. 
Title: foo_wave_seekbar
Post by: carpman on 2013-05-20 00:59:55
Zao, I have a suggestion, to make sure the database is always up to date, without having to do wholesale re-scans:

Component checks if there's a waveform in database.
1) If yes, it loads it -- then goes to (3)
2) If no, it scans and loads (done).
3) It then scans in background and if there's a difference between old scan and new scan it replaces the old scan with the new and refreshes / loads the new one while playing.

Since this would just be a matter of seconds and small degrees (minor replaygain shift etc..) the change while playing would be minor.
Seems a decent way to keep the DB up to date.

What do you think? Or does it do this already?

C.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-05-20 01:26:51
scanning again to check if it's different would be just as much overhead as scanning on every play and not keeping a cache of previous results.
Title: foo_wave_seekbar
Post by: carpman on 2013-05-20 01:40:27
Yes, it would. But I don't think it's really going to stress a modern CPU.
If this was an option, I'd select it. The difference between this and just scanning without a cache is that there's no delay offering up the waveform for pre-scanned tracks.

C.

EDIT: Additionally, because there would already be a waveform to load, the "background check" scan could be super-low priority.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-20 06:39:06
Zao, I have a suggestion, to make sure the database is always up to date, without having to do wholesale re-scans:

Component checks if there's a waveform in database.
1) If yes, it loads it -- then goes to (3)
2) If no, it scans and loads (done).
3) It then scans in background and if there's a difference between old scan and new scan it replaces the old scan with the new and refreshes / loads the new one while playing.

Since this would just be a matter of seconds and small degrees (minor replaygain shift etc..) the change while playing would be minor.
Seems a decent way to keep the DB up to date.

What do you think? Or does it do this already?

C.

No, it doesn't do this already for many fine reasons.

One would be that I've made the assumption that most people never mutate the audio stream of their music. The analysis scans at full scale, no RG is applied during the process so traditional changes in RG values do not matter. As for people who use MP3Gain-like tools, one'd expect that they'd generate and modify tracks once, as the computed RG for something doesn't really change.

One would be that a scan is not invisible. It has to open and pretty much lock the file for the duration, wreaking all havoc on other plugins and core parts that want to fiddle with the track being played.

One would be that I don't have any way to prioritize tracks outside of the rudimentary and fairly broken method of letting VIP tracks be processed before touching any queued regular tracks. This doesn't extend much at all to multiple tiers of tasks, especially as they're not pre-emptable.

In the end, it's all about weighing the complexity involved (and how hard it will break things implementing it) to the value it adds (off-by-default, only applies to a very odd subset of the community).
Title: foo_wave_seekbar
Post by: Zao on 2013-05-20 06:50:28
carpman: Do you have some particular use case in mind where you'd have unpredictable and recurring modifications of the underlying audio stream data?
Title: foo_wave_seekbar
Post by: White_Shadow on 2013-05-20 07:45:13
The worst thing about being the sole developer on a project is that you don't have anyone else to blame but yourself. 
Should be fixed in 0.2.38, it turns out that I forgot to call the function I had moved the RG update code to.


Thank you! Works now as expected.
Title: foo_wave_seekbar
Post by: carpman on 2013-05-20 07:52:00
carpman: Do you have some particular use case in mind where you'd have unpredictable and recurring modifications of the underlying audio stream data?
The RG algorithm provides a decent approximation, but I very often have to manually edit the album gain for collections of music (plus occasional edits and repairs). Once edited I have to re-"extract signature". This can happen quite a bit especially if I'm putting stuff together.

This is the point: Unless you keep track of what you've changed and force an "extract signature" at the time of changing it, you have to rescan the whole collection if you want to be sure each waveform is accurate, and that can take quite a while. I'd simply prefer this was done on an ongoing basis.


EDIT:

Perhaps a better way to put it is this:

I have a collection of about 10,000 tracks.
Let's say 2 weeks ago I altered the RG of 5 tracks, but I can't remember which tracks I altered.
That basically means I can't "trust" ANY waveform I see. It's a data integrity issue.

I'm making it sound way more important than it is ... but you see the point?
What I'm suggesting is ....
/EDIT

similar in some ways to the verify integrity of tracks during playback that Peter recently implemented (it's an option, for those that want it).

C.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-05-20 17:15:12
I have one good reason to add mechanism proposed by carpman as an "advanced config option": Editing cue sheets. I buy music on Juno and Beatport and sometimes I got tracks like Dinka's "Hotel Summerville" album or Stan Kolev's "Grace Light" album. They contain all tracks mixed together in one file. I have to edit cue sheets manually for them. Before cue sheet is finished I edit split points many times - automatic waveform refreshment would be very useful if it could be enabled just for cue sheet editing session.
Title: foo_wave_seekbar
Post by: technicaltitch on 2013-05-20 19:07:20
Just a quick post in case anyone is as stupid as me. I was getting the:

Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.

DirectX installed, VC++ 2012 Redist installed.

I'm running Win 7 64 bit, so installed the 64 bit version of the VC++ 2012 redist. When I installed the 32bit version of the VC++ 2012 redist, foo_wave_seekbar reappeared.

If I'd just clicked on the link in the first post, which links directly to the 32 bit version download, rather than searching out the installer myself,  (I've no idea why I did), I'd have been fine. 

Title: foo_wave_seekbar
Post by: jarko2227 on 2013-05-20 19:42:44
I have the same error 
Quote
Failed to load DLL: foo_wave_seekbar.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.

plis fast fix it.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-05-21 02:20:05
Let's say 2 weeks ago I altered the RG of 5 tracks, but I can't remember which tracks I altered.


sort by %last_modifed%. or have you been on a wild tagging spree changing the dates of all your other files?
Title: foo_wave_seekbar
Post by: carpman on 2013-05-21 02:47:04
Actually yes. Just added a %subcat% (been on a sub genre tagging spree). So in the process of going through music collection a whole bunch of files have been changed and will continue to be (whimsically re-tagged). But not nearly as many will be have their RG values changed. Thanks for asking. 

C.

EDIT: marc2003, I'm not suggesting that it's an absolute necessity, nor am I suggesting that there's no way around this. All I'm saying is, if the option was there, I'd have it ticked. Clearly, you wouldn't.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-05-21 03:26:22
edit: junk reply removed.

i just re-read zao's original response to your post.

Quote
The analysis scans at full scale, no RG is applied during the process so traditional changes in RG values do not matter. As for people who use MP3Gain-like tools, one'd expect that they'd generate and modify tracks once, as the computed RG for something doesn't really change.


this applies to what you're doing, doesn't it?
Title: foo_wave_seekbar
Post by: carpman on 2013-05-21 05:46:00
That's really weird, I'd completely missed that reply from Zao. All I saw was:
Quote
carpman: Do you have some particular use case in mind where you'd have unpredictable and recurring modifications of the underlying audio stream data?

Thanks marc2003 (and Zao); consider my suggestion abandoned.

C.
Title: foo_wave_seekbar
Post by: Andreasvb on 2013-05-21 07:47:00
I'm running Win 7 64 bit, so installed the 64 bit version of the VC++ 2012 redist. When I installed the 32bit version of the VC++ 2012 redist, foo_wave_seekbar reappeared.

It's for the architecture the host program is using, in this case foobar2000, which is a 32-bit program.
You're not the first.
Title: foo_wave_seekbar
Post by: sammael on 2013-05-21 20:21:47
Hi,
since I upgraded to latest version (0.2.38), when Direct3D is chosen as the output path, the waveform seekbar component hangs whole foobar window for about 5 seconds whenever it comes to view (i.e. on startup, when opening/closing visualisation (shpeck) etc)

when switched to GDI output this issue goes away, however it wasn't present in older versions as I used Direct3D without issue.

there is no console output, in fact, console claims the startup took 2 seconds, when in fact it takes over 8 seconds with 5 seconds of skipping music and frozen foobar window.

other than that no issues, thanks for great component!

edit: i reinstalled my skin from scratch to ensure it's not something else, and narrowed it down to the direct3d output path, as it happens on fresh install of foobar + tech skin as soon as i select direct3d in waveform seekbar preferences.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-21 20:32:26
Does it happen in a fresh portable install without "skins", just the element/panel in Default UI and/or Columns UI?
Title: foo_wave_seekbar
Post by: sammael on 2013-05-21 21:06:12
Does it happen in a fresh portable install without "skins", just the element/panel in Default UI and/or Columns UI?


Hello, I have just tested this and have to report it does indeed happen even on fresh portable installation with default ui, no skin and only new component (apart from default) installed being waveform seekbar. GDI mode again resolves this issue.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-22 13:14:25
What Windows version is this, what GPU and driver, and does this occur if you do a similiar install of an older version of the component into the portable environment?

Please try some of the following to narrow it down:
0.2.36 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.fb2k-component)
0.2.36.1 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.1.fb2k-component)
0.2.36.2 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.2.fb2k-component)
0.2.36.3 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.3.fb2k-component)
0.2.37 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.37.fb2k-component)
0.2.38 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.38.fb2k-component)
Title: foo_wave_seekbar
Post by: sammael on 2013-05-22 14:07:29
What Windows version is this, what GPU and driver, and does this occur if you do a similiar install of an older version of the component into the portable environment?

Please try some of the following to narrow it down:
0.2.36 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.fb2k-component)
0.2.36.1 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.1.fb2k-component)
0.2.36.2 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.2.fb2k-component)
0.2.36.3 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.3.fb2k-component)
0.2.37 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.37.fb2k-component)
0.2.38 (http://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.38.fb2k-component)


Windows 7 x64
primary monitor is on AMD Radeon HD7850 2GB
secondary monitor is on AMD Radeon HD5670 1GB
driver 13.5beta
8GB Ram
AMD Vishera FX-6300 Cpu
dxdiag log: http://pastebin.com/Z4abnmGC (http://pastebin.com/Z4abnmGC)

After trying all the older versions you provided links for, I have found this behaviour on all, which leads me to believe it is indeed something within my system. I don't recall installing anything serious (like drivers etc) in last 2 weeks, and I'm positive it didn't freeze on startup before.

To better illustrate the issue I have made 2 short clips, both were made with 0.2.38 version but the links you provided exhibited same behaviour (whereas I am more than sure they didn't a week ago and as I have OCD about updating I'm pretty sure I used all versions as they came out). Frankly speaking I'm at a loss as to what's happening. I mean in the end, it's no big deal, I can live with GDI path, but it keeps bugging me.

First one is startup with Direct3D path (notice the window frozen and music skipping):
http://youtu.be/FRa73PBQOqE (http://youtu.be/FRa73PBQOqE)

This is how the startup looks/sounds with same config, just GDI output.
http://youtu.be/8wQ7VcYjt_c (http://youtu.be/8wQ7VcYjt_c)

(the stupid phone cut off the part where the seekbar is but its just under the song list )
the clips were made with tech skin, but the behaviour is the same in fresh portable install as i noted in previous post.

Thanks for any suggestions
Title: foo_wave_seekbar
Post by: Zao on 2013-05-23 00:18:31
Please run a test program (http://www.acc.umu.se/~zao/seekbar-spinup-test-0.1.zip) designed to emulate the D3D9 frontend startup process and reply to me (in private if you like) with the results from the report you get after closing it. You can Ctrl-C the message box to copy them to the clipboard.
The results will be like:
Code: [Select]
(t: 0.003025, dt: 0.003025): initializing d3d
(t: 0.012729, dt: 0.009704): enumerating multisamples
(t: 0.016671, dt: 0.003942): creating device
(t: 0.089040, dt: 0.072369): testing texture formats
(t: 0.089134, dt: 0.000094): initialized d3d
(t: 0.089136, dt: 0.000002): creating resources
(t: 0.089152, dt: 0.000016): creating effect
(t: 0.129686, dt: 0.040534): creating textures
(t: 0.129773, dt: 0.000088): filling textures
(t: 0.130172, dt: 0.000398): created resources
(t: 0.130174, dt: 0.000002): startup done
(t: 0.130174, dt: 0.000000): clearing
(t: 0.130177, dt: 0.000003): drawing
(t: 0.130536, dt: 0.000359): presenting
(t: 0.139090, dt: 0.008554): done
Title: foo_wave_seekbar
Post by: sammael on 2013-05-23 02:07:55
Please run a test program (http://www.acc.umu.se/~zao/seekbar-spinup-test-0.1.zip)...


Hello,

Not sure if the program is supposed to end by itself, but I closed it after a bit and this is what came in the Timing report window:

Code: [Select]
---------------------------
Timing report
---------------------------
(t: 0.025619, dt: 0.025619): initializing d3d
(t: 0.038396, dt: 0.012777): enumerating multisamples
(t: 0.045829, dt: 0.007433): creating device
(t: 0.137369, dt: 0.091540): testing texture formats
(t: 0.137526, dt: 0.000157): initialized d3d
(t: 0.137529, dt: 0.000003): creating resources
(t: 0.137569, dt: 0.000040): creating effect
(t: 0.193159, dt: 0.055590): creating textures
(t: 0.193427, dt: 0.000268): filling textures
(t: 0.194212, dt: 0.000785): created resources
(t: 0.194219, dt: 0.000006): startup done
(t: 0.194219, dt: 0.000001): clearing
(t: 0.194225, dt: 0.000005): drawing
(t: 0.194997, dt: 0.000773): presenting
(t: 2.883113, dt: 2.688116): done

---------------------------
OK  
---------------------------

Hope it helps.
Title: foo_wave_seekbar
Post by: Zao on 2013-05-23 02:32:48
That's a 2.5 second stall on presenting, compared to the 8 milliseconds I experience.
Are you running any screen capture software like fraps or dxtory, or some user interface hacks or other software that could envisionably hook the device? Also, does this persist if you disable your secondary graphics adapter?

There's not really much seekbar specific in that test code, it's just using the effect and some hardcoded waveform data. There's something fundamentally odd with your box.
Title: foo_wave_seekbar
Post by: sammael on 2013-05-23 02:51:44
That's a 2.5 second stall on presenting, compared to the 8 milliseconds I experience.
Are you running any screen capture software like fraps or dxtory, or some user interface hacks or other software that could envisionably hook the device? Also, does this persist if you disable your secondary graphics adapter?

You nailed it!

I only run 2 programs like that - MSI Afterburner and RadeonPro. Aaaand the culprit is RadeonPro, which indeed I remember upgrading to Preview version few days ago. When I close RadeonPro The issue goes away.

I fiddled around and found a way to make RadeonPro ignore foobar, by simply setting "Disable API monitoring for programs not on profile list" (not exact spelling but the setting is called along those lines. With that setting enabled I can run RadeonPro which enforces profiles for chosen apps, and the waweform seekbar works as a charm with direct3d path again.

the utility reports no stall at last step now as well.
Code: [Select]
---------------------------
Timing report
---------------------------
(t: 0.013567, dt: 0.013567): initializing d3d
(t: 0.026311, dt: 0.012744): enumerating multisamples
(t: 0.032623, dt: 0.006312): creating device
(t: 0.095033, dt: 0.062410): testing texture formats
(t: 0.095171, dt: 0.000137): initialized d3d
(t: 0.095173, dt: 0.000002): creating resources
(t: 0.095204, dt: 0.000031): creating effect
(t: 0.146723, dt: 0.051520): creating textures
(t: 0.146896, dt: 0.000173): filling textures
(t: 0.148053, dt: 0.001156): created resources
(t: 0.148057, dt: 0.000004): startup done
(t: 0.148057, dt: 0.000000): clearing
(t: 0.148060, dt: 0.000003): drawing
(t: 0.148809, dt: 0.000749): presenting
(t: 0.154400, dt: 0.005591): done

---------------------------
OK  
---------------------------

Thank you very much for taking time to help me narrow down the issue, keep up the great work!
Title: foo_wave_seekbar
Post by: fateswarm on 2013-05-23 12:50:35
-wrong post-
Title: foo_wave_seekbar
Post by: Zao on 2013-05-23 12:57:39
In any remotely standard UI configuration you have the numeric time in the status bar.
Additionally, there already is a numeric tooltip while seeking, that is, holding your mouse button and dragging around. If you don't want to seek, simply drag the cursor far enough outside the element to abort the seek.

(edit: seems like the post it replied to was edited away, it was regarding hover tooltips)
Title: foo_wave_seekbar
Post by: garbanzo.bean on 2013-05-28 00:32:13
After updating, all waveforms appear blown out, filling the whole width of the window without much variation. Previously I saw a lot of white space behind the waveform - now it's just solid.

Same track then and now:

(http://img196.imageshack.us/img196/9357/wavef.jpg)

Here's the configuration I'm using - maybe something changed and it needs to be adjusted?

Code: [Select]
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 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 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 )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(sTex, tc.x);
if (replayGain.g != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 2; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2; //use album 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;

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

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();
}
}
Title: foo_wave_seekbar
Post by: Propheticus on 2013-05-28 11:31:28
Try this code. The problem is in the fact you are chaining replaygain calculation and normal wave hight calculation. I've changed the code so the normal wave heigth calculation only gets used when there's no rpgain info available.

Code: [Select]
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 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 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 )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(sTex, tc.x);
if (replayGain.g != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 1.8; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 1.8; //use album gain
} else {
minmaxrms.rgb *= 0.9 + 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;

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

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();
}
}
Title: foo_wave_seekbar
Post by: garbanzo.bean on 2013-05-28 13:53:48
That helps a little, but there are still many wafeforms that are overblown.
What I don't understand is why it was working before, but now it's not
Title: foo_wave_seekbar
Post by: skullinsky on 2013-06-02 21:04:48
Really nice plugin, but i have an issue to report.
In the beginning i thought that i would have to ask how it is with instalation of the libraries (but thanks to
technicaltitch
i noticed the links in first post)

...but now the seekbar doesnt load a new wave after i change a song to play. or, it loads the wave, but i have to resize the window to actually make it visible. i did copy&paste the script written by Propheticus on this forum to the frontend settings. ...aand now i see that there is the issue. Since i am not a coder, i dont know where. but i like the style of highlight he uses..

Could anyoone tell me what to rewrite, and to what?
Title: foo_wave_seekbar
Post by: Propheticus on 2013-06-03 14:05:35
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 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 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 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);

//- 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 + 0.17 * saturate(factorRms / border / 2)): 1;
        factor = insideWave ? (factor * saturate(factorWave / border / 0.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 = 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;
}

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

(http://img4.imageshack.us/img4/9614/waveformf.jpg)
this is the current code I use, now with faux-normalization/rescaling instead of replaygain. Be sure to enable front left + front right when using mix-down to stereo, and front center(mono) when using mix-down to mono.
Title: foo_wave_seekbar
Post by: skullinsky on 2013-06-03 14:20:55
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 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 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 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);

//- 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 + 0.17 * saturate(factorRms / border / 2)): 1;
        factor = insideWave ? (factor * saturate(factorWave / border / 0.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 = 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;
}

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

(http://img4.imageshack.us/img4/9614/waveformf.jpg)
this is the current code I use, now with faux-normalization/rescaling instead of replaygain. Be sure to enable front left + front right when using mix-down to stereo, and front center(mono) when using mix-down to mono.



Works perfectly! thanks.
Title: foo_wave_seekbar
Post by: Zao on 2013-06-03 14:23:11
As a side note, you can completely remove the technique10 block, that hasn't done anything since early 0.1.
Title: foo_wave_seekbar
Post by: dinfinity on 2013-06-03 18:15:17
First off: great component for fb2k. Thanks, Zao!

Having said that: I've tried moving to Direct3D from GDI (for normalization support), but every time I do, I end up hunting for shaders that have already been written, disliking their look and going back to GDI.

I'd propose either adding normalization support for GDI, or instating some kind of repository for example shaders (or even just a preset dir).
In any case, it might be worth it to mandate an explicit split of the shader code into elements responsible for different parts of the rendering process. Complete control over the shader code is nice, but it's not very accessible or convenient.
Title: foo_wave_seekbar
Post by: Zao on 2013-06-03 18:33:21
All you need is a time machine to download the non-existent v2.

If I implement something composable going forward, it'll probably be in the form of simple layers achieving a single thing, which can be stacked and blended together.

Modularisation as it stands is hard, as I'd have to interpret the contents of the blocks and compose them into unified HLSL that wouldn't blow the instruction limits.
The default effect is already very close to the limits of some of the 2.x shader models.

As for a looks repository, I've pondered it but it would involve web-dev, which makes my eyes bleed.
Title: foo_wave_seekbar
Post by: urutapu on 2013-06-10 00:38:14
Hey, I'm pretty new to editing the foobar interface so sorry if this is a dumb question, but is there some way to replace the normal seekbar with the waveform seekbar or at least put it up on/near the toolbar?
Title: foo_wave_seekbar
Post by: Zao on 2013-06-10 00:54:01
urutapu:In the Default UI, I do not currently have the capability to add any custom toolbars, it can only go where UI elements can go.
In Columns UI, the component works both as an UI panel and an UI toolbar.

The closest you can get to having it a toolbar is making a top/bottom split, putting the seekbar in the upper half and the rest of your UI in the lower half.
Title: foo_wave_seekbar
Post by: Zao on 2013-06-10 00:56:40
For you people who for some strange reason listen to .1 content and display it mixed down to stereo or mono, there are changes coming up in 0.2.39.3 where I now include the LFE channel in the mixdown result after consulting relevant documentation and mindmelding with testers.
Quote
LFE mixdown factor is now 0.5 per channel.
Removing the LFE channel completely from mixdowns is a bit of a lie, as
the content, even while purely supplemental, has some meaning in the
context of a track.

As every mixdown is a reinterpretation of the data, having an effect
over-represented is better than completely omitting it, particularly as
there is now shader parameters to adjust the displayed range of a
waveform.

ITU recommendation BS.775 specifies a choice of four mixin factors for
LFE content: 0.7071, 0.5, 0.0 and 'reserved', to be specified by the
broadcaster. As any such information is not available, I've selected 0.5
as the coefficient due to it being the lowest non-zero choice, avoiding
over-attenuation while still representing the content somehow.
Title: foo_wave_seekbar
Post by: dinfinity on 2013-06-10 10:25:40
Modularisation as it stands is hard, as I'd have to interpret the contents of the blocks and compose them into unified HLSL that wouldn't blow the instruction limits.
The default effect is already very close to the limits of some of the 2.x shader models.

I wasn't aware that anybody still cared about 2.x shader model limits. 3.0 was introduced 9 years ago

Concerning the modularisation: you could also create more of an implicit social contract between people who write shader code. That is: just have several designated text editors for different parts of the shader code, but simply concatenate their contents. This would not break flexibility nor should it be a lot of work, but it would stimulate more segmented customization.
Title: foo_wave_seekbar
Post by: Zao on 2013-06-10 10:34:03
I wasn't aware that anybody still cared about 2.x shader model limits. 3.0 was introduced 9 years ago

The machines people use to play music tend to more often than not be considered 'vintage'. There's lots of bending over in the Direct3D9 component to support all kinds of odd texture formats and GPU quirks.
Concerning the modularisation: you could also create more of an implicit social contract between people who write shader code. That is: just have several designated text editors for different parts of the shader code, but simply concatenate their contents. This would not break flexibility nor should it be a lot of work, but it would stimulate more segmented customization.

The optimal solution would be one that has a minimum amount of GUI work needed for me in the component itself. The sane solution would probably be a standalone effect designer, either using some weirdo GUI toolkit like Qt, or driven via the browser or something. The current scintilla component as I use it is ... not good, and tends to be slightly unstable.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-06-13 17:36:18
Hey, I'm pretty new to editing the foobar interface so sorry if this is a dumb question, but is there some way to replace the normal seekbar with the waveform seekbar or at least put it up on/near the toolbar?


You can use top/bottom splitter in Default UI (as Zao said), and additionally you can turn off regular seekbar when you rightclick on toolbar. I turned off regular seekbar, but I placed waveform one at the bottom of my layout.
Title: foo_wave_seekbar
Post by: Zao on 2013-06-13 19:10:12
0.2.39.6 is out now. If you've installed any of the 0.2.39 series, please upgrade to this one, it resolves a bug where the foobar2000 installer will not finish due to my component being stupid.
Changelog 0.2.39.6 (https://github.com/zao/foo_wave_seekbar/wiki/Changelog#02396-20130613)
Title: foo_wave_seekbar
Post by: EpicForever on 2013-06-13 19:21:08
Zao, one question - could coefficients for downmixing display of multichannel tracks to mono/stereo be made as user editable values? For example in that script window or somewhere in foobar's "Advanced Preferences"?
Title: foo_wave_seekbar
Post by: Zao on 2013-06-13 19:50:32
A core problem with making things configurable is that anything is made configurable, it's set in stone forever. You cannot distinguish between a user-selected value and one that was the default in the past, which makes it quite a bother for changing the defaults for a reason.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-06-13 21:06:08
OK, but do you see such possibility in future or is it just impossible from your point of view? I know that I can't force you and I understand that you can simply don't have enough time. If you don't plan it at any time then just say "no"
Title: foo_wave_seekbar
Post by: dinfinity on 2013-06-14 01:08:50
The machines people use to play music tend to more often than not be considered 'vintage'. There's lots of bending over in the Direct3D9 component to support all kinds of odd texture formats and GPU quirks.

I doubt the 'more often than not' part of that, but it is noble that you choose to support such hardware nonetheless (and endure all the pain that comes with it ;-).

Quote
The optimal solution would be one that has a minimum amount of GUI work needed for me in the component itself. The sane solution would probably be a standalone effect designer, either using some weirdo GUI toolkit like Qt, or driven via the browser or something. The current scintilla component as I use it is ... not good, and tends to be slightly unstable.

I'd say that 'adding some extra textareas' is about the least amount of GUI work definable within the realm of GUI work ;-)

Anyway, I've switched back to GDI rendering again. Although it sounds awesome, I really can't justify spending several hours on 'programming shaders for a static waveform visualization in my music player' ;-)
Still a thankful user of your component, of course.
Title: foo_wave_seekbar
Post by: nesvariigi on 2013-06-18 00:46:43
Where can I find old versions? L O L.
Title: foo_wave_seekbar
Post by: Zao on 2013-06-18 15:01:08
That depends on why you need them. If there's something that is inferior or unacceptable in a newer version, I'd rather work in public towards resolving that than to have a bunch of people staying on versions with eternal bugs.
Title: foo_wave_seekbar
Post by: grunz on 2013-06-20 20:09:51
i would also like to know where i could find an older version of your plugin. the reason for that is, that i'm running foobar2k with wine on ubuntu linux. starting with some version which i don't exactly remember, foobar started crashing when waveform seekbar was installed. unfortunately, i couldn't find a workaround yet, but i'd love to continue using the plugin.
Title: foo_wave_seekbar
Post by: garbanzo.bean on 2013-06-21 02:03:20
How do I achieve this effect, with the grayscale seekbar becoming colored with time?

(http://img195.imageshack.us/img195/7382/j0a.png)
Title: foo_wave_seekbar
Post by: Zao on 2013-06-21 02:57:12
i would also like to know where i could find an older version of your plugin. the reason for that is, that i'm running foobar2k with wine on ubuntu linux. starting with some version which i don't exactly remember, foobar started crashing when waveform seekbar was installed. unfortunately, i couldn't find a workaround yet, but i'd love to continue using the plugin.

The only way I can ever find out about these kinds of problems is if I'm told about them, as wine is explicitly ignored by the crash reporting system.
Title: foo_wave_seekbar
Post by: skullinsky on 2013-06-21 15:07:39
How do I achieve this effect, with the grayscale seekbar becoming colored with time?

(http://img195.imageshack.us/img195/7382/j0a.png)

Open settings, select Direct3D, then open Frontend settings, and paste this code:
Code: [Select]
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 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 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 )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(sTex, tc.x);
if (replayGain.g != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 1.8; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 1.8; //use album gain
} else {
minmaxrms.rgb *= 0.9 + 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;

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

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

then apply, and set up colors (here is preview with my colors (red / dark red / black)
(http://img69.imageshack.us/img69/5237/lsi6.png)

...its a code someone mentioned here earlier, and it isnt the only one solution...

I have a question myself though... Could someone give me a hint how to edit this code so that it would show the waves as are on Soundcloud?
 (http://img844.imageshack.us/img844/3576/exq5.png)

I am talking about the mirror effect on L/R output
Title: foo_wave_seekbar
Post by: nesvariigi on 2013-06-22 22:18:00
That depends on why you need them. If there's something that is inferior or unacceptable in a newer version, I'd rather work in public towards resolving that than to have a bunch of people staying on versions with eternal bugs.
Sorry for late answer. D3D mode worked fine few versions back. But now it is displayed wrong.
(http://ipp.lv/pagaidu/seekbar.png)
I admit, it is an old laptop, maybe it lacks some new hardware features. :/
Title: foo_wave_seekbar
Post by: Zao on 2013-06-23 02:34:17
nesvariigi: Is this a custom effect? Could you put your D3D effect code in a post with a codebox, as well as mention what graphics card and OS this is running on. I haven't seen that look since 2009
(http://www.acc.umu.se/~zao/seekbar06.png)
Title: foo_wave_seekbar
Post by: daviszarins on 2013-06-23 04:16:55
nesvariigi: Is this a custom effect? Could you put your D3D effect code in a post with a codebox, as well as mention what graphics card and OS this is running on. I haven't seen that look since 2009
I have no custom effects (default code). Graphics adapter is Trident CyberALADDiN-P4  v6.4612.22ICD_SE_NP. OS is WinXP Pro SP3 x86. As I mentioned, it is old laptop used mainly for music listening. I added pictures with D3D features support.
(http://ipp.lv/pagaidu/1.PNG)
(http://ipp.lv/pagaidu/2.PNG)
Title: foo_wave_seekbar
Post by: Zao on 2013-06-23 04:34:53
Amazing. The code must be falling into some sort of software rasterisation mode, or the driver for that card does some extreme magic.
It's also possible that all this time it has been falling back onto GDI mode transparently and _something_ changed enough to make the frontend kind of load.
Title: foo_wave_seekbar
Post by: daviszarins on 2013-06-23 04:36:53
So you say, it is impossible to run D3D mode on this hardware?
Title: foo_wave_seekbar
Post by: Zao on 2013-06-23 05:05:36
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.
Code: [Select]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.15.fb2k-component]foo_wave_seekbar-0.2.15.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.16.fb2k-component]foo_wave_seekbar-0.2.16.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.17.fb2k-component]foo_wave_seekbar-0.2.17.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.18.fb2k-component]foo_wave_seekbar-0.2.18.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.19.fb2k-component]foo_wave_seekbar-0.2.19.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.20.fb2k-component]foo_wave_seekbar-0.2.20.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.21.fb2k-component]foo_wave_seekbar-0.2.21.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.22.fb2k-component]foo_wave_seekbar-0.2.22.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.23.fb2k-component]foo_wave_seekbar-0.2.23.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.24.fb2k-component]foo_wave_seekbar-0.2.24.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.25.fb2k-component]foo_wave_seekbar-0.2.25.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.26.fb2k-component]foo_wave_seekbar-0.2.26.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.27.fb2k-component]foo_wave_seekbar-0.2.27.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.28.fb2k-component]foo_wave_seekbar-0.2.28.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.29.fb2k-component]foo_wave_seekbar-0.2.29.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.30.fb2k-component]foo_wave_seekbar-0.2.30.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.30.1.fb2k-component]foo_wave_seekbar-0.2.30.1.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.31.fb2k-component]foo_wave_seekbar-0.2.31.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.32.fb2k-component]foo_wave_seekbar-0.2.32.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.33.fb2k-component]foo_wave_seekbar-0.2.33.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.34.fb2k-component]foo_wave_seekbar-0.2.34.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.35.fb2k-component]foo_wave_seekbar-0.2.35.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.fb2k-component]foo_wave_seekbar-0.2.36.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.1.fb2k-component]foo_wave_seekbar-0.2.36.1.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.2.fb2k-component]foo_wave_seekbar-0.2.36.2.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.3.fb2k-component]foo_wave_seekbar-0.2.36.3.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.37.fb2k-component]foo_wave_seekbar-0.2.37.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.38.fb2k-component]foo_wave_seekbar-0.2.38.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.fb2k-component]foo_wave_seekbar-0.2.39.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.1.fb2k-component]foo_wave_seekbar-0.2.39.1.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.2.fb2k-component]foo_wave_seekbar-0.2.39.2.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.3.fb2k-component]foo_wave_seekbar-0.2.39.3.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.4.fb2k-component]foo_wave_seekbar-0.2.39.4.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.5.fb2k-component]foo_wave_seekbar-0.2.39.5.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.6.fb2k-component]foo_wave_seekbar-0.2.39.6.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.7.fb2k-component]foo_wave_seekbar-0.2.39.7.fb2k-component[/url]
Title: foo_wave_seekbar
Post by: mzso on 2013-06-24 09:54:34
Hi!
This question only a slightly related.
If "someone" installed old versions of directx in hopes of making an old DirectDraw game playable, but getting garbage instead, how would one remove them without breaking never directx installs (9 and up)?
Title: foo_wave_seekbar
Post by: Zao on 2013-06-24 10:04:10
In general, a D3D runtime installer should never ruin or touch more recent revisions, just provide the things that are missing or strictly upgrade things that are.
If you've force-clobbered parts of your system, I recommend that you either restore from a known good state, or nuke the OS from orbit. It's the only way to be sure.
Title: foo_wave_seekbar
Post by: daviszarins on 2013-06-26 12:08:13
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.
Strange, but none of them seem to work. All versions have the same green effect. Console shows, that D3D has loaded successfully. I have no idea what has changed in this computer since then when it was working. It looks like I will have to stick to GDI. Well, nevermind then, sorry for troubling you.
Title: foo_wave_seekbar
Post by: Zao on 2013-06-26 13:08:21
daviszarins: Do you get the same green behaviour from running this simple test program? Seekbar spinup test (https://www.acc.umu.se/~zao/seekbar-spinup-test-0.1.zip)
If executing properly, it should render a simple stereo waveform in a standalone application.
Title: foo_wave_seekbar
Post by: daviszarins on 2013-06-26 13:24:22
daviszarins: Do you get the same green behaviour from running this simple test program? Seekbar spinup test (https://www.acc.umu.se/~zao/seekbar-spinup-test-0.1.zip)
If executing properly, it should render a simple stereo waveform in a standalone application.
Is it 64 bit program or do I have to install some prerequisites because "...test.exe is not a valid Win32 application"?
Title: foo_wave_seekbar
Post by: Zao on 2013-06-26 14:41:44
Seems like I built that with the default toolset in VS2012, which means targetting Vista (6.0) and up. It will probably not tell you anything interesting anyway.
Title: foo_wave_seekbar
Post by: j.r. on 2013-07-03 23:47:42
Seems like I built that with the default toolset in VS2012, which means targetting Vista (6.0) and up. It will probably not tell you anything interesting anyway.


hello zao

i have the same problem with my notebook.  i can't use direct3d 9.0c. i have always a green/grey screen with it like 'nesvariigi'
when i switch to direct2d it skips to gdi. the gdi-mode is the only one that works here. i have a onboard gfx-card
intel  82852/82855 gm/gme graphics controller. as long as i installed wave_seekbar d3d never worked with any version.

the console prints:

Seekbar: taking Direct3D9 path.
Seekbar: Frontend initialized. (but with the green/grey screen)

Seekbar: taking Direct2D1 path.
Seekbar: frontend creation failed: unavailable frontend
Seekbar: taking GDI path.


just for your information
kind regards j.r.
Title: foo_wave_seekbar
Post by: Zao on 2013-07-04 16:57:50
Version 0.2.40 is out.
It has a lot of robustness fixes, GDI painting optimizations, and is built with a new compiler and functionality from its standard library resulting in regaining almost a megabyte of disk footprint.

This is a bit intrusive, so report changed or broken behavior.
Title: foo_wave_seekbar
Post by: Zao on 2013-07-04 17:02:53
j.r.: Your GPU is a DX7 part, with DX9 support in software. I haven't been able to assemble a machine with a comparable chip to test on. Has the Direct3D frontend ever worked on this configuration?

Direct2D requires around Vista SP2 by definition, so if you're on XP that will never work.
Title: foo_wave_seekbar
Post by: j.r. on 2013-07-04 18:06:18
j.r.: Your GPU is a DX7 part, with DX9 support in software. I haven't been able to assemble a machine with a comparable chip to test on. Has the Direct3D frontend ever worked on this configuration?

dear zao

as far as i know, no!  but to be sure, i tried some of the older revisions tonight, 0.2.38, 36, 34, 32, 30, 29, 21, and 15
and for any of them only the gdi-mode works here. it's not a problem and ok for me, i can life with the gdi-mode.

Direct2D requires around Vista SP2 by definition, so if you're on XP that will never work.

ahh! ok! i didn't know that . i use win xp sp3 here.

by the way, have you ever seen  the waveform display from edison the waveform-editor available for the fl-studio? 
that's very great and also very nice to handle.
 
thanks a lot and kind regards j.r.

Title: foo_wave_seekbar
Post by: Gnx on 2013-07-05 11:50:00
issue with new v0.2.40 on XP SP2, FB v1.2.8 information pop up:
"Failed to load DLL: foo_wave_seekbar.dll
Reason: La procédure spécifiée est introuvable.  "

FYI "C:\Documents and Settings\xxx\Application Data\foobar2000\user-components\foo_wave_seekbar" contents:
foo_wave_seekbar.dll, frontend_direct2d.dll, frontend_direct3d9.dll, msvcp120.dll, msvcr120.dll, SciLexer.dll
Title: foo_wave_seekbar
Post by: Dandruff on 2013-07-05 12:09:24
issue with new v0.2.40 on XP SP2, FB v1.2.8 information pop up:


Can't confirm this on german WinXP SP3. Working fine here.


One thing that's ugly in 0.2.40: In GDI mode, internet streams are now just displaying a black background. Doesn't look nice. Please leave it white!
Title: foo_wave_seekbar
Post by: Zao on 2013-07-05 20:12:29
v0.2.40 on XP SP2

You seem to be running a Windows XP with an unsupported service pack. Both Visual Studio 2012 (v110_xp) and Visual Studio 2013 (v120_xp) target only supported versions (SP3 for x86, SP2 for x64), and in less than a year, none at all.

Quote from: Microsoft link=msg=0 date=
For these operating systems, the supported versions are Windows XP Service Pack 3 (SP3) for x86, Windows XP Service Pack 2 (SP2) for x64, and Windows Server 2003 Service Pack 2 (SP2) for both x86 and x64.

You all are aware that XP will die a fiery support death in April 2014, right, whether you like it or not? That means no security updates, no updates, and no pity. I have no idea how to handle this imminent doomsday, as there's the long tail of people that for their own reasons can't or won't migrate to a less doomed OS.

All I know is that it won't be pretty.
Title: foo_wave_seekbar
Post by: Gnx on 2013-07-05 21:01:54
@ Zao
I know that XP SP2 is not really up to date ... 
don't matter, back to v0.2.39.6, it works fine

many thanks for all your work
regards
Title: foo_wave_seekbar
Post by: EpicForever on 2013-07-06 17:15:51
I got a question. I completely don't understand the code that is under D3D configuration - I am complete noob in this matter. So I wanted to know if using specific variables in this code I will be able to normalize amplitude of waveform but ONLY when I use downmixed view? Here is the code that suits my needs when I don't need downmixing:

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 faded_bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show, float vert_from, float vert_to )
{
float dist = abs(pos - tc.x);
float fluff = smoothstep(vert_from, vert_to, abs(tc.y));
float4 c = show
? lerp(fg, bg, max(fluff, smoothstep(0, width, dist)))
: bg;
return c;
}

// #define BORDER_ON_HIGHLIGHT

float4 played( float pos, float2 tc, float4 fg, float4 bg, float alpha)
{
float4 c = bg;
float2 d = 1 / viewportSize;
if (pos > tc.x)
{
#ifdef BORDER_ON_HIGHLIGHT
if (tc.x < d.x || tc.y >= (1 - d.y) || tc.y <= (2 * d.y - 1))
c = selectionColor;
else
#endif
c = lerp(c, fg, saturate(alpha));
}
return c;
}

float4 evaluate( float2 tc )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex1D(sTex, tc.x);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;

#if 1
float4 bgColor = backgroundColor;
#else
float a = viewportSize.x / viewportSize.y;
float2 aspect = horizontal ? float2(a, 1) : float2(1/a, 1);
float2 tcBg = float2(tc.x, -tc.y / 2 + 0.5) * aspect;
float4 bgColor = tex2D(sTexBg, tcBg);
#endif

float4 wave = outside
? bgColor
: lerp(bgColor, textColor, 4.0 * factor+0.8);

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);
c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible);
c0 = bar(seekPos,  input.tc, selectionColor, c0, seekWidth,    seeking      );
if (shade_played)
c0 = played(cursorPos, input.tc, highlightColor, c0, 0.3);
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();
}
}

If I'm not wrong it's just the default code, but one colour mixing/blending setting is tuned: lerp(bgColor, textColor, 4.0 * factor+0.8);

So - is it possible to modify this code to normalize ONLY when downmixed view is turned on?
Title: foo_wave_seekbar
Post by: Zao on 2013-07-06 23:33:38
Good for you that I checked the actual thread. Post edits do not appear in the mail notifications.

No, there's not currently any way to find out which channel is currently being shaded and how many channels there are, and if they're the result of downmixing.

I'm a bit reluctant to add semantics for every little thing, as they count to some global limit in the shader, and they might be painful to maintain over time. I'll ponder it.
Title: foo_wave_seekbar
Post by: Dandruff on 2013-07-07 09:27:25
One thing that's ugly in 0.2.40: In GDI mode, internet streams are now just displaying a black background. Doesn't look nice. Please leave it white!


Anything to say about this?
Title: foo_wave_seekbar
Post by: Zao on 2013-07-07 11:06:18
Noted that, not intended.

Haven't had time to get around looking at it.
Title: foo_wave_seekbar
Post by: Dandruff on 2013-07-07 11:12:23
Ok, thanks!
Title: foo_wave_seekbar
Post by: EpicForever on 2013-07-07 20:34:17
I noted these lines in derty2 code:

   //- - - - - NORMALIZE/RESCALE ALL WAVEFORMS TO FILL PANEL EDGE-TO-EDGE - - - - - - - -
   //Requires "foo_wave_seekbar" version 0.2.34 or higher - 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));

I found that basically they do exactly what I want for 5.1 downmixed to 2.0. But even despite I tested  both variations on several files I don't get the difference between them... what is the difference between  [min_peak,max_peak], and  [-largest_peak,largest_peak] ? what is the difference between largest_peak and max_peak?
Title: foo_wave_seekbar
Post by: Zao on 2013-07-07 21:14:55
(https://www.acc.umu.se/~zao/seekbar-peaks.png)
The full blue line is the maximum peak for the track, determined by finding the numerically highest value in the waveform extents.
The full red line is the minimum peak for the track, that is, the lowest (quite likely negative) value in the waveform extents.
The light blue and light red lines are those peaks, reflected around the middle, zero.

Scaling to [minpeak/maxpeak] would map the waveform so that the peaks on both sides would touch the sides of the window.
Scaling to [-largest/largest] would map the waveform so that the peaks of one side would touch the side, and that the zero line remains centered, to avoid a lopsided look.
Title: foo_wave_seekbar
Post by: Dandruff on 2013-07-07 21:16:31
0.2.40:

Direct3D 9.0c causes strange high CPU usage (sometimes up to 13% on Intel Core2 Duo E6700 + Geforce GTS450, 1920x1200 pixels) on WinXP SP3 I think. Dispay rate set to 100%. Display = dowmix to mono.


GDI mode seems to be performing much better.
Title: foo_wave_seekbar
Post by: Zao on 2013-07-08 04:28:55
I've fixed the black-stream bug, now clearing to the preferred background color instead.
It'll be in a release eventually.

I have yet to find the cause of the phantom position indicator at pixel zero, nor diagnosed any of the reported CPU burn in the D3D9 frontend, the latter due to the lack of 3D acceleration in my development VM.
Title: foo_wave_seekbar
Post by: Axon on 2013-07-23 23:07:57
i would also like to know where i could find an older version of your plugin. the reason for that is, that i'm running foobar2k with wine on ubuntu linux. starting with some version which i don't exactly remember, foobar started crashing when waveform seekbar was installed. unfortunately, i couldn't find a workaround yet, but i'd love to continue using the plugin.

The only way I can ever find out about these kinds of problems is if I'm told about them, as wine is explicitly ignored by the crash reporting system.

FWIW, version 0.2.34 appears to be the last version which works on my Linux system (Arch x86_64). Everything after that generally crashes on startup.

Also, only GDI mode works; when trying D3D9, I get the console error "DirectX redistributable not found." I installed directx9+d3dx10+d3dx11_43 via winetricks, although I have no earthly idea if any of that is installing what foo_wave_seekbar is looking for.
Title: foo_wave_seekbar
Post by: Zao on 2013-07-24 06:53:48
The reason nothing works anymore on Linux is because the Wine people are ... amusingly talented.
There's a lot of assumptions and stubs in the Wine code, resulting in that anything using the C++11 threading primitives like mutexes from Visual Studio 2012 or 2013 will break completely.
You either have to wait for Wine to fix it, which may take an indeterminate amount of time, or I will have to sidestep some bloody clods whose motto seems to be "STUB THE WORLD!".

As for your Direct3D9 troubles, heaven knows. I've never supported manual installation of D3DX.
I do, however, use the February 2010 compiler, which means that you need at a very minimum d3dx9_42, and possibly whichever one down around 33 (31?) that provides the legacy compiler.
Title: foo_wave_seekbar
Post by: Wander on 2013-07-24 16:20:32
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.
Title: foo_wave_seekbar
Post by: Zao on 2013-07-25 00:21:21
[!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--]
Code: [Select]
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
[/size]
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.
Title: foo_wave_seekbar
Post by: TomasPin on 2013-07-25 05:05:07
Found out about this component too late... Thank you so much! Works fine for me
Title: foo_wave_seekbar
Post by: Manchesterer on 2013-07-25 08:19:28
I´m getting double seekbar slider with version 0.2.40, GDI, foobar2000 v1.2.8.

http://postimg.org/image/3nnzdm1pl/ (http://postimg.org/image/3nnzdm1pl/)
Title: foo_wave_seekbar
Post by: Zao on 2013-07-25 11:39:25
Manchesterer: Yup, there's a known bug where it always displays the seek location indicator in the GDI frontend.
Title: foo_wave_seekbar
Post by: continous on 2013-07-26 00:35:50
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.
Title: foo_wave_seekbar
Post by: Wander on 2013-07-26 08:23:09
Take a look at the console output, it's probably falling back to GDI. Therefore the "Frontend Settings..." doesn't work.
Title: foo_wave_seekbar
Post by: Zao on 2013-07-26 08:29:28
« 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.
Title: foo_wave_seekbar
Post by: continous on 2013-07-26 09:55:41
« 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
Title: foo_wave_seekbar
Post by: continous on 2013-07-27 04:24:15
I found the error. Turns out I had a WIP component loaded and it was conflicting with your component's D3D
Title: foo_wave_seekbar
Post by: Zao on 2013-07-27 08:32:12
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.
Title: foo_wave_seekbar
Post by: grunz on 2013-08-05 18:52:20
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!!
Title: foo_wave_seekbar
Post by: Zao on 2013-08-05 21:38:10
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.
Title: foo_wave_seekbar
Post by: free30 on 2013-08-07 16:48:07
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. 
Title: foo_wave_seekbar
Post by: Zao on 2013-08-07 22:15:57
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%).
Title: foo_wave_seekbar
Post by: free30 on 2013-08-08 21:22:36
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.
Title: foo_wave_seekbar
Post by: slyman on 2013-08-18 09:49:48
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.
Title: foo_wave_seekbar
Post by: Zao on 2013-08-18 10:51:41
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 (https://github.com/zao/foo_wave_seekbar/issues/18) 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.
Title: foo_wave_seekbar
Post by: slyman on 2013-08-18 22:20:59
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 (https://github.com/zao/foo_wave_seekbar/issues/18) 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 

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.

(http://i.imgur.com/vF4kF3y.jpg)

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

Code: [Select]
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
Title: foo_wave_seekbar
Post by: Zao on 2013-08-18 22:52:32
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: [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);

// 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();
    }
}
(http://zao.se/~zao/seekbar84.png)
Title: foo_wave_seekbar
Post by: slyman on 2013-08-18 23:12:28
ah awesome thank you, i appreciate the help
Title: foo_wave_seekbar
Post by: olegausa on 2013-08-19 03:32:33
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: [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);

// 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();
    }
}
(http://zao.se/~zao/seekbar84.png)

Thanks a lot it also works with other foreground colors
Title: foo_wave_seekbar
Post by: lynxx on 2013-08-20 17:53:21
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.
Title: foo_wave_seekbar
Post by: hgodzillay on 2013-09-05 19:24:41
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
what the ..
Title: foo_wave_seekbar
Post by: Zao on 2013-09-05 22:10:47
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?
Title: foo_wave_seekbar
Post by: mauzel on 2013-09-07 06:58:44
I've been using this component for over 3.5 years now. The last time I posted in this thread was like in April 2010.

The last time I updated this component was on version 0.2.12 (2010/04/24).

(Yes, I know I should probably update my components more regularly)

Anyway, I just updated to 0.2.40 and purged my old wavecache.db file, and I was really impressed with how ridiculously fast waveform analysis is now. I assume this is due to 0.2.30 (2013/03/22) (https://github.com/zao/foo_wave_seekbar/wiki/Changelog#0230-20130322).

ANYWAY, I just wanted to say thanks after all these years. Bye.
Title: foo_wave_seekbar
Post by: tedych on 2013-09-07 23:05:15
Hi, I'm using a very old beta of waveseekbar on Foobar 1.1.11 or something, after zao fixed something back in 2010 or 2011, and I had no problems since. I'm still not having problems. But I just tested on another machine the latest foobar and waveseekbar because I felt it was time to test and eventually update my main system (I have tested a newer than 1.1.11 of foobar some time ago and I found it buggy so I decided to stick with 1.1.11 - you know, if it ain't broken...).
I see waveseekbar no longer processes the next song in the list - I listen to a song (10-20 seconds so WS has the time to process the next song), and then advance to the next song, and I see the delay until WS processes it and shows its wave. Why this change, or it is a bug? I'm sorry, I went through the last few pages but I don't seem to find anything related.
Title: foo_wave_seekbar
Post by: mauzel on 2013-09-08 00:12:43
I see waveseekbar no longer processes the next song in the list - I listen to a song (10-20 seconds so WS has the time to process the next song), and then advance to the next song, and I see the delay until WS processes it and shows its wave. Why this change, or it is a bug? I'm sorry, I went through the last few pages but I don't seem to find anything related.


He made this change in 0.2.37:

0.2.37 (2013/05/13) (https://github.com/zao/foo_wave_seekbar/wiki/Changelog#0237-20130513)
Title: foo_wave_seekbar
Post by: Zao on 2013-09-08 01:48:49
It's nice to see that others remember more what I've done with the component than I do 

I don't recall if I had a rationale for dropping it when I moved the rescanning to a central entity instead of in each of the waveform instances. Right now, I'd probably ret-con it with "it probably made the scan of the current track slower, and might've interfered with other components".

If you care about always having waveforms, there's always the explicit Extract command.
Title: foo_wave_seekbar
Post by: tedych on 2013-09-08 08:08:01
No, it's not a big deal anyway, but I intend to follow my tested method - it ain't broken and I won't push it for now  .
You say it maight have made scanning slower, but above another guy said he feels it faster than before.. (I find it maybe faster..)
Anyway, I'll give this a second thought and test.
Title: foo_wave_seekbar
Post by: yurithedragonhalf on 2013-09-12 04:57:20
Maybe it's been asked and answered but anyhoo how can i make it wider about the same width as the soundcloud?
Title: foo_wave_seekbar
Post by: Zao on 2013-09-12 07:14:12
yurithedragonhalf: Are you talking about the vertical extents of the waveform inside the display?
The generic way to do that is to use the Direct3D9 mode and in the effect use TRACKMAGNITUDE's components to find out how low/high the peaks are, as described in an earlier post. There's also a REPLAYGAIN semantic you can use to determine the RG amounts you may need to compensate with to get a perceptual full-scale display.

Personally I don't bother with the RG compensation and prefer to see the waveform at its natural extents, maybe just scaled down if it clips some.

Anyway, I've got a soundcloud-like asymmetric look (https://www.acc.umu.se/~zao/seekbar-soundcloud.fx) that scales the waveform to the maximum peak, offset from the center-line and with a slight gradient behind.
(https://www.acc.umu.se/~zao/seekbar-soundcloud.png)

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;
float3 track_magnitude  : TRACKMAGNITUDE;

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( float2 tc, float cursorPos )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex1D(sTex, tc.x);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;
bool played = cursorPos < tc.x;
float4 inside_color = played ? textColor : highlightColor;
float4 bgColor = backgroundColor;

float4 wave = outside
? bgColor
: inside_color
;

return saturate(wave);
}

float4 reflect_evaluate( float2 tc, float cursorPos)
{
float baseline = -1.0/3.0;
float low_unscale = 3.0/2.0;
float high_unscale = 3.0/4.0;
bool mirrored = tc.y < baseline;
if (mirrored) {
tc.y = baseline - tc.y;
tc.y = tc.y * low_unscale;
}
else {
tc.y = tc.y - baseline;
tc.y = tc.y * high_unscale;
}
float mag = max(-track_magnitude.r, track_magnitude.g);
if (mag > 0.95) {
tc.y = lerp(0, mag/0.95, tc.y);
}
float boost = mirrored ? 1.3 : 1.0;
float gradient = lerp(0.7, 1.0, tc.y);
return boost * gradient * evaluate(tc, cursorPos);
}

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 = reflect_evaluate(input.tc, cursorPos);
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();
}
}

Edit: made reflect_evaluate saturate it's output, otherwise the position/seek-bar got lopsided.
Title: foo_wave_seekbar
Post by: Nisto on 2013-09-14 04:38:44
Zao, any chance you can get the component to work with cdda:// entries? It's not showing any waveform (I have "analyze tracks not in the media library" enabled). Thanks.

---looks like it was already brought up earlier. Sorry. It's a shame that won't work though!
Title: foo_wave_seekbar
Post by: Zao on 2013-09-14 09:05:37
The core problem with CDDA is that it's impossible to decode more than one track at the same time, thanks to that reads from optical media is serial in nature.
This means that anything that causes concurrent decoding is impossible, which means that neither automatic scanning while playing (because you are playing) nor explicit scanning (as that decodes multiple tracks at once) is possible.
In order for it to be possible at all, the analysis would have to be aware of what kind of input is currently playing and ensure that no other analysis thread is currently touching the device, which is way more complexity than I have been bothered to handle.

Of course, most of the restrictions above are moot if you play all your CDDA from ISOs, but I don't really consider that a common valid use case, as you by then might as well just keep regular boring lossless files.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-09-14 13:41:55
I think that reason for not scanning files on optical media is obvious, well justified and thus there should be no discussion about that. This is media storage induced limitation. Of course there could be discussion another "Advanced preferences" checkbox for those who don't care about their ODDs, but I think that properly written application should avoid any damage to the hardware - and that's why even such checkbox should never exist.
Title: foo_wave_seekbar
Post by: foosion on 2013-09-15 19:24:42
It might be possible to get the audio data from the visualization API as the song plays, but I imagine it would be more than a little cumbersome to fit this into the code.
Title: foo_wave_seekbar
Post by: Zao on 2013-09-15 20:21:59
Cute idea, but I definitely do not want to touch the weirdo vis interfaces with their polling-of-data and other oddities.
Title: foo_wave_seekbar
Post by: Vomitus on 2013-09-17 19:23:04
I've updated component from 0.2.27.0 to 0.2.40.0 and now I experience full UI freeze on foobar start. Foobar does not crash, it can even respond to Windows 7 taskbar context menu actions (like Play) but foobar itself is unresponsive. Removing component or downgrading to 27 version fixes an issue.
I would be grateful for any help on making new version work. Thanks!
Title: foo_wave_seekbar
Post by: Dandruff on 2013-09-17 21:31:44
What about version 0.2.41? No download available yet?
Title: foo_wave_seekbar
Post by: Zao on 2013-09-17 21:38:49
Dandruff: Right, it's just the features that I intend to ship with that release, whenever I can get around actually testing it enough. It also includes a bump of Visual Studio version to 2013 RC, so there's untold fun lurking under the surface.
Title: foo_wave_seekbar
Post by: Dandruff on 2013-09-17 22:05:35
Ok
Title: foo_wave_seekbar
Post by: kode54 on 2013-09-18 01:52:21
SDK/playback_stream_capture.h

Sends you the audio data in chunks, roughly in time with what the user hears. Still real-time, but provides a continuous stream of the data. Of course, it doesn't provide track metadata or track change markers, so you don't know where the audio is coming from any better than if you poll the visualization interface.
Title: foo_wave_seekbar
Post by: Zao on 2013-09-18 13:11:13
Yeah, I'm aware of that interface too, and it's about as unsuitable indeed.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-09-22 08:11:29
http://www.hydrogenaudio.org/forums/index....howtopic=102724 (http://www.hydrogenaudio.org/forums/index.php?showtopic=102724)

As I said in last post I still need to test but it seems that we have some incompatibility between Win 8.1 and wave_seekbar or at least between newest AMD graphic driver and wave_seekbar. I use Sapphire HD 7750 Ultimate graphic card with latest Catalyst drivers (stable release, not the beta one), under Win 8.1 Preview x64.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-09-22 08:25:21
i think you're barking up the wrong tree. foo_wave_seekbar just happens to the first thing is utilising your GPU after waking from hibernation. i don't see how you can expect Zao to do anything about that. your issue looks to be OS/driver or possibly BIOS related.

you could try another application that uses your GPU immediately after wakeup and see what happens?
Title: foo_wave_seekbar
Post by: Zao on 2013-09-22 18:37:38
The crash is deep inside the AMD drivers when I try to lock a texture after a device reset. The documentation mandates that such operations shall fail gracefully until the device is properly reset.

AMD considers that to be for the weak and instead violently crashes on an internal null pointer. Most GPU vendors are equally incompetent when it comes to resuming from hibernation. Heck, you can trigger stupidity by simply locking a Windows 8 session.

I could "solve" this problem by getting rid of D3D9 and D2D, but I doubt people would be overly happy about it. 
Title: foo_wave_seekbar
Post by: EpicForever on 2013-09-22 18:48:05
OK. Thanks for your explanation. I am just reporting the issue. If it's unsolvable then OK I'll try to live with it. Maybe I will have to install foo_jesus
From my point of view it looks like this: In Win7x64, on integrated Radeon HD4200 everything is OK. In Win8.1x64 on "normal" Radeon HD7750 there are crashes... Why the thing that you described happens only on Win8.1? In the end I plan to go back to Win7x64 (probably when 8.1 Preview will expire), so it will take some time before I check how Win7 works with my new graphic card and hibernation...
Title: foo_wave_seekbar
Post by: andrew_berge on 2013-09-22 22:57:40
I have a question. I tend to have a lot of files that i'll listen to once and then delete. I don't add them to the music library. I was wondering if the waveforms still get added to the database, taking up space (not much, but still), or if they're just disposed of after the track is finished or Foobar is closed.

I know i can set it not to scan those tracks at all, but i'd still like to see the waveforms, just not save them.
Title: foo_wave_seekbar
Post by: Zao on 2013-09-22 23:13:26
There's a menu option in "Library -> Waveform Seekbar -> Remove Dead Waveforms" which removes all waveforms for which the track is not present.

The component always stores everything it scans.
Title: foo_wave_seekbar
Post by: andrew_berge on 2013-09-22 23:30:59
Oh! That's perfect, thanks for the help
Title: foo_wave_seekbar
Post by: MindWork on 2013-09-25 20:36:21
Zao, thanks for great plugin!
And I have a question:
Can I change the location of the file wavecache.db?
Title: foo_wave_seekbar
Post by: marc2003 on 2013-09-25 20:41:56
http://www.hydrogenaudio.org/forums/index....st&p=821897 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=821897)
Title: foo_wave_seekbar
Post by: MindWork on 2013-09-25 20:55:11
marc2003, thanks, but mklink is not what i wanted.
Title: foo_wave_seekbar
Post by: Zao on 2013-10-01 16:46:22
*shakes a fist at mutt that forgot to tell me about new mail in =hydrogenaudio*

For now and the foreseeable future, there can only be exactly one wavecache.db, and it happens that the place where I care about looking is the profile directory, until I can be bothered adding some sort of configuration for it.

If you want it somewhere else, the best you can do from the outside is link it in from somewhere else with mklink as marc mentioned. If that workaround doesn't solve your problem, please tell me why. Are you looking for multiple wavecache.db files? Do you lack permissions to do so? Are you working on a filesystem that doesn't have symlinks? Are you moving across machines?
Title: foo_wave_seekbar
Post by: Malstroemchen on 2013-10-04 13:06:23
Hey guys, i really love that plugin and I used it for years now.
However i needed to resetup my PC and foobar. I am running foobar 1.2.9 and after installing the waveform foobar crashes at startup.  After removing the seekbar in the safe-mode everything runs fine. Is there a way to get the waveform working in foobar 1.2.9 or do I have do downgrade?

Here is the crash report of fb2k:

Code: [Select]
Illegal operation:
Code: E06D7363h, flags: 00000001h, address: 7B83AE0Bh
Additional parameters: 19930520h 0033EF08h 0185BBF8h
Last win32 error: 120

Call path:
entry

Code bytes (7B83AE0Bh):
7B83ADCBh:  C7 45 10 0F 00 00 00 8B 45 10 89 45 B8 8B 45 10
7B83ADDBh:  C1 E0 02 89 44 24 08 8B 45 14 89 44 24 04 8D 45
7B83ADEBh:  A8 83 C0 14 89 04 24 E8 D9 3B FE FF EB 07 C7 45
7B83ADFBh:  B8 00 00 00 00 8D 45 A8 89 04 24 E8 39 B6 FE FF
7B83AE0Bh:  83 EC 04 8B 5D FC C9 C2 10 00 55 89 E5 57 56 53
7B83AE1Bh:  83 EC 3C E8 CD 41 FE FF 81 C3 DD 51 07 00 8B 45
7B83AE2Bh:  08 8B 00 89 45 E4 8B 45 E4 8B 00 3D 1D 00 00 C0
7B83AE3Bh:  0F 84 23 01 00 00 3D 1D 00 00 C0 77 5E 3D 10 01

Stack (0033EE50h):
0033EE30h:  7BCC8000 00000003 0033EEB4 7BC7F6CC
0033EE40h:  00000001 FFFFFFA4 7B83AE0B 0033EE5C
0033EE50h:  0033EEE8 0000000C 00000000 E06D7363
0033EE60h:  00000001 00000000 7B83AE0B 00000003
0033EE70h:  19930520 0033EF08 0185BBF8 B7692AF5
0033EE80h:  00000000 7BA42894 7B890A29 7B8909B4
0033EE90h:  0033EED0 0033EEB0 0178EC02 00000040
0033EEA0h:  001F0002 0033EEEC 0033EED0 00000038
0033EEB0h:  00000000 0033EEF4 017AFA77 E06D7363
0033EEC0h:  00000001 00000003 0033EEE8 00152240
0033EED0h:  00000000 E06D7363 00000001 00000000
0033EEE0h:  00000000 00000003 19930520 0033EF08
0033EEF0h:  0185BBF8 0033EF1C 017CEB92 0033EF08
0033EF00h:  0185BBF8 00000000 017E383C 00000000
0033EF10h:  0033EF00 80070078 FFFFFFFF 0033EFB0
0033EF20h:  017A0DBE A88B909E 0033F048 00000000
0033EF30h:  0033F054 00000000 0033F048 00000000
0033EF40h:  0033EF60 0178EBDF 00110000 00000002
0033EF50h:  00000210 0033F048 00000000 80000000
0033EF60h:  0033EF7C 0178EC02 00152240 017A2CEC

Registers:
EAX: 7B826449, EBX: 7B8B0000, ECX: 00000000, EDX: 0185BBF8
ESI: 0185BBF8, EDI: 0033EF08, EBP: 0033EEB4, ESP: 0033EE50

Crash location:
Module: kernel32
Offset: 2AE0Bh

Loaded modules:
foo_fileops   loaded at 01D30000h - 01D7A000h
foo_cdda loaded at 01BD0000h - 01C1F000h
foo_rgscan   loaded at 01A70000h - 01ABC000h
msimg32   loaded at B7490000h - B74A0000h
foo_ui_std   loaded at 01870000h - 01959000h
msvcr120 loaded at 01780000h - 0186C000h
msvcp120 loaded at 016F0000h - 01775000h
foo_wave_seekbar loaded at 014A0000h - 016E4000h
foo_albumlist loaded at 01330000h - 0138C000h
foo_dsp_eq   loaded at 011E0000h - 01216000h
avutil-fb2k-52   loaded at 635C0000h - 635F9000h
avcodec-fb2k-54   loaded at 6F080000h - 6F322000h
foo_input_std loaded at 00F50000h - 010C2000h
foo_dsp_std   loaded at 00E00000h - 00E36000h
foo_unpack   loaded at 003D0000h - 003FF000h
foo_converter loaded at 00B60000h - 00BDF000h
foo_freedb2   loaded at 00A00000h - 00A4E000h
imm32 loaded at 7D8B0000h - 7D8D1000h
winex11   loaded at 7DA70000h - 7DB14000h
winhttp   loaded at 7DBE0000h - 7DC1B000h
oleaut32 loaded at 7DC30000h - 7DD60000h
gdiplus   loaded at 7DD70000h - 7DDE4000h
ws2_32   loaded at 7DDF0000h - 7DE18000h
iphlpapi loaded at 7DE20000h - 7DE3D000h
netapi32 loaded at 7DE40000h - 7DE6C000h
secur32   loaded at 7DE70000h - 7DEA1000h
crypt32   loaded at 7DEB0000h - 7DF77000h
winspool loaded at 7DF80000h - 7DFB8000h
comdlg32 loaded at 7DFC0000h - 7E0A6000h
psapi loaded at 7E0B0000h - 7E0BA000h
dbghelp   loaded at 7E0C0000h - 7E12A000h
imagehlp loaded at 7E130000h - 7E145000h
shared   loaded at 10000000h - 1002B000h
msvcrt   loaded at 7E160000h - 7E1E7000h
zlib1 loaded at 62E80000h - 62E9F000h
shell32   loaded at 7E220000h - 7E44B000h
uxtheme   loaded at 7E450000h - 7E482000h
shlwapi   loaded at 7E490000h - 7E4F8000h
msacm32   loaded at 7E500000h - 7E524000h
rpcrt4   loaded at 7E530000h - 7E5AE000h
ole32 loaded at 7E5C0000h - 7E710000h
winmm loaded at 7E720000h - 7E7C6000h
dsound   loaded at 7E7D0000h - 7E813000h
version   loaded at 7E820000h - 7E82E000h
advapi32 loaded at 7E840000h - 7E8A0000h
gdi32 loaded at 7E8B0000h - 7E981000h
user32   loaded at 7E990000h - 7EAF1000h
comctl32 loaded at 7EB00000h - 7EC10000h
kernel32 loaded at 7B810000h - 7BA44000h
ntdll loaded at 7BC10000h - 7BCE4000h
foobar2000   loaded at 00400000h - 005BF000h

Stack dump analysis:
Address: 7B83AE0Bh (kernel32+2AE0Bh)
Address: 0185BBF8h (msvcr120+DBBF8h)
Address: B7692AF5h (libwine.so.1+4AF5h), symbol: "wine_dbg_log" (+6Ah)
Address: 7BA42894h (kernel32+232894h)
Address: 7B890A29h (kernel32+80A29h)
Address: 7B8909B4h (kernel32+809B4h)
Address: 0178EC02h (msvcr120+EC02h)
Address: 017AFA77h (msvcr120+2FA77h)
Address: 0185BBF8h (msvcr120+DBBF8h)
Address: 017CEB92h (msvcr120+4EB92h)
Address: 0185BBF8h (msvcr120+DBBF8h)
Address: 017E383Ch (msvcr120+6383Ch)
Address: 017A0DBEh (msvcr120+20DBEh)
Address: 0178EBDFh (msvcr120+EBDFh)
Address: 0178EC02h (msvcr120+EC02h)
Address: 017A2CECh (msvcr120+22CECh)
Address: 017A0A3Eh (msvcr120+20A3Eh)
Address: 017A276Ah (msvcr120+2276Ah)
Address: 017A2785h (msvcr120+22785h)
Address: 0185A83Eh (msvcr120+DA83Eh)
Address: 017A27DEh (msvcr120+227DEh)
Address: 0185DEE8h (msvcr120+DDEE8h)
Address: 0185A898h (msvcr120+DA898h)
Address: 0179FC80h (msvcr120+1FC80h)
Address: 0179F8DEh (msvcr120+1F8DEh)
Address: 0179F930h (msvcr120+1F930h)
Address: 7B87B3D8h (kernel32+6B3D8h), symbol: "GetCurrentThreadId" (+0h)
Address: 7BCC8000h (ntdll+B8000h)
Address: 017EB645h (msvcr120+6B645h)
Address: 0171EDFBh (msvcp120+2EDFBh)
Address: 0171EFDAh (msvcp120+2EFDAh)
Address: 0171F257h (msvcp120+2F257h)
Address: 0171F13Dh (msvcp120+2F13Dh)
Address: 0172EF1Ch (msvcp120+3EF1Ch)
Address: 01530854h (foo_wave_seekbar+90854h)
Address: 016F1E64h (msvcp120+1E64h)
Address: 011EB770h (foo_dsp_eq+B770h)
Address: 016B4600h (foo_wave_seekbar+214600h)
Address: 016B468Ch (foo_wave_seekbar+21468Ch)
Address: 016B468Ch (foo_wave_seekbar+21468Ch)
Address: 016B468Ch (foo_wave_seekbar+21468Ch)
Address: 016B468Ch (foo_wave_seekbar+21468Ch)
Address: 01657A8Bh (foo_wave_seekbar+1B7A8Bh)
Address: 01530AF7h (foo_wave_seekbar+90AF7h)
Address: 0042883Ah (foobar2000+2883Ah)
Address: 10002884h (shared+2884h)
Address: 016B468Ch (foo_wave_seekbar+21468Ch)
Address: 0051A470h (foobar2000+11A470h)
Address: 00426FDFh (foobar2000+26FDFh)
Address: 7EC438A8h (libnss_compat.so.2+18A8h), symbol: "_nss_compat_getgrnam_r" (+38h)
Address: 01D360CCh (foo_fileops+60CCh)
Address: 7D52C33Bh (libkrb5.so.3+3D33Bh)
Address: 7DB382F3h (libfreetype.so.6+B2F3h), symbol: "FT_Get_Glyph_Name" (+63h)
Address: 7DCA935Bh (oleaut32+7935Bh)
Address: 7E9CB663h (user32+3B663h), symbol: "EndDialog" (+45h)
Address: 00A4CBF3h (foo_freedb2+4CBF3h)
Address: 010BB83Ah (foo_input_std+16B83Ah)
Address: 7EA8A000h (user32+FA000h)
Address: 7E9A8AD8h (user32+18AD8h), symbol: "RegisterClassW" (+84h)
Address: 7E9B5B0Bh (user32+25B0Bh), symbol: "LoadCursorW" (+A3h)
Address: 0056F29Ch (foobar2000+16F29Ch)
Address: 0053E228h (foobar2000+13E228h)
Address: 0053DA3Ch (foobar2000+13DA3Ch)
Address: 005731C8h (foobar2000+1731C8h)
Address: 01937608h (foo_ui_std+C7608h)
Address: 00525157h (foobar2000+125157h)
Address: 00459AA4h (foobar2000+59AA4h)
Address: 7B8B0000h (kernel32+A0000h)
Address: 00538FC0h (foobar2000+138FC0h)
Address: 7BCC8000h (ntdll+B8000h)
Address: 7BCC8000h (ntdll+B8000h)
Address: 0053E228h (foobar2000+13E228h)
Address: 0053E228h (foobar2000+13E228h)
Address: 7BC33F8Bh (ntdll+23F8Bh)
Address: 7BC33FA9h (ntdll+23FA9h)
Address: 0050D9DBh (foobar2000+10D9DBh)
Address: 0050AD50h (foobar2000+10AD50h)
Address: 0050D9DBh (foobar2000+10D9DBh)
Address: 0050B545h (foobar2000+10B545h)
Address: 10002836h (shared+2836h)
Address: 0053E4E4h (foobar2000+13E4E4h)
Address: 005265E2h (foobar2000+1265E2h)
Address: 00459F37h (foobar2000+59F37h)
Address: 00400000h (foobar2000+0h)
Address: 7B8B0000h (kernel32+A0000h)
Address: 0050C800h (foobar2000+10C800h)
Address: 00572490h (foobar2000+172490h)
Address: 0050A6F6h (foobar2000+10A6F6h)
Address: 00506586h (foobar2000+106586h)
Address: 00506580h (foobar2000+106580h)
Address: 0052FA4Ch (foobar2000+12FA4Ch)
Address: 0052FA50h (foobar2000+12FA50h)
Address: 7B8B0000h (kernel32+A0000h)
Address: 0052CB21h (foobar2000+12CB21h)
Address: 0050AD50h (foobar2000+10AD50h)
Address: 00506580h (foobar2000+106580h)
Address: 0052681Dh (foobar2000+12681Dh)
Address: 005084DDh (foobar2000+1084DDh)
Address: 00400000h (foobar2000+0h)
Address: 7B8B0000h (kernel32+A0000h)
Address: 0050AD50h (foobar2000+10AD50h)
Address: 7B8621C8h (kernel32+521C8h), symbol: "call_process_entry" (+Ch)

Environment:
App: foobar2000 v1.2.9

Components:
Core (2013-07-10 12:45:36 UTC)
foobar2000 core 1.2.9
foo_albumlist.dll (2013-02-11 11:28:58 UTC)
Album List 4.5
foo_cdda.dll (2013-03-07 09:48:32 UTC)
CD Audio Decoder 3.0
foo_converter.dll (2013-07-10 12:25:32 UTC)
Converter 1.5
foo_dsp_eq.dll (2013-02-11 11:28:58 UTC)
Equalizer 1.0
foo_dsp_std.dll (2013-07-10 12:25:50 UTC)
Standard DSP Array 1.3
foo_fileops.dll (2013-02-11 11:28:10 UTC)
File Operations 2.2
foo_freedb2.dll (2013-02-11 11:27:56 UTC)
Online Tagger 0.7
foo_input_std.dll (2013-07-10 12:45:38 UTC)
Standard Input Array 1.0
foo_rgscan.dll (2013-07-10 12:25:36 UTC)
ReplayGain Scanner 2.2
foo_ui_std.dll (2013-07-10 12:45:36 UTC)
Default User Interface 0.9.5
foo_unpack.dll (2013-02-11 11:28:10 UTC)
ZIP/GZIP/RAR Reader 1.6
foo_wave_seekbar.dll (2013-10-04 12:01:41 UTC)
Waveform seekbar 0.2.40


Machine specifications:
OS: wine-1.4.1, on: Linux / 3.8.0-31-generic
CPU: AMD Athlon™ Dual Core Processor 5050e, features: 3DNow!ex MMX SSE SSE2 SSE3
Audio: default; HDA NVidia - HDMI 0; HDA NVidia - ALC1200 Analog; Xonar DGX - Digital; HDA NVidia - ALC1200 Digital
Title: foo_wave_seekbar
Post by: Zao on 2013-10-04 13:34:03
Malstroemchen: It would have helped if you had mentioned that you were using Wine in the main body of the post, it would have saved me a few brain cycles.

As mentioned earlier in the thread, wine lacks some of the OS functions that the runtime of VC++ 2012 and 2013 requires for threading primitives. This means that until the Wine folks manages to implement those properly, none of the more recent foo_wave_seekbar versions will run on Wine.
It'd be nice if it could be made to work, but I've got better things to do than to fight the bureaucracy. The fixes needed for the threading bits are trivial, but pretty much impossible to get upstream into a project driven by fear of reverse-engineering and source leaks.

Your issue may of course be some other one than this one, but as it's fundamentally broken, I see very little point in investigating all the ancillary ways it could fail.
Title: foo_wave_seekbar
Post by: Malstroemchen on 2013-10-04 14:30:07
First: Sorry, that i didnt mentioned the usage of wine in the beginning Zao.
I just was wondering, why it doesnt work anymore because my Netbook runs fine with fbk and ur waveform seekbar.

So i try to copy configs and versions aof wine and foobar from my netbook. Thanks anyway - its a great extension
Title: foo_wave_seekbar
Post by: Wolfin on 2013-10-07 04:52:29
Registered just to say, thanks for putting in the effort and making this component. I really like it!
Title: foo_wave_seekbar
Post by: EpicForever on 2013-10-12 18:57:21
Hello, I just wanted to report that after installing latest stable Catalyst suite (packages v. 13.9) foobar doesn't crashes under Windows 8.1 Preview x64, when computer goes out from hibernation/sleep, even when waveseekbar is enabled and foobar plays music while PC is put into hibernation.
Title: foo_wave_seekbar
Post by: Zao on 2013-10-12 20:22:43
That's lovely, particularly as I don't have any machine running anything newer than 7, and can't install any either.
Title: foo_wave_seekbar
Post by: banderlog on 2013-10-16 07:18:47
Hello. I'm trying to fine version of foo_wave_seekbar older than 0.2.35, but I can't. Can you please help me?
Title: foo_wave_seekbar
Post by: marc2003 on 2013-10-16 07:47:07
http://www.hydrogenaudio.org/forums/index....st&p=837803 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=837803)
Title: foo_wave_seekbar
Post by: Zao on 2013-10-16 09:48:07
banderlog: Can you please tell me why you think you need an older version of the component? The problem may be possible to solve in some other way than downgrading, and if not, at least I'm aware of the impact the problem has.
Title: foo_wave_seekbar
Post by: dniwe on 2013-10-22 10:21:42
how to disable the saving wavecache.db ?
Title: foo_wave_seekbar
Post by: Zao on 2013-10-22 21:37:43
It is not possible in any released version to avoid the use of the wavecache.db file.
Title: foo_wave_seekbar
Post by: foomark on 2013-10-25 22:56:50
Long time user of this beautiful component, thank you for developing it!
I don't have any problem with it, but i have a suggestion for future improvement, of course if you do like the idea.
It would be nice to have an option to visualize a small box that display the time where your mouse pointer is.
It's something i've seen in the spectrogram seekbar and it's quite useful.
(http://i.imgur.com/Ekpydu0.jpg)
Title: foo_wave_seekbar
Post by: Zao on 2013-10-26 01:16:57
The tooltip is there when you click-hold to seek. You can do that and abort the seek by moving your cursor far enough from the component and releasing.
Title: foo_wave_seekbar
Post by: foomark on 2013-10-26 08:35:29
Wow, i'm using this component for years and i never noticed it, sorry
Thank you for the tip!
Title: foo_wave_seekbar
Post by: Firestarter001 on 2013-10-26 12:17:38
Hello my dear friends!!
im trying to find a way to set a different location for the db file!!

I read about your suggestions but I am a noob and I cant program!
is there any very very very easy way for noobs to set a different location of the db file?

thanks you very very much!!

kind regards!
Title: foo_wave_seekbar
Post by: EpicForever on 2013-10-26 13:39:26
Zao, I have a small request - could we have an option to save all settings of waveform seekbar to separate .cfg file (or wehatever .xxx file)? By all settings I mean really all settings: DX shader code, chosen colors, chosen setting for displaying channels (which are used and if downmix is selected) as well as those miscellaneous options like shading played, disabling window border and mirror display. It will ease sharing settings between computers. Now I can for example share whole my foobar config with others, but this means also my Library settings, output settings, columns etc, and those vary between computers. Additionally when I had to temporarily remove your component from my config (when I got crashes under Win 8.1) then all my waveform config was lost. It would be much easier to restore it from some .cfg file.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-10-26 13:46:16
^if you're using default UI, enable layout editing mode and right click the panel>copy. paste into windows explorer and you'll have an .fth file which you can then copy/paste into any new layout, retaining all the panel specific settings.



@Firestarter001, first close foobar and then move the wavecache.db file to your desired location.

click start>programs>accesories> right click command prompt and run as administrator

if you have foobar installed in normal mode, type something like

Code: [Select]
mklink %appdata%\foobar2000\wavecache.db "e:\my new folder\wavecache.db"


if you have foobar in portable mode then the first part needs to be the full path to your foobar folder. eg...

Code: [Select]
mklink "c:\my apps\foobar2000\wavecache.db" "e:\my new folder\wavecache.db"


Title: foo_wave_seekbar
Post by: EpicForever on 2013-10-26 14:58:29
marc, you mean that I can create FTH file, that contains only a portion of foobar config, and if I double click on it, it will insert to any existing foobar config, only description of waveform seekbar settings?
Title: foo_wave_seekbar
Post by: marc2003 on 2013-10-26 15:20:04
yes to the first part but don't double click it as that would import only that panel, replacing the entire layout. you can right click>copy the .fth file from explorer and then paste over an existing panel or into a blank space on a new layout. obviously the component already has to be present on the new install.

you can use this same method to backup any section of a foobar layout without exporting the whole thing. anything you can right click>copy in layout editing mode is good be it a single panel or entire tabs/splitters full of panels.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-10-26 17:48:22
Hmmm... Sems it to be tricky. For example to properly instruct someone how to make it, without being right next to that person.
So, OK, I appreciate your instructions marc and I want to thank you for this solution, but I still prefer special rightclick option under "Configure" - called for example "Export" and the other one "Import". Similar to how it is done in foo_musical_spectrum, which has "Settings" button on its config dialog, where there are options to import and export .cfg files.
Title: foo_wave_seekbar
Post by: marc2003 on 2013-10-26 17:56:34
for the other person to import the settings, the must already have a seekbar in their layout?  if that is the case, right click>copy the .fth file in explorer, enable layout editing mode, right click their existing seekbar and select paste.

or is that too much effort? 

i tell you what is a lot of effort and that would be making an import/export dialog to do this. if Zao does this at your request i'll be ****ing amazed. 
Title: foo_wave_seekbar
Post by: Zao on 2013-10-26 18:00:04
I've considered having a preferences page with profiles, and the per-element configuration would just be selecting a profile, pretty much.
It's delayed until Ragnarök due to it being annoying to make UI for, not to mention all the pain in migrating old configurations.
Title: foo_wave_seekbar
Post by: Zao on 2013-10-26 18:01:28
As for reimplementing export/import, the only reason I could see doing it as the DUI already has perfectly fine functionality for it, would be if I somehow cared enough about CUI users. I wouldn't hold my thumbs.
Title: foo_wave_seekbar
Post by: Firestarter001 on 2013-10-28 13:51:31
@marc2003 : thanks you very very much sir!!! it worked great!! very important setting!!
Title: foo_wave_seekbar
Post by: Bugai on 2013-11-10 00:30:21
Sorry, i try update Waveform Seekbar to latest 0.2.40 (now 0.2.12), but when unpack "foo_wave_seekbar-0.2.40.fb2k-component" NIS alert frontend_direct3d9.dll contain Suspicious.Cloud.7.F
Probably NIS problem, but check it please for just in case.

OS Win7 x32
Title: foo_wave_seekbar
Post by: Zao on 2013-11-10 09:53:07
In general, antivirus vendors have a tendency to flag perfectly fine software based on very vague criteria like some hash, some aspect of the program or just because they "haven't seen it much before."

I did a virustotal online scan, 3/47 vendors resulted in such generic diagnostics and nothing with an actual named virus.

I'm fairly confident that this is a false positive, particularly if it only occurs in this particular build as nothing has changed in my build environment between releases.
Title: foo_wave_seekbar
Post by: Bugai on 2013-11-10 13:00:07
Ok Zao thank for reply (and very helpful plug)
Title: foo_wave_seekbar
Post by: alekksander on 2013-11-11 17:42:23
any way to disable signature storing? i'd like it to generale new waveform each time i play it. where are those signatures stored by the way?
Title: foo_wave_seekbar
Post by: Propheticus on 2013-11-11 18:40:13
any way to disable signature storing? i'd like it to generale new waveform each time i play it. where are those signatures stored by the way?

C:\Users\<user>\AppData\Roaming\foobar2000\wavecache.db
or
C:\Program Files(x86)\Foobar2000\wavecache.db

depending on where you store your settings/components.
Title: foo_wave_seekbar
Post by: Zao on 2013-11-11 18:55:57
The database is stored in your foobar2000 profile directory. You can open that location by holding Shift, clicking the File menu and selecting the "Browse configuration folder" item.
(https://www.acc.umu.se/~zao/browseconfig.png)

As for not having a cache at all, no, there's no such functionality, and if you try to mess with the database file, it's likely to break horribly.
Title: foo_wave_seekbar
Post by: alekksander on 2013-11-12 20:57:02
okay, thanks! ...but am i missing something then, or the wavecache.db file will grow endlessly as i play new tracks?
Title: foo_wave_seekbar
Post by: Zao on 2013-11-12 21:32:20
Indeed it will. It's typically not a problem for people with non-insane amounts of tracks.
Each new track that isn't already cached contributes 3*2048*4 == 24 KiB before compression, without the database overhead.

A quick glance at my old foobar2000 directory reveals 329 megs of cache for a bit over 8.8k tracks.
Title: foo_wave_seekbar
Post by: EpicForever on 2013-11-13 16:25:14
just FYI - for 70k tracks it goes up to 1,5GB. Still not that much when you take current disk sizes into account.
Title: foo_wave_seekbar
Post by: shadowrazor on 2013-11-24 23:11:25
Does someone still have version 0.2.12 to upload?

I want to use it for foobar2000 in wine
Title: foo_wave_seekbar
Post by: shadowrazor on 2013-11-25 14:45:44
Does someone still have version 0.2.12 to upload?

I want to use it for foobar2000 in wine


For people that want to use foo_wave_seekbar in wine without direct3d compatability (gdi):
0.2.36.1 (http://file:///home/jon/Downloads/foo_wave_seekbar-0.2.36.1.fb2k-component) seems to be the latest version that works for me
Title: foo_wave_seekbar
Post by: Zao on 2013-11-25 14:49:21
That would be foo_wave_seekbar-0.2.36.1.fb2k-component (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.1.fb2k-component), as your accidental filesystem-local link has very little meaning on most machines. 
Title: foo_wave_seekbar
Post by: Renovacio on 2013-12-03 13:08:29
Dear Zao!

Thank you very much for this amazing fantastic component.

I use windows 8 x64 and installed all C++ packages, but can't change and set Direct3D 9.0c's Frontend settings... When I'm pressing this button I don't get an additional window with additional settings.

Could you advise how I can do it?

With best regards!
Title: foo_wave_seekbar
Post by: marc2003 on 2013-12-03 13:23:08
did you install the directx runtimes as well? the link is in the first post.
Title: foo_wave_seekbar
Post by: Renovacio on 2013-12-03 13:33:17
Sorry that destrubed you are right. I thought it was installed in win 8. Thank you for your help!!!
Title: foo_wave_seekbar
Post by: Zao on 2013-12-03 14:45:44
The instructions in the first post should still apply to all Windows versions.

While Win8 (and Win8.1) has ruined DirectX by including it in the Windows SDK (and thus as an OS component), it only includes the core of 10.0, 10.1, 11.0 (and in Win8.1: 11.1). There is no D3DX of any sort, there is no Direct3D 9.0c, and so on.

Much like VC++ redists, standalone DXSDK redists will never be part of the core OS or available through Windows Update. (Apart from VC++ redist security updates force-pushed, but that requires previous installs).
Title: foo_wave_seekbar
Post by: Introverterz on 2013-12-05 17:54:38
yurithedragonhalf: Are you talking about the vertical extents of the waveform inside the display?
The generic way to do that is to use the Direct3D9 mode and in the effect use TRACKMAGNITUDE's components to find out how low/high the peaks are, as described in an earlier post. There's also a REPLAYGAIN semantic you can use to determine the RG amounts you may need to compensate with to get a perceptual full-scale display.

Personally I don't bother with the RG compensation and prefer to see the waveform at its natural extents, maybe just scaled down if it clips some.

Anyway, I've got a soundcloud-like asymmetric look (https://www.acc.umu.se/~zao/seekbar-soundcloud.fx) that scales the waveform to the maximum peak, offset from the center-line and with a slight gradient behind.
Title: foo_wave_seekbar
Post by: Daeron on 2013-12-05 21:09:01
Just define a custom highlight color?
Title: foo_wave_seekbar
Post by: Zao on 2013-12-06 07:48:21
It's working as intended, where the intent is to only affect the waveform, not the background.
It's working as intended, where 'working' is defined as looking like a SoundCloud waveform, including their semantics for "shading".

It makes complete sense if you interpret "shade played" as "differently render played".

Feel free to rewrite the effect code to do what you want.
Title: foo_wave_seekbar
Post by: Introverterz on 2013-12-06 08:38:48
I thank for replies.
Title: foo_wave_seekbar
Post by: Zao on 2013-12-06 14:50:46
Introverterz: If you want a background change, you can modify evaluate to:
Code: [Select]
float4 evaluate( float2 tc, float cursorPos )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex1D(sTex, tc.x);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;
bool played = cursorPos < tc.x;
float4 inside_color = played ? textColor : highlightColor;
float4 outside_color = lerp((played ? 0.3 : 0.0), backgroundColor, highlightColor);

float4 wave = outside
? outside_color
: inside_color
;

return saturate(wave);
}

The area outside of the waveform will in the case of a played section be (30% highlight + 70% background), and for unplayed (100% background).
You can do a similar change for inside_color if you want to interpolate instead of select text vs. highlight.

Shader code is simpler than it seems, if you just squint at it right.
Title: foo_wave_seekbar
Post by: Introverterz on 2013-12-06 16:46:39
Thanks Zao. I meant something else. I apologise for trouble. In the picture everything is explained.

(http://i5.minus.com/iH6jlsfGA381y.PNG)
Title: foo_wave_seekbar
Post by: Zao on 2013-12-06 16:58:45
I don't quite follow your reasoning.
Does the image illustrate something you wish there would be, or something that doesn't behave like you want?

What exactly is it you want? 
Title: foo_wave_seekbar
Post by: Renovacio on 2013-12-07 12:07:29
Dear Zao!

I'm thankful for your creation.

Wish you only positive people and events on your way.

This skin was made due to you: (http://clip2net.com/clip/m258830/thumb640/1386417801-my-theme-of-foobar2000-600kb.jpg) (http://clip2net.com/s/6kK7qe)

only best regards!
Title: foo_wave_seekbar
Post by: Introverterz on 2013-12-07 13:18:30
I don't quite follow your reasoning.
Does the image illustrate something you wish there would be, or something that doesn't behave like you want?

What exactly is it you want? 

The image illustrates what I want to achieve.
(http://i5.minus.com/iH6jlsfGA381y.PNG)

Check box "shade played" effect visible top of the image ("Shade played On").
Uncheck box "shade played" effect visible the lower part of the image ("Shade played Off").

The same effect can be achieved by changing the color of the "Highlight color" on the same as the "Text color".
At the change of color theme it is uncomfortable.
I would like get this effect check/uncheck "shade played" box.
Title: foo_wave_seekbar
Post by: Zao on 2013-12-07 14:19:14
Ah, I didn't realize you were talking about the "Shade played" checkbox state.
Disregard the previous suggestion and change the two lines in evaluate to:
Code: [Select]
    bool played = shade_played && tc.x < cursorPos;
    float4 inside_color = !played ? textColor : highlightColor;

Replace them completely, there has been a subtle change in the logic.
Title: foo_wave_seekbar
Post by: Introverterz on 2013-12-07 14:59:33
Big thanks Zao. You are the best 
Title: foo_wave_seekbar
Post by: olegausa on 2013-12-09 17:55:03
Looks really nice but I'm not good at programing so is it possible to get entire code content so that you just open D3D settings (if I understand it right) and replace whatever is there with new code and save the changes?
Thanks in advance
Title: foo_wave_seekbar
Post by: marc2003 on 2013-12-09 18:00:53
just replace the code on lines 79/80.
Title: foo_wave_seekbar
Post by: Revan on 2014-01-13 06:29:15
So has anyone managed to get the frontend editor working in Windows 8 or 8.1 yet? Apparently it refuses to recognize that I have all the proper .dll files in place and the button still doesn't work for me.
Title: foo_wave_seekbar
Post by: mudlord on 2014-01-13 10:41:01
Ah, I didn't realize you were talking about the "Shade played" checkbox state.
Disregard the previous suggestion and change the two lines in evaluate to:
Code: [Select]
    bool played = shade_played && tc.x < cursorPos;
    float4 inside_color = !played ? textColor : highlightColor;

Replace them completely, there has been a subtle change in the logic.


Some people should really take the time to learn a programming language.
Its not that hard. >_>
Title: foo_wave_seekbar
Post by: Zao on 2014-01-13 10:43:40
So has anyone managed to get the frontend editor working in Windows 8 or 8.1 yet? Apparently it refuses to recognize that I have all the proper .dll files in place and the button still doesn't work for me.

Are you certain that you've installed the June 2010 DirectX redistributable?
What are "the proper DLL files" in your eyes?

WorksForMe
Title: foo_wave_seekbar
Post by: Revan on 2014-01-13 15:58:53
So has anyone managed to get the frontend editor working in Windows 8 or 8.1 yet? Apparently it refuses to recognize that I have all the proper .dll files in place and the button still doesn't work for me.

Are you certain that you've installed the June 2010 DirectX redistributable?
What are "the proper DLL files" in your eyes?

WorksForMe


I guess the ones that came with the plugin.  When I try installing the redistributable says it installed fine but then when I restart Foobar the "Frontend Settings" button still does nothing.
Title: foo_wave_seekbar
Post by: EpicForever on 2014-01-13 18:21:20
Currently I am using Win7 x64. But some time ago I used Win 8.1 Preview and as far as I remember everything worked fine with waveform_seekbar in foobar. Now my wife got shiny and new Samsung ultrabook with Windows 8.1 x64 and also there everything works OK. And all that should have been done was:
1st: installing this: http://www.microsoft.com/en-us/download/details.aspx?id=8109 (http://www.microsoft.com/en-us/download/details.aspx?id=8109) (Total Size: 95.6 MB)
2nd: installing plugin.
Apart from that both systems had installed VC2012 Redistributable (x86) with latest update available. Currently this one (choose x86 version to work with foobar/waveform_seekbar) : http://www.microsoft.com/en-us/download/de...s.aspx?id=30679 (http://www.microsoft.com/en-us/download/details.aspx?id=30679)
Title: foo_wave_seekbar
Post by: Zao on 2014-01-13 18:26:17
There shouldn't be any problems whatsoever on any Windows version from XP and onward.
I do my development on Win7 x86 and Win8.1 x64.
Title: foo_wave_seekbar
Post by: Revan on 2014-01-13 21:38:21
Okay, turns out the problem is actually with Columns UI.

Thanks for a great plugin, btw. (Sorry I didn't say that with my first post)
Title: foo_wave_seekbar
Post by: Zao on 2014-01-17 22:11:53
After getting my VC++ concurrency removal branch in a shape good enough to release, I've made a preliminary build of version 0.2.41.

You can download it from here (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.41.fb2k-component) for now until I know it's good enough to release properly. The changelog (https://github.com/zao/foo_wave_seekbar/wiki/Changelog) is available on the Github wiki.

One of the major features of this release is that I've purged enough of the threading primitives that Wine hasn't implemented underlying support for, so this release should work in GDI mode on Wine and Darwine.

New features since 0.2.40:
Title: foo_wave_seekbar
Post by: Zao on 2014-01-18 12:25:33
I hear from OSX users that the D3D mode even shows some semblance of existence if you sneak in a D3DX via WineTricks.
My testing was done with Ubuntu Wine 1.6 and 1.7 from the PPA. The 1.4.x shipped with stock Linux Mint 13.10 is completely unsuitable for foobar2000 and foo_wave_seekbar.
Title: foo_wave_seekbar
Post by: Reith on 2014-01-18 13:33:11
Zao, thank you for continuing to develop this amazing component.

It's the best seekbar I've ever used, and I take my seekbars seriously.
Title: foo_wave_seekbar
Post by: grimes on 2014-01-19 22:44:18
  • Scrolling the bar seeks by a minute per notch.


Thanks Zao.
It might be better to seek by 1 second?
Title: foo_wave_seekbar
Post by: Reith on 2014-01-20 03:10:43
Is the 0.2.41 update behaving strangely for anyone else? It's drawing the waveform all scrunched up at the top of the window with some of the Direct3D ones I got from this thread.
Title: foo_wave_seekbar
Post by: marc2003 on 2014-01-20 06:36:44
  • Scrolling the bar seeks by a minute per notch.


Thanks Zao.
It might be better to seek by 1 second?


i think variable depending on track length would be better. but i'm happy enough dragging with my mouse for it not to bother me. 

Is the 0.2.41 update behaving strangely for anyone else? It's drawing the waveform all scrunched up at the top of the window with some of the Direct3D ones I got from this thread.


it's been fine for me. i'm using the soundcloud-a-like code Zao posted here (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=844585).
Title: foo_wave_seekbar
Post by: Reith on 2014-01-20 07:04:24
This is how it looked on 0.2.40:

Title: foo_wave_seekbar
Post by: marc2003 on 2014-01-20 07:11:32
i have no idea myself. i'm sure Zao will be along as soon as he gets time. i believe he subscribes to the thread to get notification of new posts.
Title: foo_wave_seekbar
Post by: grimes on 2014-01-20 09:24:08
  • Scrolling the bar seeks by a minute per notch.

Thanks Zao.
It might be better to seek by 1 second?

i think variable depending on track length would be better. but i'm happy enough dragging with my mouse for it not to bother me. 


"variable depending on track length" would confuse in case of classical music divided in several tracks.
Original seekbar seeks by 1 second per notch.
Title: foo_wave_seekbar
Post by: marc2003 on 2014-01-20 09:51:55
eh? the default UI seekbar has variable steps which is why i suggested it. i even tested it just now....

it only steps by 1 second for tracks shorter than 30 seconds.
for anything between 0:30 and 2:32 it steps 5 seconds.
between 2:33 and 5:06> 10 seconds
5:07 to ?? > 1 minute steps...

i see there are 5 minute and 10 minute steps for really long files but i can't be bothered to figure out the boundaries for those.
Title: foo_wave_seekbar
Post by: grimes on 2014-01-20 10:02:50
eh? the default UI seekbar has variable steps which is why i suggested it. i even tested it just now....

it only steps by 1 second for tracks shorter than 30 seconds.
for anything between 0:30 and 2:32 it steps 5 seconds.
between 2:33 and 5:06> 10 seconds
5:07 to ?? > 1 minute steps...

i see there are 5 minute and 10 minute steps for really long files but i can't be bothered to figure out the boundaries for those.


You are correct marc2003.
I've tested only Columns UI seekbar.
Title: foo_wave_seekbar
Post by: Zao on 2014-01-20 12:54:55
I based my seeking off the stock DUI seekbar, which on all the files I tested jumped in one-minute steps. (it's a jump-to-conclusions-mat!)

Reith: The improvements that may cause your behaviour is either: I'd have to test the code and see what happens, but I fear it may be related to which GPU you have. What GPU do you have?
Title: foo_wave_seekbar
Post by: marc2003 on 2014-01-20 13:25:16
i see the same issue using the code Reith linked to. i have an AMD 6850.
Title: foo_wave_seekbar
Post by: Reith on 2014-01-20 13:25:57
I have an NVIDIA GTX 760.
Title: foo_wave_seekbar
Post by: Zao on 2014-01-20 14:40:46
Ah, looking at the code the problem stands out like a sore thumb:

Code: [Select]
float RMSfactor( float2 tc, float border )
{
    // alpha 1 indicates biased texture
    float4 minmaxrms = tex.Sample(sTex, tc.x);
...
}

His code is missing the unbias code present in the original shaders, which makes it fail on non-float texture formats as those have a [0..255] or [0..4095] range.
The proper statements should be along the lines of:
Code: [Select]
    float4 minmaxrms = tex.Sample(sTex, tc.x);
    minmaxrms.rgb -= 0.5 * minmaxrms.a;
    minmaxrms.rgb *= 1.0 + minmaxrms.a;

Full effect: Removed, see fixed code in later post. (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=855915)
Title: foo_wave_seekbar
Post by: marc2003 on 2014-01-20 15:24:58
minmaxrms.rgb *= 1.0 + minmaxrms.a;


is that + a typo? it doesn't look right at all??

)

(https://dl.dropboxusercontent.com/u/22801321/2014/january/seek%20two.png)

edited to include screenshots
Title: foo_wave_seekbar
Post by: Zao on 2014-01-20 15:44:53
The desired range is -1.0 to +1.0 which floating point textures hold natively.
A normalized 8-bit texture holds values from 0.0 to +1.0.
The reason it's there is to implement a branch by having some terms that conditionally do nothing.

Alpha is 0.0 in textures that already have the proper range, and 1.0 in textures that need adjustment.

Code: [Select]
f( c,a) = ( c - 0.5*a) * (1+a)

// floating [-1,1] a=0
f(-1,0) = (-1 - 0.5*0) * (1+0) = -1
f( 1,0) = ( 1 - 0.5*0) * (1+0) =  1

// biased [0,1] a=1
f( 0,1) = ( 0 - 0.5*1) * (1+1) = -0.5*2 = -1
f( 1,1) = ( 1 - 0.5*1) * (1+1) =  0.5*2 =  1

It's semantically equivalent to a conditional bias and scale:
Code: [Select]
if (a == 1) {
  c = (c - 0.5) * 2;
}
Title: foo_wave_seekbar
Post by: Zao on 2014-01-20 15:48:32
I may of course have screwed up some other logic in my less-tested 8-bit code path, or the effect may have some other assumptions in it.
Since 0.2.41, the only path there is is the A=1 8-bit biased path, so most of this hackery can be replaced with a static expression, unless I see a need to change it in the future.
Title: foo_wave_seekbar
Post by: marc2003 on 2014-01-20 16:46:56
i'm not going to pretend i understood any of that...

but i will just say i tested your code in version 0.40 of the component and the + is most definitely required. it does look pretty much the same as my .41 screenshot with the modification i posted.

anyway, thanks for the updates.
Title: foo_wave_seekbar
Post by: Zao on 2014-01-20 20:50:12
Ah, I didn't read the deranged code enough to spot the mutated unbias a few lines below.
It seems like the author has conflated unbiasing the input texture (which should always be done) with application of track/album gain.

Below should be an accurate rendition, in which I removed the double-work and removed the *1.8 factor in the RG computation I couldn't derive from anything.
Code: [Select]
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 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 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 )
{
    // alpha 1 indicates biased texture
    float4 minmaxrms = tex.Sample(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 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;

    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 = 2.5 * dx;
    float positionWidth = 2.5 * 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();
    }
}
Title: foo_wave_seekbar
Post by: Reith on 2014-01-21 01:10:33
Thanks, guys. It obviously looks a lot better, but some quiet tracks appear smaller now - is there a way to make it scale the waveform until the loudest part touches the inside edges like before?

EDIT: On second thought, I have no idea if that's what it was actually doing. Was it just the *1.8 factor you mentioned? Either way, it works now, which is all that matters.
Title: foo_wave_seekbar
Post by: Zao on 2014-01-21 02:48:54
The only thing that 0.2.41 changed regarding this is that it changed the fallback chain of RGBA16F -> RGB10A2 -> RGBA8 into just RGBA8 across the board as more precision than that isn't really needed for effects.

The effect-visible change of this change is that effects that previously were broken for anyone that lacked floating point textures is now broken for everyone.

Previous scaling by the CHANNELMAGNITUDE and TRACKMAGNITUDE semantics will continue to work as it used to.

They are float4 vectors with the X component containing the lowest signed amplitude of the channel/track, the Y component the highest signed amplitude and the Z component the highest recorded RMS value.
Title: foo_wave_seekbar
Post by: tedgo on 2014-01-21 08:05:43
Where to swap channels in this code?
The front right channel is on top instead of front left channel, which is way inconvenient.
Title: foo_wave_seekbar
Post by: Zao on 2014-01-21 08:22:17
The effect is invoked once per channel with each channel configured in the Configure dialog.
The way you reorder channels is by clicking the channel name and using the "Move up"/"Move down" buttons to reorder them.
Title: foo_wave_seekbar
Post by: tedgo on 2014-01-21 08:58:31
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).
Title: foo_wave_seekbar
Post by: Zao on 2014-01-21 09:54:48
It would be the D3D frontend in general then as the addon have very limited ability to reorder. I'll take a look at it, probably flipped too many things getting them mirrored right.
Title: foo_wave_seekbar
Post by: grimes on 2014-01-21 13:10:54
  • Scrolling the bar seeks by a minute per notch.


Ciao Zao,

I've tested the problem and found the optimum for the seek with mouse-wheel.
It is 5 seconds per notch.
It is the best compromise between short tracks (<2min) and long tracks (>1h).
Please consider a correction of the code. Thanks.

Ciao Zao

Title: foo_wave_seekbar
Post by: Zao on 2014-01-21 19:35:46
I have implemented roughly the same intervals as the original seekbar for 0.2.42.  Tracks longer than around 14.5h for which the original DUI seekbar doesn't scroll-seek, I skip by 5h per wheel notch.
Code: [Select]
 1s:     0s -    21s (      21s)
 5s:    22s -  108s (    1m48s)
10s:  109s -  145s (    2m25s)
 1m:  146s -  872s (  14m32s)
 5m:  873s -  4362s ( 1h12m42s)
10m:  4363s -  8724s ( 2h25m24s)
30m:  8725s - 26174s ( 7h16m14s)
 1h: 26175s - 52349s (14h32m29s)
n/a: 52350s - \infty
Title: foo_wave_seekbar
Post by: grimes on 2014-01-21 19:51:14
Thanks Zao, good job.
Title: foo_wave_seekbar
Post by: Dandruff on 2014-01-21 20:20:35
I have implemented roughly the same intervals as the original seekbar for 0.2.42.  Tracks longer than around 14.5h for which the original DUI seekbar doesn't scroll-seek, I skip by 5h per wheel notch.
Code: [Select]
 1s:     0s -    21s (      21s)
 5s:    22s -  108s (    1m48s)
10s:  109s -  145s (    2m25s)
 1m:  146s -  872s (  14m32s)
 5m:  873s -  4362s ( 1h12m42s)
10m:  4363s -  8724s ( 2h25m24s)
30m:  8725s - 26174s ( 7h16m14s)
 1h: 26175s - 52349s (14h32m29s)
n/a: 52350s - \infty

I'm still getting 1min jumps for some tracks in the 2 to 3 min range with 0.2.42!?

On some other tracks it seems to work (10s jumps).
Title: foo_wave_seekbar
Post by: grimes on 2014-01-21 20:28:40
It seems to work as intended.

<2:25 10s
>2:25 1min

EDIT: For a track with 2:30 only two notches a 1min are needed to pass the track. Strange!
marc2003 figured out different boundaries:


eh? the default UI seekbar has variable steps which is why i suggested it. i even tested it just now....

it only steps by 1 second for tracks shorter than 30 seconds.
for anything between 0:30 and 2:32 it steps 5 seconds.
between 2:33 and 5:06> 10 seconds
5:07 to ?? > 1 minute steps...

i see there are 5 minute and 10 minute steps for really long files but i can't be bothered to figure out the boundaries for those.


EDIT2:
Steps of DUI seekbar:

Code: [Select]
1-50 1s
51-251 5s
252-507 10s
508-3000 1m
3000-? 5m
Title: foo_wave_seekbar
Post by: grimes on 2014-01-22 01:21:36
The algorithm behind:

Code: [Select]
1-50 1s
51-250 5s
251-500 10s
501-3000 1m
3001-15000 5m
15001-30000 10m

Title: foo_wave_seekbar
Post by: Zao on 2014-01-22 14:46:36
My measurements are based off filling a playlist with silence://X tracks and binary searching for the ones where the DUI seekbar changes behaviour. The table of measurements is correct based on my machine with a granularity of 1s.

However, this was all done with an UI of a particular size. It is possible that it varies based on factors like seekbar length, screen size, mouse configuration, player size, or moon phase.
Title: foo_wave_seekbar
Post by: grimes on 2014-01-22 15:09:25
OK, you are kidding. 

To be serious:

Improvement of the DUI seekbar algorithm:

Code: [Select]
1-50 1s
51-100 2s
101-250 5s
251-500 10s
501-1500 30s
1501-3000 1m
3001-6000 2m
6001-15000 5m
15001-30000 10m
30001-90000 30m


EDIT: Oh now I see, it depends on seekbar size. Really confusing.
Title: foo_wave_seekbar
Post by: Zao on 2014-01-22 15:37:43
0.2.42-2-gbc95729: Change seek intervals to whatever grimes conjured (https://github.com/zao/foo_wave_seekbar/commit/bc95729b82cd40e244dcd87c7654992f43a9941a)
Title: foo_wave_seekbar
Post by: grimes on 2014-01-22 15:48:51
Have you prepared a dll also? I want to test it.
Title: foo_wave_seekbar
Post by: Zao on 2014-01-22 16:12:09
foo_wave_seekbar-0.2.42.2-gbc95729.fb2k-component (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.42.2-gbc95729.fb2k-component)
Title: foo_wave_seekbar
Post by: Zao on 2014-01-22 16:15:30
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.
Title: foo_wave_seekbar
Post by: grimes on 2014-01-22 16:27:54
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!
Title: foo_wave_seekbar
Post by: Nisto on 2014-01-23 13:10:28
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.
Title: foo_wave_seekbar
Post by: Zao on 2014-01-24 03:30:24
There will be an advconfig checkbox (default enabled) to enable wheel-scrolling in the next release.
0.2.42-3-gd99962e: Add config to disable scroll-to-seek (https://github.com/zao/foo_wave_seekbar/commit/d99962eeded30f71d2d6815716752228b3e4bee2)
Title: foo_wave_seekbar
Post by: Philip Goddard on 2014-01-25 22:17:19
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.
Title: foo_wave_seekbar
Post by: Zao on 2014-01-25 22:25:23
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.
Title: foo_wave_seekbar
Post by: Philip Goddard on 2014-01-26 12:10:10
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!
Title: foo_wave_seekbar
Post by: dinodisc on 2014-01-31 20:52:02
Version 0.2.43 broke "my" config which was ok until version 0.2.40.

0.2.40(http://i.imgur.com/7B9iBM3.png)
0.2.43(http://i.imgur.com/Bhvgq2E.png)

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!
Title: foo_wave_seekbar
Post by: ChronoSphere on 2014-01-31 21:27:02
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...


Title: foo_wave_seekbar
Post by: dinodisc on 2014-01-31 22:10:46
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!
Title: foo_wave_seekbar
Post by: ChronoSphere on 2014-01-31 22:57:14
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.
Title: foo_wave_seekbar
Post by: dinodisc on 2014-01-31 23:01:12
I am in the dark too! I really like this inverted scheme, so we'll have to wait indeed.
Title: foo_wave_seekbar
Post by: marc2003 on 2014-01-31 23:13:19
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();
}
}
Title: foo_wave_seekbar
Post by: foosion on 2014-01-31 23:56:26
dinodisc, Chronosphere: I think you have run into the same issue as this poster (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=855842). 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." (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=855678)). Zao describes the necessary changes to effects in the following posts, particularly this one (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=855873).
Title: foo_wave_seekbar
Post by: Zao on 2014-02-01 00:04:28
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 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77490&view=findpost&p=855915) ought to be fixing those lopsidedness problems the original author introduced.
Title: foo_wave_seekbar
Post by: Zao on 2014-02-01 00:06:57
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. 
Title: foo_wave_seekbar
Post by: ChronoSphere on 2014-02-01 00:13:25
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 ^^
Title: foo_wave_seekbar
Post by: tedsmith on 2014-02-01 00:20:35
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.
Title: foo_wave_seekbar
Post by: Zao on 2014-02-01 01:02:29
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 (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.44.fb2k-component).

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.
Title: foo_wave_seekbar
Post by: tedsmith on 2014-02-01 07:30:43
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...
Title: foo_wave_seekbar
Post by: dinodisc on 2014-02-01 08:34:17
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!
Title: foo_wave_seekbar
Post by: ChronoSphere on 2014-02-01 12:23:10
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
Title: foo_wave_seekbar
Post by: Dandruff on 2014-02-07 13:08:55
Waveform Seekbar 0.2.43 is causing three problems here:

1. http://www.hydrogenaudio.org/forums/index....howtopic=104501 (http://www.hydrogenaudio.org/forums/index.php?showtopic=104501)
2. http://www.hydrogenaudio.org/forums/index....howtopic=104500 (http://www.hydrogenaudio.org/forums/index.php?showtopic=104500)
3. http://www.hydrogenaudio.org/forums/index....howtopic=104537 (http://www.hydrogenaudio.org/forums/index.php?showtopic=104537)


Removing the component fixes all these!
Title: foo_wave_seekbar
Post by: Zao on 2014-02-07 13:41:27
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 (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.40.fb2k-component)
0.2.41 download (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.41.fb2k-component)

Common thread seems to be internet streams, so possibly something on the analysis side of things.
Title: foo_wave_seekbar
Post by: Dandruff on 2014-02-07 13:53:05
Ok, 0.2.40 is working fine. 0.2.41 is broken!
Title: foo_wave_seekbar
Post by: Zao on 2014-02-08 21:40:09
Dandruff: Please give 0.2.45 (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.45.fb2k-component) a try. I cannot reproduce the flickering spectrum indicator here anymore with it.

If this is the cause, division by near-zero is awesome.
Title: foo_wave_seekbar
Post by: Dandruff on 2014-02-09 11:46:45
Yeah, 0.2.45 is working fine!

Thanks!
Title: foo_wave_seekbar
Post by: terranaut on 2014-02-09 20:24:00
is there a way now, or can there be in the future, a way to lock the size of the WS panel, so that if i stretch foobar downwards to expand seeing the playlist, it doesnt also stretch the WS panel as well? once i adjust the height on the WS panel i pretty much never want it to be resized again, no matter how i expand foobars window downwards, tx
Title: foo_wave_seekbar
Post by: Dandruff on 2014-02-09 20:41:12
is there a way now, or can there be in the future, a way to lock the size of the WS panel, so that if i stretch foobar downwards to expand seeing the playlist, it doesnt also stretch the WS panel as well? once i adjust the height on the WS panel i pretty much never want it to be resized again, no matter how i expand foobars window downwards, tx



This is already working. A feature of foobar2000, not the component.
Title: foo_wave_seekbar
Post by: Zao on 2014-02-09 21:07:55
In Default UI: Rightclick a splitter in Layout Editing mode and the context menu will allow you to lock the size of either half.
In Columns UI: Rightclick a pane in Live Editing mode and select Locked to lock the size of a pane.
Title: foo_wave_seekbar
Post by: ChronoSphere on 2014-02-09 22:13:35
nevermind, I somehow failed to see Zao's post.
Title: foo_wave_seekbar
Post by: terranaut on 2014-02-09 23:34:28
thank you both for the response, and so quick.
wow, thats the first time i've seen the ability to rightclick on splits in a program, thats a fantastic option for a gui.
Title: foo_wave_seekbar
Post by: CmdRobot on 2014-02-15 16:35:28
Hey Zao.
Thank you very much for this most awesome component! My foobar-fun would be so much smaller without it.

I have one question/request though:

I want only the tracks in my media-library to be scanned, so I unchecked "Analyse tracks not in the media library" at the advanced settings. Only sometimes I want to see the waveform of a song that is not in the library. When it rightclick and select "Extract seekbar signature" nothing happens. I pretty sure that's because of the advanced settings. Would it be possible to override the 'Don't scan files not from the library'-setting and extract the signature if I force foobar to do it? Would help me a lot!
Title: foo_wave_seekbar
Post by: Zao on 2014-02-19 14:23:21
CmdRobot: Technically possible, but would require me to have "free time" and to think out how to properly do such an override.
Hold Shift/Ctrl/Meta while selecting the item?
Advanced preference to relax conditions when explicitly asking?
Additional context menu item to try harder?
What restrictions to lift, just the Media Library boundary or also things like ignored input types like CDDA while still banning HTTP?
Title: foo_wave_seekbar
Post by: ChronoSphere on 2014-02-19 14:45:14
You might be overthinking it, zao. What CmdRobot seem to be asking is for the rightclick (manual extract) option to function with block in place. It makes sense to restrict the automatic scanning to library items only, but if the user explicitly instructs the program to extract a signature, then it's obvious the user actually wants to see the waveform no matter the location.
Title: foo_wave_seekbar
Post by: Dandruff on 2014-02-19 14:56:22
I agree.
Title: foo_wave_seekbar
Post by: Zao on 2014-02-19 14:57:00
What I'm saying is that there's a corpus of users that expect that their preferences are honored even if they trigger an explicit scan.
This also includes things like not rescanning items that already exist, so that you can select-all your whole collection, extract, and not have unnecessary work done.

It's not overthinking if there's actual concerns from several camps. Whatever I choose to do, I'm going to suffer for an eternity for.
Title: foo_wave_seekbar
Post by: ChronoSphere on 2014-02-19 15:11:48
But rescanning items that already exist do not fall under the category of "don't scan if not in library", at least I don't see how it does.
In this particular case all it does is make you go to preferences and untick that option, which imho is trying to be smarter than the user.
Title: foo_wave_seekbar
Post by: Zao on 2014-02-19 16:09:00
The point is, there's users (including me) that expect that the things that an explicit scan does continues to be the things that an explicit scan would do.
If I change the default behaviour of an explicit scan to disregard that preference, you get silent misbehaviour.

Thus I rule out changing the default behaviour of the action, however wrong you may feel it is.
Now, do you have any input on how to properly achieve this?
Title: foo_wave_seekbar
Post by: Dandruff on 2014-02-19 16:24:19
Can't you just display the waveform without storing it in the database?
Title: foo_wave_seekbar
Post by: Zao on 2014-02-19 16:56:14
Dandruff: With the current codebase. No. Probably not. Most of it should be purged with fire.
Title: foo_wave_seekbar
Post by: ChronoSphere on 2014-02-19 17:20:08
- "don't rescan files with present waveforms" checkbox for those who select multiple tracks, if that's the scenario you described
- "don't scan files outside of media library" as we currently have
- "allow manual (re-)scan" checkbox (disabled by default)

should preserve current behavior and allow people to customize. Unless I'm missing something.
Title: foo_wave_seekbar
Post by: Zao on 2014-02-19 17:42:53
Maybe.

In any way, it's nothing I have time to implement anytime soon.
I'm in full firefighting mode.
Title: foo_wave_seekbar
Post by: aeidein on 2014-02-20 02:46:10
Can't you just display the waveform without storing it in the database?

Dandruff: With the current codebase. No. Probably not. Most of it should be purged with fire.

This is what I came in to request.  I'm not sure in what the context the above was in though.  Does this really mean there's no way to display the waveform without storing all waveforms in wavecache.db?  Could it be stored in a temp file and purged occasionally / upon track change or something?

I apologize if this is a naive or common question.
Title: foo_wave_seekbar
Post by: Zao on 2014-02-20 06:45:00
aeidein: Everything that is queued for scanning is filtered against the blacklist of forbidden format, checked against the preferences to only do Media Library, etc. If it's blocked, it's neither scanned nor put in the database. Once something is scanned, it's put into the database and returned to the caller. There is currently no way to scan something and return it without also storing it into the database. Similarly, there is no way to scan something and ignore its presence in the database.

I'd have to change quite a lot of things in the interface to achieve things like "multiple databases", "scan without storing", "force scan".
There's a fair bit of horror in achieving things like: "display selected waveform" instead of the current state of always attempting to display the playing one.
Title: foo_wave_seekbar
Post by: aeidein on 2014-02-20 14:26:32
Okay, I just wanted to make sure I was interpreting correctly.  Thank you for the response and all your work on this fantastic component.
Title: foo_wave_seekbar
Post by: CmdRobot on 2014-02-20 14:35:21
Hey everybody,

I'm happy to see my post getting so much attention. ChronoSphere was right, I didn't want any fancy or complex changes, I just feel like Rightclick > Extract Seekbar Signature should force it, even though scanning outside the library is turned off. I think this wouldn't change but expand the usability of this feature. Downside is that you could accidentially extract signatures from non-library files if you scan both library and non-library music at the same time. But isn't that a very unlikely thing to happen to only a few users? I feel like the benefits of this change of behaviour would be much stronger than it's possible annoyances.

Love you guys, cheers from Germany!
Title: foo_wave_seekbar
Post by: EpicForever on 2014-03-06 19:03:19
One question:
What exactly happens when forced rescan of files is running and I will reset my PC and then turn it on and start foobar? I see now that scans are continuing, but how about data from previous session - were they stored immediately? And what will happen if by mistake I ordered another rescan before I noticed that task from previous session is running after restart?
Title: foo_wave_seekbar
Post by: Zao on 2014-03-06 21:29:38
All pending scan jobs are stored to the cache at shutdown and restored on startup.
As for starting another one, it'll be as-if you did it in the same session, whatever that behaviour is.
Title: foo_wave_seekbar
Post by: Ello on 2014-03-09 15:19:14
Made an account to say thank you. <3
Title: foo_wave_seekbar
Post by: sappyyy on 2014-03-13 06:26:21
thanks for this beautiful plugin!
I'd like to add a constant gain to replaygain tracks' waveforms? (like +7db, as in my replaygain pre-amp setting)
is there a way to do it?
I've tried
minmaxrms.rgb *= pow(10,(replayGain.g) / 20)+0.7; //use track gain
but it seems it's not exactly what I want.
thnx!
Title: foo_wave_seekbar
Post by: Zao on 2014-03-13 09:51:34
The scale of the signal after decoding and RG is linear full scale from -1.0 (negative full scale) through DC=0 up to +1.0 (positive full scale).
If you want to attenuate or amplify by decibels, you should probably use whatever fancypants math one uses to attenuate a linear signal.
Also note that the 'r' channel is the minimum sample value (closest to negative infinity) in the range, 'g' is the maximum sample value (closest to positive infinity), and 'b' is the Root-Mean-Square measurement of that slice, which is in whatever range that measurement is.
Title: foo_wave_seekbar
Post by: Zao on 2014-03-23 01:12:16
While spelunking in the codebase I discovered a size bug in the writing of RIFF chunks for the Render To Clipboard functionality.
This may be related to the clipboard content not being recognized by some DAWs, or might just be cosmetic. A fix will probably appear in a future version.
Title: foo_wave_seekbar
Post by: narucy on 2014-03-26 12:26:27
I hope customization for soundcloud-ish style, please hint?
Title: foo_wave_seekbar
Post by: Zao on 2014-03-26 12:38:17
narucy: I've got an effect, seekbar-soundcloud.fx (http://zao.se/~zao/seekbar-soundcloud.fx) which does a decent job of looking like the Real Deal.

Is that what you are asking about, or are you looking for ways to change this effect?
Title: foo_wave_seekbar
Post by: narucy on 2014-03-26 14:29:26
narucy: I've got an effect, seekbar-soundcloud.fx (http://zao.se/~zao/seekbar-soundcloud.fx) which does a decent job of looking like the Real Deal.

awesome! thank you! It's pretty fun 
Title: foo_wave_seekbar
Post by: Revan on 2014-04-14 04:33:48
I've got an effect, seekbar-soundcloud.fx (http://zao.se/~zao/seekbar-soundcloud.fx) which does a decent job of looking like the Real Deal.


Thanks for that effect, Zao, it looks amazing.  Since I can't help myself from customizing things, I've made my own modification (http://csserver.evansville.edu/~wg24/senior_project/other/hlsl/custom-seekbar-soundcloud_mod.fx) which makes multiple passes for more complex effect combinations.

If you don't like an effect, just comment or delete the line with the appropriate #define and it'll turn off.

Everyone is also welcome to use that as a reference if they want to experiment with multiple-pass effects, it's not like I hold a copyright on it
Title: foo_wave_seekbar
Post by: Zao on 2014-04-14 08:50:15
Heh. Turns out that I've got multi-pass effects in my D3D9 code. I don't remember ever writing it...

Note that D3D10 bits of the effects is entirely non-functional, as there never was a released D3D10 frontend.
Title: foo_wave_seekbar
Post by: Revan on 2014-04-14 14:34:34
Heh. Turns out that I've got multi-pass effects in my D3D9 code. I don't remember ever writing it...

Note that D3D10 bits of the effects is entirely non-functional, as there never was a released D3D10 frontend.


Yeah, I noticed that. You were probably thinking of adding D3D10 at some point when you wrote your shaders originally.
Title: foo_wave_seekbar
Post by: Zao on 2014-04-14 14:53:13
I had an D3D10 implementation in the early days but it didn't gain me anything above what D3D9 could provide, so I scrapped it.
If I make any other implementations, it'll probably be a decent software renderer or possibly OpenGL to avoid having to rely on the DXSDK forever.
Title: foo_wave_seekbar
Post by: StealthX on 2014-04-27 23:11:04
I installed this and I copied the settings (exactly) in Right Click -> Configuration from another theme and my seekbar did not turn out like it should, any idea what i'm doing wrong?

(http://i.imgbox.com/dYFQY7xc.jpg) Mine is the top one, the way I wan't it to look is the bottom one.
Title: foo_wave_seekbar
Post by: Zao on 2014-04-28 01:44:39
Some effects are lacking the unbias operation needed for 8-bit textures I standardized on a few versions ago. The theme you used probably relied on the historical formats that didn't need unbiasing. You want code similiar to the following, where the important part is the subtraction and scale on lines 2-3.

Code: [Select]
 // alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(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
}
Title: foo_wave_seekbar
Post by: StealthX on 2014-04-28 01:50:57
Some effects are lacking the unbias operation needed for 8-bit textures I standardized on a few versions ago. The theme you used probably relied on the historical formats that didn't need unbiasing. You want code similiar to the following, where the important part is the subtraction and scale on lines 2-3.

Code: [Select]
 // alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(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
}

This is the code in the 'Frontend Settings', if that helps:

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

//- 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 *= .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 - 0.5 * saturate(factorRms / border / 2)): 1;
factor = insideWave ? (factor * saturate(factorWave / border / 0.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(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;
}

technique10 Render10
{
pass P0
{
SetGeometryShader( 1 );
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();
}
}

It is an older version of your component, is there any harm in using it? I know nothing about making themes really I was just copy and pasting that code. What should I change?
Title: foo_wave_seekbar
Post by: Zao on 2014-04-28 04:35:32
Turn
Code: [Select]
minmaxrms.rgb *= .95 + minmaxrms.a;
into
Code: [Select]
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
minmaxrms.rgb *= .95;
Title: foo_wave_seekbar
Post by: StealthX on 2014-04-28 08:05:33
Turn
Code: [Select]
minmaxrms.rgb *= .95 + minmaxrms.a;
into
Code: [Select]
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
minmaxrms.rgb *= .95;

Thanks, that works on the portable mode, but apparently I don't know anything about Foobar because when I do the exact same thing on a standard install nothing shows up, no matter what I do on a regular install nothing shows up in the wave seekbar its just whatever color I make the background!
Title: foo_wave_seekbar
Post by: StealthX on 2014-04-28 16:38:24
Turn
Code: [Select]
minmaxrms.rgb *= .95 + minmaxrms.a;
into
Code: [Select]
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
minmaxrms.rgb *= .95;

Thanks, that works on the portable mode, but apparently I don't know anything about Foobar because when I do the exact same thing on a standard install nothing shows up, no matter what I do on a regular install nothing shows up in the wave seekbar its just whatever color I make the background!

Found the problem? On the portable version I have  'Front Center (mono)' checked and on the standard install to display the same thing I have to have 'Front Left' checked, odd? Front Center (mono) doesn't show anything on standard install.
Title: foo_wave_seekbar
Post by: Zao on 2014-04-28 17:02:16
"Front left" displays the left stereo channel in all playback that has a left channel.
"Front center (mono)" displays the center channel for playback that has one (5.1/7.1 etc.) or the mono channel in mono playback.

If you want to display a mix of left/right, use the "downmix to mono" option and use the "Front center (mono)" checkbox.
Title: foo_wave_seekbar
Post by: StealthX on 2014-04-28 17:15:47
"Front left" displays the left stereo channel in all playback that has a left channel.
"Front center (mono)" displays the center channel for playback that has one (5.1/7.1 etc.) or the mono channel in mono playback.

If you want to display a mix of left/right, use the "downmix to mono" option and use the "Front center (mono)" checkbox.

Thank you, that did the trick I forgot I had it on 'Keep as is' because I didn't know what the option did.
Title: foo_wave_seekbar
Post by: bpp on 2014-04-29 18:39:21
Hi Zao, I love your plugin but I'm not satisfied with the standard effect. I was looking for something similar to what a zippyshare player is using and I found it. It's written by you:
Code: [Select]
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 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 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 )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(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 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;

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 = 2.5 * dx;
float positionWidth = 2.5 * 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();
}
}
Pic: (http://i.imgur.com/9mWttPw.jpg)
The gray waveform inside that black one is the one I'm looking for. Can you please get rid of the black one and make the gray use all the space, so it looks like here:
(http://i.imgur.com/7Btb5cC.jpg)
Title: foo_wave_seekbar
Post by: Zao on 2014-04-30 22:17:27
I could, if I could recall the name of the 'extent' semantics.
In any way, change the RMSfactor function to only consider insideRms, and then scaling the result by 1 over the RMS extent semantic, if I even bothered to provide that parameter.

Might conjure up a fixed effect once I've slept properly.
Title: foo_wave_seekbar
Post by: slyman on 2014-05-04 21:54:57
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: [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);

// 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();
    }
}
(http://zao.se/~zao/seekbar84.png)
switched from 32bit windows to 64bit and i'm using this code (actually a slightly altered one but i figure if you know what's wrong i can apply it to mine) you made for me a while back and it looks like this now

(https://i.imgur.com/up29a8m.png)

i messed the numbers in this line and it seemed to sort of work but there was a shadow in the middle of it and i couldn't get it right

bool insideWave = (belowWave > 0 && aboveWave < 0);
Title: foo_wave_seekbar
Post by: Zao on 2014-05-04 22:37:41
slyman: You've got the same problem as everyone else with the lack of unbias.
After
float4 minmaxrms = tex1D(sTex, tc.x);
add
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;


Your problem isn't really about OS bitness, but installing a slightly newer seekbar after I removed special-case code that your effect relied on.
Title: foo_wave_seekbar
Post by: slyman on 2014-05-04 23:18:48
ah so i could've figured that out by looking through the thread haha, my bad. thanks though, especially for the fast reply. you're awesome!

it's funny, it wasn't working at first because i didn't have dx installed and before i remembered i had to install it i updated to the new version to see if that would work. would've been fine if i never updated or at least would've realized it was the update rather than the os change. although, i did look through the thread for 64bit stuff because i thought it was that.
Title: foo_wave_seekbar
Post by: torturesauce on 2014-05-05 16:33:06
When I load a .mid file, foobar2000 crashes and the report says that it's the Waveform Seekbar's fault.
Title: foo_wave_seekbar
Post by: Zao on 2014-05-05 17:39:18
What component are you using for MIDI playback and is it written by competent people?
Does it happen for any MIDI file and configuration?

I do extensive blacklisting of stupidity already as many inputs are just outright broken.
Title: foo_wave_seekbar
Post by: torturesauce on 2014-05-05 17:50:38
foo_midi. I found out that the error was caused by BASSMIDI in foo_midi's settings. I changed it back to the regular setting and now it works with wave_seekbar properly.

EDIT: I found the REAL REAL reason: the soundfont I was using for BASSMIDI was missing, and foobar blamed wave_seekbar for it for some reason.
Title: foo_wave_seekbar
Post by: kode54 on 2014-05-06 01:19:46
Currently, foo_midi returns End Of File on first decode_run call, rather than throwing an error, as I didn't decide to make the MIDIPlayer class return error in any different way than returning zero samples. So it looks like Wave Seekbar doesn't like handling zero length files.
Title: foo_wave_seekbar
Post by: Zao on 2014-05-06 12:08:10
torturesauce, kode54: I have now equipped both belts and bracers and guarded against inputs that bail out on the first decode.

Should be in the next release (0.2.46?), whenever that is.
Title: foo_wave_seekbar
Post by: StealthX on 2014-05-14 15:32:46
It doesn't seem to show anything but the Selection bar when I play a CD with Foobar, is this suppose to not work with CD's?
Title: foo_wave_seekbar
Post by: marc2003 on 2014-05-14 15:36:31
Audio CDs are on the ignore list, as they're not a format that isn't possible to scan in the background or concurrently. Be happy, as it'd kill your optical drive if it still was, not to mention that it would ruin your playback by eternal underruns.
Title: foo_wave_seekbar
Post by: StealthX on 2014-05-14 16:11:51
Audio CDs are on the ignore list, as they're not a format that isn't possible to scan in the background or concurrently. Be happy, as it'd kill your optical drive if it still was, not to mention that it would ruin your playback by eternal underruns.


Thanks just reporting in case it was a bug as I only play CD's on my computer after I burn them to make sure they play correctly.
Title: foo_wave_seekbar
Post by: Todoroki on 2014-05-17 20:11:17
Thanks Zao for this usefullfull component. I can see the waves of my own music easily after mixing. Very useful.
By the way, I cannot do the frontend settings... nothing happens when I push it.
I use a Portable version, maybe that could be the reason, but Zao said that there aren't differences between portable/non-portable, and now I'm at a loss.
foobar v1.3.2, portable. waveformSeekbar 0.2.45.
Title: foo_wave_seekbar
Post by: AlphaWave on 2014-05-23 23:27:31
Hi, can you help with this persistent crash on Win 8 x64 please (last part of log cut out as it just shows things irrelevant to the issue - happy to post a full log if it helps)?

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 5E16B6FFh
Access violation, operation: read, address: 5266B0DBh

Call path:
entry=>app_mainloop

Code bytes (5E16B6FFh):
5E16B6BFh:  E4 90 FC FF 83 C4 0C BE 6C 08 76 88 EB 17 FF 75
5E16B6CFh:  1C FF 75 18 FF 75 14 FF 75 10 FF 75 0C 57 E8 D7
5E16B6DFh:  FE FF FF 8B F0 8D 4C 24 08 E8 65 B2 F8 FF 8B C6
5E16B6EFh:  5F 5E 8B E5 5D C2 18 00 90 90 90 90 90 E9 0F 6C
5E16B6FFh:  EA B1 83 E4 F8 51 51 56 57 8B 7D 08 85 FF 74 05
5E16B70Fh:  8D 47 04 EB 02 33 C0 6A 00 8D 74 24 0C E8 B9 AF
5E16B71Fh:  F8 FF 8B C7 E8 F6 1F F9 FF 85 C0 74 07 BE 6C 08
5E16B72Fh:  76 88 EB 16 6A 00 FF 75 18 FF 75 14 FF 75 10 FF

Stack (003AF7C4h):
003AF7A4h:  00000000 0000000E 006DCC58 00000002
003AF7B4h:  00000000 00000000 000009F6 000000B4
003AF7C4h:  003AF7F8 5A8853C4 09DD0CC0 00000000
003AF7D4h:  00000000 00000000 00000000 073703F0
003AF7E4h:  5B055B0F 073703F0 5B027DEF 00000000
003AF7F4h:  07365420 003AF840 5B027BC1 00070922
003AF804h:  0000000F 00000000 00000000 003AF8E0
003AF814h:  00000000 4DE5A86A 073703F0 07365420
003AF824h:  00000000 003AF818 003AF1D4 003AF970
003AF834h:  5B0F7BA0 16CCC1A2 00000000 003AF860
003AF844h:  5B0281AF 00070922 0000000F 00000000
003AF854h:  00000000 003AF8E0 00000000 003AF888
003AF864h:  5B027C37 00070922 0000000F 00000000
003AF874h:  00000000 003AF8E0 00000000 0000000F
003AF884h:  073703F0 003AF8D8 5B02809D 00070922
003AF894h:  0000000F 00000000 00000000 003AF8E0
003AF8A4h:  00000000 00000000 0000000F 00000000
003AF8B4h:  00070922 0000000F 00000000 00000000
003AF8C4h:  00000000 00000000 00000000 00000024
003AF8D4h:  00000001 003AF904 768D77D8 00000000

Registers:
EAX: 09DD0CC0, EBX: 00000000, ECX: 006DCC58, EDX: 09DD3AF4
ESI: 006DCC58, EDI: 073703F0, EBP: 003AF7F8, ESP: 003AF7C4

Crash location:
Module: d3d9
Offset: 7B6FFh
Symbol: "DebugSetLevel" (+16FEFh)

Loaded modules:
foobar2000                       loaded at 00920000h - 00AEE000h
ntdll                            loaded at 77160000h - 772B7000h
KERNEL32                         loaded at 74B90000h - 74CC0000h
KERNELBASE                       loaded at 76F10000h - 76FB7000h
COMCTL32                         loaded at 71F50000h - 72148000h
DSOUND                           loaded at 744F0000h - 74574000h
SHLWAPI                          loaded at 74E20000h - 74E60000h
UxTheme                          loaded at 71910000h - 71998000h
USER32                           loaded at 768D0000h - 769E6000h
GDI32                            loaded at 74D20000h - 74E1D000h
ADVAPI32                         loaded at 74770000h - 7481E000h
SHELL32                          loaded at 74EF0000h - 75FB6000h
ole32                            loaded at 769F0000h - 76B09000h
zlib1                            loaded at 62E80000h - 62E9F000h
shared                           loaded at 5B830000h - 5B85B000h
CRYPT32                          loaded at 76B20000h - 76CA2000h
Secur32                          loaded at 72750000h - 72759000h
gdiplus                          loaded at 6D570000h - 6D6D3000h
WINHTTP                          loaded at 6FF80000h - 70002000h
msvcrt                           loaded at 75FC0000h - 76071000h
WINMM                            loaded at 74470000h - 74491000h
POWRPROF                         loaded at 74430000h - 7446F000h
sechost                          loaded at 763E0000h - 76414000h
RPCRT4                           loaded at 76800000h - 768AC000h
combase                          loaded at 76080000h - 761B6000h
imagehlp                         loaded at 768B0000h - 768C2000h
dbghelp                          loaded at 684A0000h - 685C9000h
COMDLG32                         loaded at 74AE0000h - 74B69000h
MSASN1                           loaded at 74B70000h - 74B82000h
WINMMBASE                        loaded at 74400000h - 7442B000h
SspiCli                          loaded at 74750000h - 7476C000h
SHCORE                           loaded at 72B90000h - 72C03000h
cfgmgr32                         loaded at 767B0000h - 767F6000h
DEVOBJ                           loaded at 74CE0000h - 74CFE000h
CRYPTBASE                        loaded at 74740000h - 74749000h
bcryptPrimitives                 loaded at 746E0000h - 74731000h
IMM32                            loaded at 749E0000h - 74A00000h
MSCTF                            loaded at 76FC0000h - 7709E000h
RTSSHooks                        loaded at 10000000h - 10026000h
MSVCR90                          loaded at 6C920000h - 6C9C3000h
RocketDock                       loaded at 008D0000h - 008E5000h
PSAPI                            loaded at 74820000h - 74826000h
dwmapi                           loaded at 6F2C0000h - 6F2D9000h
foo_unpack                       loaded at 5B800000h - 5B82F000h
foo_converter                    loaded at 5B780000h - 5B800000h
foo_dsp_eq                       loaded at 5B740000h - 5B776000h
foo_ui_std                       loaded at 5B650000h - 5B73B000h
MSIMG32                          loaded at 72160000h - 72166000h
foo_fileops                      loaded at 5B600000h - 5B64B000h
foo_albumlist                    loaded at 5B5A0000h - 5B5FA000h
foo_freedb2                      loaded at 5B550000h - 5B59E000h
foo_cdda                         loaded at 5B500000h - 5B54F000h
foo_vst                          loaded at 5B4A0000h - 5B4F4000h
foo_dop                          loaded at 04C10000h - 04DE0000h
SETUPAPI                         loaded at 74830000h - 749DF000h
WS2_32                           loaded at 76380000h - 763D0000h
QUARTZ                           loaded at 5B310000h - 5B492000h
USP10                            loaded at 6C400000h - 6C414000h
NSI                              loaded at 763D0000h - 763D8000h
OLEAUT32                         loaded at 74E60000h - 74EEB000h
foo_dsp_std                      loaded at 5B2D0000h - 5B306000h
foo_vis_vumeter                  loaded at 5B220000h - 5B2C5000h
foo_vis_shpeck                   loaded at 5B1D0000h - 5B211000h
foo_out_asio                     loaded at 05170000h - 051A2000h
foo_rgscan                       loaded at 5B170000h - 5B1CB000h
foo_out_wasapi                   loaded at 045C0000h - 045E9000h
foo_wave_seekbar                 loaded at 5AFC0000h - 5B169000h
IPHLPAPI                         loaded at 72730000h - 72750000h
MSVCP120                         loaded at 5AF40000h - 5AFB1000h
MSVCR120                         loaded at 5AE50000h - 5AF3E000h
WINNSI                           loaded at 72770000h - 72778000h
mswsock                          loaded at 72AB0000h - 72AFA000h
foo_input_std                    loaded at 5A8C0000h - 5AA18000h
MSACM32                          loaded at 5AE30000h - 5AE44000h
avcodec-fb2k-55                  loaded at 5A180000h - 5A353000h
avutil-fb2k-52                   loaded at 5ADC0000h - 5AE2A000h
clbcatq                          loaded at 74A00000h - 74A74000h
frontend_direct2d                loaded at 5AD70000h - 5ADB1000h
d2d1                             loaded at 5AA20000h - 5AD47000h
MMDevApi                         loaded at 6B350000h - 6B39D000h
frontend_direct3d9               loaded at 5A870000h - 5A8C0000h
d3d9                             loaded at 5E0F0000h - 5E2A5000h
d3dx9_42                         loaded at 554A0000h - 55685000h
VERSION                          loaded at 746D0000h - 746D8000h
AUDIOSES                         loaded at 6B2B0000h - 6B304000h
SciLexer                         loaded at 5A7C0000h - 5A862000h
nvd3dum                          loaded at 672E0000h - 6809B000h
nvspcap                          loaded at 06F70000h - 07079000h
nvapi                            loaded at 689E0000h - 68C9E000h
nvSCPAPI                         loaded at 5A5F0000h - 5A727000h
vis_milk2                        loaded at 0B9D0000h - 0BE64000h
WINTRUST                         loaded at 76430000h - 76472000h
dxgi                             loaded at 5A590000h - 5A5EC000h
sud                              loaded at 5A4F0000h - 5A584000h
PROPSYS                          loaded at 6CFD0000h - 6D0E9000h
ADVPACK                          loaded at 5A790000h - 5A7BB000h
DUI70                            loaded at 5A360000h - 5A4BC000h
iZotope Ozone 5 Equalizer        loaded at 0D480000h - 0D6D6000h
iZOzone5Equalizer                loaded at 0D750000h - 0DF55000h
OLEACC                           loaded at 744A0000h - 744F0000h
WININET                          loaded at 761C0000h - 76377000h
iertutil                         loaded at 76D10000h - 76F09000h
USERENV                          loaded at 74D00000h - 74D1B000h
profapi                          loaded at 74CC0000h - 74CD1000h
d3dx9_36                         loaded at 550F0000h - 55499000h
d3dx9_31                         loaded at 127B0000h - 12A17000h
DWrite                           loaded at 6D1E0000h - 6D340000h
avrt                             loaded at 6A790000h - 6A798000h
WindowsCodecs                    loaded at 6D420000h - 6D56B000h
mlang                            loaded at 68980000h - 689B2000h

Stack dump analysis:
Address: 5A8853C4h (frontend_direct3d9+153C4h), symbol: "g_seekbar_frontend_entrypoint" (+13C3Fh)
Address: 5B055B0Fh (foo_wave_seekbar+95B0Fh), symbol: "g_gdi_entrypoint" (+2FA0Fh)
Address: 5B027DEFh (foo_wave_seekbar+67DEFh), symbol: "g_gdi_entrypoint" (+1CEFh)
Address: 5B027BC1h (foo_wave_seekbar+67BC1h), symbol: "g_gdi_entrypoint" (+1AC1h)
Address: 5B0F7BA0h (foo_wave_seekbar+137BA0h), symbol: "foobar2000_get_interface" (+2D760h)
Address: 5B0281AFh (foo_wave_seekbar+681AFh), symbol: "g_gdi_entrypoint" (+20AFh)
Address: 5B027C37h (foo_wave_seekbar+67C37h), symbol: "g_gdi_entrypoint" (+1B37h)
Address: 5B02809Dh (foo_wave_seekbar+6809Dh), symbol: "g_gdi_entrypoint" (+1F9Dh)
Address: 768D77D8h (USER32+77D8h), symbol: "gapfnScSendMessage" (+4E0h)
Address: 768D90E7h (USER32+90E7h), symbol: "GetAncestor" (+2A7h)
Address: 768D787Ah (USER32+787Ah), symbol: "gapfnScSendMessage" (+582h)
Address: 76943991h (USER32+73991h), symbol: "WaitForRedirectionStartComplete" (+A2h)
Address: 768D7B6Fh (USER32+7B6Fh), symbol: "PeekMessageW" (+1ECh)
Address: 76943991h (USER32+73991h), symbol: "WaitForRedirectionStartComplete" (+A2h)
Address: 768D7C44h (USER32+7C44h), symbol: "PeekMessageW" (+2C1h)
Address: 771A2C92h (ntdll+42C92h), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 771A2BF0h (ntdll+42BF0h), symbol: "KiUserApcDispatcher" (+48h)
Address: 7718F976h (ntdll+2F976h), symbol: "NtdllDialogWndProc_W" (+B0h)
Address: 768D8C5Fh (USER32+8C5Fh), symbol: "RedrawWindow" (+5Dh)
Address: 76943991h (USER32+73991h), symbol: "WaitForRedirectionStartComplete" (+A2h)
Address: 768E5B2Eh (USER32+15B2Eh), symbol: "CallMsgFilterW" (+91h)
Address: 76943991h (USER32+73991h), symbol: "WaitForRedirectionStartComplete" (+A2h)
Address: 768E5C40h (USER32+15C40h), symbol: "IsDialogMessageW" (+10Ah)
Address: 5B6C938Ch (foo_ui_std+7938Ch)
Address: 0097FAD6h (foobar2000+5FAD6h)
Address: 768DCF9Eh (USER32+CF9Eh), symbol: "DestroyWindow" (+0h)
Address: 00A457E0h (foobar2000+1257E0h)
Address: 0097FBB9h (foobar2000+5FBB9h)
Address: 00A45E00h (foobar2000+125E00h)
Address: 00980697h (foobar2000+60697h)
Address: 00A75258h (foobar2000+155258h)
Address: 00A7523Ch (foobar2000+15523Ch)
Address: 00A7523Ch (foobar2000+15523Ch)
Address: 00A75220h (foobar2000+155220h)
Address: 00A30F15h (foobar2000+110F15h)
Address: 00A3860Bh (foobar2000+11860Bh)
Address: 00A35980h (foobar2000+115980h)
Address: 00A3860Bh (foobar2000+11860Bh)
Address: 00A36175h (foobar2000+116175h)
Address: 5B832836h (shared+2836h), symbol: "uPrintCrashInfo_OnEvent" (+B1h)
Address: 00A6AB98h (foobar2000+14AB98h)
Address: 00A518D2h (foobar2000+1318D2h)
Address: 009808BBh (foobar2000+608BBh)
Address: 00920000h (foobar2000+0h)
Address: 00A35326h (foobar2000+115326h)
Address: 00A311E7h (foobar2000+1111E7h)
Address: 00A311E1h (foobar2000+1111E1h)
Address: 00A5BAD4h (foobar2000+13BAD4h)
Address: 00A5BAD8h (foobar2000+13BAD8h)
Address: 00A58231h (foobar2000+138231h)
Address: 00A35980h (foobar2000+115980h)
Address: 00A311E1h (foobar2000+1111E1h)
Address: 00A51BC5h (foobar2000+131BC5h)
Address: 00A3310Dh (foobar2000+11310Dh)
Address: 00920000h (foobar2000+0h)
Address: 5AF6C8D0h (MSVCP120+2C8D0h), symbol: "std::locale::global" (+1Ch)
Address: 00A35980h (foobar2000+115980h)
Address: 74BB86E3h (KERNEL32+286E3h), symbol: "BaseThreadInitThunk" (+Eh)
Address: 771BBF39h (ntdll+5BF39h), symbol: "RtlInitializeExceptionChain" (+85h)
Address: 77165191h (ntdll+5191h), symbol: "RtlDeregisterWait" (+1F0h)
Address: 771BBF0Ch (ntdll+5BF0Ch), symbol: "RtlInitializeExceptionChain" (+58h)
Address: 00A33160h (foobar2000+113160h)
Address: 77231DF7h (ntdll+D1DF7h), symbol: "RtlInitializeContext" (+120h)
Address: 00A33160h (foobar2000+113160h)

Environment:
App: foobar2000 v1.3.2
UI: Default User Interface 0.9.5

Components:
Core (2014-04-11 09:51:08 UTC)
    foobar2000 core 1.3.2
foo_albumlist.dll (2014-04-11 09:49:46 UTC)
    Album List 4.5
foo_cdda.dll (2014-04-11 09:49:18 UTC)
    CD Audio Decoder 3.0
foo_converter.dll (2014-04-11 09:49:20 UTC)
    Converter 1.5
foo_dop.dll (2011-06-12 21:17:16 UTC)
    iPod manager 0.6.9.6
foo_dsp_eq.dll (2014-04-11 09:49:32 UTC)
    Equalizer 1.0
foo_dsp_std.dll (2014-04-11 09:49:24 UTC)
    Standard DSP Array 1.3
foo_fileops.dll (2014-04-11 09:49:06 UTC)
    File Operations 2.2.1
foo_freedb2.dll (2014-04-11 09:49:24 UTC)
    Online Tagger 0.7
foo_input_std.dll (2014-04-11 09:51:10 UTC)
    Standard Input Array 1.0
foo_out_asio.dll (2014-04-01 18:17:43 UTC)
    ASIO support 2.1.2
foo_out_wasapi.dll (2014-03-31 23:43:11 UTC)
    WASAPI output support 3.2.3
foo_rgscan.dll (2014-04-11 09:49:26 UTC)
    ReplayGain Scanner 2.2.1
foo_ui_std.dll (2014-04-11 09:51:08 UTC)
    Default User Interface 0.9.5
foo_unpack.dll (2014-04-11 09:48:52 UTC)
    ZIP/GZIP/RAR Reader 1.6
foo_vis_shpeck.dll (2014-03-31 23:01:00 UTC)
    Shpeck - Winamp vis plugins wrapper 0.3.7
foo_vis_vumeter.dll (2013-02-16 10:44:26 UTC)
    VU Meter 2013-02-16
foo_vst.dll (2011-03-05 07:19:04 UTC)
    VST 2.4 adapter 0.9.0.3
foo_wave_seekbar.dll (2014-03-31 22:55:07 UTC)
    Waveform seekbar 0.2.45
Title: foo_wave_seekbar
Post by: Zao on 2014-05-24 03:10:15
It's nice to see someone that knows what is relevant or not, saves me the work of trying to find the crash report in the UI so I can see the full picture.

Is it always happening in the same way, does it break immediately, after a while, after some plays, on a full moon?
Title: foo_wave_seekbar
Post by: Zao on 2014-05-24 03:24:36
After squinting at the remains of the process, I'm leaning towards that one of your visualisations or one of the silly DLLs injected into the process may be interacting poorly with the frontend in use.

Try killing off one or more of the visualisations, and see if you can reproduce the problem in a portable installation.
Title: foo_wave_seekbar
Post by: garbanzo.bean on 2014-07-15 02:43:46
Hi Zao,

With the latest upgrade, the script I am using has gone crazy. It used to display a mirrored waveform across the middle of the bar - now it just shows the bottom half of the waveform across teh top. Can you help?

Thanks!

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

//- 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 *= .75 + 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.5 * saturate(factorRms / border / 2)): 1;
factor = insideWave ? (factor * saturate(factorWave / border / 0.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(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;
}

technique10 Render10
{
pass P0
{
SetGeometryShader( 1 );
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();
}
}


Title: foo_wave_seekbar
Post by: Zao on 2014-07-15 06:19:33
Code: [Select]
texture tex : WAVEFORMDATA;
// ...
float RMSfactor( float2 tc, float border )
{
float4 minmaxrms = tex1D(sTex, tc.x);

minmaxrms.rgb *= .75 + minmaxrms.a;

float belowWave = tc.y + border - minmaxrms.r;
float aboveWave = tc.y - border - minmaxrms.g;
// ...
}


slyman: You've got the same problem as everyone else with the lack of unbias.
After
float4 minmaxrms = tex1D(sTex, tc.x);
add
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;


Your problem isn't really about OS bitness, but installing a slightly newer seekbar after I removed special-case code that your effect relied on.


You need to replace your bogus minmaxrms.rgb *= .75 + minmaxrms.a; statement with the two unbias statements mentioned in my quote to the other guy.

If you want to retain your 75% scale, have an minmaxrms.rgb *= .75; after them.
Title: foo_wave_seekbar
Post by: Kyro0 on 2014-08-15 19:34:12
I dont know why, but foobar is always crashing on startup if the seekbar-component is installed.
Weird thing is that I've never had this problem before and I've been using it for a couple of month now.

Also I'm unable to send a bugreport/crashreport because of this: http://www.foobar2000.org/?page=SDKLicenseViolation (http://www.foobar2000.org/?page=SDKLicenseViolation)

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 5B524BA8h
Access violation, operation: write, address: 5B524BA8h

Call path:
entry=>app_mainloop

Stack (00B9F204h):
00B9F1E4h:  71542F01 FFFFFD34 000002E4 FFFFFD34
00B9F1F4h:  000002CC 00000019 00000000 71596EC2
00B9F204h:  7156C5DF 00000000 00F8C6E8 0AC20CE0
00B9F214h:  771000AC 000002CE 0000007D 00000015
00B9F224h:  00000001 00000008 00000003 00000001
00B9F234h:  000103D4 00000001 00000000 00000000
00B9F244h:  00000000 00000000 80000000 17000017
00B9F254h:  00000080 02000002 FFFFFECF 5D00015C
00B9F264h:  01150000 00000000 00000000 00F8C6E8
00B9F274h:  00000018 0AC23648 00000000 00000001
00B9F284h:  00000000 000007FF 01150000 44000044
00B9F294h:  FFFFFFEF 00000000 01150000 00000001
00B9F2A4h:  0000020D 00000080 0115BDA0 0699C170
00B9F2B4h:  0115028C 00000001 00000044 00000000
00B9F2C4h:  0699DB80 0115BDA8 00000000 00000000
00B9F2D4h:  CFAE9BCA 00B9F44C 7156C31F 00F8C6E8
00B9F2E4h:  00000000 071A87A8 00F8C680 FFFFFFFF
00B9F2F4h:  00000044 06990990 00F8C6E8 00000044
00B9F304h:  0100001F 00000044 00000044 0152C121
00B9F314h:  01150260 0AC20CE4 00000000 00B9F3BC

Registers:
EAX: 00000001, EBX: 0AC20CE0, ECX: 0AC20CE0, EDX: 020B0000
ESI: 00000000, EDI: 0AC23644, EBP: 00B9F2D8, ESP: 00B9F204

Unable to identify crash location!

Loaded modules:
foobar2000                       loaded at 012F0000h - 014BE000h
ntdll                            loaded at 770C0000h - 77228000h
KERNEL32                         loaded at 759D0000h - 75B10000h
KERNELBASE                       loaded at 75600000h - 756CF000h
COMCTL32                         loaded at 71740000h - 71926000h
DSOUND                           loaded at 654A0000h - 65519000h
SHLWAPI                          loaded at 75100000h - 75141000h
UxTheme                          loaded at 70E30000h - 70F0B000h
USER32                           loaded at 74FB0000h - 750FF000h
GDI32                            loaded at 754F0000h - 755F7000h
ADVAPI32                         loaded at 75380000h - 753F8000h
SHELL32                          loaded at 75B10000h - 76CD0000h
ole32                            loaded at 758C0000h - 759CC000h
zlib1                            loaded at 62E80000h - 62E9F000h
shared                           loaded at 61720000h - 6174B000h
CRYPT32                          loaded at 76CD0000h - 76E4F000h
Secur32                          loaded at 73E70000h - 73E79000h
gdiplus                          loaded at 65C50000h - 65D9D000h
WINHTTP                          loaded at 72310000h - 723A4000h
msvcrt                           loaded at 751D0000h - 7528E000h
WINMM                            loaded at 74770000h - 74790000h
POWRPROF                         loaded at 74890000h - 748CE000h
combase                          loaded at 74DC0000h - 74F0E000h
sechost                          loaded at 74F10000h - 74F4E000h
RPCRT4                           loaded at 75400000h - 754B0000h
imagehlp                         loaded at 74BE0000h - 74BF2000h
dbghelp                          loaded at 615D0000h - 61718000h
COMDLG32                         loaded at 75830000h - 758B6000h
MSASN1                           loaded at 75180000h - 7518E000h
WINMMBASE                        loaded at 74750000h - 74770000h
SspiCli                          loaded at 74AF0000h - 74B0D000h
SHCORE                           loaded at 74900000h - 74976000h
cfgmgr32                         loaded at 754B0000h - 754EA000h
DEVOBJ                           loaded at 74820000h - 7483F000h
CRYPTBASE                        loaded at 74AE0000h - 74AE9000h
bcryptPrimitives                 loaded at 74A80000h - 74AD3000h
IMM32                            loaded at 75150000h - 75175000h
MSCTF                            loaded at 76E50000h - 76F47000h
kernel.appcore                   loaded at 748F0000h - 748F9000h
RTSSHooks                        loaded at 10000000h - 1005E000h
MSVCR90                          loaded at 70800000h - 708A3000h
dwmapi                           loaded at 71500000h - 71518000h
foo_deskband_controls            loaded at 615A0000h - 615C3000h
foo_converter                    loaded at 61520000h - 615A0000h
foo_rgscan                       loaded at 614C0000h - 6151B000h
foo_input_std                    loaded at 61360000h - 614B8000h
MSACM32                          loaded at 6F9A0000h - 6F9B5000h
avcodec-fb2k-55                  loaded at 61180000h - 61353000h
avutil-fb2k-52                   loaded at 61110000h - 6117A000h
foo_albumlist                    loaded at 610B0000h - 6110A000h
foo_httpcontrol                  loaded at 61040000h - 610AD000h
WS2_32                           loaded at 74B90000h - 74BDD000h
WSOCK32                          loaded at 72570000h - 72578000h
MPR                              loaded at 73A60000h - 73A74000h
NSI                              loaded at 75820000h - 75827000h
foo_cdda                         loaded at 60FF0000h - 6103F000h
foo_uie_wsh_panel_mod            loaded at 60F40000h - 60FEC000h
OLEAUT32                         loaded at 76F50000h - 76FD7000h
Msimg32                          loaded at 70FE0000h - 70FE6000h
foo_dsp_xgeq                     loaded at 60F00000h - 60F3C000h
foo_dsp_std                      loaded at 60EC0000h - 60EF6000h
foo_w7shell                      loaded at 03410000h - 0344D000h
foo_playcount                    loaded at 60E80000h - 60EBE000h
foo_clownware                     loaded at 60E30000h - 60E71000h
wtsapi32                         loaded at 74A60000h - 74A6E000h
psapi                            loaded at 75290000h - 75296000h
foo_audioscrobbler               loaded at 03450000h - 03483000h
foo_quicksearch                  loaded at 60DD0000h - 60E27000h
WindowsCodecs                    loaded at 60C80000h - 60DCD000h
foo_touchremote                  loaded at 60BF0000h - 60C76000h
MSVCR100                         loaded at 60B30000h - 60BEF000h
mscoree                          loaded at 60AD0000h - 60B26000h
mscoreei                         loaded at 60A50000h - 60ACE000h
clr                              loaded at 603B0000h - 60A4B000h
MSVCR120_CLR0400                 loaded at 602D0000h - 603A7000h
mscorlib.ni                      loaded at 5F230000h - 602C5000h
clrjit                           loaded at 5F150000h - 5F1CD000h
foo_dsp_effect                   loaded at 03890000h - 038C7000h
foo_wave_seekbar                 loaded at 5EFA0000h - 5F149000h
IPHLPAPI                         loaded at 74A20000h - 74A3E000h
MSVCP120                         loaded at 5EF20000h - 5EF91000h
MSVCR120                         loaded at 5EE30000h - 5EF1E000h
WINNSI                           loaded at 74980000h - 74988000h
mswsock                          loaded at 73D30000h - 73D75000h
foo_dsp_eq                       loaded at 5EDF0000h - 5EE26000h
foo_dsp_soundtouch               loaded at 03910000h - 03936000h
foo_upnp                         loaded at 5EBE0000h - 5EDE7000h
foo_ui_std                       loaded at 5EAF0000h - 5EBDB000h
foo_masstag                      loaded at 03B40000h - 03B94000h
clbcatq                          loaded at 74B10000h - 74B8D000h
MMDevApi                         loaded at 6F2A0000h - 6F2EA000h
AUDIOSES                         loaded at 6F2F0000h - 6F345000h
sxs                              loaded at 66FB0000h - 6702B000h
frontend_direct2d                loaded at 5EAA0000h - 5EAE1000h
d2d1                             loaded at 5E6D0000h - 5EA95000h
frontend_direct3d9               loaded at 5E680000h - 5E6D0000h
d3d9                             loaded at 71520000h - 716D8000h
d3dx9_42                         loaded at 5E490000h - 5E675000h
VERSION                          loaded at 73E80000h - 73E88000h
USERENV                          loaded at 74A40000h - 74A59000h
profapi                          loaded at 74990000h - 7499E000h
twinapi                          loaded at 70DA0000h - 70E2B000h
propsys                          loaded at 705C0000h - 706E3000h
Bcp47Langs                       loaded at 65A40000h - 65A87000h
LINKINFO                         loaded at 688E0000h - 688EA000h
ntshrui                          loaded at 659A0000h - 65A40000h
srvcli                           loaded at 6F350000h - 6F36B000h
SETUPAPI                         loaded at 74C00000h - 74DAD000h
cscapi                           loaded at 65990000h - 6599D000h
CRYPTSP                          loaded at 748D0000h - 748E8000h
rsaenh                           loaded at 74860000h - 7488F000h
bcrypt                           loaded at 74840000h - 7485D000h
urlmon                           loaded at 74460000h - 74588000h
iertutil                         loaded at 74110000h - 7432A000h
WININET                          loaded at 73F50000h - 7410D000h
System.ni                        loaded at 5DB00000h - 5E48D000h
System.Core.ni                   loaded at 5D450000h - 5DAF3000h
explorerframe                    loaded at 68EB0000h - 69103000h
DUser                            loaded at 68E30000h - 68EA6000h
DUI70                            loaded at 68CE0000h - 68E2B000h
System.Configuration.ni          loaded at 5D360000h - 5D44E000h
System.Xml.ni                    loaded at 5CBE0000h - 5D353000h
dnssd                            loaded at 5CBC0000h - 5CBD5000h
sud                              loaded at 5C880000h - 5C914000h
ADVPACK                          loaded at 5C850000h - 5C87C000h
dhcpcsvc                         loaded at 71280000h - 71293000h
nvd3dum                          loaded at 6E1A0000h - 6EF6E000h
nvspcap                          loaded at 06F40000h - 07054000h
nvapi                            loaded at 6FD90000h - 70062000h

Stack dump analysis:
Address: 7156C5DFh (d3d9+4C5DFh), symbol: "Direct3DCreate9" (+24249h)
Address: 771000ACh (ntdll+400ACh), symbol: "RtlFreeHeap" (+79Dh)
Address: 5D00015Ch (System.Xml.ni+42015Ch)
Address: 7156C31Fh (d3d9+4C31Fh), symbol: "Direct3DCreate9" (+23F89h)
Address: 77146645h (ntdll+86645h), symbol: "wcstombs" (+87h)
Address: 770FFAC9h (ntdll+3FAC9h), symbol: "RtlFreeHeap" (+1BAh)
Address: 751D9A22h (msvcrt+9A22h), symbol: "free" (+46h)
Address: 751D9A15h (msvcrt+9A15h), symbol: "free" (+39h)
Address: 751D9A22h (msvcrt+9A22h), symbol: "free" (+46h)
Address: 751D9A15h (msvcrt+9A15h), symbol: "free" (+39h)
Address: 5E69DFDFh (frontend_direct3d9+1DFDFh), symbol: "g_seekbar_frontend_entrypoint" (+1C85Ah)
Address: 5EE3ECFAh (MSVCR120+ECFAh), symbol: "free" (+1Ah)
Address: 5EE3ECFAh (MSVCR120+ECFAh), symbol: "free" (+1Ah)
Address: 5E69FCFDh (frontend_direct3d9+1FCFDh), symbol: "g_seekbar_frontend_entrypoint" (+1E578h)
Address: 5E69FD10h (frontend_direct3d9+1FD10h), symbol: "g_seekbar_frontend_entrypoint" (+1E58Bh)
Address: 5E6A5545h (frontend_direct3d9+25545h), symbol: "g_seekbar_frontend_entrypoint" (+23DC0h)
Address: 5E6951FFh (frontend_direct3d9+151FFh), symbol: "g_seekbar_frontend_entrypoint" (+13A7Ah)
Address: 5F02D0A9h (foo_wave_seekbar+8D0A9h), symbol: "g_gdi_entrypoint" (+26FA9h)
Address: 5EAF754Ah (foo_ui_std+754Ah)
Address: 5F0F7418h (foo_wave_seekbar+157418h), symbol: "foobar2000_get_interface" (+4CFD8h)
Address: 5F0F7424h (foo_wave_seekbar+157424h), symbol: "foobar2000_get_interface" (+4CFE4h)
Address: 5F0E54A7h (foo_wave_seekbar+1454A7h), symbol: "foobar2000_get_interface" (+3B067h)
Address: 5F035AE1h (foo_wave_seekbar+95AE1h), symbol: "g_gdi_entrypoint" (+2F9E1h)
Address: 5F007DEFh (foo_wave_seekbar+67DEFh), symbol: "g_gdi_entrypoint" (+1CEFh)
Address: 5F007BC1h (foo_wave_seekbar+67BC1h), symbol: "g_gdi_entrypoint" (+1AC1h)
Address: 5F0D7BA0h (foo_wave_seekbar+137BA0h), symbol: "foobar2000_get_interface" (+2D760h)
Address: 5F0081AFh (foo_wave_seekbar+681AFh), symbol: "g_gdi_entrypoint" (+20AFh)
Address: 5F007C37h (foo_wave_seekbar+67C37h), symbol: "g_gdi_entrypoint" (+1B37h)
Address: 5F00809Dh (foo_wave_seekbar+6809Dh), symbol: "g_gdi_entrypoint" (+1F9Dh)
Address: 74FB7834h (USER32+7834h), symbol: "CallNextHookEx" (+97h)
Address: 74FB930Fh (USER32+930Fh), symbol: "GetWindowThreadProcessId" (+3E5h)
Address: 74FB7997h (USER32+7997h), symbol: "CallNextHookEx" (+1FAh)
Address: 74FE5EA4h (USER32+35EA4h), symbol: "IsHungAppWindow" (+2A9h)
Address: 74FB7BEDh (USER32+7BEDh), symbol: "CallNextHookEx" (+450h)
Address: 74FE5EA4h (USER32+35EA4h), symbol: "IsHungAppWindow" (+2A9h)
Address: 74FB7D81h (USER32+7D81h), symbol: "CallNextHookEx" (+5E4h)
Address: 770FEED2h (ntdll+3EED2h), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 770FEE30h (ntdll+3EE30h), symbol: "KiUserApcDispatcher" (+48h)
Address: 770EB570h (ntdll+2B570h), symbol: "NtdllDialogWndProc_W" (+160h)
Address: 74FB9B6Ch (USER32+9B6Ch), symbol: "SetRectEmpty" (+3Ah)
Address: 74FD24F1h (USER32+224F1h), symbol: "CallMsgFilterW" (+6Bh)
Address: 74FE5EA4h (USER32+35EA4h), symbol: "IsHungAppWindow" (+2A9h)
Address: 74FD2626h (USER32+22626h), symbol: "IsDialogMessageW" (+10Bh)
Address: 5EB6938Ch (foo_ui_std+7938Ch)
Address: 0134FAD6h (foobar2000+5FAD6h)
Address: 74FBAD54h (USER32+AD54h), symbol: "DestroyWindow" (+0h)
Address: 014157E0h (foobar2000+1257E0h)
Address: 0134FBB9h (foobar2000+5FBB9h)
Address: 01350697h (foobar2000+60697h)
Address: 01445258h (foobar2000+155258h)
Address: 0144523Ch (foobar2000+15523Ch)
Address: 0144523Ch (foobar2000+15523Ch)
Address: 01445220h (foobar2000+155220h)
Address: 01400F15h (foobar2000+110F15h)
Address: 0140860Bh (foobar2000+11860Bh)
Address: 01405980h (foobar2000+115980h)
Address: 0140860Bh (foobar2000+11860Bh)
Address: 01406175h (foobar2000+116175h)
Address: 61722836h (shared+2836h), symbol: "uPrintCrashInfo_OnEvent" (+B1h)
Address: 0143AB98h (foobar2000+14AB98h)
Address: 014218D2h (foobar2000+1318D2h)
Address: 013508BBh (foobar2000+608BBh)
Address: 012F0000h (foobar2000+0h)
Address: 01405326h (foobar2000+115326h)
Address: 014011E7h (foobar2000+1111E7h)
Address: 014011E1h (foobar2000+1111E1h)
Address: 0142BAD4h (foobar2000+13BAD4h)
Address: 0142BAD8h (foobar2000+13BAD8h)
Address: 01428231h (foobar2000+138231h)
Address: 01405980h (foobar2000+115980h)
Address: 014011E1h (foobar2000+1111E1h)
Address: 01421BC5h (foobar2000+131BC5h)
Address: 0140310Dh (foobar2000+11310Dh)
Address: 012F0000h (foobar2000+0h)
Address: 01405980h (foobar2000+115980h)
Address: 759E919Fh (KERNEL32+1919Fh), symbol: "BaseThreadInitThunk" (+Eh)
Address: 7710A22Bh (ntdll+4A22Bh), symbol: "RtlInitializeExceptionChain" (+84h)
Address: 77146645h (ntdll+86645h), symbol: "wcstombs" (+87h)
Address: 7710A201h (ntdll+4A201h), symbol: "RtlInitializeExceptionChain" (+5Ah)
Address: 770FF233h (ntdll+3F233h), symbol: "RtlCaptureContext" (+100h)
Address: 01403160h (foobar2000+113160h)

Environment:
App: foobar2000 v1.3.2
UI: Default User Interface 0.9.5

Components:
Core (2014-04-11 09:51:08 UTC)
    foobar2000 core 1.3.2
foo_albumlist.dll (2014-04-11 09:49:46 UTC)
    Album List 4.5
foo_audioscrobbler.dll (2013-04-28 17:01:31 UTC)
    Audioscrobbler 1.4.7
foo_cdda.dll (2014-04-11 09:49:18 UTC)
    CD Audio Decoder 3.0
foo_converter.dll (2014-04-11 09:49:20 UTC)
    Converter 1.5
foo_deskband_controls.dll (2014-07-11 15:10:50 UTC)
    Deskband Controls 1.1
foo_dsp_effect.dll (2013-09-30 02:14:29 UTC)
    Effect DSP 0.12
foo_dsp_eq.dll (2014-04-11 09:49:32 UTC)
    Equalizer 1.0
foo_dsp_soundtouch.dll (2012-10-30 01:26:35 UTC)
    SoundTouch DSP 0.1 (SSE)
foo_dsp_std.dll (2014-04-11 09:49:24 UTC)
    Standard DSP Array 1.3
foo_dsp_xgeq.dll (2013-05-01 02:01:52 UTC)
    Graphic Equalizer 0.3.7
foo_httpcontrol.dll (2014-02-05 15:34:49 UTC)
    HTTP Control 0.97.13
foo_input_std.dll (2014-04-11 09:51:10 UTC)
    Standard Input Array 1.0
foo_masstag.dll (2012-11-29 23:44:53 UTC)
    Masstagger 1.8.4
foo_playcount.dll (2013-02-01 08:40:46 UTC)
    Playback Statistics 3.0.2
foo_quicksearch.dll (2012-11-02 02:01:23 UTC)
    Quick Search Toolbar 3.4
foo_rgscan.dll (2014-04-11 09:49:26 UTC)
    ReplayGain Scanner 2.2.1
foo_touchremote.dll (2013-01-08 16:40:26 UTC)
    TouchRemote DACP server for foobar2000 0.2.8.3
foo_clownware.dll (2014-07-14 23:49:19 UTC)
    UI Hacks 2013-02-19
foo_ui_std.dll (2014-04-11 09:51:08 UTC)
    Default User Interface 0.9.5
foo_uie_wsh_panel_mod.dll (2010-02-28 02:59:14 UTC)
    WSH Panel Mod 1.3.2
foo_upnp.dll (2013-12-09 20:37:05 UTC)
    UPnP/DLNA Renderer, Server, Control Point 0.99.48
foo_w7shell.dll (2010-01-17 03:09:20 UTC)
    Windows 7 integration 0.2.9.1
foo_wave_seekbar.dll (2014-07-11 15:10:29 UTC)
    Waveform seekbar 0.2.45

Recent events:
Starting playlist loading
User Interface initialized in: 0:00.065201
Processing commandline
initquit::init entry
w7shell: init started
w7shell: GDI+ initialized
w7shell: COM initialized
w7shell: running on Windows NT 6.3.9600
w7shell: DWM composition enabled
w7shell: WA_DISALLOW_PEEK successfully set
w7shell: WA_DISALLOW_PEEK successfully set
w7shell: WA_HAS_ICONIC_BITMAP successfully set
w7shell: WA_FORCE_ICONIC_REPRESENTATION successfully set
w7shell: failed to set WA_FLIP3D_POLICY: 0x80070057
w7shell: all green
TouchRemote initialization started
TouchRemote database id: 87CFB89383870D26
Folder watching failure: Das System kann den angegebenen Pfad nicht finden.  
Watching: C:\Users\Public\Music
TouchRemote initialization finished
Graphic Equalizer: initialized (SSE support: 3)
foo_upnp: succesfully loaded file C:\Users\Kyro0\AppData\Roaming\foobar2000\foo_upnp.xml
foo_upnp: initialized in 0.014s
initquit::init exit
Startup time : 0:01.124427
foo_upnp: loaded Media Library tree in 0.008s
w7shell: taskbar button create notification got
foo_upnp: created 3469 path registry entries in 0.034s
Seekbar: taking Direct3D9 path.
Seekbar: Frontend initialized.


Machine specifications:
OS: Windows 6.3.9600 x64
CPU: AMD Phenom(tm) II X4 955 Processor, features: 3DNow!ex MMX SSE SSE2 SSE3
CPU threads: 4
Audio: (Realtek High Definition Audio)
Title: foo_wave_seekbar
Post by: Zao on 2014-08-15 19:57:20
I strongly recommend that you move away components that cause that restriction so I can retrieve and debug the crash logs.
Title: foo_wave_seekbar
Post by: Kyro0 on 2014-08-16 00:12:17
I strongly recommend that you move away components that cause that restriction so I can retrieve and debug the crash logs.

But it's your plugin that is causing this. Made a fresh foobar-install + your plugin only and it's still crashing
Title: foo_wave_seekbar
Post by: Zao on 2014-08-16 00:21:39
What I'm saying is that to my knowledge, my component is not one of the ones that are flagged for SDK violation.
I am not redirecting blame for the crash. I'm saying that in order to look at a crash, I need a crash report which should be possible to submit for an install that only has my component in it.
Title: foo_wave_seekbar
Post by: kode54 on 2014-08-16 05:17:27
foo_ui_hacks detected. That is your SDK license violation.
Title: foo_wave_seekbar
Post by: Wolfbane on 2014-08-16 16:33:53
Would it be possible to add a transparent % meter to to the "Highlight colo" atm is seems to be a transparent fader around 20%.

Would be nice to have the option to set the transparent meter manually instead of ON/OFF
Title: foo_wave_seekbar
Post by: Kyro0 on 2014-08-16 17:02:38
What I'm saying is that to my knowledge, my component is not one of the ones that are flagged for SDK violation.
I am not redirecting blame for the crash. I'm saying that in order to look at a crash, I need a crash report which should be possible to submit for an install that only has my component in it.

Sorry, I was referring to the crash itself, not the SDK violation.

foo_ui_hacks detected. That is your SDK license violation.

Oh, ok, didn't know that... removed it and sent a crash report, thanks!

This is what i got:

Quote
Problem caused by: foo_wave_seekbar.dll : Waveform seekbar
Known buggy component
Download the latest version...

See also: Help: foobar2000 has crashed.


Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 5B754BA8h
Access violation, operation: write, address: 5B754BA8h

Call path:
entry=>app_mainloop

Stack (0025F574h):
0025F554h:  00000000 FFFFFD34 000002E4 FFFFFD34
0025F564h:  000002CC 00000019 00000000 717C6EC2
0025F574h:  7179C5DF 00000000 00674B20 0A07BCE0
0025F584h:  774B00AC 000002CC 0000007D 00000015
0025F594h:  00000001 00000008 00000003 00000001
0025F5A4h:  000603F8 00000001 00000000 00000000
0025F5B4h:  00000000 00000000 80000000 03000003
0025F5C4h:  00000000 F10007F6 FFFFFFC1 3600083E
0025F5D4h:  00550000 00000000 00000000 00674B20
0025F5E4h:  00000018 0A07E648 00000000 00000001
0025F5F4h:  00000000 3800063E FFFFFAE4 00000080
0025F604h:  00550000 00000000 000000CC 000007FF
0025F614h:  06077130 0A00010B 00553A30 00000001
0025F624h:  000005BE 00000000 0000003F 06077138
0025F634h:  00000000 00000000 00000122 0000083E
0025F644h:  85D8F37E 0025F7B8 7179C31F 00674B20
0025F654h:  00000000 08056850 00674AB8 080125D8
0025F664h:  00553958 0000014F 00674B20 000000CF
0025F674h:  0000014F 0125F714 00553958 F4689F0E
0025F684h:  FFFFFFFE 0A07BCE4 00000000 F4689F0E

Registers:
EAX: 00000001, EBX: 0A07BCE0, ECX: 0A07BCE0, EDX: 00D50000
ESI: 00000000, EDI: 0A07E644, EBP: 0025F648, ESP: 0025F574

Unable to identify crash location!

Loaded modules:
foobar2000                       loaded at 012B0000h - 0147E000h
ntdll                            loaded at 77470000h - 775D8000h
KERNEL32                         loaded at 75040000h - 75180000h
KERNELBASE                       loaded at 75350000h - 7541F000h
COMCTL32                         loaded at 72A30000h - 72C16000h
DSOUND                           loaded at 6D4A0000h - 6D519000h
SHLWAPI                          loaded at 77100000h - 77141000h
UxTheme                          loaded at 71520000h - 715FB000h
USER32                           loaded at 77150000h - 7729F000h
GDI32                            loaded at 75D10000h - 75E17000h
ADVAPI32                         loaded at 75220000h - 75298000h
SHELL32                          loaded at 75E20000h - 76FE0000h
ole32                            loaded at 75650000h - 7575C000h
zlib1                            loaded at 62E80000h - 62E9F000h
shared                           loaded at 6AFC0000h - 6AFEB000h
CRYPT32                          loaded at 74EC0000h - 7503F000h
Secur32                          loaded at 74210000h - 74219000h
gdiplus                          loaded at 6F340000h - 6F48D000h
WINHTTP                          loaded at 73380000h - 73414000h
msvcrt                           loaded at 772A0000h - 7735E000h
WINMM                            loaded at 74B40000h - 74B60000h
POWRPROF                         loaded at 74C40000h - 74C7E000h
combase                          loaded at 75910000h - 75A5E000h
sechost                          loaded at 75420000h - 7545E000h
RPCRT4                           loaded at 75AF0000h - 75BA0000h
imagehlp                         loaded at 752A0000h - 752B2000h
dbghelp                          loaded at 6AE70000h - 6AFB8000h
COMDLG32                         loaded at 752C0000h - 75346000h
MSASN1                           loaded at 75460000h - 7546E000h
WINMMBASE                        loaded at 74B20000h - 74B40000h
SspiCli                          loaded at 74EA0000h - 74EBD000h
SHCORE                           loaded at 74CB0000h - 74D26000h
cfgmgr32                         loaded at 75A60000h - 75A9A000h
DEVOBJ                           loaded at 74BD0000h - 74BEF000h
CRYPTBASE                        loaded at 74E90000h - 74E99000h
bcryptPrimitives                 loaded at 74E30000h - 74E83000h
IMM32                            loaded at 76FF0000h - 77015000h
MSCTF                            loaded at 75BB0000h - 75CA7000h
kernel.appcore                   loaded at 74CA0000h - 74CA9000h
RTSSHooks                        loaded at 10000000h - 1005E000h
MSVCR90                          loaded at 70620000h - 706C3000h
dwmapi                           loaded at 71730000h - 71748000h
foo_input_std                    loaded at 6AD10000h - 6AE68000h
MSACM32                          loaded at 6DE90000h - 6DEA5000h
avcodec-fb2k-55                  loaded at 6AB30000h - 6AD04000h
avutil-fb2k-52                   loaded at 6AAC0000h - 6AB2D000h
foo_deskband_controls            loaded at 6AA90000h - 6AAB3000h
foo_cdda                         loaded at 6AA40000h - 6AA8F000h
foo_audioscrobbler               loaded at 00CA0000h - 00CD3000h
foo_dsp_effect                   loaded at 00CF0000h - 00D27000h
foo_albumlist                    loaded at 6A9E0000h - 6AA3A000h
foo_dsp_std                      loaded at 6A9A0000h - 6A9D6000h
foo_fileops                      loaded at 6A950000h - 6A99B000h
foo_playcount                    loaded at 6A910000h - 6A94E000h
foo_wave_seekbar                 loaded at 6A760000h - 6A909000h
OLEAUT32                         loaded at 77020000h - 770A7000h
WS2_32                           loaded at 75AA0000h - 75AED000h
PSAPI                            loaded at 75180000h - 75186000h
IPHLPAPI                         loaded at 74DD0000h - 74DEE000h
MSVCP120                         loaded at 6A520000h - 6A591000h
MSVCR120                         loaded at 6A120000h - 6A20E000h
NSI                              loaded at 75BA0000h - 75BA7000h
WINNSI                           loaded at 74D30000h - 74D38000h
mswsock                          loaded at 74180000h - 741C5000h
foo_touchremote                  loaded at 6A490000h - 6A516000h
MSVCR100                         loaded at 6A060000h - 6A11F000h
mscoree                          loaded at 6A3F0000h - 6A446000h
mscoreei                         loaded at 6A370000h - 6A3EE000h
clr                              loaded at 69840000h - 69EDB000h
MSVCR120_CLR0400                 loaded at 6A290000h - 6A367000h
mscorlib.ni                      loaded at 65DA0000h - 66E35000h
clrjit                           loaded at 6A210000h - 6A28D000h
foo_uie_wsh_panel_mod            loaded at 675E0000h - 6768C000h
Msimg32                          loaded at 73FF0000h - 73FF6000h
foo_dsp_soundtouch               loaded at 02C90000h - 02CB6000h
foo_rgscan                       loaded at 6A700000h - 6A75B000h
foo_w7shell                      loaded at 02E30000h - 02E6D000h
foo_converter                    loaded at 69670000h - 696F5000h
foo_httpcontrol                  loaded at 69FF0000h - 6A05D000h
WSOCK32                          loaded at 73840000h - 73848000h
MPR                              loaded at 73E10000h - 73E24000h
foo_dsp_xgeq                     loaded at 6A450000h - 6A48C000h
foo_masstag                      loaded at 05230000h - 05284000h
foo_ui_std                       loaded at 674D0000h - 675DD000h
foo_dsp_eq                       loaded at 69800000h - 69836000h
foo_quicksearch                  loaded at 55760000h - 557B7000h
WindowsCodecs                    loaded at 6A5A0000h - 6A6ED000h
foo_upnp                         loaded at 55550000h - 55757000h
frontend_direct2d                loaded at 67480000h - 674C1000h
d2d1                             loaded at 55DC0000h - 56185000h
frontend_direct3d9               loaded at 58530000h - 58580000h
d3d9                             loaded at 71750000h - 71908000h
d3dx9_42                         loaded at 55360000h - 55545000h
VERSION                          loaded at 74230000h - 74238000h
clbcatq                          loaded at 751A0000h - 7521D000h
MMDevApi                         loaded at 6B240000h - 6B28A000h
AUDIOSES                         loaded at 6B290000h - 6B2E5000h
CRYPTSP                          loaded at 74C80000h - 74C98000h
rsaenh                           loaded at 74C10000h - 74C3F000h
bcrypt                           loaded at 74BF0000h - 74C0D000h
urlmon                           loaded at 74840000h - 74968000h
iertutil                         loaded at 74600000h - 7481A000h
WININET                          loaded at 74430000h - 745ED000h
USERENV                          loaded at 74DF0000h - 74E09000h
profapi                          loaded at 74D40000h - 74D4E000h
System.ni                        loaded at 65410000h - 65D9D000h
System.Core.ni                   loaded at 64D60000h - 65403000h
twinapi                          loaded at 71490000h - 7151B000h
propsys                          loaded at 70E70000h - 70F93000h
Bcp47Langs                       loaded at 70240000h - 70287000h
SETUPAPI                         loaded at 75760000h - 7590D000h
LINKINFO                         loaded at 70DE0000h - 70DEA000h
ntshrui                          loaded at 6F490000h - 6F530000h
srvcli                           loaded at 70480000h - 7049B000h
cscapi                           loaded at 70DA0000h - 70DAD000h
sud                              loaded at 552C0000h - 55354000h
ADVPACK                          loaded at 55290000h - 552BC000h
DUI70                            loaded at 6F770000h - 6F8BB000h
System.Configuration.ni          loaded at 67390000h - 6747E000h
System.Xml.ni                    loaded at 645E0000h - 64D53000h
dnssd                            loaded at 697E0000h - 697F5000h
dhcpcsvc                         loaded at 713C0000h - 713D3000h
explorerframe                    loaded at 6F8C0000h - 6FB13000h
DUser                            loaded at 704B0000h - 70526000h
nvd3dum                          loaded at 59A00000h - 5A7CE000h
nvspcap                          loaded at 08BB0000h - 08CC4000h
nvapi                            loaded at 6FEE0000h - 701B2000h

Stack dump analysis:
Address: 7179C5DFh (d3d9+4C5DFh), symbol: "Direct3DCreate9" (+24249h)
Address: 774B00ACh (ntdll+400ACh), symbol: "RtlFreeHeap" (+79Dh)
Address: 7179C31Fh (d3d9+4C31Fh), symbol: "Direct3DCreate9" (+23F89h)
Address: 774AFAC9h (ntdll+3FAC9h), symbol: "RtlFreeHeap" (+1BAh)
Address: 772A9A22h (msvcrt+9A22h), symbol: "free" (+46h)
Address: 772A9A15h (msvcrt+9A15h), symbol: "free" (+39h)
Address: 772A9A22h (msvcrt+9A22h), symbol: "free" (+46h)
Address: 772A9A15h (msvcrt+9A15h), symbol: "free" (+39h)
Address: 772A9A22h (msvcrt+9A22h), symbol: "free" (+46h)
Address: 6A12ECFAh (MSVCR120+ECFAh), symbol: "free" (+1Ah)
Address: 6A12ECFAh (MSVCR120+ECFAh), symbol: "free" (+1Ah)
Address: 5854FCFDh (frontend_direct3d9+1FCFDh), symbol: "g_seekbar_frontend_entrypoint" (+1E578h)
Address: 5854FD10h (frontend_direct3d9+1FD10h), symbol: "g_seekbar_frontend_entrypoint" (+1E58Bh)
Address: 58555545h (frontend_direct3d9+25545h), symbol: "g_seekbar_frontend_entrypoint" (+23DC0h)
Address: 58543671h (frontend_direct3d9+13671h), symbol: "g_seekbar_frontend_entrypoint" (+11EECh)
Address: 585451EBh (frontend_direct3d9+151EBh), symbol: "g_seekbar_frontend_entrypoint" (+13A66h)
Address: 6A7ED0A9h (foo_wave_seekbar+8D0A9h), symbol: "g_gdi_entrypoint" (+26FA9h)
Address: 6753200Fh (foo_ui_std+6200Fh)
Address: 6A8B7418h (foo_wave_seekbar+157418h), symbol: "foobar2000_get_interface" (+4CFD8h)
Address: 6A8B7424h (foo_wave_seekbar+157424h), symbol: "foobar2000_get_interface" (+4CFE4h)
Address: 7716D3CFh (USER32+1D3CFh), symbol: "GetWindowRgn" (+423h)
Address: 6A8A54A7h (foo_wave_seekbar+1454A7h), symbol: "foobar2000_get_interface" (+3B067h)
Address: 6A7F5AE1h (foo_wave_seekbar+95AE1h), symbol: "g_gdi_entrypoint" (+2F9E1h)
Address: 6A7C7DEFh (foo_wave_seekbar+67DEFh), symbol: "g_gdi_entrypoint" (+1CEFh)
Address: 6A7C7BC1h (foo_wave_seekbar+67BC1h), symbol: "g_gdi_entrypoint" (+1AC1h)
Address: 6A897BA0h (foo_wave_seekbar+137BA0h), symbol: "foobar2000_get_interface" (+2D760h)
Address: 6A7C81AFh (foo_wave_seekbar+681AFh), symbol: "g_gdi_entrypoint" (+20AFh)
Address: 6A7C7C37h (foo_wave_seekbar+67C37h), symbol: "g_gdi_entrypoint" (+1B37h)
Address: 6A7C809Dh (foo_wave_seekbar+6809Dh), symbol: "g_gdi_entrypoint" (+1F9Dh)
Address: 77157834h (USER32+7834h), symbol: "CallNextHookEx" (+97h)
Address: 7715930Fh (USER32+930Fh), symbol: "GetWindowThreadProcessId" (+3E5h)
Address: 77157997h (USER32+7997h), symbol: "CallNextHookEx" (+1FAh)
Address: 75BB1E6Fh (MSCTF+1E6Fh), symbol: "TF_Notify" (+1E6h)
Address: 77185EA4h (USER32+35EA4h), symbol: "IsHungAppWindow" (+2A9h)
Address: 77157BEDh (USER32+7BEDh), symbol: "CallNextHookEx" (+450h)
Address: 774B683Dh (ntdll+4683Dh), symbol: "RtlDeactivateActivationContextUnsafeFast" (+A4h)
Address: 77185EA4h (USER32+35EA4h), symbol: "IsHungAppWindow" (+2A9h)
Address: 77157D81h (USER32+7D81h), symbol: "CallNextHookEx" (+5E4h)
Address: 01313513h (foobar2000+63513h)
Address: 774AEED2h (ntdll+3EED2h), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 774AEE30h (ntdll+3EE30h), symbol: "KiUserApcDispatcher" (+48h)
Address: 7749B570h (ntdll+2B570h), symbol: "NtdllDialogWndProc_W" (+160h)
Address: 77159B6Ch (USER32+9B6Ch), symbol: "SetRectEmpty" (+3Ah)
Address: 771724F1h (USER32+224F1h), symbol: "CallMsgFilterW" (+6Bh)
Address: 77185EA4h (USER32+35EA4h), symbol: "IsHungAppWindow" (+2A9h)
Address: 77172626h (USER32+22626h), symbol: "IsDialogMessageW" (+10Bh)
Address: 675493F6h (foo_ui_std+793F6h)
Address: 01310904h (foobar2000+60904h)
Address: 7715AD54h (USER32+AD54h), symbol: "DestroyWindow" (+0h)
Address: 013D5A80h (foobar2000+125A80h)
Address: 013109E7h (foobar2000+609E7h)
Address: 013114C5h (foobar2000+614C5h)
Address: 01405264h (foobar2000+155264h)
Address: 01405248h (foobar2000+155248h)
Address: 01405248h (foobar2000+155248h)
Address: 0140522Ch (foobar2000+15522Ch)
Address: 013C884Bh (foobar2000+11884Bh)
Address: 013C5BC0h (foobar2000+115BC0h)
Address: 013C884Bh (foobar2000+11884Bh)
Address: 013C63B5h (foobar2000+1163B5h)
Address: 6AFC2836h (shared+2836h), symbol: "uPrintCrashInfo_OnEvent" (+B1h)
Address: 013FAC28h (foobar2000+14AC28h)
Address: 013E1B62h (foobar2000+131B62h)
Address: 013116E9h (foobar2000+616E9h)
Address: 012B0000h (foobar2000+0h)
Address: 013C5566h (foobar2000+115566h)
Address: 013C141Fh (foobar2000+11141Fh)
Address: 013C1419h (foobar2000+111419h)
Address: 013EBAFCh (foobar2000+13BAFCh)
Address: 013EBB00h (foobar2000+13BB00h)
Address: 013E84B1h (foobar2000+1384B1h)
Address: 013C5BC0h (foobar2000+115BC0h)
Address: 013C1419h (foobar2000+111419h)
Address: 013E1E69h (foobar2000+131E69h)
Address: 013C334Dh (foobar2000+11334Dh)
Address: 012B0000h (foobar2000+0h)
Address: 013C5BC0h (foobar2000+115BC0h)
Address: 7505919Fh (KERNEL32+1919Fh), symbol: "BaseThreadInitThunk" (+Eh)
Address: 774BA22Bh (ntdll+4A22Bh), symbol: "RtlInitializeExceptionChain" (+84h)
Address: 774F6645h (ntdll+86645h), symbol: "wcstombs" (+87h)
Address: 774BA201h (ntdll+4A201h), symbol: "RtlInitializeExceptionChain" (+5Ah)
Address: 774AF21Bh (ntdll+3F21Bh), symbol: "RtlCaptureContext" (+E8h)
Address: 013C33A0h (foobar2000+1133A0h)

Environment:
App: foobar2000 v1.3.3
UI: Default User Interface 0.9.5

Components:
Core (2014-07-16 13:32:52 UTC)
    foobar2000 core 1.3.3
foo_albumlist.dll (2014-07-16 13:29:06 UTC)
    Album List 4.5
foo_audioscrobbler.dll (2013-04-28 17:01:31 UTC)
    Audioscrobbler 1.4.7
foo_cdda.dll (2014-07-16 13:28:50 UTC)
    CD Audio Decoder 3.0
foo_converter.dll (2014-07-16 13:29:00 UTC)
    Converter 1.5
foo_deskband_controls.dll (2014-07-11 15:10:50 UTC)
    Deskband Controls 1.1
foo_dsp_effect.dll (2013-09-30 02:14:29 UTC)
    Effect DSP 0.12
foo_dsp_eq.dll (2014-07-16 13:29:12 UTC)
    Equalizer 1.0
foo_dsp_soundtouch.dll (2012-10-30 01:26:35 UTC)
    SoundTouch DSP 0.1 (SSE)
foo_dsp_std.dll (2014-07-16 13:28:58 UTC)
    Standard DSP Array 1.3
foo_dsp_xgeq.dll (2013-05-01 02:01:52 UTC)
    Graphic Equalizer 0.3.7
foo_fileops.dll (2014-07-16 13:28:26 UTC)
    File Operations 2.2.1
foo_httpcontrol.dll (2014-02-05 15:34:49 UTC)
    HTTP Control 0.97.13
foo_input_std.dll (2014-07-16 13:32:52 UTC)
    Standard Input Array 1.0
foo_masstag.dll (2012-11-29 23:44:53 UTC)
    Masstagger 1.8.4
foo_playcount.dll (2013-02-01 08:40:46 UTC)
    Playback Statistics 3.0.2
foo_quicksearch.dll (2012-11-02 02:01:23 UTC)
    Quick Search Toolbar 3.4
foo_rgscan.dll (2014-07-16 13:31:50 UTC)
    ReplayGain Scanner 2.2.1
foo_touchremote.dll (2013-01-08 16:40:26 UTC)
    TouchRemote DACP server for foobar2000 0.2.8.3
foo_ui_std.dll (2014-07-16 13:32:52 UTC)
    Default User Interface 0.9.5
foo_uie_wsh_panel_mod.dll (2010-02-28 02:59:14 UTC)
    WSH Panel Mod 1.3.2
foo_upnp.dll (2013-12-09 20:37:05 UTC)
    UPnP/DLNA Renderer, Server, Control Point 0.99.48
foo_w7shell.dll (2010-01-17 03:09:20 UTC)
    Windows 7 integration 0.2.9.1
foo_wave_seekbar.dll (2014-08-16 15:55:35 UTC)
    Waveform seekbar 0.2.45

Recent events:
Starting playlist loading
Folder watching failure: Das System kann den angegebenen Pfad nicht finden.  
Watching: C:\Users\Public\Music
User Interface initialized in: 0:00.061774
Processing commandline
initquit::init entry
Graphic Equalizer: initialized (SSE support: 3)
TouchRemote initialization started
TouchRemote database id: 87CFB89383870D26
TouchRemote initialization finished
foo_upnp: succesfully loaded file C:\Users\Kyro0\AppData\Roaming\foobar2000\foo_upnp.xml
foo_upnp: initialized in 0.013s
w7shell: init started
w7shell: GDI+ initialized
w7shell: COM initialized
w7shell: running on Windows NT 6.3.9600
w7shell: DWM composition enabled
w7shell: WA_DISALLOW_PEEK successfully set
w7shell: WA_DISALLOW_PEEK successfully set
w7shell: WA_HAS_ICONIC_BITMAP successfully set
w7shell: WA_FORCE_ICONIC_REPRESENTATION successfully set
w7shell: failed to set WA_FLIP3D_POLICY: 0x80070057
w7shell: all green
initquit::init exit
Startup time : 0:00.983143
foo_upnp: loaded Media Library tree in 0.013s
w7shell: taskbar button create notification got
foo_upnp: created 3470 path registry entries in 0.035s
Seekbar: taking Direct3D9 path.
Seekbar: Frontend initialized.


Machine specifications:
OS: Windows 6.3.9600 x64
CPU: AMD Phenom(tm) II X4 955 Processor, features: 3DNow!ex MMX SSE SSE2 SSE3
CPU threads: 4
Audio: (Realtek High Definition Audio)
Title: foo_wave_seekbar
Post by: Zao on 2014-08-16 20:51:50
At a cursory glance, there's something that makes device creation for Direct3D9 to fail, or the device is lost in a spectacular manner.
If you want to mitigate this and can stand the GDI or D2D frontends, you could remove the frontend_direct3d9.dll and see if the other ones work.
Title: foo_wave_seekbar
Post by: Moorindal on 2014-08-31 15:52:46
Foobar2000 started to crash on exit recently. It appears that crashes were caused by foo_wave_seekbar 0.2.45. I reinstalled it and crashes disappeared. There's crash log:
Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 00000000h
Access violation, operation: write, address: 00000000h

Call path not available.

Stack (0987FCC0h):
0987FCA0h: 00000000 FFFFFD34 000002E4 FFFFFD34
0987FCB0h: 000002CC 00000019 00000000 6E1CEE1F
0987FCC0h: 6E05F91F 742A3D63 00CA6C1C 0053ADA0
0987FCD0h: 74221538 0053ADA0 6E060745 B54D1E84
0987FCE0h: 00511794 0987FD08 0987FD70 0987FCC4
0987FCF0h: 0987FD30 6E06FEE0 00000000 0987FD3C
0987FD00h: 6E0608BE 004D9310 0053C038 74221538
0987FD10h: 0987FD38 6E05C12F 00000000 B54D1F40
0987FD20h: B54D1F44 00000002 0987FE30 0987FD08
0987FD30h: 0987FE5C 6E06FF78 FFFFFFFF 0987FE68
0987FD40h: 6E0654B0 0987FD58 B54D1C10 0987FE74
0987FD50h: 004837E8 004837EC 00000020 00000100
0987FD60h: 00000000 00000000 0053C038 3F800000
0987FD70h: 004837E8 0987FD9C 0015941C 4435C000
0987FD80h: 41A80000 0987FDAC 00000002 00000001
0987FD90h: 0D024928 0D024930 0D024930 0C7D0428
0987FDA0h: 0C7D0230 0C7D0278 0C7D01E8 00000002
0987FDB0h: 6E07311C 00000000 00000000 00000000
0987FDC0h: 4435C000 41A80000 42C00000 42C00000
0987FDD0h: 00000002 6E07311C 00000000 00000000

Registers:
EAX: 004B1850, EBX: 004D9310, ECX: 004D9310, EDX: 00448D08
ESI: 0987FCC4, EDI: 00511794, EBP: 0987FCFC, ESP: 0987FCC0

Unable to identify crash location!

Loaded modules:
foobar2000 loaded at 01390000h - 0155E000h
ntdll loaded at 77260000h - 773E0000h
kernel32 loaded at 75130000h - 75240000h
KERNELBASE loaded at 76660000h - 766A7000h
COMCTL32 loaded at 74450000h - 745EE000h
msvcrt loaded at 74F40000h - 74FEC000h
GDI32 loaded at 74D00000h - 74D90000h
USER32 loaded at 76810000h - 76910000h
ADVAPI32 loaded at 76260000h - 76300000h
sechost loaded at 76170000h - 76189000h
RPCRT4 loaded at 75FF0000h - 760E0000h
SspiCli loaded at 74940000h - 749A0000h
CRYPTBASE loaded at 74930000h - 7493C000h
LPK loaded at 74F30000h - 74F3A000h
USP10 loaded at 764A0000h - 7653D000h
SHLWAPI loaded at 76190000h - 761E7000h
DSOUND loaded at 6FDE0000h - 6FE52000h
ole32 loaded at 75240000h - 7539C000h
WINMM loaded at 71120000h - 71152000h
POWRPROF loaded at 71160000h - 71185000h
SETUPAPI loaded at 74B60000h - 74CFD000h
CFGMGR32 loaded at 76230000h - 76257000h
OLEAUT32 loaded at 760E0000h - 7616F000h
DEVOBJ loaded at 76780000h - 76792000h
UxTheme loaded at 743D0000h - 74450000h
SHELL32 loaded at 753A0000h - 75FEA000h
zlib1 loaded at 62E80000h - 62E9F000h
shared loaded at 72AA0000h - 72ACB000h
imagehlp loaded at 74D90000h - 74DBB000h
dbghelp loaded at 6EC60000h - 6ED4B000h
COMDLG32 loaded at 76300000h - 7637B000h
CRYPT32 loaded at 76380000h - 764A0000h
MSASN1 loaded at 750C0000h - 750CC000h
Secur32 loaded at 71190000h - 71198000h
gdiplus loaded at 70930000h - 70AC0000h
WINHTTP loaded at 73460000h - 734B8000h
webio loaded at 73410000h - 7345F000h
IMM32 loaded at 750D0000h - 75130000h
MSCTF loaded at 766B0000h - 7677C000h
ActiveDetect32 loaded at 10000000h - 10036000h
WindowsApiHookDll32 loaded at 00250000h - 00270000h
VERSION loaded at 748D0000h - 748D9000h
dwmapi loaded at 74320000h - 74333000h
pshook loaded at 70E50000h - 70E5A000h
foo_input_std loaded at 6EB00000h - 6EC58000h
MSACM32 loaded at 70AC0000h - 70AD4000h
avcodec-fb2k-55 loaded at 6E920000h - 6EAF3000h
avutil-fb2k-52 loaded at 6E8B0000h - 6E91A000h
foo_plorg loaded at 6FDB0000h - 6FDDA000h
MSVCP100 loaded at 6E840000h - 6E8A9000h
MSVCR100 loaded at 6E780000h - 6E83F000h
foo_audioscrobbler loaded at 00E60000h - 00E93000h
foo_playlist_attributes loaded at 011B0000h - 01206000h
foo_queuecontents loaded at 01320000h - 0138E000h
foo_cdda loaded at 6E730000h - 6E77F000h
foo_cad loaded at 6FD80000h - 6FDA6000h
foo_input_monkey loaded at 00FA0000h - 00FE8000h
foo_converter loaded at 6E6B0000h - 6E730000h
foo_uie_lyrics3 loaded at 036B0000h - 0376E000h
WININET loaded at 76540000h - 7665B000h
Normaliz loaded at 77230000h - 77233000h
iertutil loaded at 749A0000h - 74B59000h
urlmon loaded at 74DC0000h - 74ED1000h
MSIMG32 loaded at 70D50000h - 70D55000h
foo_rgscan loaded at 6E650000h - 6E6AB000h
foo_freedb2 loaded at 6E600000h - 6E64E000h
foo_ui_columns loaded at 059C0000h - 05B50000h
foo_albumlist loaded at 6E5A0000h - 6E5FA000h
foo_abx loaded at 00F50000h - 00F82000h
foo_fileops loaded at 6E550000h - 6E59B000h
foo_dsp_eq loaded at 6E510000h - 6E546000h
foo_jesus loaded at 6ED70000h - 6ED8A000h
foo_unpack loaded at 6E4E0000h - 6E50F000h
foo_wave_seekbar loaded at 6E330000h - 6E4D9000h
WS2_32 loaded at 74FF0000h - 75025000h
NSI loaded at 76800000h - 76806000h
PSAPI loaded at 76220000h - 76225000h
IPHLPAPI loaded at 72350000h - 7236C000h
WINNSI loaded at 72340000h - 72347000h
MSVCP120 loaded at 6E2B0000h - 6E321000h
MSVCR120 loaded at 6E1C0000h - 6E2AE000h
mswsock loaded at 723E0000h - 7241C000h
wshtcpip loaded at 721A0000h - 721A5000h
wship6 loaded at 73C80000h - 73C86000h
foo_keep_queue loaded at 72A90000h - 72A9F000h
MSVCR90 loaded at 6ED90000h - 6EE33000h
foo_uie_albumlist loaded at 02FB0000h - 02FF3000h
foo_ui_std loaded at 6E0D0000h - 6E1BB000h
foo_dsp_std loaded at 6E090000h - 6E0C6000h
frontend_direct2d loaded at 6E040000h - 6E081000h
d2d1 loaded at 72CE0000h - 73027000h
d3d9 loaded at 70B30000h - 70CF3000h
d3d8thk loaded at 70B20000h - 70B26000h
frontend_direct3d9 loaded at 6DFF0000h - 6E040000h
d3dx9_42 loaded at 6DE00000h - 6DFE5000h
SciLexer loaded at 6DD50000h - 6DDF2000h
CLBCatQ loaded at 76910000h - 76993000h
MMDevApi loaded at 734C0000h - 734F9000h
PROPSYS loaded at 74020000h - 74115000h
AUDIOSES loaded at 733D0000h - 73406000h
WindowsCodecs loaded at 741F0000h - 74320000h
apphelp loaded at 741A0000h - 741EC000h
EhStorShell loaded at 74120000h - 74151000h
ntshrui loaded at 73F40000h - 73FB0000h
srvcli loaded at 74180000h - 74199000h
cscapi loaded at 74170000h - 7417B000h
slc loaded at 74160000h - 7416A000h
dxgi loaded at 72B50000h - 72B9C000h
WINTRUST loaded at 761F0000h - 7621E000h
d3d11 loaded at 6FE60000h - 6FFD5000h
nvwgf2um loaded at 6CF70000h - 6DBE8000h
sud loaded at 6DC90000h - 6DD4B000h
ADVPACK loaded at 6DC60000h - 6DC8E000h
DUI70 loaded at 73760000h - 73812000h
explorerframe loaded at 73850000h - 739BF000h
DUser loaded at 73820000h - 7384F000h
DNSAPI loaded at 72390000h - 723D4000h
rasadhlp loaded at 722F0000h - 722F6000h
fwpuclnt loaded at 72300000h - 72338000h
D3D10Warp loaded at 6EFA0000h - 6F189000h
avrt loaded at 73DE0000h - 73DE7000h

Stack dump analysis:
Address: 6E05F91Fh (frontend_direct2d+1F91Fh)
Address: 742A3D63h (WindowsCodecs+B3D63h), symbol: "IWICColorContext_InitializeFromMemory_Proxy" (+851EEh)
Address: 74221538h (WindowsCodecs+31538h), symbol: "IWICColorContext_InitializeFromMemory_Proxy" (+29C3h)
Address: 6E060745h (frontend_direct2d+20745h)
Address: 6E06FEE0h (frontend_direct2d+2FEE0h), symbol: "g_seekbar_frontend_entrypoint" (+A6F0h)
Address: 6E0608BEh (frontend_direct2d+208BEh)
Address: 74221538h (WindowsCodecs+31538h), symbol: "IWICColorContext_InitializeFromMemory_Proxy" (+29C3h)
Address: 6E05C12Fh (frontend_direct2d+1C12Fh)
Address: 6E06FF78h (frontend_direct2d+2FF78h), symbol: "g_seekbar_frontend_entrypoint" (+A788h)
Address: 6E0654B0h (frontend_direct2d+254B0h)
Address: 6E07311Ch (frontend_direct2d+3311Ch), symbol: "g_seekbar_frontend_entrypoint" (+D92Ch)
Address: 6E07311Ch (frontend_direct2d+3311Ch), symbol: "g_seekbar_frontend_entrypoint" (+D92Ch)
Address: 6E0730C4h (frontend_direct2d+330C4h), symbol: "g_seekbar_frontend_entrypoint" (+D8D4h)
Address: 6E0703A1h (frontend_direct2d+303A1h), symbol: "g_seekbar_frontend_entrypoint" (+ABB1h)
Address: 6E05834Ch (frontend_direct2d+1834Ch)
Address: 6E072FC4h (frontend_direct2d+32FC4h), symbol: "g_seekbar_frontend_entrypoint" (+D7D4h)
Address: 6E058190h (frontend_direct2d+18190h)
Address: 6E072FC4h (frontend_direct2d+32FC4h), symbol: "g_seekbar_frontend_entrypoint" (+D7D4h)
Address: 6E06F6ABh (frontend_direct2d+2F6ABh), symbol: "g_seekbar_frontend_entrypoint" (+9EBBh)
Address: 6E042B15h (frontend_direct2d+2B15h)
Address: 6E072D50h (frontend_direct2d+32D50h), symbol: "g_seekbar_frontend_entrypoint" (+D560h)
Address: 6E1EC01Dh (MSVCR120+2C01Dh), symbol: "_get_flsindex" (+6Fh)
Address: 6E1DA0D5h (MSVCR120+1A0D5h), symbol: "_ValidateRead" (+439h)
Address: 6E1EC001h (MSVCR120+2C001h), symbol: "_get_flsindex" (+53h)
Address: 7514338Ah (kernel32+1338Ah), symbol: "BaseThreadInitThunk" (+12h)
Address: 77299F72h (ntdll+39F72h), symbol: "RtlInitializeExceptionChain" (+63h)
Address: 73956245h (explorerframe+106245h), symbol: "Ordinal134" (+43323h)
Address: 751676F7h (kernel32+376F7h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 751676F7h (kernel32+376F7h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 772D71F5h (ntdll+771F5h), symbol: "WinSqmSetIfMaxDWORD" (+31h)
Address: 77299F45h (ntdll+39F45h), symbol: "RtlInitializeExceptionChain" (+36h)
Address: 6E1EBFB4h (MSVCR120+2BFB4h), symbol: "_get_flsindex" (+6h)
Address: 6E1EBFB4h (MSVCR120+2BFB4h), symbol: "_get_flsindex" (+6h)

Environment:
App: foobar2000 v1.3.2
UI: Columns UI 0.3.8.8

Components:
Core (2014-04-11 09:51:08 UTC)
foobar2000 core 1.3.2
foo_abx.dll (2012-07-09 03:30:27 UTC)
ABX Comparator 1.3.4
foo_albumlist.dll (2014-04-11 09:49:46 UTC)
Album List 4.5
foo_audioscrobbler.dll (2011-07-14 15:55:19 UTC)
Audioscrobbler 1.4.7
foo_cad.dll (2012-05-06 15:20:23 UTC)
CD Art Display 1.0.2
foo_cdda.dll (2014-04-11 09:49:18 UTC)
CD Audio Decoder 3.0
foo_converter.dll (2014-04-11 09:49:20 UTC)
Converter 1.5
foo_dsp_eq.dll (2014-04-11 09:49:32 UTC)
Equalizer 1.0
foo_dsp_std.dll (2014-04-11 09:49:24 UTC)
Standard DSP Array 1.3
foo_fileops.dll (2014-04-11 09:49:06 UTC)
File Operations 2.2.1
foo_freedb2.dll (2014-04-11 09:49:24 UTC)
Online Tagger 0.7
foo_input_monkey.dll (2013-05-25 12:17:56 UTC)
Monkey's Audio Decoder 2.1.7
foo_input_std.dll (2014-04-11 09:51:10 UTC)
Standard Input Array 1.0
foo_jesus.dll (2012-07-09 02:48:30 UTC)
Autosave & Autobackup 10
foo_keep_queue.dll (2012-07-09 03:26:35 UTC)
Keep Queue 0.3.5
foo_playlist_attributes.dll (2013-05-25 12:17:56 UTC)
Playlist Attributes 0.5.2
foo_plorg.dll (2012-07-09 03:10:26 UTC)
Playlist Organizer 2.4
foo_queuecontents.dll (2012-07-09 03:20:04 UTC)
Queue Contents Editor 0.5.1
foo_rgscan.dll (2014-04-11 09:49:26 UTC)
ReplayGain Scanner 2.2.1
foo_ui_columns.dll (2011-02-27 20:22:58 UTC)
Columns UI 0.3.8.8
foo_ui_std.dll (2014-04-11 09:51:08 UTC)
Default User Interface 0.9.5
foo_uie_albumlist.dll (2013-07-14 06:53:00 UTC)
Album list panel 0.3.5
foo_uie_lyrics3.dll (2014-07-21 03:59:29 UTC)
Lyric Show Panel 3 0.4.4
foo_unpack.dll (2014-04-11 09:48:52 UTC)
ZIP/GZIP/RAR Reader 1.6
foo_wave_seekbar.dll (2014-07-21 03:59:29 UTC)
Waveform seekbar 0.2.45

Recent events:
Loading DLL: C:\Program Files (x86)\foobar2000\components\foo_dsp_std.dll
Components loaded in: 0:00.046429
Pre config read
Configuration read in: 0:00.006092
Starting playlist loading
Watching: D:\Music
Watching: I:\Music
Seekbar: taking Direct2D1 path.
Seekbar: Frontend initialized.
User Interface initialized in: 0:00.291683
Processing commandline
initquit::init entry
initquit::init exit
Startup time : 0:01.920373
Opening track for playback: "D:\Music\The Great Old Ones\2012 - Al Azif\04. Rue d'Auseil.flac"
Audioscrobbler: Handshake successful.
Columns UI/Tab stack: Warning: Playlist Organizer panel was visible on creation! This usually indicates a bug in this panel.
Album list panel: initialised in 0.495 s
Refresh visuals
Refresh visuals
Autobackup: Backed up 170 items to autobackup.20140831-150341.zip
Opening track for playback: "D:\Music\The Great Old Ones\2012 - Al Azif\05. The Truth.flac"
Wave cache: finished analysis of "D:\Music\The Great Old Ones\2012 - Al Azif\05. The Truth.flac"
Autosaving... (I)
Configuration saved in: 0:03.775968
Autobackup: Backed up 170 items to autobackup.20140831-203542.zip
Shutting down...
initquit::quit entry
initquit::quit exit
Playlist Organizer: Last instance destroyed, Memorizing configuration


Machine specifications:
OS: Windows 6.1.7601 Service Pack 1 x64
CPU: Intel® Core™ i5 CPU M 430 @ 2.27GHz, features: MMX SSE SSE2 SSE3 SSE4.1 SSE4.2
CPU threads: 4
Audio: Динамики (Conexant CX20671 SmartAudio HD)



UPD:
I just found out that the problem caused by Frontend option - Direcd2D 1.0. Otherwise it don't crash.
Title: foo_wave_seekbar
Post by: Wolfbane on 2014-09-05 14:07:42
*** 1 *** ===> Transparent % settings    ===>    http://oi59.tinypic.com/2hn05n6.jpg (http://oi59.tinypic.com/2hn05n6.jpg)
(Image: The top one is how it is now, bottom one is just more faded, and how I would prefer it to be.)

Would it be possible to add a transparent % meter to to the "Highlight color" atm is seems to be a transparent fader around 20%.

Would be nice to have the option to set the transparent to X% meter manually instead of ON/OFF




*** 2 *** ===> Automaticly bost/lower songs "volume"

And my pictures are on the "Mix-down to mono" settings, so I dont show left and right speakers.
What I mean with "low" "Loud" "Balanced"    ===>    http://oi61.tinypic.com/2j4ofp0.jpg (http://oi61.tinypic.com/2j4ofp0.jpg)
Im not an audiophile, so if I have misunderstood anything, sorry in advance.

So some songs have nice volume while other songs are really loud and then there are some songs some are low.

But what I understood how big/small ("loud"/"low") the meters are related to the recording/sample, and it is in a way how loud/low the recording at that part of the song.

I have a few hundred/thousands songs in my playlist. And some songs is also added to my play list true "FooBar YouTube" ( http://www.hydrogenaud.io/forums/index.php?showtopic=104379 (http://www.hydrogenaud.io/forums/index.php?showtopic=104379) )
So plz dont give me a reply that "The song is recorded that way, you need to download/get a better version of the song in better quality sample."
Since a few songs are you tube, stuff that I cant control in any way.

So my question if it would possible to have a few options , that boost/decrease some settings ? (Not THE volume meter)
And when I write Boost/decrease Im NOT referring to "THE Volume meter", best would be if there was some other way to increase the volume you hear without increasing/decreasing "THE volume meter" itself.
Bit if it is not possible to do it in any other way then to move the Volume meter, then that would be a better way then how it is now.

Now that I have explained why, lets try and explain how I mean.

How would one have settings for this ?
"Red Zone"    ===>    http://oi62.tinypic.com/qx5u15.jpg (http://oi62.tinypic.com/qx5u15.jpg)
My theory is that you can have settings that the program auto adjusts so in a "Low" song then it will increase it untill 10% (factor Y) of the peaks are in the red area.
And on the "Loud" songs it would decrease untill only 10% (factor Y) of the peaks are in the red area.

Dont look at the "Red Zone" and say, no the zone should be smaller, or i should be bigger zone, its just an image trying to simulate what Im refering to. Size of zone and % (factor Y) is something that people who are more into audio can determine then me.
Title: foo_wave_seekbar
Post by: Zao on 2014-09-05 14:55:14
#1: If you're using the D3D9 frontend, you can modify the shader to use any alpha you want for the played region. If not, meh. It's technically possible to expose a scalar from the UI, but it's way more GUI work than I want to ever do.

#2: I don't touch the audio. If you want to adjust how your audio is played back, look into ReplayGain (http://wiki.hydrogenaud.io/index.php?title=ReplayGain) or use some DSP like a compressor to adjust the audio.

The frontends adjust their display based on ReplayGain values stored in metadata, so if foobar2000 tells me there's RG and it's enabled, I'll use it to rescale the visual waveform.
Title: foo_wave_seekbar
Post by: Daeron on 2014-09-05 16:39:39
I think what Wolfbane tried to ask was a way to automatically scale the waveform to fill the entirety of the available space without (or with minimal) clipping, when applicable.

(http://i.imgur.com/wxxufTG.png)

So for songs like the top two, all is good. Some of them however produces waveforms as the bottom three (all of them has RG tags). Those could be scaled vertically to use all space available.

I'm obviously not using the default frontend and don't remember whether it produces similar results, so I could be totally wrong and might have misunderstood Wolfbane as well. It's just something that bothered me personally but never enough to actually address the 'issue'.


(The frontend I'm using, probably taken from somewhere in this topic:)
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;
float3 track_magnitude  : TRACKMAGNITUDE;

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( float2 tc, float cursorPos )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex1D(sTex, tc.x);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;
bool played = cursorPos < tc.x;
float4 inside_color = played ? textColor : highlightColor;
float4 bgColor = backgroundColor;

float4 wave = outside
? bgColor
: inside_color
;

return saturate(wave);
}

float4 reflect_evaluate( float2 tc, float cursorPos)
{
float baseline = -1.0/3.0;
float low_unscale = 3.0/2.0;
float high_unscale = 3.0/4.0;
bool mirrored = tc.y < baseline;
if (mirrored) {
tc.y = baseline - tc.y;
tc.y = tc.y * low_unscale;
}
else {
tc.y = tc.y - baseline;
tc.y = tc.y * high_unscale;
}
float mag = max(-track_magnitude.r, track_magnitude.g);
if (mag > 0.95) {
tc.y = lerp(0, mag/0.95, tc.y);
}
float boost = mirrored ? 1.3 : 1.0;
float gradient = lerp(0.7, 1.0, tc.y);
return boost * gradient * evaluate(tc, cursorPos);
}

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 = reflect_evaluate(input.tc, cursorPos);
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();
}
}
Title: foo_wave_seekbar
Post by: Zao on 2014-09-06 01:27:25
It's impossible to tell what he really wants.
There's shader semantics for min/max extents of the waveform if you want to rescale the waveform to fit, much like the replaygain semantics.
Title: foo_wave_seekbar
Post by: Wolfbane on 2014-09-08 12:05:37
It's impossible to tell what he really wants.


What I asked for was 2 things

*1* ===> If it was possible to increase/decrease the visual Seekbar waves to be more "balanced"

If you dont know what I mean with "Balanced" take a peek at the image I posted in the thread you dint understand what I wanted.

*2* ===> If it was possible to *"increase/decrease" the volume of a song to be more "normal"
So without touching volume meter on my foobar, stereo or in windows,

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Now to try and clearify what I mean with that, and what I do NOT mean with that.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

What I mean when I write "Balanced"
(http://oi61.tinypic.com/2j4ofp0.jpg)

And as I wrote before, when I mean *"Increas/decrase", what Im refeing to is NOT something that changes/moves the volume meter in Foobar.
And as I wrote before, when I mean *"Increas/decrase", what Im refeing to is NOT something that changes/moves the volume meter on my computer/PC/Windows.
And as I wrote before, when I mean *"Increas/decrase", what Im refeing to is NOT something that changes/moves the volume meter on my stereo.

And lets say my defenition of "normal" is -30dB (decibel) in my headphones / speakers.
So when and songs come on I want the volume to be -30dB for my ears.
So if it would be possible to have the program determine if the songs need to be decrease/increasde to get to "normal" volume. (-30dB)
And for the love of god, PLEASE dont give me a reply "We cant determine what your settings are on Foobar, PC, Steroe" to determine how we achive -30dB for your ears."
-30dB was an example, but if you have 500 songs and take an average volume in a way. And that way when a song is above or below that average then the program will see that this song needs to be increase/decreasde to "normal"
And no I did not ask for a feature that goes thrue all my songs and determines "Average". I ment that people with better audio knowledge about how it should sound and have them settings done.
So the program will determine if a song is realy low, the program realizes that this songs "Volume" is not correct we need to decrease/increase it to sound more average/"normal".



And as I wrote in the other thread, Im not an audiophile so Im not sure if it is poissible, or if my assumption how things work is not correct.
But what I assumed was that the waves in the seekbar, how high/low the waves are where related to the volume of the song at that specfici hight of the wave at that time.
Reason why I would assume so is because in songs that are really low, the waves are really tiny, and in a boosted song the waves are really high.



I think what Wolfbane tried to ask was a way to automatically scale the waveform to fill the entirety of the available space without (or with minimal) clipping, when applicable.

(http://i.imgur.com/wxxufTG.png)

So for songs like the top two, all is good. Some of them however produces waveforms as the bottom three (all of them has RG tags). Those could be scaled vertically to use all space available.

I'm obviously not using the default frontend and don't remember whether it produces similar results, so I could be totally wrong and might have misunderstood Wolfbane as well. It's just something that bothered me personally but never enough to actually address the 'issue'.


(The frontend I'm using, probably taken from somewhere in this topic:)


So yes your enterpitation of what I was asking for was 1 of the 3 things I asked for"Visual", but since I tought the waves are realated to the Volume/dB I hear in with my ears then why not combine both the things into one forum post.

And an example I gave was this image, increase so x% of the waves are inside the red area.
(http://oi62.tinypic.com/qx5u15.jpg)

The 3rd thing that you did solve, in a way was the fader.
The top one is how it looks by default, the image below that is how I would prefer it to look.
(http://oi59.tinypic.com/2hn05n6.jpg)


Only problem It was solved I copy pasted the code you wrote into my Seekbar. Sure it changed it to be more darker/feaded, but it also did alot of other changes.
After I applied your code it looks like this
(http://oi57.tinypic.com/nvocqo.jpg)
So sure the fader is alot darker/intens, and that is what I was looking for, but as you prob can see its alomt more pixelated and not as smooth in the edges, and its also not "Centered".
And I prefered to have it in the middle instead as it seems to be now, where its more like 75% top and 25% bottom.

So what I also would want is to know where in the code I can change to make it more faded, without coping the entire code you have, since that did other changes I did not prefer.
Title: foo_wave_seekbar
Post by: foosion on 2014-09-11 23:53:07
Sounds like you want ReplayGain. The foo_wave_seekbar plugin only displays stuff, it doesn't change your audio.
Title: foo_wave_seekbar
Post by: Lebon14 on 2014-09-13 05:03:06
Hi guys.
There's something off with the plugin.
With columnsUI, if you have two Views and you switch between them, Seekbar Waveform breaks.

So, yeah.
Just pointing it out.
Later.
Title: foo_wave_seekbar
Post by: Zao on 2014-09-14 03:02:45
Yay, Columns UI.

The gift that keeps on giving.
Title: foo_wave_seekbar
Post by: Zao on 2014-09-14 03:06:31
With columnsUI, if you have two Views and you switch between them, Seekbar Waveform breaks.

It helps a lot if you would mention what happens, under what operations, what frontend is in use, whatever other components you have, and so on.

All I've got in front of me is a working stock CUI and no idea what to look for.
Title: foo_wave_seekbar
Post by: Lebon14 on 2014-09-14 14:20:06
With columnsUI, if you have two Views and you switch between them, Seekbar Waveform breaks.

It helps a lot if you would mention what happens, under what operations, what frontend is in use, whatever other components you have, and so on.

All I've got in front of me is a working stock CUI and no idea what to look for.


So you have ColumnsUI. You make a layout and add Waveform Seekbar somewhere. Now, in that UI, create a button that will switch to another layout that you also made, without the waveform seekbar.
SO!
Play a song from the original layout with the WSB. Use the button to switch the layout. Once switched, get back to the original layout. The Waveform Seekbar should be empty. Restarting or changing song fixes it.
Can also be tested with tabs that switches layout as long as the Waveform Seekbar is present in one but not the other. I think that it also works if they are in both as long as the whole thing changes (but I didn't test it).

Yes, be sure that the who layout changes, not part of it.

There you go, I explained.
Title: foo_wave_seekbar
Post by: Zao on 2014-09-14 19:25:14
Thanks for the elaborate report. I was looking for more spectacular failures in a tabbed setting.

The underlying problem is that when a waveform UI element is created, it will not have any content until next track change. Under normal DUI operations and tabbed CUI operations, this is not a problem as creation only happens when you manually insert the element, or prior to first playback on startup.

With multiple layouts in CUI, all elements in the layout appear to be torn down and constructed from configuration, which means that the blank-until-playing problem manifests much more visibly.
Title: foo_wave_seekbar
Post by: Lebon14 on 2014-09-16 02:00:35
^ So, it's a problem caused on how foobar2000 with columnsUI work?
Title: foo_wave_seekbar
Post by: Zao on 2014-09-16 12:13:38
The core problem is that my component doesn't immediately show content when it's created, instead waiting for a playback state event.
Outside of changing layouts in CUI, it only really occurs when you add the UI element to a layout, which means it was way down on the priority list.
Title: foo_wave_seekbar
Post by: marc2003 on 2014-10-02 04:11:57
i've recently sold my decent pc and have been relegated to using an ancient piece of shit running windows XP SP3. i think i have all the dependencies installed because it displays previously scanned waveforms just fine.

my problem is that it won't scan/display waveforms for tracks that are new to my library. nothing is reported in the console but i do get a progress display so i can at least seek like normal.


edit: oh woops. this is entirely my fault. i just installed the c++ runtimes from the first post and scanning new tracks now works. i thought because the component displayed old waveforms and didn't throw any errors that i had the necessary stuff installed. apologies to anyone who wasted their time reading this.

Title: foo_wave_seekbar
Post by: tedsmith on 2014-10-02 04:29:53
...it displays previously scanned waveforms just fine.

my problem is that it won't scan/display waveforms for tracks that are new to my library. nothing is reported in the console but i do get a progress display so i can at least seek like normal.

i'm stuck using GDI mode because of the crappy onboard SIS graphics. this previously scanned track displays fine...

i do have the component set to only scan tracks in my library but this album is definitely included in my watched folder. any ideas??

I don't know if it's relevant but when I explicitly scan a large number of files with the wave seekbar sometimes the scan stalls out.  If I close foobar2000 and reopen it the scan continues.  I've just lived with this rather than trying to get a reproducible test case for Zao, sorry.
[Edit: I see you changed your post - well this post might still be useful to someone.]
Title: foo_wave_seekbar
Post by: Zao on 2014-10-02 11:33:54
marc2003: It's nice to see that you solved your problem, and my condolences for having to run Windows XP. I guess that it was worth painfully keeping XP support in the component for all these years.

tedsmith: I could see two possible causes here:
Title: foo_wave_seekbar
Post by: marc2003 on 2014-10-02 12:25:59
it's me again and i think i've stumbled across a genuine problem albeit a small one....

i recently purged a load of stuff i don't listen to from my collection and used remove dead waveforms from the library menu. as there was no kind of status report, i put on my super nerd hat and opened the database file in a program called sqlitestudio just to check the total number of records matched what i had in my collection. i noticed a discrepancy so after a bit of investigation, i found that after i had changed a folder name to use uppercase letters, the component had scanned the files again. but windows itself is not case sensitive so i don't think this should happen.

here's a screenshot to illustrate it. note the folder name You/YOU.

(https://dl.dropboxusercontent.com/u/22801321/2014/october/db.png)

i think each there should only be one entry for each track.
Title: foo_wave_seekbar
Post by: Zao on 2014-10-02 12:49:43
That's a tricky thing, as there's case-sensitive filesystems even in the Windows world.
I could attempt some sort of normalization and go break all the turks and russians, but I have no idea how much work I'd need to do it right.
Title: foo_wave_seekbar
Post by: marc2003 on 2014-10-02 12:53:45
ah, i didn't realise it would be that much hassle. i didn't know case sensitivity was down to the file system - i thought it was the OS. i've now resolved my issue so it doesn't really matter - i just thought i'd report it.
Title: foo_wave_seekbar
Post by: tedsmith on 2014-10-02 16:49:31
tedsmith: I could see two possible causes here:
  • The thread pool dispatcher I use (Asio, unrelated to ASIO) has some corner case glitches on some platforms where it just breaks. You may have encountered one of them. In a perfect world I'd replace it with some hand-rolled work dispatcher.
  • Some input component misbehaves in a multithreaded world or just generally breaks.

Thanks.  I probably run into it because I have a lot of SACD isos and they use multiple threads just to read the DST compressed info.  If I'm not doing anything else things seem to scan more reliably, if I also run, say, the replay gain scanner that's when the chances seem higher that the wave seekbar scanner will stop.  Like I said it's not a big deal to me.  I really like the wave seekbar, thanks.
Title: foo_wave_seekbar
Post by: Dandruff on 2014-10-05 19:24:57
Minor bug:

-> playback a track
-> monitor goes into standby mode during playback
-> track playback finishes (stopped) and monitor still in standby
-> bring monitor out of standby mode

Result: Waveform seekbar showing cursor at the position where monitor went into standby

Expected: No playback cursor shown + "Shade played" section cleared


Win8.1, foobar2000 1.3.3, Waveform Seekbar 0.2.45 (Direct3D)
Title: foo_wave_seekbar
Post by: conventional pacino on 2014-10-12 16:34:11
Hi,

I've just installed the waveform seekbar, and I like it only it's too thin, and I don't know how to resize it...

(http://i.imgur.com/nxEWi7m.png)

Sorry if this has been answered already somewhere. I had a read through the thread where people discussed this component, and saw images of people's configurations, in many of which it was nice and thick, but nobody mentioned how to achieve that.

I'm using the GDI mode of the plugin, which has greyed out the "frontend settings" of the configuration - the Direct3D ones don't work for me (Win7 64).

Thanks for any counsel.
Title: foo_wave_seekbar
Post by: marc2003 on 2014-10-12 17:24:06
it looks like you're using columns UI and have enabled just the toolbar. what you should do is actually remove that toolbar and add a panel. you can do this via file>preferences>display>columns UI>layout tab. on that page, you'll probably want to the base splitter to be vertical. then you can right click it>insert panel>panel>waveform seekbar.

(https://dl.dropboxusercontent.com/u/22801321/2014/october/layout.png)

you can then right click the panels themselves if you want to move them up/down.

Title: foo_wave_seekbar
Post by: conventional pacino on 2014-10-12 19:25:13
Very nice of you to reply, that did the trick.

Thanks for the help, and quickness. 
Title: foo_wave_seekbar
Post by: w00w000 on 2014-10-23 10:45:13
hi, as far you not reply to email some year ago, will ask you on forum to add a feature: start play on double click.
thanks
Title: foo_wave_seekbar
Post by: Lebon14 on 2014-10-26 03:29:58
Would there be a reason why Waveform seekbar take 3 seconds to load/create a waveform? On a SSD, it takes a split second and on my 4TB HDD (2.1TB left) (where all my music library is), it takes like 3-4 seconds. However, the song still loads and plays immediately, no lag. I did a READ benchmark of that hard drive in HD Tune Pro 5.5. Results:

Minimum : 22.6 MB/s (spike)
Maximum : 169.3 MB/s
Average : 132.4 MB/s

Access time: 16.9 ms
Burst rate: 227.9 MB/s

Read at around 2.1TB is ~145MB/s.

The only thing beside foobar2000 using the hard drive is BackBlaze Control Panel backup software. Even then, upload rate is ~2.3Mbit all time.

Heck, until a week ago, it didn't do that. Unless it's related to those two things, I don't know what it might be:
1. I installed foo_run and ran metaflac to remove extra padding on a lot of files.
2. I created an image of a dying HDD using Macrium Reflect. That image is 500 GB big.

Heck, even on my old 1TB WD Green drive, almost being full, it was instant.

Note that foobar is installed on my SSD and the Roaming folder is also on the SSD, at the default location.

What do you think, Zao?

EDIT

They are FLAC files for the most part.
Title: foo_wave_seekbar
Post by: w00w000 on 2014-10-26 06:24:59

convert your files to .ape and you will see even more delays. guess why ?
Title: foo_wave_seekbar
Post by: Wander on 2014-10-26 08:41:03
Would there be a reason why Waveform seekbar take 3 seconds to load/create a waveform?


Yes, decoding and generating the waveform is CPU limited and therefore can take quite a few seconds depending on the length of the track, the decoder and your cpu speed. This task is done for the first time you play a file, on second play the waveform is loaeded from the waveform cache which is much more faster (nearly instant).
Title: foo_wave_seekbar
Post by: Lebon14 on 2014-10-26 14:15:12
^ I know that it needs to generate it first. Even then, my CPU is a Core i7 950. I don't think it's the issue. The songs were generally 3-5min long. I would have understoof if the track was 30min long, I think.

I discovered that when FLAC files doesn't have extra tag padding, it slows down the "first time" process. Quite strange.
Title: foo_wave_seekbar
Post by: Zao on 2014-10-26 18:52:57
The last time I benchmarked anything, my code added rather negligible time on top of raw decoding.
Run some benchmarks (with foo_benchmark or something) with just decoding, see what time it takes to decode a track.

There may be some overheads for stupid formats if they cannot cheaply determine the parameters I ask for before decoding, but you'd need an instrumented scanner to find that out.

The underlying cause here is most probably you rewriting your whole collection. Doing so tends to cause severe file fragmentation, and as non-interactive decoding speed is sequential, fragmentation kills.
Title: foo_wave_seekbar
Post by: Strigoy on 2014-10-30 00:46:00
Uh, is it possible to entirely hide bar (filling the the bar with some color for example) if the height (or width) of the element is less than _number_?
Title: foo_wave_seekbar
Post by: Zao on 2014-10-30 17:36:01
If you use the Direct3D frontend, you can modify the pixel shader to add an if-branch on the size of the window. When I manage to dig out my testbed installation, I can give it a shot.
Title: foo_wave_seekbar
Post by: Strigoy on 2014-10-31 09:52:15
If you use the Direct3D frontend, you can modify the pixel shader to add an if-branch on the size of the window. When I manage to dig out my testbed installation, I can give it a shot.

Yeah I'm using D3D frontend, but I'm not really familiar with it, so help would be appreciated.
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-05 19:36:01
Hi everybody,

I have used Propheticus and derty2 code (pages 79 and 80 of this topic : http://www.hydrogenaud.io/forums/index.php?showtopic=63984 (http://www.hydrogenaud.io/forums/index.php?showtopic=63984) ) for changing my Waveform Seekbar, but it doesn't seem to adjust/center automatically to the height allowed to the component.

(http://i62.tinypic.com/153l1fq.jpg)

What part of the code should I tweak so the waveform is automatically centered, whatever the height of the component ?

Thanks in advance.

EDIT : the problem seems to be ReplayGain related : apparently the lower the track gain, the lower the waveform :

Track gain = -1.61 dB :
(http://i57.tinypic.com/r8yogw.jpg)

Track gain = -6.00 dB :
(http://i62.tinypic.com/e9ddvq.jpg)

Track gain = -12.71 dB :
(http://i60.tinypic.com/20ud20x.jpg)

Three funny facts as you can see :
1. When the track gain is close to zero (first image), the waveform seems to "get out" of the component space
2. When the track gain becomes very low (third image), the waveform seems to be "compressed" vertically without ever getting out of the component space
3. The "inside waveform" (the darker/grey-ish orange) doesn't seem to be affected, it seems to be always centered. Here's a good example (-4.54 dB) where the "outside waveform" (orange) goes slightly up and the "inside waveform" remains centered :
(http://i62.tinypic.com/ztzm2d.jpg)
Title: foo_wave_seekbar
Post by: Zao on 2014-11-06 14:28:08
It's possible that the code used is affected by the removal of floating point pixel formats many versions ago. Or it may be that their replaygain code is defective.
Try skimming ahead from those pages and see if you find any fixes to their code, the names seem familiar.

Otherwise, I might take a look at it if the mystical "free time" happens, but don't bet on it.
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-06 14:47:48
Thanks Zao. Here's what I have done so far :
- I have skimmed the other topic from page 79 on, and I haven't found any fix
- I have posted in the other topic, hoping that Propheticus or derty2 would see my post (no answer yet)
- Oh, and BTW I have foobar 1.3.2 with Waveform Seekbar 0.2.45.

If somebody here is willing to have a look, here are several codes that seem to be affected by exactly the same problems.
If it can be of any help, the first code didn't have any problem with my previous Waveform Seekbar version (which was an old one : 0.2.10). So maybe it has something to do with the floating point stuff. I have no idea.
The second and third code are both taken from the other topic(pages 79 and 80).

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

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(backgroundColor, highlightColor, factor);
            }
            return c;
    }
   
    float RMSfactor( float2 tc, float border )
    {
            float4 minmaxrms = tex1D(sTex, tc.x);
   
            minmaxrms.rgb -= 0.1 * minmaxrms.a;
            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 diffRms = abs(tc.y) - border - minmaxrms.b;
            float factorRms = abs(diffRms);
            bool insideRms = diffRms < 0;
       
            float factor = insideRms ? ( 1 + 0.2 * saturate(factorRms / border / 2)): 1.0;
            factor = insideWave ? (factor * 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 = 2.5 * dx;
            float positionWidth = 2.5 * 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;
    }
   
    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();
        }
    }

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(backgroundColor, highlightColor, factor);
}
return c;
}

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

minmaxrms.rgb -= .1 * minmaxrms.a;

//- - - - - CHANGES THE OVERALL WAVE SIZE IN THE PANEL - - - - - - - -
//minmaxrms.rgb *= 0.8 + minmaxrms.a; <<<<<backup original
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);

//- - - - - ENABLE/DISABLE THE INSIDE WAVE - - - - - - - -
// [TO DISABLE: bool insideRms = 0;] [TO ENABLE: bool insideRms = diffRms < 0; <<<<<backup original]
//bool insideRms = diffRms < 0;
//bool insideRms = (belowWave > 0 && aboveWave < 0);
bool insideRms = (diffRms > 0 && diffRms < 0);

//- - - - - CHANGES LOOK OF INSIDE WAVE - - - - - - - -
//float factor = insideRms ? ( 1 + 0.2 * saturate(factorRms / border / 2)): 1.0; <<<<<backup original
float factor = insideRms ? ( 6 * saturate(factorRms / border / 20)): 10.0;

//- - - - - CHANGES LOOK OF OUTSIDE WAVE & PANEL BACKGROUND - - - - - - - -
//factor = insideWave ? (factor * saturate(factorWave / border / 1)) : 0.0; <<<<<backup original
factor = insideWave ? (factorRms * 6.0 + 0.8 * saturate(factorWave / border / 0.5)) : 0.0;

//return factor; <<<<<<backup original
return insideWave - saturate(factorWave);
}

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;

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

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();
}
}
Title: foo_wave_seekbar
Post by: Zao on 2014-11-06 15:13:02
See all those parts where it works with minmaxrms? In all places, they've fucked up the unbias operation.

In the first one, RG adjustments are done before unbiasing.
In the second one, the factors used have been messed with.
In the third one, heaven knows.

The thing is that in the past I had two main ways of moving data from the program to the shader.


The 8-bit kind needs a shift and a scale to turn the range of (0.0, 1.0) into (-1.0, 1.0). The way the shader knows if this should be done is the 'alpha' component of minmaxrms.
If alpha is one, we subtract 0.5 (getting us the range (-0.5, 0.5)) and multiply by two (getting us (-1.0, 1.0)).
If alpha is zero, we subtract 0 (doing nothing) and multiply by one (doing nothing), getting us the (-1.0, 1.0) we wanted all along.

This step should unconditionally be done in any shader with the value sampled from the texture. After you've got the proper fullscale range, you can then scale/shift/RG/mutilate all you want.

The reason why this surfaces more often now is because in some version inbetween the one you mentioned and now, I removed the floating point texture kind, only having 8-bit RGB. The shaders were already broken in the past on low-end video cards, but few noticed.
Title: foo_wave_seekbar
Post by: Propheticus on 2014-11-06 17:26:04
To be fair, I just hacked together some code I found somewhere and adjusted certain parameters so it looked like I wanted it to. Probably very specific to my situation, replaygain settings and other factors.
I have moved on to someone else's code that creates a soundcloud'esque waveform since then.

@Zao, sorry for causing you support questions due to old hacky code

WCS13, try this:
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(backgroundColor, highlightColor, 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;
     
        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.2 * saturate(factorRms / border / 2)): 1.0;
        factor = insideWave ? (factor * 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;
}
 
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();
    }
}
Title: foo_wave_seekbar
Post by: Zao on 2014-11-06 17:41:51
Heh, it's ultimately my fault as I didn't comment nor move the code out into a separate 'unbias' function when writing the original effect.
If all you see as a mortal is a bunch of numbers, it's instinct to twiddle them until it looks neat.
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-07 05:57:56
Thanks Zao and Propheticus for your help. It's much appreciated.

Propheticus, your new code works : it's the tweaked version of your own code, which corresponds to the 2nd codebox among the 3 I provided.
I see the two changes you've made, unless I'm wrong of course ( minmaxrms.rgb -= 0.5 * minmaxrms.a; AND minmaxrms.rgb *= 1.0 + minmaxrms.a; )

I'd like to tweak the 2 other codeboxes I provided, but as they seem to be coded differently that simple change won't work, and as a mere mortal I wouldn't dare mess with such dark magic.
Could somebody please tweak them, so we can have all 3 of them working ?

Thanks again.
Title: foo_wave_seekbar
Post by: Propheticus on 2014-11-12 08:03:27
I indeed only fixed my own screwup. Here's 1 and 3:
1
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( c ), fg.g);
c = lerp(c, grayscale( c ), fg.b);
#else
c = grayscale( c );
//c = sepia( c );
#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();
}
}
( c ) without spaces gets replaced by a ©. That's why I added the spaces. @forum: stop screwing with code inside a codebox!

3
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(backgroundColor, highlightColor, 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;

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

//- - - - - ENABLE/DISABLE THE INSIDE WAVE - - - - - - - -
// [TO DISABLE: bool insideRms = 0;] [TO ENABLE: bool insideRms = diffRms < 0; <<<<<backup original]
//bool insideRms = diffRms < 0;
//bool insideRms = (belowWave > 0 && aboveWave < 0);
bool insideRms = (diffRms > 0 && diffRms < 0);

//- - - - - CHANGES LOOK OF INSIDE WAVE - - - - - - - -
//float factor = insideRms ? ( 1 + 0.2 * saturate(factorRms / border / 2)): 1.0; <<<<<backup original
float factor = insideRms ? ( 6 * saturate(factorRms / border / 20)): 10.0;

//- - - - - CHANGES LOOK OF OUTSIDE WAVE & PANEL BACKGROUND - - - - - - - -
//factor = insideWave ? (factor * saturate(factorWave / border / 1)) : 0.0; <<<<<backup original
factor = insideWave ? (factorRms * 6.0 + 0.8 * saturate(factorWave / border / 0.5)) : 0.0;

//return factor; <<<<<<backup original
return insideWave - saturate(factorWave);
}

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;

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

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();
}
}
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-13 21:52:19
BTW Zao, I have a question/request :

Right now Waveform Seekbar works as follows :
- When foobar starts : show nothing
- When a song is selected : show nothing
- When a song is played : show the waveform
- When a song is selected while a song is being played : stick to the waveform of the song that's being played
- When a song is stopped : keep showing the waveform of the song that was played, even if another song was/is selected

Could Waveform Seekbar be modified to function as follows ?
- When foobar starts : show nothing
- When a song is selected : show the waveform (including calculating it if it's not in the database)
- When a song is played : show the waveform
- When a song is selected while a song is being played : stick to the waveform of the song that's being played
- When a song is stopped : show the waveform of the selected song, even if the selected song is not the one that was played

This could be optional of course : there could be a checkbox in the preferences to switch between that mode and the usual mode.

Zao, what do you think ?
Title: foo_wave_seekbar
Post by: w00w000 on 2014-11-14 03:15:34
hi, as far you not reply to email some year ago, will ask you on forum to add a feature: start play on double click waveform.
thanks

Title: foo_wave_seekbar
Post by: Zao on 2014-11-14 07:45:11
wcs13: There's a lot of obvious features that could be implemented with ease if the codebase hadn't been horrible. This is one of those that would be hard as it currently stands, as all information flow is arranged around the currently playing track.

w00w000: I saw you the first few times, and took a look or two at it. That may be somewhere between easy and hard to do, but as it currently stands, I don't trust the code to make a release unless I really have to work around a serious bug. 
Title: foo_wave_seekbar
Post by: w00w000 on 2014-11-14 16:36:04
i agree, not urgent, probably can wait another year.
just didn't sure after noreply you care about intuitive improvements or just interesting for being around.
but if need beta testing, feel free to reply my email at 24.11.2012 13:42 GMT. no probs
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-14 23:59:54
Zao, I totally understand. The codebase has certainly been horrible and it would need some serious rewriting, since I've read you many times say it since 2010.

Nearly 5 years have passed now since the first version of your wonderful component, so I think that a rewriting would be in order to celebrate them.
I know : you don't have time... I totally get it, since that is also what you've been saying for the last 5 years.
And yet you have managed to find some spare time to get out dozens of new (minor but new) releases for all of us to enjoy.
And of course we all thank you for that.
So maybe it's not really that you don't have time (in 5 years every single soul on Earth has time), but that the task may seem too long/difficult to actually start dealing with it.
And I understand it too, because it's human nature and we would probably all do the same in your position. 

So here's what I suggest : just stop pushing out new minor releases, and start rewriting it once and for all. after 5 years and 72 topic pages, I think such an awesome component really deserves it.
Besides, you'll see that once you have started doing it, it will all look easier than now. A mountain can seem long and difficult to climb, until you've actually started climbing it.
What do you think ? Good idea, right ?...

(please don't kill me  )
Title: foo_wave_seekbar
Post by: Zao on 2014-11-15 03:00:25
Heh, as you can find if you dig hard enough, I've speculated about what a proper remake would entail.

Replacing programmable shaders with something more building-block like for the mortal user; storing of waveforms near the audio files; incremental display of waveforms for streaming audio; display of tracks for non-playing songs; and a service that renders waveforms for other interested components, like playlist or properties.

Lots of fun stuff, and as with everything else, completely soul-draining once you run into limitations of the Windows platform instead of the actual thing you wanted to do.

And yes, the "no time" excuse is indeed wearing thin, but I feel like I've been burned out for half a decade now.
Title: foo_wave_seekbar
Post by: w00w000 on 2014-11-15 04:30:33
hey take it easy, no need to rewrite from the ground up or stopped/selected waveform showing, storing waveforms near audio files etc..
ie. i dont store waveforms at all, every track recreated all the time from scratch. it's all rare using situation like showing waveform of streams (and not a "seekbar" job at all).
but when it's paused and stopped and you want to play from some part or again current track showing, it's intuitive to click on a waveform to start play.
instead of seekbar from the box (which i dont have at all) the hand want to double click on a waveform, very logical..
let it make "waveform seekbar" be real advanced 'seekbar', and not just waveform visualization for show. Or next good step to rename it2: foo_waveform_visualisation.dll then..

peace!
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-15 14:45:49
Zao, I understand what you mean about Windows platform limitations. And you certainly know that subject much better than us.
Which means that you could easily write down the specs for a rewritten Waveform Seekbar component, and say "this can be done", "this can be done", "uh, this will be tricky because of Windows", etc..
So ultimately you could easily decide which features you should implement or not in the rewritten component.

The rewritten component doesn't have to be perfect and include everything that all of us (including yourself) have been dreaming of for the last 5 years.
But either way it will be so much better than the current Waveform Seekbar (which is already very good) that it will completely justify the rewriting process.
I'm sure you believe it too.

So here's another suggestion : why not start a preliminary thread about the features that you would like to implement in a rewritten component ?
It could be a thread like this foobar2000 thread : http://www.hydrogenaud.io/forums/index.php...st&p=525549 (http://www.hydrogenaud.io/forums/index.php?s=&showtopic=58351&view=findpost&p=525549)
People could contribute with their own ideas, but ultimately you would decide on what should be implemented or not.
Maybe that would motivate you, because let's face it : that's what you need to start working on it, right ?

There are other threads that could/should already have been started. Like a thread for people to share their own waveforms / codes / tips / etc. instead of polluting this thread. It could be a thread like this foobar2000 thread : http://www.hydrogenaud.io/forums/index.php?showtopic=58574 (http://www.hydrogenaud.io/forums/index.php?showtopic=58574) . The same thing could be said about other components like WSH panel component, where it's very difficult to find panel codes since they're buried in that huge thread when they could be nicely displayed in a specific thread, with screenshots, etc... Anyway. 
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-17 17:18:06
Back to topic, and to the unbias operation suggested by Zao in page 69 : http://www.hydrogenaud.io/forums/index.php...mp;#entry864358 (http://www.hydrogenaud.io/forums/index.php?showtopic=77490&st=1700&p=864358&#entry864358)
Basically as Zao (and Propheticus by PM) said, we can take a waveform code in the frontend settings, find the
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;

and add this afterwards (if not present already) :
minmaxrms.rgb *= 2.0;
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
}

We can then play with the overall height by changing the minmaxrms.rgb *= 2.0; value.

However, this is not the result I'd like to achieve, because with this code all the waveform heights remain relative (smaller waveforms remain smaller than the bigger waveforms). I can provide examples if needed.
What I want is that ALL waveforms have the SAME max height inside my component's space (in other words, have them occupy the maximum possible space without clipping).
Can this be achieved, and how ?

Thanks !
Title: foo_wave_seekbar
Post by: Zao on 2014-11-17 21:28:16
There are two semantics you can use. They have the largest sample value in the Y component and the lowest sample value in the X component. Z probably contains the largest RMS value.
CHANNELMAGNITUDE contains the values for the current channel being drawn.
TRACKMAGNITUDE contains the most significant values from all channels.

You can either shift and rescale to fit the window to the range of [X,Y], or rescale to fit the range of [-abs(max(X,Y)),abs(max(X,Y))], give or take some signs.
If you want to promote touching the edge, you should probably not involve RG.
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-18 02:10:24
Thanks Zao. You have understood what I want !
And I totally agree that RG should not be involved, since the purpose here would be "touching the edge" for the largest sample value (be it positive or negative) of every waveform. So I will gladly remove the previous RG code.
I just put it in my previous post for info purposes, since it had suggested previously (by you in this topic and by Propheticus by PM). But like I said it's not what I would like (Propheticus, I hope you understand better now, thank you).

Since I only have one waveform ("mix-down to mono" enabled) I guess I would have to use CHANNELMAGNITUDE and the range of [-abs(max(X,Y)),abs(max(X,Y))] . So far I think I understand.

However like I said previously, I'm not a dev and I'm not familiar with such coding language / dark magic.
So could you or somebody else provide the tiny bit of code necessary to achieve this ? I believe it would be helpful to many others besides me.
It's probably trivial to the point that you haven't bothered writing it, but I really could use that bit of help here. Thank you !

PS : I can report upon success (with screen caps) if somebody's interested.
Title: foo_wave_seekbar
Post by: w00w000 on 2014-11-18 05:15:29
foosion, that's cool, i will get a look..
Title: foo_wave_seekbar
Post by: Zao on 2014-11-18 17:41:18
Up toward along with the viewport size and other stuff, you add
float4 trackmag : TRACKMAGNITUDE;

Then in the PS function, where input.tc is used, instead use input.tc / float2(1.0, max(abs(trackmag.r), abs(trackmag.g)))

When testing this in my default effect, the result was a bit airy, which I think is due to computing averages instead of min/max in my mipmaps or possibly due to it being very sensitive to spikes. Play around and see if it works satisfactory. If all else fails, introduce a bullshit factor
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-18 21:12:04
Thanks. Here's the code I'm trying to modify :

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;
float4 trackmag : TRACKMAGNITUDE;

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();
}
}
I've added the float4 trackmag : TRACKMAGNITUDE; in the right place.
Then there are 8 occurrences of input.tc

Occurrences 1 to 4 are these :
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);

Occurrences 5 to 8 are these :
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;

I've tried replacing occurrences 5 to 8 since they were in the PS function, but the result wasn't convincing. I was expecting at least all waveforms to have the same max magnitude, but it wasn't the case : I saw no difference vs. the previous, unmodified code.

Can somebody help here ? 
Title: foo_wave_seekbar
Post by: Zao on 2014-11-18 21:36:45
Either change the VS or the PS, and if you do the PS, avoid messing with things that are unrelated to waveform height like bars.

In any way, from what I gathered from the contents of the parameters, their values seem to be around 0.9-0.999 on most my tracks. You probably won't get a better metric  unless something a bit more "intelligent" is provided from the application.
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-18 22:10:16
I don't know how to change the VS (occurrences 1-4) since I don't know what input.tc.x (or input.tc.y) is... so if I just replace it with input.tc / float2(1.0, max(abs(trackmag.r), abs(trackmag.g))).x it doesn't work. 
I warned you that I'm not familiar with coding so please assume that I'm really not at ALL.
You're trying to give me interesting clues that I can't get instead of providing the code. That would be useful if I understood the tiniest bit about the code, which I simply DON'T.
Thanks for your understanding.

About the PS, I've tried changing occurrence 5 only, occurrence 6 only, and occurrences 5 and 6. It's always pretty much the same result, and it's nowhere near the 0.9-0.999 range (which would be enough for me).
FYI occurrence 6 seems to have no incidence at all. Occurrence 5... well, replacing input.tc with input.tc / float2(1.0, max(abs(trackmag.r), abs(trackmag.g))) makes it slightly... worse (smaller waveforms, and their relative magnitudes are always the same). I don't get it.

Here's a screen cap to prove it. I don't think this is in the 0.9-0.999 range, is it ?
Title: foo_wave_seekbar
Post by: Zao on 2014-11-18 22:35:57
A sample of -1.0 is negative digital fullscale and corresponds by default to the lower edge of the window. A sample of 1.0 is correspondingly the positive fullscale and maps to the upper edge.

The measures I mentioned (channel magnitude, track magnitude) finds the very lowest and highest peak in the track. All it takes is a single sample at fullscale amplitude to make the magnitude hit the ceiling. The rescale is doing exactly what is intended, the problem is determining the "min" and "max" values that would result in a visually pleasing display.

I've played around a bit more with ridiculously expensive shaders now to see what I can divine out of the data by looking at more or less of it, and at best I can get some pessimistic approximations that tend to cut off the biggest peaks by looking at all the datapoints of a smoothed version of the waveform. Below can be seen a lucky example, but it still cuts off things if used to scale the waveform instead of drawing red bars.

(http://zao.se/~zao/seekbar91.png)
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-18 22:48:18
I understand what you're saying, that's exactly what I would have done myself (if I understood shaders of course) : cut off the biggest peaks with a smoothed version of the waveform.
The purpose here is not to have something "close to reality" anymore, but rather to have something "visually pleasing" as you just said. So yes, right now we are on the same page. Yay !

So, based on your new experience with those "ridiculously expensive shaders" (lol  ), will there be at some point some code that you'll be able to share, so I could finally modify my previous code (which I like very much) into something better ?
Thanks again for your time.

PS : still on the visual side, you could choose to limit the displayed waveform amplitude to +/- 0.98 or so, so there would be one or two pixels free at the top and bottom and we wouldn't have a visual impression of clipping. Just my two cents.
Title: foo_wave_seekbar
Post by: Zao on 2014-11-19 13:11:44
I can implement "any" measure envisionable, the problem is that I can't envision a good programmatic measure for "cutting off some peaks, but not some others, kind of".

What you essentially want is a visual analogue of ReplayGain on a heavily downsampled sequence. I've got no idea how to approach that.
Title: foo_wave_seekbar
Post by: wcs13 on 2014-11-19 15:54:05
From my small experience in waveforms and the way they are displayed on-screen, here's what I could humbly suggest :
- Find the number of peaks in a given waveform (let's say the top A% of the waveform, A being configurable, e.g. 5%). Let's call that number N.
- If N < L (L being a configurable limit), then treat them as exceptions/aberrations, so cut them off (don't take them into account for displaying the waveform)
- If N >=L then display everything

Playing around with A and L should to the trick for at least 95% of the waveforms, which is what we're expecting, right ?
Title: foo_wave_seekbar
Post by: Christilut on 2014-12-04 19:49:49
Hi,

I love the seekbar and it's worked great in the past but I've changed my audio server setup to use DLNA.
I can manually click to extract the signature but it won't do it automatically. Am I missing a setting or is this expected?
(I've tested it and it does do it automatically for tracks on my local disk.)

I'm using MiniDLNA (shouldnt matter) on my server and UPnp/DLNA Renderer plugin for foobar.

Thanks for the help
Title: foo_wave_seekbar
Post by: Zao on 2014-12-05 18:13:37
Never really used it, but upnp smells like HTTP transport, and there's a blacklist for automatic scans in the component.
Title: foo_wave_seekbar
Post by: Christilut on 2014-12-05 21:24:50
Alright, so is there no way it can be enabled?
Since it works fine if I manually click a track to extract the signature and it seems to remember it too.
Title: foo_wave_seekbar
Post by: Zao on 2014-12-05 21:40:14
https://github.com/zao/foo_wave_seekbar/blo...essFile.cc#L376 (https://github.com/zao/foo_wave_seekbar/blob/master/CacheImpl.ProcessFile.cc#L376) is the pattern that ends up matching forbidden sources.
https://github.com/zao/foo_wave_seekbar/blo...essFile.cc#L402 (https://github.com/zao/foo_wave_seekbar/blob/master/CacheImpl.ProcessFile.cc#L402) later ignores that test if it's user-requested.

Remote sources in general are not of known duration, particularly as it's the primary delivery method of streams. A carte blanche accept on HTTP streams would result in rather unpleasant results, so I don't really know how to handle this.

To be honest, if you're dealing with expensive sources like networked locations, I would probably lean towards it being only for user-initiated scans.
Title: foo_wave_seekbar
Post by: Christilut on 2014-12-06 11:51:46
Okay I've tried to build foo_wave_seekbar but had some trouble with the dependencies (and the lack of experience with cmake). I wanted to do a quick test to see if it would work if I just ignored that forbidden check.
Anyway, could you maybe make an option so that it still tries to extract signatures from all sources automatically? For my use case it would be fine since I don't use lastfm or anything like that with foobar anyway.
I guess it would be even better if we know what kind of transport it is but I'm not sure how to find that out.
Title: foo_wave_seekbar
Post by: Zao on 2014-12-06 12:21:42
I don't expect anyone to manage to build my source. It requires my CMake-ified foobar2000_sdk, -DFB2K_COMPONENTS=foo_wave_seekbar, and an XP toolset. I don't know if _my_ source is fit for building anymore, it's a bit damaged by experiments.

In any way, it's a bit of a tricky thing. Some of those protocols are banned because they're properly broken while some are just there because automatic scanning would either be expensive (transfer limits on networking) or actively harmful (CDDA making drive eat itself). I'd say it's technically a bug that the plain broken ones can be overridden at all.

People doing CDDA is the reason why the user-initiated override is there at all, as if you have control over it, you can ensure you don't scan while playing.

As for actually solving your problem, splitting the formats into "broken" and "unsuitable", and an advanced pref for overriding would probably be the way.
Title: foo_wave_seekbar
Post by: Christilut on 2014-12-06 14:20:31
Is there anything I can do to help with this?
Title: foo_wave_seekbar
Post by: Dandruff on 2014-12-10 18:54:02
Minor bug:

-> playback a track
-> monitor goes into standby mode during playback
-> track playback finishes (stopped) and monitor still in standby
-> bring monitor out of standby mode

Result: Waveform seekbar showing cursor at the position where monitor went into standby

Expected: No playback cursor shown + "Shade played" section cleared


Win8.1, foobar2000 1.3.3, Waveform Seekbar 0.2.45 (Direct3D)


Can you reproduce this Zao?
Title: foo_wave_seekbar
Post by: Zao on 2014-12-10 20:35:39
Minor bug:

-> playback a track
-> monitor goes into standby mode during playback
-> track playback finishes (stopped) and monitor still in standby
-> bring monitor out of standby mode

Result: Waveform seekbar showing cursor at the position where monitor went into standby

Expected: No playback cursor shown + "Shade played" section cleared


Win8.1, foobar2000 1.3.3, Waveform Seekbar 0.2.45 (Direct3D)


Can you reproduce this Zao?

Haven't tried, I don't run Windows 8, nor any monitor power saving on any of my machines.

On my MBP in Windows 7, with 0.2.33, there is no strange behavior after powersave dim+off of the monitor.
I used stop-after-current to stop after the playing track.

Edit: reproduced with 0.2.45 on the same setup. Yay.
Title: foo_wave_seekbar
Post by: Dandruff on 2014-12-11 16:17:43
Edit: reproduced with 0.2.45 on the same setup. Yay.


Thanks! Easy to fix?
Title: foo_wave_seekbar
Post by: Zao on 2014-12-11 17:27:06
The underlying problem, considering that at some point in time it has worked correctly enough, probably not that horribly hard.
Getting the codebase and the bugfix into a releasable shape? More work.

As it stands now, even if I work off the 0.2.45 branch, my machine can't build a working seekbar without fixing up a lot of things.
Title: foo_wave_seekbar
Post by: Dandruff on 2014-12-11 18:15:07
Ok. No big issue.
Title: foo_wave_seekbar
Post by: wcs13 on 2014-12-16 03:54:05
The idea for this component is awesome, it's a complete must for me and I simply couldn't envision a foobar without it.

However it looks like we're coming to a dead end, because more and more things can't be fixed without a complete rework of the component.
Zao would be the logical choice for that rework, but it looks like he doesn't have any spare time for that, and we are in a sort of status quo that has been going on for several years now.
So, would there be anyone else willing to take on that challenge ?

I'm sorry to say this, but I'm getting increasingly frustrated because this component could do so many more things in a better way, and right now we can only hope for somebody to do it.
I hope you won't find my comment offensive. I have the utmost respect for Zao, but I also would like things to speed up a bit if it were possible.
It's not Zao's fault, but the development of this component besides some bug fixes is now almost non-existent. We need it to evolve in a natural way, just like foobar itself evolves, right ?

Thanks in advance.
Title: foo_wave_seekbar
Post by: Zao on 2014-12-16 08:05:07
wcs13: It's not dead until the title of the forum topic gets an "abandoned/clownware" label. 
I've been spending a decent amount of thought-cycles on responsiveness via analysis pre-emption, and pondering on a friendlier, more composable way of specifying looks lately. I've also done the grunt work of getting it building again fresh from the 0.2.45 branch. I should probably make a write-up of the work on a blag somewhere or something.

As for the things that are not fixed or evolved or worked around, a lot of them are hidden in this thread among tons of support traffic. Significant amounts of booze would be required to look through it all and find the things that are actual actionable things and not already fixed. There's an issue tracker on Github, but I doubt that anyone but bb10 has found it 

In order to attempt to build the component, you roughly need the following:

Do a checkout of zao/foobar2000_sdk; in the foobar2000 subdirectory, check out zao/foo_wave_seekbar. In another directory, do an out-of-source build with:
cmake ^
-DFB2K_COMPONENTS=foo_wave_seekbar ^
-DCMAKE_PREFIX_PATH=Y:\location\of\dependencies ^
-G "Visual Studio 10 2010" ^
Y:\location\of\foobar2000_sdk
Title: foo_wave_seekbar
Post by: Zao on 2014-12-16 09:47:20
I have written a humongous blog post fleshing out the things alluded to in the previous post. Have fun reading through my ramblings.

A new direction for foo_wave_seekbar (http://blog.zao.se/future-directions-for-foo_wave_seekbar/)
Title: foo_wave_seekbar
Post by: wcs13 on 2014-12-17 16:02:31
I've read your blog. Looks awesome. I still have faith.

(http://i58.tinypic.com/167l6w4.jpg)
Title: foo_wave_seekbar
Post by: Zao on 2015-01-11 19:08:48
If you feel overly foolish and/or are insane, there's a test build available of 0.2.45.3. It has HiDPI fixes for Direct2D, significant work scheduling changes and some ability for VIP tracks to override bulk tracks.
Please report back any installation problems, scanning problems, playback problems, hangs, hitches, stutters and other undesirables.

A glimpse of foo_wave_seekbar progress (http://blog.zao.se/a-glimpse-of-foo_wave_seekbar-progress/)
Title: foo_wave_seekbar
Post by: deus-ex on 2015-01-12 16:21:57
Hi Zao,

thanks for providing the opportunity to openly commit oneself to be insane.
Indeed the plugin is quite a lot snappier now, very nice!!
Title: foo_wave_seekbar
Post by: Zao on 2015-01-12 16:59:50
Heh, the phrasing on that percentage parameter is forever confusing.

The frontends have a particular interval between attempts to redraw itself. It's 50ms for GDI, 25ms for Direct2D, and 10ms for Direct3D9.
Expressed in Hertz, this would be an update rate of 20Hz, 40Hz and 100Hz, respectively.

The parameter adjusts this rate. A value of 200% will double the update rate, resulting in a twice as smooth (and costly) display.

As for incremental scans, it's still very rough and half-functioning. Under the covers, it always scans the track incrementally if the flag is on, but the propagation of this result to the frontend is not fully wired up. I need to finish that propagation, and ensure that I do less work in generating an incremental result if incremental results are not desired.

Be happy you're not trying 0.2.45.1, which had 20s UI blocking delays on track change when incremental scans were enabled.
Title: foo_wave_seekbar
Post by: EpicForever on 2015-01-18 17:57:45
Hi Zao,
I have a question if some functionality would be possible in your component.
Let's assume that foobar is running but it is not playing any track - just idling. When you move cursor through the tracks on playlist and you have album art viewer turned on, pictures are changing automatically.
Is this possible that for files that are already scanned and have their signatures, also signatures would be automatically changed similarly to pictures in album art viewer? But only when playback is stopped (and not when it is just paused).
I will not call it feature request. Just a casual proposition that might be implemented if anyone will find it interesting. First of all, the question is if this can be done without turning current code upside down. If too many changes will be required to current structure, then just let it go and forget that I ever asked about it
Title: foo_wave_seekbar
Post by: Zao on 2015-01-18 21:03:01
Indeed.

I've pondered how to make something like what you propose before, as evidenced by the ancient entry in the bug tracker for such a feature (https://github.com/zao/foo_wave_seekbar/issues/16).

It's slightly less impossible with the changes in the scanning backend as present in the test builds of 0.2.45.3 (that's a mouthful, eh?), as I've changed how results from scans are handed back to the requesting party.

What remains to be done is wiring up code to make requests based on selection changes, and set up the ability to shadow the currently showing waveform.

The open questions are things like how to handle multiple selections, if at all. Show it take priority while playing, while paused, or only while stopped. Should clicks on the track start playing it, seek in the track?

Some of those belong in settings. Some of those should not make it in. Some should be implemented. Time will tell if I get around to think it all out.
Title: foo_wave_seekbar
Post by: Brand on 2015-03-27 20:16:23
There's a bug when using GDI for the frontend: playing very short files on repeat causes full CPU load and Foobar freezes...

For example a file like this (https://www.sendspace.com/file/5r4udp) (but it doesn't have to be that short).
Title: foo_wave_seekbar
Post by: Zao on 2015-03-28 02:05:41
Exciting. I'll see if I can get a build up again after my Windows 10 decided to self-destruct.
Title: foo_wave_seekbar
Post by: Zao on 2015-04-06 03:34:41
There's a bug when using GDI for the frontend: playing very short files on repeat causes full CPU load and Foobar freezes...

For example a file like this (https://www.sendspace.com/file/5r4udp) (but it doesn't have to be that short).

I cannot reproduce this problem with 0.2.45 or 0.2.45.4, with neither GDI nor D3D.

What version are you on of foobar2000 and my component?

Edit: Missed the repeat. Now that looks glorious.
Title: foo_wave_seekbar
Post by: askold on 2015-04-07 19:04:33
crash on startup
Quote
Failed to load DLL: foo_wave_seekbar.dll
Reason: Unknown error code (3221225501)

v.0.2.45 from component page
WinXP SP3 Athlon XP (non-sse2)
Title: foo_wave_seekbar
Post by: Zao on 2015-04-08 06:42:58
crash on startup
Quote
Failed to load DLL: foo_wave_seekbar.dll
Reason: Unknown error code (3221225501)

v.0.2.45 from component page
WinXP SP3 Athlon XP (non-sse2)

The slightly experimental 0.2.45.4 (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.45.4.fb2k-component) is built with VS2010 and as such doesn't default to assuming SSE2 presence and may work on your machine..

Amusingly enough, I just used SSE2 explicitly in my development builds to accelerate the GDI frontend. These days, you kind of have to assume _some_ kind of baseline system. I can't wait for the day when 64-bit is mandatory, as I could rely on SSE2 then.
Title: foo_wave_seekbar
Post by: Zao on 2015-04-08 07:24:18
There's a bug when using GDI for the frontend: playing very short files on repeat causes full CPU load and Foobar freezes...

What is your actual use case that encounters this problem?
Are you repeatedly playing the same file, or do you for some obscure reason have playlists full of miniscule tracks, abusing foobar2000 as an ad-hoc tracker?

This is a corner case that incurs a ton of complexity to resolve properly, as I've designed around the use case of reasonable-length tracks. Heck, your 339 sample track will have serious artifacts due to the 2048-bucket approach of the component.
Title: foo_wave_seekbar
Post by: askold on 2015-04-08 21:19:45
Quote
The slightly experimental 0.2.45.4 is built with VS2010 and as such doesn't default to assuming SSE2 presence and may work on your machine


thanks, man - it works
Title: foo_wave_seekbar
Post by: Dandruff on 2015-05-13 15:36:56
Waveform Seekbar 0.2.45

GDI frontend has small visual glitch:

-> start playback of a new track


Result: At the left a vertical blue line remains which goes away when resizing the scrollbar (foobar window). Can be seen best with "Shade played" disabled.



Feature request: Can we have "Shade played" for AudioCD playback in GDI mode? In Direct3D mode it's working.


Thank you!
Title: foo_wave_seekbar
Post by: Brand on 2015-05-13 16:21:17
There's a bug when using GDI for the frontend: playing very short files on repeat causes full CPU load and Foobar freezes...

What is your actual use case that encounters this problem?

I encountered it when opening some drum samples and the playback happened to be on repeat. As I said, it doesn't need to be an extremely short sound, like the one I linked, but maybe even something around 100ms...

I switched to D3D and it's fine. So no big deal for me and it shouldn't affect regular music, just putting it out there.


(Sorry for late reply, didn't see your post sooner.)
Title: foo_wave_seekbar
Post by: Zao on 2015-05-14 18:17:05
Brand: That's great. I should still have some rate limiting to mitigate such runaway trackstarts, but it's nice to see that it's not an legitimate workflow that broke.

Dandruff: I think that I've seen that problem reported before, not quite sure yet if it's a stray position indicator or an offset in update region calcs, if I have those. As for the CDDA thing, never seen that, probably because I don't have any optical drives anymore.

I filed issues for those two things so I can more reliably forget about them.
Title: foo_wave_seekbar
Post by: Dandruff on 2015-05-14 19:21:43
Cool,  thanks!
Title: foo_wave_seekbar
Post by: Dandruff on 2015-05-16 14:23:42
Another small request: Could you add normalized waveform display as default?
Title: foo_wave_seekbar
Post by: Zao on 2015-05-16 17:04:22
The problem with having normalize-to-fit is that without any form of tickmarks or scale indicators, it defeats one of the core purposes of the component, seeing if tracks are quiet or above fullscale.

Not really sure how replaygain compensation fits into things either, I don't remember if that's in the default effect or not.
Title: foo_wave_seekbar
Post by: Dandruff on 2015-05-16 18:37:33
The problem with having normalize-to-fit is that without any form of tickmarks or scale indicators, it defeats one of the core purposes of the component, seeing if tracks are quiet or above fullscale.


Ok, but you could make this optional (checkbox in preferences).


Not really sure how replaygain compensation fits into things either, I don't remember if that's in the default effect or not.


It's not I think. But that's something I wouldn't need personally. I just like to see all the waveforms normalized to 0dBFS. To see if they are quiet or loud I can use my ears or a levelmeter.
Title: foo_wave_seekbar
Post by: Daeron on 2015-05-16 20:15:31
I'd certainly welcome a fit-to-window toggle as well.

My personal usage is to jump between certain (silent vs loud) parts of the current song. I'm not interested in how tracks wage against each other in loudness on an absolute/static scale. Only to gain a quick overview on how the rest of the song looks like relative to the part I'm currently at. Is there a big action section at 3/4 of the song that is otherwise close to silent? I want to see that. If the song is unusually quiet (and consistently so) with the peaks barely spiking out, this actually becomes hard to see as of right now. This is a rare and specific occurrence, just thought might as well mention it.
Title: foo_wave_seekbar
Post by: Dandruff on 2015-05-16 20:24:35
But this would need some type of "compression". Personally I don't need/want this. I just want to see the highest peak of the track at the border of the window (scaled, not compressed).
Title: foo_wave_seekbar
Post by: Daeron on 2015-05-16 20:36:21
I'm talking about simple scaling as well. Maybe my rambling at the end implied otherwise, that wasn't my intention.
Title: foo_wave_seekbar
Post by: Zao on 2015-05-16 21:14:52
I'm starting to remember the horrors of trying to implement a robust and useful normalization in the past.

There are two core problems.

What does one do with waveforms that have a DC bias? Should they scale to absolute magnitude, or so that lowest and highest peaks touch the edge.

A naive scale where a single sample spike is all it takes to push the scale out isn't overly pleasing. How many samples are needed to be considered significant, and how on earth do you compute that reliably?

Experiments with computing bounds from mipmaps in the D3D frontend show no conclusive evidence for any flavor being better than another, so I put it on the shelf forever.
Title: foo_wave_seekbar
Post by: Daeron on 2015-05-16 22:40:16
With a lot of guessing and tinkering, probably. My initial try would be (obviously numbers subject to change):

1) Find highest peak (A0)
2) Find peaks of similar magnitude to A0 within a 10% margin (A1, A2, A3...)
3) Check if step 2 nets at least 3 samples (A1, A2, A3). If not, repeat steps 1 and 2 with A0 = second highest peak, third highest peak, etc. until a sufficient sample group is found.
4) Scale the waveform to the average of A0,A1,A2,A3.

Note that I don't know how the data collection for the waveforms work thus what kind of data is available to work on, so my thought process could be completely wrong. This primitive normalization idea might as well crash and burn the moment you feed it real data, too. I'd need to mess around a lot to find an algorithm that works acceptable enough. Is using ReplayGain values out of question? Would it make any sense for what we are trying to accomplish?

I'd still be curious to test myself how the waveforms look like if you just scale it to the single highest peak and nothing else, by the way.
Title: foo_wave_seekbar
Post by: Zao on 2015-05-18 07:51:01
Analysis takes the waveform, splits it evenly into 2048 segments and for each segments, produces the minimum and maximum value, as well as RMS measure of whatever RMS measures.

The Direct3D frontend has all the information you would ever need available in shaders, as it has both replaygain factors and numeric min/max values of the waveform, I believe. This leads to a problem with the imagined "normalize display" option, as that would either have to mutate the data (affecting all effects in ways that may not expect it) or set an additional flag (which no effects knows how to interpret).

Personally, I consider this generation of the component a bit of an evolutionary dead end that only really exists as a courtesy to XP users, and because I have not made a proper replacement yet without all the freely programmable headaches.
Title: foo_wave_seekbar
Post by: deus-ex on 2015-05-20 16:57:54
Personally, I consider this generation of the component a bit of an evolutionary dead end that only really exists as a courtesy to XP users, and because I have not made a proper replacement yet without all the freely programmable headaches.

Having said that why not declare the current release as the final version of the v2.x branch including WinXP support? Move ahead to a v3.xx branch leaving behind any roadblocks and bottlenecks that are hindering your progress (and probably your enjoyment) in developing the plugin further. Meanwhile WinXP is an fairly old OS, system updates and support by the developer has been discontinued since quite some time. With the release of Windows 10 being very close, there are plans to make WinXP users an attractive upgrade offer.
Title: foo_wave_seekbar
Post by: Zao on 2015-05-20 17:30:50
It'd have to be a new component, as otherwise the autoupdate would clobber 0.2 installations whenever it runs.
While moderately amusing, it's not quite beneficial to keeping legacy users happy.

As work on a new version of the component won't happen until after Windows 10 ships, the situation may have changed by then. My personal guess is that pretty much no XP user will even entertain the idea of migrating, being grumpy luddites.
Title: foo_wave_seekbar
Post by: ProTofik on 2015-05-30 00:32:32
Hi.
Is there any chance you could implement a DPI scaling to this plugin?
Have a look at this screenshot: http://i.imgur.com/ybClXR6.png (http://i.imgur.com/ybClXR6.png)
On my Ultra HD monitor, with windows scaling set to 200%, the waveform is stretched up. This also happens on my laptop with 150% scaling.
Foobar now supports dpi scaling, so does the columns_ui. It would be nice if this plugin did that as well.
Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2015-05-30 22:00:53
Could you please indicate what part of the waveform that you feel isn't right?

Inspecting it in an image program, there are several locations where there are single-pixel features in the horizontal direction.
All gradients are single-pixel accurate as well.

I assume that you are objecting to the many two-pixel wide features in the waveform. These are likely due to that the dataset I store for a track is 2048 data points wide. Whenever you have a horizontal resolution wider than that, there will be duplication between adjacent pixels with the current set of filters, aiming to have the least distortion of the data.

This 2048 sample limit is rather fundamental in the current incarnation of the seekbar, so I will not change that. It may be possible to adjust filtering, but you did not mention which frontend you were using.
Title: foo_wave_seekbar
Post by: ProTofik on 2015-05-30 23:22:39
The front end I am using is GDI. I feel that some columns (not sure how it's called) should be 1 pixel wide, but I can only see 2 pixel wide ones.
Also, the resolution of my monitor is 3840x2160
Title: foo_wave_seekbar
Post by: Zao on 2015-05-30 23:38:32
(http://zao.se/~zao/seekbar96.png)

Note how several pixel columns are 1-wide, while most are 2-wide. This is because your window is wider than the dataset, so most pixels will be sharing data with its neigbour.

As the dataset width is set in stone, the only thing one can do in the frontend is to sample with a different filter from the dataset. All filters have drawbacks, so you'd lose sharp peaks if you went for linear filtering, etc.

(and again, it has nothing to do with DPI awareness... that's all sorted out since the D2D clusterhug)
Title: foo_wave_seekbar
Post by: Echo51 on 2015-06-30 12:41:03


Other then that, i abseloutly adore this plugin.
Title: foo_wave_seekbar
Post by: lvqcl on 2015-06-30 13:08:50
https://en.wikipedia.org/wiki/Moiré_pattern (https://en.wikipedia.org/wiki/Moiré_pattern)
Title: foo_wave_seekbar
Post by: DeadSix27 on 2015-08-03 12:24:24
In the danger of sounding like a idiot, is there a way to normalize the waveform to prevent the "complete fill" of the bar? (Sure is caused by the song being loud there, but yet again in the danger of sounding like a idiot, replaygain can't fix that either. E.g setting it to -16dB for example. Has no effect on the waveform at all)

As seen here:

(http://i.imgur.com/T90AP3U.jpg)
Title: foo_wave_seekbar
Post by: Zao on 2015-08-03 15:22:36
If you are using the Direct3D 9.0c frontend, you can modify the effect to take replaygain into consideration, or add a uniform scale to samples after unbias.
Title: foo_wave_seekbar
Post by: DeadSix27 on 2015-08-03 18:37:12
If you are using the Direct3D 9.0c frontend, you can modify the effect to take replaygain into consideration, or add a uniform scale to samples after unbias.


Well found a variable controlling the max texture rgb i believe, never fiddled with shaders..

Original:
(http://i.imgur.com/dzUJgGe.png)

Edit:
(http://i.imgur.com/HrCutq2.png)
Title: foo_wave_seekbar
Post by: Zao on 2015-08-03 21:43:34
Seems like you didn't break it too much. Probably. 
Title: foo_wave_seekbar
Post by: DeadSix27 on 2015-08-03 22:26:54
Seems like you didn't break it too much. Probably. 


Well I only turned
Code: [Select]
minmaxrms.rgb *= 1.0 + minmaxrms.a;


into

Code: [Select]
minmaxrms.rgb *= 0.6 + minmaxrms.a;
Title: foo_wave_seekbar
Post by: Zao on 2015-08-03 23:35:52
I recommend changing that to:
Code: [Select]
minmaxrms.rgb *= 1.0 + minmaxrms.a; // first unbias
minmaxrms.rgb *= 0.6; // then diminish

or if you're feeling compact:
Code: [Select]
minmaxrms.rgb *= 0.6 * (1.0 + minmaxrms.a); // unbias and diminish


The reason is because as mentioned earlier in this thread, the addition and scale there is to convert from a biased texture format into a balanced -1.0 to 1.0 value.

Your change makes the biased and unbiased formats differ in magnitude, while mine will not. If there's one thing I wish I did different in my original code, it would be to hide this in a function and have a nice customization point for amplitude manipulation.
Title: foo_wave_seekbar
Post by: DeadSix27 on 2015-08-04 07:59:39
I recommend changing that to:
Code: [Select]
minmaxrms.rgb *= 1.0 + minmaxrms.a; // first unbias
minmaxrms.rgb *= 0.6; // then diminish

or if you're feeling compact:
Code: [Select]
minmaxrms.rgb *= 0.6 * (1.0 + minmaxrms.a); // unbias and diminish


The reason is because as mentioned earlier in this thread, the addition and scale there is to convert from a biased texture format into a balanced -1.0 to 1.0 value.

Your change makes the biased and unbiased formats differ in magnitude, while mine will not. If there's one thing I wish I did different in my original code, it would be to hide this in a function and have a nice customization point for amplitude manipulation.


Guess that works too:

Code: [Select]
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
minmaxrms.rgb *= 0.6;


Same as

Code: [Select]
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 0.6 * (1.0 + minmaxrms.a);


(http://i.imgur.com/x4X6st1.png)
Title: foo_wave_seekbar
Post by: lukac on 2015-08-10 13:59:57


(http://i.imgur.com/31wsd4C.png)

thanks, glad to be here.
Title: foo_wave_seekbar
Post by: lukac on 2015-08-11 09:57:09
ok, found it in Columns UI topic, so much stuff there

Waveform Seekbar code for Post #1997 :
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(backgroundColor, highlightColor, factor);
      }
      return c;
}
 
float RMSfactor( float2 tc, float border )
{
      float4 minmaxrms = tex1D(sTex, tc.x);
 
      minmaxrms.rgb -= .1 * minmaxrms.a;

      //- - - - - CHANGES THE OVERALL WAVE SIZE IN THE PANEL - - - - - - - -
      //minmaxrms.rgb *= 0.8 + minmaxrms.a;  <<<<<backup original
        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);

      //- - - - - ENABLE/DISABLE THE INSIDE WAVE - - - - - - - -
      //  [TO DISABLE:  bool insideRms = 0;]  [TO ENABLE:  bool insideRms = diffRms < 0;  <<<<<backup original]     
        //bool insideRms = diffRms < 0;
        //bool insideRms = (belowWave > 0 && aboveWave < 0);
          bool insideRms = (diffRms > 0 && diffRms < 0);
   
      //- - - - - CHANGES LOOK OF INSIDE WAVE - - - - - - - -
      //float factor = insideRms ? ( 1 + 0.2 * saturate(factorRms / border / 2)): 1.0;  <<<<<backup original
        float factor = insideRms ? ( 6 * saturate(factorRms / border / 20)): 10.0;
 
      //- - - - - CHANGES LOOK OF OUTSIDE WAVE & PANEL BACKGROUND - - - - - - - -
      //factor = insideWave ? (factor * saturate(factorWave / border / 1)) : 0.0;  <<<<<backup original
        factor = insideWave ? (factorRms * 6.0 + 0.8 * saturate(factorWave / border / 0.5)) : 0.0;
 
      //return factor;    <<<<<<backup original
        return insideWave - saturate(factorWave);
}
 
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;
}
 
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();
  }
}
Title: foo_wave_seekbar
Post by: Zao on 2015-08-11 12:44:23
Do you people want to know what my biggest motivation is to work on v2? Eradicating that bloody unbias code once and for all.

EVERYONE breaks it by thinking it's just there for the lulz and twiddling the coefficients.
Title: foo_wave_seekbar
Post by: lukac on 2015-08-11 14:58:22
it was not my intention to show disrespect to your work, quite the opposite. i'm sorry if my post caused troubles.
Title: foo_wave_seekbar
Post by: foosion on 2015-08-11 15:47:13
I think Zao is mostly frustrated because the unbias code is a fixed piece of code which has to be included in all configurations. Fixed means that is not intended to be modified. Custom processing can be applied after the unbias operation. Yet many people are not aware of this and think the constants in the unbias code are just additional tuning parameters. Zao has expressed his regret about exposing this implementation detail on several occasions.
Title: foo_wave_seekbar
Post by: lukac on 2015-08-11 16:56:27
Well, if it is for any comfort, i promptly included (as author recommended above) unbias and diminish line (short), instead of original minmax.rms

Thanks, Zao.
Title: foo_wave_seekbar
Post by: mgpai on 2015-08-28 09:37:29
Here's a version of the RMS effect which uses the highlight colour instead of just grey-scaling it. http://pastebin.com/rVfuCDgy (http://pastebin.com/rVfuCDgy)

(http://i42.tinypic.com/4utgti.jpg)


Can anybody please share the code which  can achieve this in 0.2.45

Thanks in advance.
Title: foo_wave_seekbar
Post by: mgpai on 2015-08-28 10:51:43
Cannot edit so sorry for the double post. Was using this with 0.2.40. Does not render correctly in  0.2.45.

Quote
http://pastebin.com/xjQGqEbD (http://pastebin.com/xjQGqEbD)
Title: foo_wave_seekbar
Post by: Zao on 2015-08-28 13:25:12
Code: [Select]
        float4 minmaxrms = tex.Sample(sTex, tc.x);

        // === This block
        minmaxrms.rgb -= 0.5 * minmaxrms.a;
        minmaxrms.rgb *= 1.0 + minmaxrms.a;
        // ===

        // === Must be before this block
        if (replayGain.g != -1000) {
                minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 1.5; //use track gain
        } else if (replayGain.r != -1000) {
                minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 1.75; //use album gain
        }
        // ===


In the linked code, RG correction is done before the mandatory unbias, and corrupts the data.

There may of course be other snafus, but this is a core one.
Title: foo_wave_seekbar
Post by: mgpai on 2015-08-28 14:02:26
@Zao

Works fine now.

Thank you very much.
Title: foo_wave_seekbar
Post by: juniiflow on 2015-09-14 00:09:59
Is it normal for it to lag a little before the song starts? http://a.uguu.se/eafumq_2015-09-13-1908-15.mp4 (http://a.uguu.se/eafumq_2015-09-13-1908-15.mp4)


I think what Wolfbane tried to ask was a way to automatically scale the waveform to fill the entirety of the available space without (or with minimal) clipping, when applicable.

(http://i.imgur.com/wxxufTG.png)

So for songs like the top two, all is good. Some of them however produces waveforms as the bottom three (all of them has RG tags). Those could be scaled vertically to use all space available.

I'm obviously not using the default frontend and don't remember whether it produces similar results, so I could be totally wrong and might have misunderstood Wolfbane as well. It's just something that bothered me personally but never enough to actually address the 'issue'.


(The frontend I'm using, probably taken from somewhere in this topic:)
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;
float3 track_magnitude  : TRACKMAGNITUDE;

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( float2 tc, float cursorPos )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex1D(sTex, tc.x);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;
bool played = cursorPos < tc.x;
float4 inside_color = played ? textColor : highlightColor;
float4 bgColor = backgroundColor;

float4 wave = outside
? bgColor
: inside_color
;

return saturate(wave);
}

float4 reflect_evaluate( float2 tc, float cursorPos)
{
float baseline = -1.0/3.0;
float low_unscale = 3.0/2.0;
float high_unscale = 3.0/4.0;
bool mirrored = tc.y < baseline;
if (mirrored) {
tc.y = baseline - tc.y;
tc.y = tc.y * low_unscale;
}
else {
tc.y = tc.y - baseline;
tc.y = tc.y * high_unscale;
}
float mag = max(-track_magnitude.r, track_magnitude.g);
if (mag > 0.95) {
tc.y = lerp(0, mag/0.95, tc.y);
}
float boost = mirrored ? 1.3 : 1.0;
float gradient = lerp(0.7, 1.0, tc.y);
return boost * gradient * evaluate(tc, cursorPos);
}

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 = reflect_evaluate(input.tc, cursorPos);
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 for sharing
Title: foo_wave_seekbar
Post by: Zao on 2015-09-14 01:55:08
juniiflow: The way the component makes the waveforms is that it decodes the whole track and generates a set of data which the waveform image is drawn from. This takes some time and is around a second or two for a typical lossy track, simply because decoding a track at high speed can only run at like 400-1000x realtime.

In order to avoid doing this too often, the component caches the waveform data between times in a big database in the foobar2000 profile directory. You can trigger these scans manually by selecting some tracks and using the context menu to "extract seekbar signatures".

If the waveform is cached, you will get pretty much instant results.
Title: foo_wave_seekbar
Post by: juniiflow on 2015-09-14 02:37:58
Oh alright, thanks.
which one of these should I use to extract them? didn't really saw an extract option in configuration.
http://i.imgur.com/0ijp0nq.png (http://i.imgur.com/0ijp0nq.png)
Title: foo_wave_seekbar
Post by: Zao on 2015-09-14 03:10:54
The context menu is the one that appears when you right-click, in this case on tracks in your playlist.
If your skin doesn't have context menus anymore, you can bind a key to it under Preferences.
http://imgur.com/kLTN97j (http://imgur.com/kLTN97j)
Title: foo_wave_seekbar
Post by: shakey_snake on 2015-09-14 16:31:47
I took DeadSix27's seekbard shader from above and made it Zao-Rage-Proof. Thought I'd share:

(http://i.imgur.com/0MDH7ku.png)
(I'm using different colors than above, obviously)
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(backgroundColor, highlightColor, 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) * 2.5; //use track gain
  } else if (replayGain.r != -1000) {
          minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2.5; //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 diffRms = abs(tc.y) - border - minmaxrms.b;
float factorRms = abs(diffRms);

//- - - - - ENABLE/DISABLE THE INSIDE WAVE - - - - - - - -
// [TO DISABLE: bool insideRms = 0;] [TO ENABLE: bool insideRms = diffRms < 0; <<<<<backup original]
//bool insideRms = diffRms < 0;
//bool insideRms = (belowWave > 0 && aboveWave < 0);
bool insideRms = (diffRms > 0 && diffRms < 0);

//- - - - - CHANGES LOOK OF INSIDE WAVE - - - - - - - -
//float factor = insideRms ? ( 1 + 0.2 * saturate(factorRms / border / 2)): 1.0; <<<<<backup original
float factor = insideRms ? ( 6 * saturate(factorRms / border / 20)): 10.0;

//- - - - - CHANGES LOOK OF OUTSIDE WAVE & PANEL BACKGROUND - - - - - - - -
//factor = insideWave ? (factor * saturate(factorWave / border / 1)) : 0.0; <<<<<backup original
factor = insideWave ? (factorRms * 6.0 + 0.8 * saturate(factorWave / border / 0.5)) : 0.0;

//return factor; <<<<<<backup original
return insideWave - saturate(factorWave);
}

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 = 3 * 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;
}

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();
}
}
Title: foo_wave_seekbar
Post by: Zao on 2015-09-14 17:30:40
<3
Title: foo_wave_seekbar
Post by: juniiflow on 2015-09-14 20:37:33
The context menu is the one that appears when you right-click, in this case on tracks in your playlist.
If your skin doesn't have context menus anymore, you can bind a key to it under Preferences.
http://imgur.com/kLTN97j (http://imgur.com/kLTN97j)

thanks
Title: foo_wave_seekbar
Post by: ColdChemical on 2015-10-03 06:45:03
First of all thank you Zao for creating such a wonderful component!  I'm a total novice when it comes to shader coding and I was hoping someone here could help point me in the right direction.  What scripting language is being used?  Are there any simple examples that would be easy to break down and dissect? 

Thanks.
Title: foo_wave_seekbar
Post by: Zao on 2015-10-03 20:18:17
The language used is HLSL, Microsoft's shader language for Direct3D 9. There's some documentation on MSDN about what functions there are and some on the syntax of the language.
As it's intended for 3D graphics, I am using it in a bit of a strange manner; more similiar to a full-screen post processing effect like bloom or tone mapping.

The way it works is that you have a pair of triangles covering the whole window pane. Each pixel that the triangles cover is run separately through the pixel shader (PS function in my effects).
The window has two value ranges stretched across it:


The simplest effect reads out the waveform sample for the corresponding part of the waveform, and checks if the current pixel is outside or inside the value, colouring it either with background colour or foreground colour.
The progress bar is drawn by figuring out if the current pixel is before, around, or after the current playback location.

It's a bit backwards compared to how you normally would draw things by putting pixels where you want them, to figuring out for all pixel locations what factors contribute to the colour for that location.
Title: foo_wave_seekbar
Post by: Typhoon859 on 2015-10-25 23:44:48
NO idea how to get it to work.  I'm sure I have all the necessary stuff installed.  I get no errors, but I also don't get anything to show up.  Couldn't find any place to turn it on in a menu.  I didn't see a step-by-step process anywhere, tried Googling it, and I'm sure as hell not going to spend another half an hour just trying to figure out how to get simple component/addition to Foobar's UI to appear on screen.  What are just the simple steps assuming someone has nothing installed to get this to show up?  Simply installing the necessary packages/files does nothing.

I'm on Windows 10 Pro 64-bit btw.  Thanks!

EDIT: Nvm, figured it out.  I needed to go into layout editing mode, create a subdivision, and add it (which in itself wasn't exactly the most straight-forward thing).  I've never done this before.
Title: foo_wave_seekbar
Post by: Zao on 2015-10-26 08:25:40
Nice to see that you figured it out.
I believe I've outlined in older posts in this thread somewhere, and possibly in the first post as well.
The HA wiki entry also mentions this towards the "Troubleshooting (http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Components_0.9/foo_wave_seekbar#Troubleshooting)" section.
Title: foo_wave_seekbar
Post by: _Stevie_ on 2015-12-05 17:06:10
Hey all,

been using this component in D2D mode for a while now. Since DX never worked.
I have no idea what the problem is. I have an ATI 3450 card, which has pixel shader 4.1 and is definitely a DX9 card.
The DirectX runtimes are installed as well and when I check the configuration the selected frontend is "Direct3D 9.0c".
However, the graphics in the seekbar look very similar to the GDI. Clicking the "frontend button" doesn't do anything either.
Therefore I edited the seekbar.fx manually but with no result. The graphics stay the same. Any idea what the culprit could be here?

Cheers and thanks,

Stevie
Title: foo_wave_seekbar
Post by: Zao on 2015-12-05 20:58:26
All the configuration is stored inside the UI element instances themselves, and the initial effect comes from a DLL resource.
Any stray "seekbar.fx" files you have are probably from some early version or from some misguided theme.

As for the failure to open the frontend configuration dialog, it's probably the Scintilla control breaking due to multiple deregistration of window classes.

As for what you can try to do to diagnose/fix it, see if the thing works in a new fresh portable installation, without possibly conflicting components.
Title: foo_wave_seekbar
Post by: _Stevie_ on 2015-12-06 03:38:33
Hey Zoa! Thanks so much, it now works indeed. Did a complete re-install and that did it!
Title: foo_wave_seekbar
Post by: _Stevie_ on 2015-12-06 03:53:19
Found the culprit. It's the foo_uie_wsh_panel_mod. When removing it, Seekbar works also in DX mode!
The version was form 2010 by the way. I'll check for a newer one.
Title: foo_wave_seekbar
Post by: marc2003 on 2015-12-06 07:47:32
WSH panel mod v1.5.6 from 2012 works fine with this seekbar component.

https://code.google.com/p/foo-wsh-panel-mod/downloads/list (https://code.google.com/p/foo-wsh-panel-mod/downloads/list)
Title: foo_wave_seekbar
Post by: Zao on 2015-12-06 13:34:50
marc2003: Does that version of foo_wsh_panel_mod attempt to mitigate the Scintilla window class problem, because I don't think I do.

The core problem I and foosion ran into in the past was that Scintilla when failing to initialize multiple instances of itself, it unregisters the window class of the previous instance, breaking both.
The recommended workaround from the authors link here (http://sourceforge.net/p/scintilla/bugs/1639/) is to embed a manifest and use isolation-aware LoadLibrary, but I could never be arsed to get that working with foo_wave_seekbar.

Bonus fun is had from the foobar2000 order for loading components being indeterminate.
Title: foo_wave_seekbar
Post by: marc2003 on 2015-12-06 16:40:01
Yes it does. The scintilla source code has been modified here...

https://code.google.com/p/foo-wsh-panel-mod...lobal-class#106 (https://code.google.com/p/foo-wsh-panel-mod/source/browse/win32/ScintillaWin.cxx?repo=scintilla&name=no-global-class#106)

The component's resource.rc file was then updated here...

https://code.google.com/p/foo-wsh-panel-mod.../resource.rc#53 (https://code.google.com/p/foo-wsh-panel-mod/source/browse/foo_uie_wsh_panel_mod/res/resource.rc#53)
Title: foo_wave_seekbar
Post by: Zao on 2015-12-06 19:59:00
Ah, I guess it's easier if you static-link it. I've got mine as a DLL mostly due to wanting to reuse it between multiple frontends. Sadly that leads to ambitious end-users replacing the DLL.
Title: foo_wave_seekbar
Post by: foosion on 2015-12-06 20:42:07
By the way the unregister-after-failed-initialization bug was fixed in Scintilla 3.5.1.
Title: foo_wave_seekbar
Post by: _Stevie_ on 2015-12-07 01:23:35
Zao, is there a way to "normalize" the waveform, no matter how soft or loud the track is? I just want to have a detailed view of the waveform.
Title: foo_wave_seekbar
Post by: Zao on 2015-12-07 08:24:22
If you are using the current (0.2.45.*) version, there are two semantics exposed to the Direct3D9 effect that may be of use.

TRACKMAGNITUDE and CHANNELMAGNITUDE both contains the most negative peak (X), most positive peak (Y) and highest RMS value (Z).

You'd declare them much like the seek position and the other data up top.
Code: [Select]
float4 mag : TRACKMAGNITUDE;


As for something built-in that sneakily normalizes behind the back of frontends, nope, no such thing.
Title: foo_wave_seekbar
Post by: _Stevie_ on 2015-12-08 01:02:56
Thanks Zao!

I took the example from this post here https://www.hydrogenaud.io/forums/index.php...st&p=855915 (https://www.hydrogenaud.io/forums/index.php?showtopic=77490&view=findpost&p=855915)
Worked perfectly!

Whereas, I just realized that there is no "magnitude" in the script, however it still works. Apparently this is due to the fact, that my old script did not take ReplayGain into account
Title: foo_wave_seekbar
Post by: Dexter_prog on 2015-12-09 13:07:52
This may be a silly question, but is my GPU supposed to be running at full-speed (clocks to the max, like if I was in-game) while using D3D or D2D (GDI doesn't produce this)? It's a GTX 970
Title: foo_wave_seekbar
Post by: Zao on 2015-12-09 13:14:34
If your drivers follow the popular belief that there's two kinds of workload "lightweight 2D" and "3D", you're likely to get clocks corresponding to the latter as my component both increases timer precision and rapidly draws up to a configurable framerate cap. As for Direct2D triggering it, the underlying technology behind the MS curtains is a Direct3D.

I don't know what the detection triggers on.
Title: foo_wave_seekbar
Post by: Dexter_prog on 2015-12-09 13:32:58
If your drivers follow the popular belief that there's two kinds of workload "lightweight 2D" and "3D", you're likely to get clocks corresponding to the latter as my component both increases timer precision and rapidly draws up to a configurable framerate cap. As for Direct2D triggering it, the underlying technology behind the MS curtains is a Direct3D.

I don't know what the detection triggers on.


Oh, I see. I MAY have found a workaround. I created a profile under Manage 3D settings for nvidia's driver and particularly, there is an option called "Power management mode", which many gamers suggest as setting to "prefer maximum performance" for gaming. I changed this so that Foobar uses "Adaptive" and now it isn't clocking to the max of my GPU:

(http://i.imgur.com/Rng6CoZ.jpg)

(this is as compared to having my clocks at the max: 1114/1753 and thus the temp at about 60 °C
Title: foo_wave_seekbar
Post by: Zao on 2015-12-09 14:29:16
Clever.
Title: foo_wave_seekbar
Post by: leonardofree on 2015-12-21 18:56:47
Can you give me old versions of Waveform Seekbar ?
Title: foo_wave_seekbar
Post by: leonardofree on 2015-12-21 20:27:05
Can you give me old versions of foo_wave_seekbar ?
Title: foo_wave_seekbar
Post by: Zao on 2015-12-21 22:04:39
Maybe. Why do you feel you need one?
Title: foo_wave_seekbar
Post by: leonardofree on 2015-12-22 12:31:08
I want to check them.Please give me
Title: foo_wave_seekbar
Post by: Akel on 2015-12-22 23:04:06
Would it be possible to make the waveform check for replaygain info and act on it?
Because I hear a lot of music in midi, and is rather common for midi to need at least +5 db, often 10, and the waveform is nearly invisible, as can be seen in http://i.imgur.com/hk3Wcdj.png (http://i.imgur.com/hk3Wcdj.png) , making it esentialy useless.
Title: foo_wave_seekbar
Post by: Zao on 2015-12-22 23:06:39
If you're using the Direct3D9 frontend, it's possible to modify it according to previous posts in this thread to honor replaygain or rescale to max-peak.
For the other frontends, no such thing.
Title: foo_wave_seekbar
Post by: Akel on 2015-12-23 00:45:20
Ah, so I just add
        float4 minmaxrms = tex.Sample(sTex, tc.x);

Code: [Select]
        // === This block
        minmaxrms.rgb -= 0.5 * minmaxrms.a;
        minmaxrms.rgb *= 1.0 + minmaxrms.a;
        // ===

        // === Must be before this block
        if (replayGain.g != -1000) {
                minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 1.5; //use track gain
        } else if (replayGain.r != -1000) {
                minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 1.75; //use album gain
        }
        // ===

to the frontend settings? Or that code was the broken one?
I don't want some fancy schmancy 3D seekbar with bloom, x16 antialiasing and a little kitten in a corner, just the default one responding to RG info. so just grabbing some random one isn't especialy atractive for me.
Title: foo_wave_seekbar
Post by: Dandruff on 2015-12-25 02:25:06
If you're using the Direct3D9 frontend, it's possible to modify it according to previous posts in this thread to honor replaygain or rescale to max-peak.
For the other frontends, no such thing.


Why not making this the default (at least for the Direct3D9 frontend)? RMS display too.
Title: foo_wave_seekbar
Post by: Zao on 2015-12-25 07:33:38
Partly because the non-replaygain display came first.

Changing the default effect would mean having to figure out how to update existing saved effects or leave them be, having a split in what "default functionality" is between users that has touched settings before, and those who have not. New installations would have a different look than old ones, and support load would increase.

There is also the question what to do about unconfigurable frontends like D2D and GDI, as those sorts of knobs kind of need to be global across them all.

Nothing intrinsically prevents a half-arsed change, or a substantial change with care, but it's nothing that interests me. This component is an evolutionary dead-end and I have no will whatsoever to work on it. Building with an XP/wine compatible toolset is getting harder and harder, the D3D9 SDK and redist doesn't install cleanly anymore, and the structure with multiple frontends means thrice the effort to do anything.

I've been playing around with a successor, but it's properly Hard to make something that while suitably powerful still works in the minds of the users. Shader code while sufficiently powerful, has been proven to not be understandable by mortals.

TL;DR: Had I got remaining hoots to give, it'd be solved.
Title: foo_wave_seekbar
Post by: San_dr on 2016-01-03 14:14:02
Zao, and I can knock the chisel? ))  My knock Here's why: I like this informative plugin. But in the case of streaming radio do not need it. Can I create one that in this case it collapses the window itself along the vertical coordinate to a few pixels? (Well, at least in Direct3D9)
Спасибо! (Thanks!)
Title: foo_wave_seekbar
Post by: Zao on 2016-01-03 15:57:03
What kind of UI splitter/container do you have the element in? It's possible that it already supports switching layouts based on the kind of track.
I don't know if it's possible for a UI element to constrain its size for layout purposes, sounds like it would be hard for the UI plugin to do layout then.
Title: foo_wave_seekbar
Post by: San_dr on 2016-01-03 16:39:04
I want it to be implemented in a DUI. In the window Waweform probably already can obtain the switching condition - Foobar is on, but the metadata do not act - and then switch the event to happen. Usually topology use Waveform - he is at the top of the playlist, and will cause the collapse of the expansion y- coordinates playlist up. I am not a programmer and I can only express wishes )))


I thought that it can be implemented as an option with a checkbox in the settings


Title: Re: foo_wave_seekbar
Post by: incifinci on 2016-01-30 18:34:06
Thank you for an excellent component!
I beg all's pardon, did not read all 77 pages. :D So, maybe, my idea will a repeat: to have a (right click?) menu item: "Refresh THIS waveform".
Appereantly I expected, that have some song files with long silence in the end. I search for them, looking at waveform, then trim them in Audacity. But after triming, waveform remains the old.
Title: Re: foo_wave_seekbar
Post by: Dandruff on 2016-01-30 18:36:54
Thank you for an excellent component!
I beg all's pardon, did not read all 77 pages. :D So, maybe, my idea will a repeat: to have a (right click?) menu item: "Refresh THIS waveform".
Appereantly I expected, that have some song files with long silence in the end. I search for them, looking at waveform, then trim them in Audacity. But after triming, waveform remains the old.


Rightclick file -> Utilities -> Extract seekbar signature
Title: Re: foo_wave_seekbar
Post by: incifinci on 2016-01-30 19:57:38
Yes, thank you! I found it now, too. :) But "remove", instead of "extract".
Title: Re: foo_wave_seekbar
Post by: Coreda on 2016-02-02 05:04:23
Here's a version of the RMS effect which uses the highlight colour instead of just grey-scaling it. http://pastebin.com/rVfuCDgy (http://pastebin.com/rVfuCDgy)

(http://i42.tinypic.com/4utgti.jpg)

Can foo_wave_seekbar be configured to have both a different elapsed waveform and background color than the remaining section? I could only get this script to do one or the other at a time.

Example from AIMP's 4.0 skin:

(http://i.imgur.com/VnlKway.png)

I'm also looking for a way of having a completely flat waveform, rather than the dual shaded style it has currently. Any ideas?
Title: Re: foo_wave_seekbar
Post by: dinodisc on 2016-02-13 14:25:18
I'm also looking for a way of having a completely flat waveform, rather than the dual shaded style it has currently. Any ideas?
Here is the one I use, "inverted" colors.
(http://i.imgur.com/tL7SBZp.png)
Based on the same post you refer too.
Made with help of some forum members earlier in this thread.
Here is the code: Spoiler (click to show/hide)
Maybe you can improve it, I am curious  ;)
Title: Re: foo_wave_seekbar
Post by: Tallanted on 2016-02-13 17:08:48
Have been searching on and off for over a year now and can't find a solution for this. Almost every time i load a new track the waveform seekbar doesn't load with the track and in order to see it i have to press play for the track again. Has there been a solution for this? I have only ran it on Windows 8,8.1 if that makes a difference.
Title: Re: foo_wave_seekbar
Post by: Daeron on 2016-02-14 00:38:16
Almost every time i load a new track the waveform seekbar doesn't load with the track and in order to see it i have to press play for the track again.
Tracks must be analyzed first to build the waveform data which will be shown via the seekbar. This takes some time depending on your hardware, You don't have to restart the track, it will show up when it's finished. Tracks scanned earlier are saved and should show up immediately. You can also highlight all your tracks, right click and select 'Utilities/Extract seekbar signature' or choose 'Library/Waveform Seekbar/Rescan all waveforms' from your menu to mass scan your library.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-02-14 01:33:03
There was/is a bug with some frontends where it doesn't show the image until reopening the track, but I thought that was for most purposes solved by now. Pre-scan your tracks as Daeron recommends or use a frontend where it doesn't happen.
Title: Re: foo_wave_seekbar
Post by: Tallanted on 2016-02-14 17:01:45
Thanks the mass scan sounds like a good idea, I didn't realise that it actually remembered previously scanned tracks only noticed when it needed reloading, the reloading may have only been for 1 or 2 hour long mixes as i can remember it getting half way through these mixes and still not showing the waveform.
Title: foo_wave_seekbar & Windows 10
Post by: attachmentDownload on 2016-02-22 18:26:01
I'm not sure I'm really the only one in here with a Windows 10 question, but search didn't bring anything up:

My nice looking seekbar turned fugly after switching (clean install) to Windows 10. It won't allow me to install DX3D, so I'm stuck with D2D or GDI. Is that true?!
Title: Re: foo_wave_seekbar
Post by: marc2003 on 2016-02-23 04:24:22
From the first post...

Links:
The Direct3D 9.0c mode requires the DirectX end-user runtime dated earliest February 2010, which can be installed through use of the DirectX end-user Runtime Web Installer (http://www.microsoft.com/downloads/details.aspx?familyid=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en) (make sure to not accidentally install the Bing Bar they try to force on you).
Note that the DirectX redistributable is required on all OSes no matter whether you think you "have DirectX installed already, lol" or not.

The above link might work if you're on windows 10. It should link to directx runtimes but as I'm on windows 8.1, it redirects me to a windows 10 download page instead. :/

Title: Re: foo_wave_seekbar
Post by: Coreda on 2016-02-23 05:00:05
Here is the one I use, "inverted" colors.
(http://i.imgur.com/tL7SBZp.png)
Based on the same post you refer too.
Made with help of some forum members earlier in this thread.
Here is the code:

Maybe you can improve it, I am curious  ;)

Thanks, didn't see your reply (I wish the Mentions tab of the forum would highlight quotes, too).

It's a tricky request for the limitations of the component. This formatting seems to exclude the Highlight Color, replacing it with the inverse of the Background/Foreground. Interesting script. I do like that it displays the wave form as a solid color, will see if I can fiddle around with it :)
Title: Re: foo_wave_seekbar
Post by: attachmentDownload on 2016-02-25 07:45:56
The above link might work if you're on windows 10. It should link to directx runtimes but as I'm on windows 8.1, it redirects me to a windows 10 download page instead. :/

Nope, it redirects me to a W10-downloadpage as well. And when I try to install DirectX 3D manually it says it won't install on W10.
Title: Re: foo_wave_seekbar
Post by: marc2003 on 2016-02-25 12:11:27
So Microsoft are hijacking their own links to force windows 10 down the throats of people already running windows 10? That's brilliant.

The full redist should install on windows 10.

https://www.microsoft.com/en-gb/download/details.aspx?id=8109
Title: Re: foo_wave_seekbar
Post by: GeSomeone on 2016-02-26 12:53:43
The full redist should install on windows 10.
Maybe, but the page just says:
Quote
Supported Operating System

Windows 7, Windows Server 2003 Service Pack 1, Windows Server 2003 Service Pack 2, Windows Server 2008, Windows Vista, Windows XP Service Pack 2, Windows XP Service Pack 3
Title: Re: foo_wave_seekbar
Post by: marc2003 on 2016-02-26 13:55:24
Well windows 8.1 isn't listed either but I know it installs on that. And if it didn't work on windows 10, I'm sure someone would have reported it before now.
Title: Re: foo_wave_seekbar
Post by: juniiflow on 2016-03-06 17:04:28
weird.. it's only using the background..

(http://i.imgur.com/UW8hk1H.png)

This is on columm UI
Title: Re: foo_wave_seekbar
Post by: juniiflow on 2016-03-07 03:01:22
Since I can't edit my post, the plugin seems to work now, I re-installed DX9 a couple of times and now it works.
Title: Re: foo_wave_seekbar
Post by: Pollux88 on 2016-03-16 22:29:44
Love this plugin. The only thing I'm missing is a floating tooltip *before* you click on the seekbar.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-03-17 09:36:55
Only thing? You must not have looked that deeply then :P
In any way, I don't remember if I tried on-hover tooltips and ruled them out due to stealing input, or if I never tried. It has a likelyhood of interoperating poorly with scroll-to-seek.

Don't have your hopes up for a release with new features, I cannot compile the component anymore due to not having the extremely ancient toolchains around anymore. Not overly keen on breaking compatibility for the wretched souls that insist on running XP with auto-updates.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-15 19:25:32
I have just installed this plugin for the first time and I LOVE it! Thank you so much Zao! :) :) :)

I am very happy with it, but there are just 6 things I would like to be able to do which I can't do:

1. First and foremost, I really don't like how the highlighting works: it blends two colors together, which gives unpredictable results. I want to be able to specify a solid highlight color of my choice, so that the two sides of the playhead are totally different colors. I appreciate this might not be possible.

2. I want to resize the bar to make it much taller, but I can't do this. Currently it's fixed at a very thin height. Is it possible to resize it? (I use Columns UI, could this be why I'm having problems?)

3. Also I would like to be able to turn off the "white" in the middle of the waveform. The white doesn't fit in with my color scheme at all.

4. Also I would like to be able to change the width of the playhead line - it's too thin in my opinion.

5. I would like to be able to turn off the playhead line. If I can choose two totally different colors either side of the line, I don't need a line at all.

6. Also, is there any way to have the plugin scan my entire music collection all in one, so that I will never have to wait for them to generate?

Thank you! :)
Title: Re: foo_wave_seekbar
Post by: Daeron on 2016-04-15 20:15:24
I would suggest reading backwards into the topic and you'll find multiple scripts that change how the waveform looks. Nothing about the playhead specifically, but perhaps you can find something more to your liking.

Is there any way to have the plugin scan my entire music collection all in one, so that I will never have to wait for them to generate?
Either select all your files in foobar and 'right click/Utilities/Extract seekbar signature' or 'Library/Waveform Seekbar/Rescan All Signatures'.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-15 20:55:17
I would suggest reading backwards into the topic and you'll find multiple scripts that change how the waveform looks.
Thank you! :)

Either select all your files in foobar and 'right click/Utilities/Extract seekbar signature' or 'Library/Waveform Seekbar/Rescan All Signatures'.
Thanks again! :) The latter option works, though when I right click, I don't see any "Utilities", I see only Remove/Crop/Sort/Cut/Copy/Add to playback queue/Open containing folder/Tagging/File Operations/Convert/ReplayGain/BPM Analyser/Properties.
Title: Re: foo_wave_seekbar
Post by: Daeron on 2016-04-15 21:04:47
It's possible you turned that part of the right click menu off or that's the default setting. Shift+right click should still bring it up.

You can edit what is shown by default using 'File/Preferences/Display/Context menu', by the way.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-15 21:18:50
It's possible you turned that part of the right click menu off or that's the default setting. Shift+right click should still bring it up.
Thank you so much! :) :) :) That's so helpful. I vaguely remember long ago "tidying up" the context menu, maybe about 10 years ago - so it's my fault that Utilities isn't there! The shift+right click shortcut to see all menu items is really helpful, thank you Daeron.

It seems to be slowly scanning my entire music collection as we speak… shame there's no progress bar but never mind, I'll know when it's done as I'll check tracks near the bottom of the playlist.

I am absolutely thrilled with this plugin! :) This has really made my day! I think I would go as far as to say, without any exaggeration, that this little plugin has made my Foobar experience about twice as good. I think Foobar was only half as good without it. :) I have wanted something like this for years but it didn't occur to me that it was possible as I'm not really a regular here.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-15 21:28:52
Could anyone please tell me how to run a script? I've found the scripts I want to run but can't figure out how.
Title: Re: foo_wave_seekbar
Post by: Shinsekai on 2016-04-15 21:33:57
Click Frontend Settings, delete all the code and paste the shader code you want to use, then apply.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-15 22:02:11
Click Frontend Settings, delete all the code and paste the shader code you want to use, then apply.
I found the "Front End Settings" button, but it is grayed out for GDI and Direct 2D. When I change it to Direct 3D, the button appears, but nothing happens when I click it.
Title: Re: foo_wave_seekbar
Post by: Shinsekai on 2016-04-15 22:19:52
Try to install/update DirectX:
https://www.microsoft.com/en-us/download/details.aspx?id=8109
Title: Re: foo_wave_seekbar
Post by: PeteG on 2016-04-15 22:46:02
@Grand Dizzy
When you are up and running:
4. and 5. Look for positionWidth in the shader script. Some examples:

Code: [Select]
//	float positionWidth = 1.0 * dx;		// standard marker width (slight flicker on my screen)
// float positionWidth = 1.5 * dx; // stable marker width (no flicker)
// float positionWidth = 0.5 * dx; // 0.1-0.9 = blinking marker
// float positionWidth = 9.0 * dx; // bad taste, imho
float positionWidth = 0.0 * dx; // turn off marker
Title: Re: foo_wave_seekbar
Post by: Daeron on 2016-04-16 00:41:10
It seems to be slowly scanning my entire music collection as we speak… shame there's no progress bar.
View/Console. Each scan leaves a note there as I recall. The wavecache.db file in your foobar directory should also grow in size and theres a temporary file probably named similarly as well while the scan is in progress.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-16 03:56:32
Thank you to everyone for the help. Unfortunately I can't get "Frontend settings" to work, even after installing the DirectX update.

Edit: I got it working! :) Stupid me, I hadn't installed Direct X properly.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-16 22:35:18
I am really so happy about this plugin. I have now managed to make the panel larger - instead of displaying it as a toolbar, I displayed it as a panel, which now allows me to resize it :)

But could anyone please explain why waveforms vary so much? Some are perfectly symmetrical, others are asymmetrical. Some are central, others are offset - sometimes so offset that they are right off the edge and you can barely see them. Some are a solid colour, others have bands of different shades, while others have a 'symmetrical' shading pattern. Some are completely blank and look like they haven't been generated. Some fill the entire height of the bar and look really "fat" while others are really small and you can barely see them.
Title: Re: foo_wave_seekbar
Post by: Shinsekai on 2016-04-16 22:47:05
This comes to mind:
(http://www.cdmasteringservices.com/images/Loudness_Race_Graph_1.10.gif)
Can you post a screenshot?
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-16 23:16:06
This comes to mind:
(http://www.cdmasteringservices.com/images/Loudness_Race_Graph_1.10.gif)
That is a good point, but this problem definitely has nothing to do with compression. Half my music collection is not even from commercial CDs. Besides, I would expect the plugin to display in a logarithmic manner like the spectrum analyser, and to use ReplayGain to present all the waveforms at a similar scale. In short, I would always expect a reasonable amount of consistency, and for the whole height of the panel to be occupied by at least some portion of the waveform.

Can you post a screenshot?
Yes, here is a random selection of waveforms from various different songs. (About a third of them were completely blank, so I didn't include them.)

http://i.imgsafe.org/5a67969.png
Title: Re: foo_wave_seekbar
Post by: Shinsekai on 2016-04-17 00:19:12
Try with this:
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;
float3 track_magnitude : TRACKMAGNITUDE;

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( float2 tc, float cursorPos )
{
// alpha 1 indicates biased texture
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) / 25) * 1.6; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 25) * 1.6; //use album gain
}

float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;
bool played = cursorPos < tc.x;
float4 inside_color = played ? textColor : highlightColor;
float4 bgColor = backgroundColor;


float4 wave = outside
? bgColor
: inside_color
;

return saturate(wave);
}

float4 reflect_evaluate( float2 tc, float cursorPos)
{
float baseline = -1.0/3.0;
float low_unscale = 3.0/2.0;
float high_unscale = 3.0/4.0;
bool mirrored = tc.y < baseline;
if (mirrored) {
tc.y = baseline - tc.y;
tc.y = tc.y * low_unscale;
}
else {
tc.y = tc.y - baseline;
tc.y = tc.y * high_unscale;
}
float mag = max(-track_magnitude.r, track_magnitude.g);
if (mag > 0.95) {
tc.y = lerp(0, mag/0.95, tc.y);
}
float boost = mirrored ? 1.3 : 1.0;
float gradient = lerp(0.7, 1.0, tc.y);
return boost * gradient * evaluate(tc, cursorPos);
}

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.3 * dx;

float4 c0 = reflect_evaluate(input.tc, cursorPos);
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();
}
}
(https://i.imgur.com/X6FWtpD.png)
Quiet tracks will appear bigger, loudness war victims will appear small...
Most of my music is classic rock, so i don't care that much. I think it's a good balance.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-17 01:52:40
Try with this:
Who hoo!!!! :) :) :) It works perfectly! :) :) :)

I am so happy with this plugin. Foobar has been my favorite program for the last 10 years, and now my favorite program is SO MUCH BETTER! :) Thank you Zao for this amazing plugin, and thanks to everyone else for the help!
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-20 01:22:00
OK I'm back with more script requests for this wonderful plugin :)

I've made a visual to show my ideas:
http://i.imgsafe.org/bf1c9bc.png

The ideas are as follows:
1. Revert the top and bottom halves to equal height (I prefer it to look symmetrical)
2. Is it possible to have the playback time follow along the playhead?
3. Switch around the colors so that the bottom half is more transparent, making it look like a shadow or reflection at the bottom
4. Can the playhead line be a solid rectangle instead of faded? And can there be a 1 pixel gap at the top and bottom?
5. Finally (and most importantly) can a grid be overlayed over the whole thing? This will give it a sense of texture, detail and fine waveforms, instead of just looking like a big solid block of color.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-04-20 12:50:03
I'm going to post my suggestions in-line with the quotes below, but anything that requires development work on the component itself is way out of scope, as I don't touch this code anymore for reasons outlined earlier in the thread.

> 1. Revert the top and bottom halves to equal height (I prefer it to look symmetrical)

Just tune some numbers in the effect.

> 2. Is it possible to have the playback time follow along the playhead?

With a bunch of work if you had arbitrary texture support in the shader or parametric letters, but not really.

> 3. Switch around the colors so that the bottom half is more transparent, making it look like a shadow or reflection at the bottom

Just tune some numbers in the effect.

> 4. Can the playhead line be a solid rectangle instead of faded? And can there be a 1 pixel gap at the top and bottom?

Just tune some logic in the effect.

> 5. Finally (and most importantly) can a grid be overlayed over the whole thing? This will give it a sense of texture, detail and fine waveforms, instead of just looking like a big solid block of color.

Just tune some logic and numbers in the effect.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-04-20 13:34:53
here's some posts in this thread that might lead to what you want.

https://hydrogenaud.io/index.php/topic,77490.msg677800.html#msg677800
https://hydrogenaud.io/index.php/topic,77564.msg677896.html#msg677896
https://hydrogenaud.io/index.php/topic,77490.msg700690.html#msg700690
https://hydrogenaud.io/index.php/topic,77490.msg701045.html#msg701045
https://hydrogenaud.io/index.php/topic,77490.msg705002.html#msg705002
https://hydrogenaud.io/index.php/topic,77490.msg705262.html#msg705262
https://hydrogenaud.io/index.php/topic,63984.msg829077.html#msg829077
https://hydrogenaud.io/index.php/topic,63984.msg829849.html#msg829849
https://hydrogenaud.io/index.php/topic,77490.msg834712.html#msg834712
https://hydrogenaud.io/index.php/topic,77490.msg837702.html#msg837702
https://hydrogenaud.io/index.php/topic,77490.msg907084.html#msg907084
https://hydrogenaud.io/index.php/topic,77490.msg916190.html#msg916190

But I can tell you upfront that having a grid overlay and playback time showing is not possible.

Can't help you with the other things as I have no clue about Pixel Shader programming and have still not managed to get it to show how I want it myself (and given the answer above mine, it don't look like I ever will be. Like there seems to be a way to have an image as background, and to have it dump the full bar as screenshot but so far not found out how)
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-04-20 14:58:03
You can do the grid effect by using the x pixel coordinate as a lookup into a table of intensities, like:

Code: [Select]
float imap[4] = { 0.3, 0.7, 1.0, 0.7 };
int idx = pixel_x % 4;
float grid_intensity = imap[idx];
color *= grid_intensity;

For the vertical fade component of this, multiplying this with (1.0-abs(y)) or something ought to kind of work.
I've not written D3D9-era HLSL in ages, so take things with a fistful of salt.

When it comes to arbitrary textures my mind is failing but I think that functionality was removed at some point in time due to not being used and being annoying to work with in the code. Screenshots may or may not be in there still, with a hidden command or something. That was a one-off feature for someone.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-20 21:13:14
Thank you both for your help. I'm afraid I know nothing of this scripting language, so I am entirely at the mercy of other people here.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-04-21 04:19:46
like you I'm barely out of the gate and can just manage juggling numbers, which most times does weird unexpected things to the colors and other times by sheer luck comes close to what I hoped, but when it comes to stuff, like putting that Grid code Zao posted in a place where it'll do something meaningful ... he he :) that's already beyond me...
Title: Re: foo_wave_seekbar
Post by: Shinsekai on 2016-04-21 08:07:50
Thank you both for your help. I'm afraid I know nothing of this scripting language, so I am entirely at the mercy of other people here.
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;
float3 track_magnitude : TRACKMAGNITUDE;

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( float2 tc, float cursorPos )
{
// alpha 1 indicates biased texture
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) / 25) * 1.6; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 25) * 1.6; //use album gain
}

float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;
bool played = cursorPos < tc.x;
float4 inside_color = played ? textColor : highlightColor;
float4 bgColor = backgroundColor;


float4 wave = outside
? bgColor
: inside_color
;

return saturate(wave);
}

float4 reflect_evaluate( float2 tc, float cursorPos)
{
float baseline = -1.0/9.0;
float low_unscale = 3.0/3.7;
float high_unscale = 3.0/3.7;
bool mirrored = tc.y < baseline;
if (mirrored) {
tc.y = baseline - tc.y;
tc.y = tc.y * low_unscale;
}
else {
tc.y = tc.y - baseline;
tc.y = tc.y * high_unscale;
}
float mag = max(-track_magnitude.r, track_magnitude.g);
if (mag > 0.95) {
tc.y = lerp(0, mag/0.95, tc.y);
}
float boost = mirrored ? 1.1 : 1.4;
float gradient = lerp(0.7, 1.0, tc.y);
return boost * gradient * evaluate(tc, cursorPos);
}

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 = 3.0 * dx;

float4 c0 = reflect_evaluate(input.tc, cursorPos);
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();
}
}
(https://i.imgur.com/Y84M5s5.png)
Not exactly what you wanted... but it's something :D
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-04-21 10:22:21
Not exactly what you wanted... but it's something :D
Hey that's great, thank you! :) It achieves 1 and 3 of my requests.

I also found I could make the waveform more central by changing the line:
float baseline = -1./9.0;
to
float baseline = -0/9.0;

Though changing this code is all guesswork. None of the codes people post here have any comments in them so it's hard to know what does what. I can't even understand my own code without comments, let alone someone else's!
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-04-21 13:28:43
Yep, although after a while you do get a slight feel for what some parts of the code do or which parts to ignore.

And my own tinkering gave me the surprise of my life yesterday. I suspected there was a possibility but never saw anyone mention this.
I've managed to do something that makes the vertical bar stay static in the middle and have the wave seekbar  scroll to left (with about the same speed as the spectogram.)

I changed this
Code: [Select]
	if (horizontal)
output.tc = float2((input.tc.x + 1) / 2 , input.tc.y);
to this
Code: [Select]
	if (horizontal)
output.tc = float2((input.tc.x + cursorPos*22.5 ) / 22.5, input.tc.y);

this makes the vertical bar very wide so to compensate I changed this
Code: [Select]
	float positionWidth = 2.5 * dx;
to this
Code: [Select]
	float positionWidth = (2.5/20) * dx;
The speed of the scroll can be altered by changing the divisors in the if (horizontal) part. This doesn't affect the vertical bar width much so changing the divisor for the positionWidth too isn't always needed when fiddling with scrollspeed .

Caveat. The resolution of the bar doesn't change to match, the number of samples remains the same for the total length. But hey :) it's still fun to see.

EDIT: I also noticed that there's a difference between Default UI and Columns UI in that to get the same scroll speed in the Default UI, a much lower divisor needed to be used (I went down to about 12.5 to get the same speed as my spectrogram)
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-04-21 14:55:16
couldn't edit anymore but found that scrollspeed with a given divisor is also related to the duration of the track. I don't know if it is possible to compensate for this as I have no idea if the track length is available as variable here
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-05-03 19:37:29
teaser  ;)
Title: Re: foo_wave_seekbar
Post by: PeteG on 2016-05-04 18:53:00
^Really nice teaser, Just_Addict!
Any plans of publishing the fx 'playbook'? I suppose that the grayscale bar is a JS thingy?
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-05-04 21:02:56
There we go, beauty in the hands of the somewhat competent  :))
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-05-05 21:56:58
^Really nice teaser, Just_Addict!
Any plans of publishing the fx 'playbook'? I suppose that the grayscale bar is a JS thingy?
Thank you, and yes, that is the plan. I went out with the wish to try and combine the various effects I found in this and the 'other' topic that it's gotten to the point it might need a little documentation with screenshots to show what it all can look like... as there's by now a fair number of combinations possible, even some that I didn't actually plan for but that just happened in certain combinations.

And that grayscale bar is actually just title formatting in a Columns UI "Item Details" panel. I found some CUI progress bar formatting scripts in the forum that got me going and this came out of it. It'll also be included when I have the fx file ready as I saw someone asking if it were possible to have the elapsed time showing at the vertical bar... so thought I might as well include it as alternative

There we go, beauty in the hands of the somewhat competent  :))
Wow, thanks! :) I consider that a big compliment coming from you.
Title: Re: foo_wave_seekbar
Post by: Whosondephone on 2016-05-14 05:44:00
I seem to be having a problem with some components.  I'm using foo_wave_seekbar with foo_sid.  It is very cool that wave_seekbar will display an image for sid files.  My machine is quite old, I'm running a dual core AMD Opteron @2.4Ghz with PC3200 RAM.  I was getting long pauses during playback running the two together unless the playback buffer was turned all the way up.  So I figured I would take advantage of the feature that will render waves manually.  I assigned the computer to render the 67000+ sid tracks from HVSC.  This went well for almost a month until I started getting crashes.  I would change foo_wave_seekbar.dll file extension.  Load foobar then close foobar normally.  Put the dll extension back and everything chugged along fine for a week until this method stopped working.  Now whenever I load foo_wave_seekbar.dll foobar crashes within a minute of loading.  My wavecache.db file is 1,054,801,920 bytes.  Perhaps it is to large or there is a corrupt file?  Any thoughts?  Most of the wave forms for the sid collection have been rendered.  It appeared about 90% completed.  I'm quite bummed out it came so close.  I suppose I'm asking to much.

Thank you for all the hard work coding this great plugin!
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-05-14 09:48:15
The database should not be a limiting factor, it should be paged intelligently by the sqlite3 code. I've seen multi-gigabyte databases in the wild many years ago.

foo_wave_seekbar remembers the jobs it has yet to finish in a table in the database, so it will attempt to scan them in the background as it runs.

If I had to guess, you've either got a corrupt file, or you've by means of herculean effort triggered some bug in my job scheduling. The crash dump is a bit unhelpful in that regard as there's no smoking gun remaining in the crashing thread.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-05-14 09:55:39
You could try the unreleased 0.2.45.4 (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.45.4.fb2k-component) version, there may be some changes (https://github.com/zao/foo_wave_seekbar/compare/0.2.45...0.2.45.4) (like the anti-corruption one) that may mitigate the problem.
Title: Re: foo_wave_seekbar
Post by: Whosondephone on 2016-05-14 17:56:19
At first there were a couple crashes.  But now system is up and running!  Still scanning and most of the SID files have waveforms!  I took out the msvcp120.dll and msvcr120.dll files when I was having the crashes.  I put them back in and everything is good!  Coincidence maybe?  I'll report back if I get any other hangups or when the SID files are fully processed. Thanks You Rock!!!
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-05-14 23:27:35
I've made a build of foo_sid myself and reproduced some crashes with tracks from the HVSC and foo_wave_seekbar.
Essentially, there seems to be a small window of time when initializing the SID decoder in multiple threads concurrently where it may stomp on itself. Small changes in timing or system load may change how/if this happens on your system.
Title: Re: foo_wave_seekbar
Post by: kode54 on 2016-05-15 00:59:14
I'm going to go out on a limb and say that libsidplayfp uses too much modern C++ for MSVC 2010 to compile properly. I'm not going to bother installing newer Visual Studio just to fix this, so anyone else is welcome to take over this pile of sludge, or switch back to a more ancient SID player, perhaps one that's actually usable on old computers, because this current one probably barely achieves real time on that Opteron.
Title: Re: foo_wave_seekbar
Post by: Whosondephone on 2016-05-17 03:36:16
Working great until I came home this evening.  Crashed.  But came right back after starting foobar normally.  Changed the number of concurrent scanning threads from two to one afterwards as a precaution.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-05-17 09:22:23
The library that foo_sid builds upon appears to be fundamentally unsafe to use in multiple threads, and there appears to be some serious effort needed to unscrew that. At best, a developer can mitigate the problem by serializing the scary parts, but it's not trivial to reliably identify them all.

Whenever there's a scan while playing a sid you run the risk of a crash if timing ends up just right/wrong.

In your scenario, you kind of would want a mode where nothing is automatically scanned and you get to scan things yourself when not playing.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-05-17 22:34:10
Ok, I think I got most kinks worked out now, there's still some areas where it could do with some major optimizing by someone more comfortable with shader code. For me this was a first time experience so no doubt I've done things in ways that could be done simpler or more elegant. Feel free to point those out if you see them.

In short, this effect file combines several of the different effects I found in this and the 'other' topic. I started out with Zao's incredible SoundCloud look and it simply grew from there. Also added some gimmicks of my own, namely a scrolling option, a grid option and colors changing over time. The file is layed out such that certain options can be combined to create various different looks.

I already had posted some teaser screenshots a page or so back, but here's some more.

(http://i.imgur.com/QRkmdcxl.jpg) (http://i.imgur.com/QRkmdcx.gif) (http://i.imgur.com/egqtvCtl.jpg) (http://i.imgur.com/egqtvCt.gif)

The above two should animate, they didn't in the preview so if they don't when the post has entered the forum than just go to the link, image dimensions stay the same.

These are just screenshots and will lead to a larger version (1024x128)
(http://i.imgur.com/NehSAw1l.jpg) (http://i.imgur.com/NehSAw1.png) (http://i.imgur.com/vCnHnTwl.jpg) (http://i.imgur.com/vCnHnTw.png)

The effect file (a measly 1400 lines of comments, defines and some crude code), a html file which describes the options, the above images, and a text file with 4 variations of the ASCII progressbar as was visible below the earlier posted teaser images can be found here (https://www.dropbox.com/sh/g160cm4yg4ui8wl/AACCj6aNJBVjox-jcx9Ka39la?dl=0).

I hope you like it, and as already mentioned, if you see ways to optimize or improve, don't hesitate and share so I can update this one.

PS. If you're a DUI user, be warned that the scrolling option is not as fluent as I hoped. With Columns UI it's prefectly smooth on my box, but YMMV.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-05-18 01:09:15
Woops, completely forgot to mention that in order to enjoy the beauty of the html file, it should best be copied to the wave seekbar component folder so that it can find the magical title formatting css file located in the Foobar2000 program folder. (sometimes the most obvious get overlooked, my apologies)
Title: Re: foo_wave_seekbar
Post by: nickdc on 2016-05-18 09:43:49
Frontend Direct3D 9.0c doesn't seem to work here, any tips? Thanks
Title: Re: foo_wave_seekbar
Post by: Case on 2016-05-19 11:00:00
Working great until I came home this evening.  Crashed.
kode54 released a new version of foo_sid (http://www.foobar2000.org/components/view/foo_sid) which should fix the crashing. I recommend updating as soon as possible.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-05-19 20:48:35
Little preview of things to come to next update of my effect file; embossing.

(http://i.imgur.com/Q4BdRS6l.jpg)
click for larger image (http://i.imgur.com/Q4BdRS6.png)

(http://i.imgur.com/Sb7A4jWl.jpg)
click for larger image (http://i.imgur.com/Sb7A4jW.png)

(http://i.imgur.com/xqreeJHl.jpg)
click for larger image (http://i.imgur.com/xqreeJH.png)
Title: Re: foo_wave_seekbar
Post by: incifinci on 2016-05-23 07:12:43
It seems, that the option for capturing screen is removed now (0.2.45). Really? In this case, please, remove the 3 Screenshot lines from foobar's Advanced settings. I lost 90 minutes for searching of screenshots.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-05-23 11:09:46
Oops.
I don't remember why I removed the GUI parts of rendering screenshots, but it was probably due to some good reason. It was never really an official feature, just a quick hack to debug some issue.

If it's any help (it's not), the code to render them in D3D9 is still there, but there has never been any such functionality for the other two frontends, probably a reason why it never shipped.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-05-23 14:23:19
I could have used that option when making the screenshots of what is possible with my effect file, you've no idea how difficult it was to get the component window to a specific size so I didn't need to rescale the images.
Finally found out which versions still had it but it was lacking functionality that I needed so still couldn't use it
Title: Re: foo_wave_seekbar
Post by: Whosondephone on 2016-05-31 04:50:31
I've hit a wall again crashes at startup.  As far as I can tell almost all of the sid tracks have waveform.  Is it possible to stop the background scanning somehow and keep the scanned waveforms?
Title: Re: foo_wave_seekbar
Post by: kode54 on 2016-05-31 08:43:00
I'm only seeing one crash report from you, from the the 5th of May.
Title: Re: foo_wave_seekbar
Post by: Whosondephone on 2016-06-01 01:14:13
Thanks for the quick reply!  Attached 7zip archive.

Edit:  I didn't realize how far back that archive went.  I also attached the most recent crash logs uncompressed.  On May 30th I was experimenting with the older versions of foo_sid.

Edit2: failure_00000150 is using 1.17 which is more stable than 1.35 for me.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-06-01 08:34:42
Out of curiosity, do you get a Send Crash Report question when you start foobar2000 after it has crashed in this way? Both me and kode54 can see those reports and minidumps then as if by magic.

For removing the job queue, you can download sqlite3.exe, drag the database onto the executable, and type select * from job; to show what tasks are queued, and delete from job; to clear the list.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-01 16:50:21
It's too bad there's not going to be any updates in the foreseeable future because I'm running into a nasty intermittent bug.

While working on my monster fx file it regularly happens that when I hit apply and the effect compiles without errors, the editor reverts to the previous content when opening it again from the dialog. This has caused me to lose what I've done several times already.

This wouldn't be such a problem if;
a: my memory was still good enough to fully remember all the changes I made
b: my math skills would be on the level that I just have to blink and be able to recreate what I did..and they sadly ain't

The damn thing is that I cannot pin it down to a particular chain of events. It just happens when you least expect it and always at a, for me crucial moment like after finally managing to get it to do what I wanted. And because of the mentioned handicaps it takes me about as long to get back what I had before the reset as it took me to find out how to get it to do what I want.

I've tried minimizing the risk by doing all editing outside and copy/pasting into the component editor but that sometimes leads to syntax errors which I then fix within the component editor, hitting apply, close the editor and if unlucky boom! reset on next opening...

I thought at first it might be related to having it living in a PSS frame, but I took PSS totally out of the layout (not even installed anymore) and it still happens. Also the size of the file isn't the cause as I've also had this happen with effect files roughly the size of the default effect.

Wish I could provide more info but as I said, I can't pin down the chain of events.

I also have noticed something else that causes issues in the output. When you play a 5.1 track and let the component downmix it to mono, it seems as if the magnitude values of the separate tracks get added as the resulting waveform develops some major clipping effects when I do this where if I let all 6 channels show, not even a single channel reaches the edges.

PS. PacBard says high, and wants to let you know he can now see ;)

Title: Re: foo_wave_seekbar
Post by: kode54 on 2016-06-01 21:41:47
Latest crash is in foo_dumb, which was updated so many times since your installed version that it's not even funny.
Title: Re: foo_wave_seekbar
Post by: Whosondephone on 2016-06-02 05:06:34
@Zao I did send a few initially (may 5th?) than figured it was redundant.

@kode54 That explains everything.  I'm sorry to drag you into my insanity.  I must have added all sound emulators to the render list. Thanks so much.  Solid work there kode54.  Much appreciated.

@Just_Addict Stress is the worst thing for your health.  Especially when sitting in front of a computer.  I feel you.

I'll update foo_dumb and report back Thank you all for your help and contributions to the greatest audio player of all time.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-06-02 06:44:23
Just_Addict: The editor is stable enough for me to not punch my monitor back when I used it. There's so much suffering in working with any form of non-trivial UI that I just stopped caring about it once it didn't crash everything. The problems of reverting and forgetting are known and nothing I'd ever want to touch again. I just write my shader code in something that has highlighting and saves to file, like Vim, Atom or Visual Studio.

When you downmix 5.1 content to mono, it's downmixed into stereo, which is then averaged into mono. The matrix for that is like this (https://github.com/zao/foo_wave_seekbar/blob/develop/waveform_sdk/Downmix.h#L39):
Code: [Select]
        case 6:
                {       //      { left , right , center    , LFE  , surr-left , surr-right }
                        T l[] = { one  , zero  , sqrt_half , half , sqrt_half , zero       }; left = l;
                        T r[] = { zero , one   , sqrt_half , half , zero      , sqrt_half  }; right = r;
                        break;
                }
Worst-case if you have full-scale signal in all channels you get 1 + 0.707 + 0.5 + 0.707 = 2.914.
You can read back into the archives if you want to see the discussion with some particular soul about the downmixing matrices to use. Anything that's not stereo or mono is going to have some rather coloured view of reality.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-02 11:43:28
@Zao

haha, I recognize that feeling, and like I said, I've started using an external editor myself too.

I read about that down mixing matrix before somewhere in this thread while collecting all the little titbits of useful info you've posted in the past, but must have missed the bit about the coloured view it produces.  No big deal, as I can always opt to just show a single channel instead of mixing them all down into one.

BTW, like I've mentioned before, I'm a relatively clueless when it comes to shader language, I've picked up some just enough to get by with the seekbar but to say that I know what every command does would be a lie. So forgive me if this sounds stupid, but is it possible to refer to the seekbar's output channel as if it were a 2D texture? If so, how would I need to declare this 2D texture?

Not that I have a particular idea in mind but I've been looking at some effect sample tricks to see if I could find anything that I could use for the seekbar and most of these snippets act on a 2D texture, so in my naive mind I was thinking that if I could use the output channel as a texture, it could open the road to new possibilities.

So far I've managed to brute-force a simplistic embossing effect already by running evaluate() a second time to retrieve the color value of the tc to the left, but after finding one of your examples that does an outline using mipmapping with the waveform data 'texture'  (no clue what or how it does what it does but it works) it makes me think I'm doing it the simple (i.e. stupid) and expensive way. I mean, basically what I am doing in the embossing causes the whole effect to be executed at least twice for every tc (I mean in a single pass, I know it runs multiple times per tc otherwise we wouldn't have a moving position bar).
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-06-02 12:48:59
There is just a single pass, which directly results in the output colour. The pixel shader is run many times, once per resulting pixel.
If you want to consider other pixels than the one it's supposed to generate, you need to do the same work with slightly different coordinates to figure out what the result would be for other pixels.

The example code is essentially generating the "2D waveform image" on demand from the 1D waveform texture with a simple and reasonably cheap method:
1) figure out where in the song the pixel is on a scale from 0 to 1,
2) look up min/max values from texture at that offset,
3) figure out where the vertical position of the pixel is compared to those values,
4) make a color based on that.

The naive way to do image-based effects is indeed to produce the contents of multiple pixels and do whatever operation you want to do on them.

You can also treat the input waveform as a table and do some analytic work on it. You could load individual samples near your location and make a line equation from the slope, and figure out where you are compared to that function. You could make a spline from multiple sample points. The sky (and the instruction counts in shader model 3.0) is the limit.

If you had complete control over the program, you could generate a full 2D texture containing whatever values you want, and sample those from future draws, to combine things. I've got some foo_wave_seekbar successor prototypes that do exactly that with varying levels of success.

For the average user, a simple function sampling from the available semantic variables and the 1D waveform texture has been perfectly sufficient albeit a bit corny.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-02 16:15:25
Thanks, I figured as much, it's just that I began wondering if there were better ways to do what I do with the embossing after seeing the outline version. My math skill being close to non-existent made me wonder if I wasn't going about it the wrong way.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-06-02 22:44:33
(http://i.imgur.com/wWi3OoX.png) (http://i.imgur.com/C6bIgfS.png)
It turns out that it's both rather easy and rather hard to make a standalone previewer for seekbar effect files. The tool teased above can compile and render any effect file dragged onto it, and monitors the filesystem for when that file is saved in any external editors.

It's also not quite the same as the actual Direct3D9 frontend, and it's surprising how such small changes in input variables and texture size can have drastic effects on waveforms. For example, I had to go down in size from 8192 to 2048 to be able to render the scrolling ones and the hanging gardens effect.

I recommend not trying sbs-v1.exe (https://zao.se/~zao/sbs/sbs-v1.exe), as it's rather broken and I'll soon lose the attention span.
Title: Re: foo_wave_seekbar
Post by: foosion on 2016-06-03 20:54:48
I recommend not trying sbs-v1.exe (https://zao.se/~zao/sbs/sbs-v1.exe), as it's rather broken and I'll soon lose the attention span.
Nice, even though the rapid animation annoys me.

I don't know who PacBard is but the name reminded me of my old pacman status bar title formatting script. I had created that over ten years ago together with ssamadhi97. It was insane. It was glorious. I no longer have that script.

Well, I wouldn't be writing about it here if I had not recreated it as a waveform seekbar effect.
(https://raw.githubusercontent.com/stengerh/foo_wave_seekbar_effects/master/pacman.png)
Grab it on github (https://github.com/stengerh/foo_wave_seekbar_effects/blob/master/pacman.txt). I know you want it. :D

Is there a semantic for track length? It would be nice to animate pacman's mouth at constant speed.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-04 00:30:08
it's surprising how such small changes in input variables and texture size can have drastic effects on waveforms. For example, I had to go down in size from 8192 to 2048 to be able to render the scrolling ones and the hanging gardens effect.
tell me about it... I've been working on an effect that instead of a waveform acts like a sort of minmaxrms peak meter. But depending on the length of the window in actual pixels, it's response time changes. I figured this has to do with the samples being averaged themselves (so short peaks tend to get averaged away) but have no idea how to correct for this. I suspect I have to fiddle with a virtual viewport size as big as the data set, but I do need to keep the actual viewport size for the static things to get put in the correct locations. So I've given up for now... can't wrap my head around that much math. Already took me a week or two to figure out how to get the damn scrolling effect working....

http://i.imgur.com/WxAcDRO.png


Is there a semantic for track length? It would be nice to animate pacman's mouth at constant speed.
Yes, there is... surprisingly called TRACKDURATION :) There is also TRACKTIME for the current position in the track and REALTIME for a constant ticker. (keeps running)
and  PacBard (https://gist.github.com/zao/2595196) lives here.
I've already been playing with that one and given him an eye and adapted it so he also can do vertical things, but he doesn't bite at constant speed.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-04 03:38:45
Damn, thought PacBard already animated at constant speed but just discovered I'd already had changed the copy I made.
Here's what I changed in Zao's version, I took out the sampler to make him permanent yellow, gave him an eye,
added the constant animation and tweaked some numbers to make edges more sharp
the d.x is from the viewport delta calculation in PS, instead of two single floats I changed that to a float2 d.xy or d.yx depending on orientation.
same with the swizzle in the below code.
Code: [Select]
float4 pac_bar( float pos, float2 tc, float4 c0, float2 d )
{
float4 c  = float4(1.0,1.0,0,0);
float2 vp = horizontal ? viewportSize.xy : viewportSize.yx;
float2 pixel_tc = (float2(pos, 0) - tc) * float2(1, 0.5) * vp / vp.y;
float2 eye_tc   = (float2(pos+d.x*6, 0.45) - tc) * float2(1, 0.5) * vp / vp.y;
float2 pac_tc   = pixel_tc + float2(0.5, 0.5);
if (pac_tc.x >= 0 && pac_tc.x <= 1 && pac_tc.y >= 0 && pac_tc.y <= 1)
{
float2 dir       = normalize(pixel_tc);
float2 pixel_ang = acos(dot(dir, float2(-1,0)));
float2 ang       = 0.45*sin(1000*pos*(trackDuration/200));
c.a  = smoothstep(0.40, 0.45, pixel_ang - ang);
c.a -= smoothstep(0.45, 0.40, length(eye_tc)*8);
c.a *= smoothstep(0.40, 0.39, length(pixel_tc));
}
return float4(lerp(c0.rgb, c.rgb, c.a), c.a);
}
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-04 16:27:58
:) saw I'm not the only one experimenting with fractals.  maybe someone can do something with this as I couldn't come up with a nice color pattern
Code: [Select]
	float maxIterations = 50;

float2 c = tc;
c.x = (c.x-0.665)*3;
float2 z = c;

float4 gl_FragColor = backgroundColor;
for (float i = 0; i < maxIterations; i += 1.0)
{
z = float2(z.x*z.x - z.y*z.y, 2.0*z.x*z.y) + c;
if (dot(z, z) > 4.0)
{
gl_FragColor = tex1Dbias(sTex, i / maxIterations);
break;
}
}
return gl_FragColor;
Title: Re: foo_wave_seekbar
Post by: foosion on 2016-06-04 20:31:21
Yeah, I also have a WSH panel seekbar based on the Sierpinski arrowhead curve somewhere. The hard part was the hit testing to enable seeking. ;)

TRACKTIME works nicely. By the way I managed to implement bump mapping using the ddx and ddy functions to approximate the normal vector. See drawShadedWaveform in bumpmap.txt (https://github.com/stengerh/foo_wave_seekbar_effects/blob/7ddc6ccc1f4fb3c79b8e407c5460aaea4c074af0/bumpmap.txt#L95). Too bad the *_fine variants require shader model 5.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-05 01:02:28
following your idea I made a github account and added some sample seekbar effects as gists in case they might be useful to others.

- an example of a grid (inside, outside, above or below wave) (does not work with pure colors)
- an example of a timescale along top/bottom or the center line
- an example of how to abuse the waveform seekbar as a semi minmaxrms moodbar.
- an example of a minmaxrms peakmeter display (X scale goes from -1 to +1)

https://gist.github.com/just-Addict
Title: Re: foo_wave_seekbar
Post by: PeteG on 2016-06-05 06:59:14
@Just_Addict

Thanks a lot for your new "prototypes". I've not seen time scales implemented before, indeed interesting. And of course thanks for the set of gimmicks fx you recently published.
Sadly, I simply can't figure out how to get the time axis/scale function integrated in your gimmicks set.
It's not a problem to copy the function itself but to get the return value (c0) evaluated is beyond me.
Hopefully you would be so kind to explain how (or perhaps – if the function is 'mature' – integrate it in the gimmicks set)?

Screendump explained
The fx are running at the same time in two popup panels; fbuser's component (http://www.foobar2000.org/components/view/foo_popup_panels) seems ideal when comparing different waveform effects.
For illustrative purposes and as an possible appetizer for others I've activated the time scales as well as the time axis in the upper panel.
The tick sizes have been increased as well for the same reason.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-06-05 07:41:42
I improved the previewer slightly, now you can scrub the position indicator yourself and adjust the waveform aspect ratio.
https://zao.se/~zao/sbs/sbs-v2.exe (https://zao.se/~zao/sbs/sbs-v2.exe)
Title: Re: foo_wave_seekbar
Post by: foosion on 2016-06-05 09:37:41
I have update the bump map effect to use a fine grained normal estimation. The two functions below demonstrate the old and new approach.
Code: [Select]
float3 getWaveformNormalCoarse(float2 tc, float heightScale) {
float height = evaluateHeight(tc) * heightScale;
return normalize(float3(ddx(height), ddy(height), 1.0));
}

float3 getWaveformNormalFine(float2 tc, float heightScale) {
float dx = 1/viewportSize.x;
float dy = 1/viewportSize.y;
float height = evaluateHeight(tc) * heightScale;
float heightX = evaluateHeight(float2(tc.x + dx, tc.y)) * heightScale;
float heightY = evaluateHeight(float2(tc.x, tc.y + dy)) * heightScale;
return normalize(float3((height - heightX) / dx, (height - heightY) / dy, 1.0));
}

Before: using ddx/ddy
(https://raw.githubusercontent.com/stengerh/foo_wave_seekbar_effects/7ddc6ccc1f4fb3c79b8e407c5460aaea4c074af0/bumpmap.png)
After: using finite differences manually and 3x (horizontal) multisampling
(https://raw.githubusercontent.com/stengerh/foo_wave_seekbar_effects/580723f99335db332a7431956300ab5233331b01/bumpmap.png)
Note that I also changed the light color to make it saturate into white. The code for the multisampling is not shown in the code snippet above.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-05 12:55:54
@Just_Addict

Thanks a lot for your new "prototypes". I've not seen time scales implemented before, indeed interesting. And of course thanks for the set of gimmicks fx you recently published.
Sadly, I simply can't figure out how to get the time axis/scale function integrated in your gimmicks set.
It's not a problem to copy the function itself but to get the return value (c0) evaluated is beyond me.
Hopefully you would be so kind to explain how (or perhaps – if the function is 'mature' – integrate it in the gimmicks set)?
Glad you like it :) that function is indeed part of the next update of the gimmicks set. Which hopefully will get updated this week.

PS. BTW. If anyone uses the scrolling option and found it slightly stuttering. go to
File > Preferences > Advanced > Tools > Waveform seekbar and raise the update percentage. Best to try  in steps of say 5 or 10% until it becomes fluent.
Title: Re: foo_wave_seekbar
Post by: PeteG on 2016-06-05 13:10:36
^Ah, good news. I'll keep my clumsy fingers from your code in the meantime. ;D

(Written before your edit)
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-06 16:13:04
I improved the previewer slightly
[...]
You probably are aware of this already, the resize cursor doesn't show when hovering the borders (it can resize, it's just the cursor that don't change) and when I minimize to the taskbar it always dies on Win10
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-06-06 16:52:04
Wasn't aware of minimize problem.

sbs-v3 (https://zao.se/~zao/sbs/sbs-v3.exe) has that fixed, the resize cursor fixed, and (shouldn't matter much now) wall time from program start instead of since system boot.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-06 17:46:35
cool! Thanks :) but you lost me at 'wall time'?
Title: Re: foo_wave_seekbar
Post by: foosion on 2016-06-06 22:32:24
I think Zao refers to how the value for the REALTIME semantic is computed.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-06-06 22:48:57
Right, time as counted by a clock mounted on your wall.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-08 19:50:19
I'm running into an odd situation where component and previewer are disagreeing with each other. In fact they are of opposite opinion.

... how to explain this in short.... images may be the best way...
But first a bit of background. I have a scale function that uses either replaygain scaling or magnitude scaling. Which of the two it uses is controlled by either conditional defines or if both methods end up included, the absence or presence of replaygain info.
In this case the magnitude scaling method is the only one getting used and included. I could post the function but it's a direct copy of your magnitude scaling example so I'm skipping that for the moment.

Now, since magnitude scaling changes the y component of the passed texcoord, I use a copy of the current texcoord to determine where static stuff is involved (e.g. grid, time scale, etc)... and that is also the thing here where the disagreement between component and previewer originates.

on the left, my editor with the previewer below, on the right the component editor with output below.
In both editors the code in question is in the red box. Both editors contain the exact same code (copied straight from external editor to component editor). Originally the first two calls used a dummy texcoord variable because at first I passed the unscaled copy
(http://i.imgur.com/R6h5cIBl.jpg) (http://i.imgur.com/R6h5cIB.png)
As you will probably have guessed, this is part of one of your outline functions.

Since the outline function retrieves it's own samples, I needed it to scale those so that minmaxrms values of each would be scaled equally with the one used to draw the regular waveform.  That is, when replaygain scaling is used.  To make it also work with magnitude scaling I originally passed an unscaled texcoord copy, until I realized that I didn't need to and could just pass the properly magnitude-scaled texcoord and be done with it. However, I had forgotten to change the sample_line function to replace the texcoord variable with a dummy in the third call to the scale function

The code in above screenshot is deliberately creating a logic error by re-using the same tc variable to show how component and previewer disagree when using magnitude scaling (where left,mid,right arguments are ignored). Originally I passed in the unscaled copy of the current texcoord and used dummy tc variables in the first two scale calls. In the above screenshot the component perfectly shows the effect of this progressive scaling effect of 3 successive calls with the same variable by sending the top outline skyrocketing and the bottom outline plummeting like a ton of bricks. The previewer however disagrees.

When I corrected the logic error this is what happened in both previewer and component, each next image has one of the tc variables replaced by a dummy variable.
(http://i.imgur.com/h3E1EQ1l.jpg) (http://i.imgur.com/h3E1EQ1.png)  (http://i.imgur.com/i0OMGgwl.jpg) (http://i.imgur.com/i0OMGgw.png) (http://i.imgur.com/9a08JCWl.jpg) (http://i.imgur.com/9a08JCW.png)

As you can see, the previewer scales the outline up/downwards, but the component does the exact reverse, both however place it correctly when all three texcoord variables are replaced with dummies (since the texcoord is already properly before it was passed to the outline function)

If needed I can put it together in a small sample effect, but am reluctant to post flawed code that might start to go floating around.

With all logic errors removed, both previewer and component agree again, but it looks as if the previewer has a misplaced sign somewhere if it reacts in the opposite way...
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-06-08 19:59:41
Congratulations, my head now hurts trying to read that. :)
A lot of the variables I pass into the effect in the previewer are made up and may not align with what the seekbar proper produces, particularly around replaygain and magnitude information.

Track/channel magnitude is just hardcoded to -1 to +1 in the previewer, so that's utterly unreliable.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-06-08 20:48:39
haha :) I'm making _your_ head hurt?well, that's a change  :) Usually I'm the one cringing when trying to understand what something does.

Ok :) Well as long as they both react correct without the presence of logic errors it's fine by me.
Title: Re: foo_wave_seekbar
Post by: Whosondephone on 2016-06-18 18:16:56
It's been a while now...  Just wanted to report that everything is working for me using the latest versions.  Thank you Zao and kode54.
Title: Re: foo_wave_seekbar
Post by: bpp on 2016-07-02 11:11:46
I'm back here with the same issue, as it hasn't been resolved last time.

Here's a chilled out, relatively quiet track's waveform generated by your plugin. It's called Roger Sanchez - Morning Prayer:
(http://i.imgur.com/5CCmLfm.jpg)

And here is a track with a heavy bassline called Cirez D - In The Reds:
(http://i.imgur.com/AADGtk6.jpg)

The waveform generated for a loud track is much worse in terms of readability than the one of a calm track. When the heavy track drops, all you see is a wide rectangle. I know nothing about mathematics, but it seems like a scaling issue. Please fix.

The frontend I'm using:
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;
float3 track_magnitude : TRACKMAGNITUDE;

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( float2 tc, float cursorPos )
{
// alpha 1 indicates biased texture
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) / 25) * 1.6; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 25) * 1.6; //use album gain
}

float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;
bool played = cursorPos < tc.x;
float4 inside_color = played ? textColor : highlightColor;
float4 bgColor = backgroundColor;


float4 wave = outside
? bgColor
: inside_color
;

return saturate(wave);
}

float4 reflect_evaluate( float2 tc, float cursorPos)
{
float baseline = -1.0/3.0;
float low_unscale = 3.0/2.0;
float high_unscale = 3.0/4.0;
bool mirrored = tc.y < baseline;
if (mirrored) {
tc.y = baseline - tc.y;
tc.y = tc.y * low_unscale;
}
else {
tc.y = tc.y - baseline;
tc.y = tc.y * high_unscale;
}
float mag = max(-track_magnitude.r, track_magnitude.g);
if (mag > 0.95) {
tc.y = lerp(0, mag/0.95, tc.y);
}
float boost = mirrored ? 1.3 : 1.0;
float gradient = lerp(0.7, 1.0, tc.y);
return boost * gradient * evaluate(tc, cursorPos);
}

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.3 * dx;

float4 c0 = reflect_evaluate(input.tc, cursorPos);
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();
}
}

Title: Re: foo_wave_seekbar
Post by: Zao on 2016-07-02 22:12:09
It's likely that your track is brickwalled from the source. It takes a single sample at fullscale within a bucket to peg the whole bucket to the boundary.

The only thing in the component that can be limiting is that it ignores content outside of fullscale (-1.0 to +1.0) due to the texture format used, but if your content is that clipped, you're in for a bad time as it hits the output.
Title: Re: foo_wave_seekbar
Post by: bpp on 2016-07-03 18:15:46
It's likely that your track is brickwalled from the source. It takes a single sample at fullscale within a bucket to peg the whole bucket to the boundary.

The only thing in the component that can be limiting is that it ignores content outside of fullscale (-1.0 to +1.0) due to the texture format used, but if your content is that clipped, you're in for a bad time as it hits the output.
No, every single track that is "loud" looks like this. This is not an issue with a single track. Just see it for yourself please.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-07-03 18:22:53
My claim wasn't that your particular track was broken. My claim was that if you have tracks that are mostly fullscale, you're going to get a predominantly fullscale result.

As mentioned before, the analysis considers every single sample in the slice to determine the extents. I have considered other functions that consider outliers but do not give them extreme importance, but that relies on unbiased songs with a lot of fiddling for low amplitudes.

If you have a case where it misinterprets source audio beyond what's described, feel free to show this with Audacity and a way to get files that reproduce the problem without searching the net for some random release that may or may not reproduce the problem. I've been down that route when someone reports a bug with some obscure weeaboo track no-one can spell, from any number of sources.

The promise of the component was never to give a "true picture" of the song, as you are asking it to interpret many millions of samples into 2048 slices. If you have a better function to determine "min" and "max" when doing such a drastic reduction that works across all forms of songs, including chiptunes and with slice sizes between a few dozen and few hundred thousand samples, feel free to suggest it.
Title: Re: foo_wave_seekbar
Post by: bpp on 2016-07-03 20:47:13
Please have a look at the waveform generated by zippyshare for the same heavy track I posted above:
(http://i.imgur.com/mK99d0o.jpg)

As you can see, it scales properly. I admire your work, but this is a major oversight, the extents calculation seems to be off. If you load it in Audacity, what you need is to discard the dark blue waveform, take the light blue waveform, and stretch it. Same thing goes for tracks that are very quiet. They should have their waveform scaled to fill the space vertically.
Title: Re: foo_wave_seekbar
Post by: lvqcl on 2016-07-03 21:22:18
As you can see, it scales properly. I admire your work, but this is a major oversight, the extents calculation seems to be off. If you load it in Audacity, what you need is to discard the dark blue waveform, take the light blue waveform, and stretch it.

Zippyshare doesn't "scale properly". It calculates RMS. The light blue waveform in Audacity also displays RMS: http://manual.audacityteam.org/man/audacity_waveform.html --
Quote
The dark blue part of the waveform displays the tallest peak in the area that pixel represents. At default  zoom level Audacity will display many samples within that pixel width, so this pixel represents the value of the loudest sample in the group.
The light blue part of the waveform displays the average RMS (Root Mean Square) value for the same group of samples. This is a rough guide to how loud this area might sound, but there is no way to extract or use this RMS part of the waveform separately.

Same thing goes for tracks that are very quiet. They should have their waveform scaled to fill the space vertically.
Why do you think that it should be scaled? Simply because you prefer it?
Title: Re: foo_wave_seekbar
Post by: bpp on 2016-07-03 21:36:22
Quote
Why do you think that it should be scaled? Simply because you prefer it?
For the sake of visibility. It's a suggestion, don't get all feisty. The plugin could incorporate an option for that. Besides, a guy asked for it before me.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-07-03 21:45:24
(https://i.imgur.com/vmU4tof.png)
(https://i.imgur.com/N2xzmqO.png)
(https://i.imgur.com/I3neDnm.png)

There's two factors to interpreting a song. There's the algorithm that reduces a song down into sequences of min/max/RMS values, and there's the display of that cooked data.

You can alter the display to take things like the maximum song amplitude into consideration, as well as honor ReplayGain information which will help you scale the displayed waveform.

There is nothing I can do centrally to get a song that "fills the space" well, as tastes vary greatly. My defaults are set so that you see the waveform, and if you want something fancier, you have RMS and other measures to customize via effects.

All the three images above are from almost the same base data, the bottom two is from foo_wave_seekbar with the default D3D effect and the soundcloudish one you embedded. The topmost one is from a different visualiser which has a bit harsher detail and a slightly larger supporting dataset.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-07-03 21:47:29
One of the major points of the programmable effects in the D3D9 mode is that a user can customize the look and interpretation of the source data if they can squint at shaders and hack around a bit, or get someone that understands shaders to do it for them.

There's so many interpretations and so much vagueness in what you suggest that I cannot come up with an algorithm by myself to capture it all. Checkboxes are not free.
Title: Re: foo_wave_seekbar
Post by: bpp on 2016-07-03 21:52:35
Ok my friend, it was worth a try. I will use the effect with visible RMS. Great work, maybe consider my thoughts for the v2.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-07-03 22:06:44
with all due respect but if all of your loud tracks look like that Cirez D track then you've got a load of tracks that are clipped and no amount of coding is going to rectify that.

Simply ignoring the parts that Audacity shows in dark blue is just fooling yourself. You might as well plug both ears with soundproof cotton wool to get the same effect audibly....

PS. The component was never meant as analytical tool. At best you get a representation of what a full blown professional analyzer will display.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-07-03 22:13:28
Just_Addict: Be optimistic, maybe it's just very dynamically compressed? Looking at the first (minibar) waveform, there's still a wee bit of headroom, not quite clipped. No-one needed those low-order bits anyway.

bpp: You have indeed deduced what I was about to recommend as a concrete solution, use the RMS measure if you want something a bit more representative of the "energy" of the signal, as that's literally what that computes.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-07-03 22:19:34
@Zao

Correct me if I am wrong, but from all my experimenting with replaygain scaling I never could get anywhere with (replayGain.g != -1000). And as far as I know, that is no longer a valid check.


EDIT: BTW. Eric Prydz - Cirez D In the Reds according to Audacity.... wouldn't call this very dynamic compressed...

Title: Re: foo_wave_seekbar
Post by: Zao on 2016-07-03 23:00:31
The song title is accurate at least :D
Title: Re: foo_wave_seekbar
Post by: juniiflow on 2016-08-08 12:36:07
Two question, the link to the DirectX Web Installer is gone, do you mind updating it? I believe is this one?
https://www.microsoft.com/en-us/download/details.aspx?id=35&nowin10
Title: Re: foo_wave_seekbar
Post by: crazyoatmeal on 2016-09-18 02:12:14
Anyone still here? Just installed, but can't add it to the layout. Doesn't appear in the context menu.

 W7 Ultimate, AMD FX8350, MSI GTX970.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-09-27 18:00:32
Zao,
Thank you once again for this amazing plugin! I am so thrilled with it - it makes Foobar so much more enjoyable to use. Thank you so much Zao!

I also have a (minor) request. I often trim the length of my mp3s with the excellent mp3DirectCut (http://mpesch3.de1.cc/mp3dc.html). But whenever I change an mp3, its waveform never updates (unless I rename the file). Would it be possible for the plugin to note the modified date of each song, and update waveforms when a song has been modified? Thank you.

Just_Addict, Foosion, etc.
I noticed you guys are able to draw shapes over the waveform! (Like Just_Addict's "timescale" effect and Foosion's Pac-man!)

Please could someone find a way to achieve what I really want. It looks like this:

(http://i.imgsafe.org/aa1fabe06d.png)

Basically it's a semi-transparent grid of vertical lines in the background color. It makes the waveform less plain and adds the illusion of fine detail. I would also like the "playhead" to be a solid bar if possible, maybe 3 or 4 pixels wide, with 1-pixel gaps at the top and bottom. And then the icing on the cake would be to have the current track position following the playhead, as in my illustration. If any of these things could be achieved I would be very happy indeed. For me, this would make the plugin perfect.
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-09-28 02:13:28
The vertical grid lines is already an option in my version and the width of the play position indicator can be adjusted through a setting barWidth near the top of the effect file.

I've been out of commission the last few months due to a back injury, but I had started creating a wiki before it happened, to try and explain how to use the various settings.

check the Grid section in the wiki for the possible options
https://github.com/just-Addict/seekbar-with-gimmicks/wiki

Currently grid lines are shown with same 'transparency' from top to bottom. But I like your idea of the varying transparency. Hadn't thought of that myself, but I will try and see how easy this would be to implement.

caveat: Some of the documented options don't exist yet in the current released version, but once I feel up to spending more than a couple of minutes behind a keyboard I'll try to push that version out too.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-09-28 16:15:13
Just_Addict,

Thank you! I hadn't noticed your 'Seekbar-with-gimmicks' before but WOW, I love what you've done! So many great options and features, and I love all the detailed comments and documentation, so people can edit it. I think the seekbar plugin needs a "standard" code like this that everyone can use, and I think Zao should make yours the default code (and even add a GUI to change the parameters).

As for my own requirements, your code looks very promising indeed. I need to spend a bit of time looking through the code and figuring out how to do what I want using your very helpful instructions. (At the minute I can't even work out how to change the colour and I'm stuck on the garden colors.)

If you could implement 'varying transparency', like in my illustration, that would be wonderful, even if it's only "top" and "bottom" half.

Also, if you or anyone could figure out how to make %playback_time% appear next to the playhead, like my illustration that would also be great, though this is not essential.
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-09-29 16:17:10
Just_Addict,

I've been playing around with your Seekbar-with-gimmicks script and I absolutely love it! I have now got it to look almost exactly how I want. Thank you so much! :)

Here's a demonstration of how it looks, as well as a few new ideas for features…
(http://i.imgsafe.org/d26557c72c.png)

A few minor issues to mention:

1. I love the Cheezy Magnify effect! It looks amazing, like the waveform is liquid. It's particularly impressive for a short track (like 5 seconds long). However, it only seems to work when "USE_PS_3_0" is turned on, which I can't use as it makes the playhead bar faded at the edges, and I like a nice, solid rectangle.

2. After a lot of experimentation, I found the place in the script where you can adjust the magnification level of the "Cheezy Magnify". I think it would be well worth adding a comment in the script next to this line:
      E = exp(u / 2000); // < - MAGNIFICATION LEVEL!

3. At the very start/end of a track, the magnify effect pushes the waveform off the screen (this is more of a problem with scrolling turned off and a high magnification level). It would be ideal if the start and end of the waveform could not be moved, perhaps that could be achieved by automatically reducing the magnification factor relative to proximity to the start/end?
   
4. I love the 'Crazy Colors'. It is very fun and attractive, though for me it's a little "too much color" to use regularly. However, if you implemented suggestions 4 or 5 in my illustration above (allowing a highlight color that fades out) then I might use Crazy Colors just for the selection/playhead bar, as it wouldn't occupy too much of the screen that way.

5. If you turn on Crazy Colors, scrolling, Cheezy magnification, and set it to zoom really close up, then it makes quite an attractive visualisation (certainly better than Foobar's default spectrum analyser). I don't suppose there is any way to have multiple wave seekbars in Foobar is there? If there was, I might have a small one open just as a visualisation panel. :)

Lastly, just to say that I hope you don't find all these notes/comments irritating! As a designer, I really just enjoy talking about these things and coming up with ideas. But I want to make clear that the above suggestions are only ideas for you to consider; they are not too important to me. I have already achieved what I really wanted to do, thanks to your script, which is to add detail to what was a very plain waveform. And I am SO happy with it! I can't tell you how happy it has made me! :)

I now consider my Foobar experience to be "complete". Between you and Zao, you have made a huge difference to my music-listening life! And by the way, music for me is not just fun - as a musician, I have serious use for Foobar, using it to catalog all my own work, and to compare different tracks, notes, recordings, samples, etc. I just adore Foobar and it is without doubt my favorite piece of software ever. And men like you and Zao have made it even better!

Actually there is one other feature that would complete my Foobar experience, though it's fairly off-topic here: That would be an A-B repeat feature which loops between two points and indicates the selection area on the waveform. I know that is never going to happen, but not to worry! :)
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-09-29 22:42:47
I had to check to be sure, but point 3 in the image (bar following the outline from the inside) works by uncommenting #define INSIDE_BAR. Uncommenting #define OUTSIDE_BAR would of course do the opposite, following the waveform outline on the outside

Also, the '1' pixel space between the top and bottom of the position bar can currently be sort of achieved by using FADING_BAR and setting fade_from and fade_to both to 0.95 or thereabout.  That does not give an exact 1 pixel space but rather a 95% height of the top and bottom part of the bar since height ranges from -1 to 1, so ~0.95 is a reasonably close approximation to a 1 pixel space. I will see if this could be done with it being affected by the actual panel height.

As for the other ideas, I'll certainly look into those as future enhancements as these have given me ample ideas to work with, although I fear the elapsed/remaining time display will probably remain a wish since you cannot easily 'write' text in a shader without some form of  support for external textures containing the pre drawn characters/digits (at least not without some heavy math way above my skillset). My knowledge about coding shaders is far from the point where I could come up with a method to do this without support for external textures.

The best alternative I could see would be adding a (JScript or text?) panel above or below the wavebar displaying a progressbar with textual indicators for elapsed/remaining times.

And regarding having multiple wave seekbars, that is certainly possible. Just add more wave seekbar panels.
Title: Re: foo_wave_seekbar
Post by: Decalicatan_Decalicatan on 2016-09-29 23:27:08
Just_Addict,

Congrats for your  'Seekbar-with-gimmicks' it's really awesome. I have one question about Show_RMS, what do I have to change in your script to have the RMS part (insideRMS maybe ?) darker than the outside part of the wave (such as in the darkone4mod config bu Tedgo for example), I tried to modify your script myself, but without success as I know nothing about this king of programming (HSLS shader?)
Thanks in advance
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2016-10-01 03:16:48
@Decalicatan_Decalicatan

On line 991 change

fg2 = fg1+0.3;  to

fg2 = fg1-0.3;

play with changing 0.3 to make it more or less darker
Title: Re: foo_wave_seekbar
Post by: Decalicatan_Decalicatan on 2016-10-01 12:03:52
@Just_Addict

Thank you!    :)
Title: Re: foo_wave_seekbar
Post by: Lee James on 2016-10-01 21:04:04
Just_Addict,

Thanks for your answers, all very helpful. Your suggestion about the FADING_BAR worked, however, the only way I can get FADING_BAR to activate is to turn on USE_PS_3_0 - and when I do that, the bar fades horizontally, which I really do not want! Is there any way to stop the bar from fading horizontally?

As for the other ideas, I'll certainly look into those as future enhancements as these have given me ample ideas to work with

Thank you very much Addict. As I have said, I am really happy with this now so don't worry too much about my other suggestions. The one I would like the most is a fading grid, like this:

(http://i.imgsafe.org/014e2f24e8.png)

In this example, it fades from 100% to 0% in the top half, then from 25% down to 100% in the bottom half. This seems to achieve the best of both worlds, giving the waveform a sense of texture and detail, without making the color too 'murky'. It also creates a nice line down the center of the wave which makes it more symmetrical. :)

Thanks again! :)
Title: Seekbar not in sync with music.
Post by: mzso on 2016-12-18 12:49:09
Hi!

It looks like the seekbar is seriously out of sync with the music in some cases. I attached the file I noticed it with.

https://drive.google.com/open?id=0ByfdfPvnoDuzc2t4UFYyRXZibjA

(It looks like the forum file attaching is only successful in wasting my time with vague error messages)
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-12-18 20:38:25
It'd be interesting to see in what obscure way your file lies about its duration.
Worst case is that if it cannot be divined from metadata/tags, only thing I can do is to detect deviations and reprocess the whole track.

Not that it matters much, as I've fought for like six hours now to get a build environment up that has all the mehness needed to build something w/ Boost, D3DX9 and XP support.
Title: Re: foo_wave_seekbar
Post by: lvqcl on 2016-12-19 01:00:58
Maybe it's foobar2000 bug?
foo_verifier writes: "Warning: Reported length is inaccurate : 1:19.133605 vs 1:18.206259 decoded"
sndfile-info writes the following info about this WAV file: "Block Align: 1024       Samples/Block: 1012"

1:19.133605 * 22050 = 1744896 samples = 1704*1024
1:18.206259 * 22050 = 1724448 samples = 1704*1012

Probably  fb2k uses 'block align' data to calculate duration while in this case it should use 'samples per block'.

P.S. Why keep XP support?
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-12-19 01:45:21
lvqcl: So it might not necessarily be "my fault", yay!

Regarding XP, the core problem is that there's an unknown number of people, however small, that will be highly inconvenienced if I push a new breaking version onto the updater. If they accept the (defaults to checked) update, their component breaks and they need to seek out an older version from one of my websites. This will be a stumbling block for all future update checks.

There's plenty of reasons to run XP still, like living in areas with limited purchasing power, car/media PCs, pure stubbornness, incompatible drivers/hardware.

Sadly there's no path I can take with the current incarnation of the component that would get me out of this pickle, apart from forking it and promoting the new version. I've kind of got the "minibar" software-only re-implementation down that path, but that's not designed for actual users.

I'd also like to nuke D3D9 in lieu of D3D11 or OpenGL, but that would break things for _everyone_ in a similar manner.

In the end, I'm reluctant to making any major changes unless I've got some actual new functionality that would warrant it. Breaking some/all users for a bugfix of a niche ADPCM use case sounds like a bad idea :D

Suggestions welcome if there's some obvious way forward I've missed.
Title: Re: foo_wave_seekbar
Post by: deus-ex on 2016-12-19 09:28:47
Hello Zao,

the current foo_wave_seekbar.dll release already offers two different front ends for Direct2D and Direct3D, each requiring an individual external DLL included with the plug-in distribution. With regards to that I see no issue in adding additional render paths to the plug-in. Also a new/different program logic (i.e. Wave_Seekbar v2.0) could be issued either within the same DLL or by adding an additional DLL to the distribution. The user can choose from the different plug-in code bases (v0.2/1.0/2.0) and render paths (D2D/D3D9/D3D11) from the plug-in options dialog, defaulting to v0.2/D3D9 ensuring support for the XP platform.

And yes, the other logical way indeed is to offer a new Wave_Seekbar plug-in distribution with a different name to distinguish it from the original release. For example the new version could go by the name "Wave_Seekbar_D3D11" or Wave_Seekbar_Next", for the old release a slight change of the name to "Wave_Seekbar_D3D9" or "Wave_Seekbar_Legacy" might be worth a thought should you release another update of the original component.
Title: Re: foo_wave_seekbar
Post by: lvqcl on 2016-12-19 10:00:46
P.P.S. or maybe foobar should take number of samples from 'fact' chunk? I'm not sure about correct way to deal with compressed WAVs.
Title: Re: foo_wave_seekbar
Post by: Zao on 2016-12-19 14:26:33
lvqcl: I've escalated the problem with your particular file to core, seems like your file is one of the rare truthful WAV+ADPCM files.

deus-ex: Sadly there's architecture constraints prohibiting where you put foobar2000-specific services. In short, everything that uses the SDK needs to be fully contained in the component DLL, and a fb2k-component should ship with only one component DLL.
In order for Windows XP to load and run a DLL, it and all its directly loaded dependencies needs to be built with a legacy toolchain, which means either running VS2010 or figuring out how to build every single dependency with VS2015's v140_xp toolset.
The frontend DLLs only speak my own handmade interface across the boundary, they contain nothing foobar2000-specific as the required services are just not available.
In the end, this means that the module that implements and uses the foobar2000 services needs to be loadable on all targeted OSes.

As for renaming the component, there's no provisions for doing that in the updater/repo, so any future version would be a new name, much like the prototype minibar.
Title: Re: foo_wave_seekbar
Post by: rokkokko on 2017-01-08 15:14:45
I have a feature request:

In my music library I have many (mainly classical) tracks which are very quiet. As a result, there's not much to look at in the waveform output.
Is it possible for you to implement an option to scale the waveform so that the track peak corresponds with the width of the waveform seekbar panel? Possibly in combination with ReplayGain only?
Title: Re: foo_wave_seekbar
Post by: rokkokko on 2017-01-11 22:39:25
Sorry, just read a few pages back that this is already possible...
Title: Re: foo_wave_seekbar
Post by: rokkokko on 2017-01-11 22:52:30
I have a different problem though... I've used this great panel for over a year now and since about a week ago, it won't scan new tracks after a while. I tried deleting the database or reinstalling the panel, but after 5 to 10 tracks, it won't do anything. Any idea why?
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-01-12 06:48:59
Are you playing some particular kinds of files or have them adjacent in the playlist?
Is the foobar2000 process using all or none of your CPU?

I'm not sure if they'll get flushed into the 'jobs' table in the database if the processing threads are getting wedged, but if you can inspect that with SQLiteStudio there may be some hints as to what goes wrong.
Title: Re: foo_wave_seekbar
Post by: rokkokko on 2017-01-13 16:32:53
I'm just playing music through the normal Columns UI filter + NG Playlist.
The CPU usage seems quite normal, hovers at about 10%. That used to be less, but I use more taxing components now than I used to.

I closed foobar, looked into the database and deleted all entries in "jobs" and then reopened foobar, and now it works again. For now, I'm afraid. Any idea how I can prevent the jobs from clogging the thing?
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-01-14 00:02:25
When it happens again, it'd be nice if you find the queued up jobs in the table that may be at fault.
Can't really diagnose the problem without knowing what files end up causing it.
Title: Re: foo_wave_seekbar
Post by: rokkokko on 2017-01-22 15:35:48
I've been observing when it happens and I do not see a pattern, but there is a pattern in how it happens. This is the queue after it got stuck the last time:
(http://i.imgur.com/kz9sQOw.jpg)

The tracks on top and bottom are the ones that I played most recently, and the scanning didn't work. The one in the middle, however, is a track that I played about half an hour ago (in a continuous playlist), and its waveform as well as those of the tracks before and after (until the previously mentioned two) were scanned without a problem.

That means that there is a track in the "jobs" table that has already been scanned, which might be the root of the problem. How that happens though, I don't have any idea.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-01-23 10:30:06
Jobs are read out from the database on startup, and persisted at shutdown. I'm not sure whether jobs that are "stuck" are collected, it depends on how they've broken the workers.

What kind of format is the first and last song in that list? At least for the first one, it looks like it has no extension.
Title: Re: foo_wave_seekbar
Post by: Typhoon859 on 2017-01-24 15:34:29
Any possibility it can look ahead for songs being streamed (rather than being played local) to generate the waveform?  That would be really great!  Thanks for all the hard work.
Title: Re: foo_wave_seekbar
Post by: rokkokko on 2017-01-25 10:00:16
Pretty much all of my library is mp3, including these two, the exxtension is just cut off.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-01-25 10:24:11
Any possibility it can look ahead for songs being streamed (rather than being played local) to generate the waveform?  That would be really great!  Thanks for all the hard work.
This has been suggested in the past and isn't really possible in the current architecture. The component is designed around tracks that can be opened separately and with fixed duration. The only way to get samples out of a currently playing song would be if I had a DSP or visualisation stream service, which would grab samples as they're produced.

This would be different enough from the current component that it's pretty much a separate UI element all-together.
Title: Re: foo_wave_seekbar
Post by: Typhoon859 on 2017-01-26 02:52:00
Any possibility it can look ahead for songs being streamed (rather than being played local) to generate the waveform?  That would be really great!  Thanks for all the hard work.
This has been suggested in the past and isn't really possible in the current architecture. The component is designed around tracks that can be opened separately and with fixed duration. The only way to get samples out of a currently playing song would be if I had a DSP or visualisation stream service, which would grab samples as they're produced.

This would be different enough from the current component that it's pretty much a separate UI element all-together.

Ah, I see, so in effect it is possible but not with how it was currently coded.  Alright then, well I appreciate the consideration nonetheless!
Title: Re: foo_wave_seekbar
Post by: juniiflow on 2017-01-30 09:27:28
Anyway to extract the settings and colors?
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-01-30 09:31:04
The settings are stored per-instance in the manner that Default UI and Columns UI prescribes.
You can use whatever functionality they offer to export/clone instances to preserve your settings.

For this reason, I have not bothered to implement explicit import/export as that requires the importing code to be aware of the meddling of mortals in the exported data.
Title: Re: foo_wave_seekbar
Post by: Charlatan on 2017-02-08 09:59:34
Is there any way to export the database as images en masse as JPG or PNG? I've been trying to create waveforms for my music library for a while now to no avail.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-02-08 14:42:13
Currently? No.
Technically? Yes.
Will I get around to doing it? Unlikely.

I'd have to figure out how to name the files if generating external names for them. If they're going into tags, I'd have to smack you over the fingers with a ruler, and then figure out what tag to bloat with them.

What kind of use case do you have for this? It's a bit complicated with CUEs and archives and all the other silly formats fb2k can feed me.
Title: Re: foo_wave_seekbar
Post by: Charlatan on 2017-02-09 02:36:29
I'd be giving them the same filenames as the source audio and saving/moving them all to the relevant album folders. It's for use with a program called Rainmeter, mostly for aesthetics but it also means I can keep foobar minimised and still navigate lengthy tracks by their waveforms (which I've done before, but it seems the program I used to generate waveform images last time does not play nicely with Windows 10).

Anyway, I appreciate the reply. It's remarkable that you're still actively supporting this.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-02-09 15:41:52
What frontend are you using? It's somewhere between slightly painful and very painful to implement based on the frontend used. I used to have a dev-grade screenshot function implemented, you know. Got rid of it because it required too much customizable UI to be usable by meatbags.

Not saying that I'm going to do anything of this, but you got me thinking about it. Sadly everything is gated by that the current codebase and tech used is a steaming pile of  :-X .
Title: Re: foo_wave_seekbar
Post by: Charlatan on 2017-02-13 10:39:31
(Apologies for the delayed reply. A very busy weekend just concluded.)

I'm using the Direct3D 9.0c frontend. I like to think of myself as a fairly high-tier meatbag, but a meatbag all the same.
Title: Re: foo_wave_seekbar
Post by: foobaraddicted on 2017-02-27 00:49:40
Is there anythink can do to make the waveform bigger when the song is very low at volume?

Example: Marker is to big for waveform

Title: Re: foo_wave_seekbar
Post by: Shinsekai on 2017-02-27 01:27:07
Is there anythink can do to make the waveform bigger when the song is very low at volume?

Example: Marker is to big for waveform
I'm using this:
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;
float3 track_magnitude : TRACKMAGNITUDE;

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( float2 tc, float cursorPos )
{
// alpha 1 indicates biased texture
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) / 25) * 1.4; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 25) * 1.4; //use album gain
}

float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;
bool played = cursorPos < tc.x;
float4 inside_color = played ? textColor : highlightColor;
float4 bgColor = backgroundColor;


float4 wave = outside
? bgColor
: inside_color
;

return saturate(wave);
}

float4 reflect_evaluate( float2 tc, float cursorPos)
{
float baseline = -1.0/100.0;
float low_unscale = 3.0/3.7;
float high_unscale = 3.0/3.7;
bool mirrored = tc.y < baseline;
if (mirrored) {
tc.y = baseline - tc.y;
tc.y = tc.y * low_unscale;
}
else {
tc.y = tc.y - baseline;
tc.y = tc.y * high_unscale;
}
float mag = max(-track_magnitude.r, track_magnitude.g);
if (mag > 0.95) {
tc.y = lerp(0, mag/0.95, tc.y);
}
float boost = mirrored ? 1.26 : 1.26;
float gradient = lerp(0.7, 1.0, tc.y);
return boost * gradient * evaluate(tc, cursorPos);
}

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 = 3.0 * dx;

float4 c0 = reflect_evaluate(input.tc, cursorPos);
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();
}
}
Here's another:
https://hydrogenaud.io/index.php/topic,77490.msg920510.html#msg920510

Make sure your files have ReplayGain info.
Title: Re: foo_wave_seekbar
Post by: foobaraddicted on 2017-02-27 01:38:01
thank you
Title: Re: foo_wave_seekbar
Post by: foobaraddicted on 2017-02-27 02:37:06
It works, but now it looks not as smooth as before. Is there some kind of anti aliasing on the default style?
Title: Re: foo_wave_seekbar
Post by: evesira on 2017-03-20 22:02:46
Is there any chance you'd add an option to just completely disregard cache and recompute the waveform on every play?

I'm a music composer/producer, so I make changes to files a lot. In a peak work time I could be editing and playing several different wave files a minute, where the waveform should change significantly and I want to eyeball check that turned out properly. So even though it's quick to go and delete wavecache.db or do rescan all waveforms, that adds up quick.

Processors are fast enough now anyway that I'd rather have it recompute the waveform every time (< 1 second on my machine for a 10 min song) than have to go delete the .db file (10 seconds with voidtools everything search) every time. I've even searched some kind of software or Windows trick to delete that file every time Foobar is run, but alas can't find a clean way to do that.

Of course ideally there'd be some super quick check to see if the file had changed, but I saw you mentioned that a checksum or similar would take just as long as computing the waveform. What about using the Windows "date modified" property?
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-03-20 22:54:46
I thought I had such a thing already, but it seems like I conflated some other features.

There's an advanced configuration to always refresh waveforms in response to an user-initiated rescan, you might be able to bind a hotkey to that or manually invoke a scan in the context menu with that.

I'm not quite sure how much the display part would cache the old waveform, the whole component is kind of written assuming that tracks are immutable.

foo_wave_minibar has similar attitudes to things, I'm not quite sure which component would be easiest to hack this into.

The problem with testing modification times is that there's a whole bunch of inputs that aren't directly file-based, like CUE sheets. At the moment I don't have to care much at all about the input path given to me, looking at files would mean that I'd have to figure out what the input path actually means and if the input would be deferring to other files.
Title: Re: foo_wave_seekbar
Post by: evesira on 2017-03-20 23:50:36
I thought I had such a thing already, but it seems like I conflated some other features.

There's an advanced configuration to always refresh waveforms in response to an user-initiated rescan, you might be able to bind a hotkey to that or manually invoke a scan in the context menu with that.

I'm not quite sure how much the display part would cache the old waveform, the whole component is kind of written assuming that tracks are immutable.

foo_wave_minibar has similar attitudes to things, I'm not quite sure which component would be easiest to hack this into.

The problem with testing modification times is that there's a whole bunch of inputs that aren't directly file-based, like CUE sheets. At the moment I don't have to care much at all about the input path given to me, looking at files would mean that I'd have to figure out what the input path actually means and if the input would be deferring to other files.

So I tried binding a hotkey to the "Rescan All Waveforms" function, and in my testing it seemed to function just like deleting the wavecache.db file. It doesn't seem to pull any of the old waveform from the cache, and seems to recompute the whole thing. So this will work for me, thank you! I have to press the hotkey to clear the cache then a hotkey to restart the song, but that is still way faster than having to manually delete the file.

I'm not sure what you mean regarding the modification times though. When you say "a whole bunch of inputs", do you mean the info about the file that Foobar is passing you? If so, doesn't Foobar pass you any info like the modification date?
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-03-21 00:13:32
One such input is standalone CUE sheets. Properties in foobar2000 has a "Last modified" field that only indicates seems to indicate when the CUE sheet was changed, not the file it references.

In the case with a regular boring file track, I may be able to query information from what I think is the file, I cannot tell what input will handle a particular file.

It's nice that you found a workflow that seems to work.
Title: Re: foo_wave_seekbar
Post by: evesira on 2017-03-21 00:27:50
Ah okay, I just don't know enough about this to understand the cue sheet stuff.

But yeah if you looked into doing the file modification date, or some kind of faster checksum-like heuristic, I bet a lot of people would be really appreciative. Hell, even if you just had an option to ignore the cache completely, that would be great. I don't know how your code is set up, but maybe it would even be as simple as skipping out of the code that loads stuff from cache, and going straight to your function to compute the new waveform and then display it etc.

Also props for still supporting an extension you made 7 years ago, and promptly too. Thanks for your help.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-03-21 01:01:41
Ooh, ooh, I completely forgot about tags. Tag updates tend to change the file and would ensure that I can't really have a modification test on by default. Checksums of the whole file, even if restricting to single-file inputs, would mismatch even if just things like tags differed.

I would love to implement a mode that would attempt to have as little persistent storage as possible but everything throughout the component is designed to not do anything if the waveform remains the same. Changing those things would be quite risky with regards to component stability.

The unreleased "minibar" is so close but not quite there in this regard, as it has two distinct databases. One on-disk for songs in the media library and one in memory that gets discarded on foobar2000 restart for all other songs. I made some speculative changes to it to see if I could get it to always refresh but even that had a bit of safety code in place.

Sorry to let you down, but there's no half-hour-hack I can do to deliver this :)
Title: Re: foo_wave_seekbar
Post by: Mrbencow007 on 2017-03-22 12:59:51
Hi guys,

I am a long time user of foobar2000 and the amazing waveform seek-bar plug-in.  I have a quick question, is there any way to scale the horizontal axis, and have the waveform scroll along. Ideally with the current position centred in the display?

I ask as for long tracks 10mins+ the waveform becomes on big block. For example as seen in the Image : The Bucketheads - The Bomb (Original Mix) 14:49s

(https://i.imgsafe.org/275b918290.jpg)

Apologies if this has already been asked, I am new too the forum. (I did have a good search)

Thanks

Ben
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-03-22 14:34:00
Mrbencow007: This has indeed been requested in the past and cannot be done in a satisfactory manner with the current design.

The reason for this is that at analysis time I extract the rough shape of the whole song into 2048 bins of min/max/rms data. The longer the song, the more samples cover each bin, and the min/max is more certain to be extreme; this is why your song is a bit more brickwalled than shorter songs.

While you can kind of approximate scrolling by adjusting coordinates in the effect code, the data that it works with is still severely undersampled and would just be the same brickwall, stretched out.

In order to have satisfactory scrolling, you'd have to have a finer subdivision in the analysis step, something which this incarnation of the design cannot do, it has a hard assumption of 2048 datapoints as that was a sweet spot of disk usage vs. typical screen sizes at the time.

This isn't something I aim to change over time either, my minimalistic internal version of the component has the same assumptions but a 4k set of datapoints.
Title: Re: foo_wave_seekbar
Post by: Mrbencow007 on 2017-03-22 16:11:36
Zao,

Thank you for taking the time to explain that, its a shame,  but I get what you mean and its makes sense.  

Thanks

Ben
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-03-25 17:03:20
Hi,
I need some assistance. Today I realized that suddenly my foobar 1.3,15b1 running on Windows 10 stopped working with D3D interface and falls back to GDI. I am helpless - I am unable to force it to work. Some guidance would be appreciated.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-03-25 18:38:26
EpicForever: Is this that has suddenly occurred on an existing Windows installation, or something you're observing on a new Windows installation?
Have you've done a Windows upgrade in the meantime, those tend to like to remove things like the DirectX runtime.
Have you've tried reinstalling the DirectX February 2010 or June 2010 redists?
Is there anything of interest in the console of foobar2000?
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-03-25 19:03:45
It is existing Windows 10 installation, installed from scratch and working for few months already. I tried to reinstall DX9 redist files, as an administrator, but it didn't help.
From console:
Seekbar: taking Direct3D9 path.
Seekbar: frontend creation failed: Direct3D9: could not create device.
Seekbar: taking GDI path.

My GFX: Palit GTX 750Ti KalmX 2GB with not the latest drivers (about month to 2 off).
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-03-25 22:19:04
Which version of the component are you on?
Can you send me a dxdiag.txt from dxdiag.exe's "Save All Information..." function?
Are you using Windows Update drivers for your card or ones from NVIDIA?
Are you using any form of video capture software on the system that may hook things?

Please try 0.2.45.6 (https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.45.6.fb2k-component) which I've instrumented with a bit more output for device creation failures.

It's built with VS2017 so it's probably not overly fit for normal consumption, please just use it to gather a bit more information.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-03-27 21:02:11
Hi.
After applying 0.2.45.6 even D2D became unavailable. On previously used version I could use it (but it always looked horribly so I never did it for real). Now only GDI works.
I don't update drivers through Windows Update. I find as worst possible source for updating drivers - totally uncontrollable. I don't use screeen capturing and I never did. What is running al the time is Firefox (newest), Thunderbird, foobar, I can confess that also old uTorrent 1.8.5.
Attached there is file saved as you instructed.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-03-27 21:07:30
I'm curious as to if you've tried the advice in the grooveex.dll thread, temporarily removing some of your components. You're sniffing up against the number of DLLs that you can comfortably have in a process with regard to TLS slots, I'm suspecting.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-03-27 21:12:21
In addition: when I switched back to older version D2D works again. From console, when 0.2.45.6 was loaded again:

Loading
Startup time : 0:06.566627
Seekbar: taking GDI path.
Seekbar: Frontend initialized.
Opening track for playback: "M:\(...)\CHVRCHES - Every Open Eye (Extended Edition) (2016) (CDVY3139)\10 Bury It.flac"
Audioscrobbler: Handshake failed: The system time is far off. Please correct your system time.
Audioscrobbler: Handshake failed.
Seekbar: taking Direct3D9 path.
Seekbar: frontend creation failed: unavailable frontend
Seekbar: taking GDI path.
Seekbar: taking Direct2D1 path.
Seekbar: frontend creation failed: unavailable frontend
Seekbar: taking GDI path.
Seekbar: taking Direct3D9 path.
Seekbar: frontend creation failed: unavailable frontend
Seekbar: taking GDI path.

EDIT:
In regards of grooveex.dll: I may not get context of English language correctly in your post, so just to be clear - I am chasing grooveex.dll only because it causes foobar to crash when I am trying to use Converter component. Personally I don't mind that much about the fact if it loads or not - I don't see any other side effects fo grooveex.dll. I don't have warinings about DLLs that couldn't be loaded to foobar.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-03-28 13:07:37
What I am saying is that there is a hard limit in the Windows OS on how many DLLs can be loaded, due to each static embedded C++ runtime requires one "TLS slot" each.

When you run into this limit, which is around 128, no more such DLLs can be loaded.

I am suspecting that as you have a LOT of components, you are close to this limit. I'm asking you to try with fewer components or in a fresh new "portable" installation of foobar2000, to see if this is the underlying problem.

foobar2000 only warns about when top-level components can't load. If a component fails internally due to not being able to load a DLL that _it_ needs, you may see the kind of errors we have, where internal DLLs seem to not get loaded.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-03-29 23:06:38
Hi Zao,
Thank you for your help. Yes, you are perfectly right. Recently I updated my components + added 1 or 2. Some of those updated are now splitted into 2-3 dlls. So finally I have reached the TLS slot limit. I deleted some of less important co,ponents. Now everything works fine with waveform seekbar.
Microsoft... "128 TLS slots ought to be enough for anybody" (paraphrasing Bill Gates). Yes, especially in plugin based applications.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-03-29 23:57:40
I'm delighted to hear that we've solved your problem!
Title: Re: foo_wave_seekbar
Post by: Wemppu on 2017-10-21 20:46:57
Hi, just found foobar 200 and this extension since I have been lacking visual to levels of volume.
Background: I am playing music often in figure skating and gymnastic teams contest. OK, playing also in hockey games, but those are always loud and high :) ... no need for visual there.

So I finally can see clear prepared playlist and visual if music is starting in low volume in start or so, BUT my problem is that Wave Seekbar is showing wave AFTER i start actual playing.  Therefore I am missing very start of levels.

Is there any way to set waveform to be displayed when track is selected in playlist?
Before track is actually started.

Sorry if this was answered in this thread already, but there was 84 pages to read ...




Title: Re: foo_wave_seekbar
Post by: Zao on 2017-10-22 08:32:09
@Wemppu I've had requests for selection previews in the past but have not gotten around implementing it as pretty much everything about the component(s) is designed for showing the current track, with no real way of rendering or waiting for scans for other tracks.

It could possibly be implemented if I got around to it, but I don't have any immediate solution for you.
I hacked a bit on a "generate HTML report" feature for foo_wave_minibar but got stuck on the bit where I may have needed to scan new signatures as I went

In the meantime, maybe you could scan your files with ReplayGain or something, and show the track-gain value in a playlist column, to give you a hint of how loud it is. You can also configure the player to ignore or honor RG values for attenuation/amplification, which may solve the core problem of things being too loud.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-10-22 11:17:14
I've implemented a feature in my other seekbar component, foo_wave_minibar, which might tickle your fancy.

It's a context menu item to generate a HTML-based report page for the the selected tracks which it opens in your default browser.
The report currently requires you to scan any waveforms ahead of time, as I still have no way to scan non-playing waveforms on demand.

The component is designed to only store waveforms across sessions if the songs are in the media library, any other waveforms scanned only last for the active session and are dropped on exit.

Do give it a try, see if it helps you - foo_wave_minibar-1.26.fb2k-component (https://www.acc.umu.se/~zao/foo_wave_minibar-1.26.fb2k-component)
Title: Re: foo_wave_seekbar
Post by: Wemppu on 2017-10-22 20:20:51
Do give it a try, see if it helps you - foo_wave_minibar-1.26.fb2k-component (https://www.acc.umu.se/~zao/foo_wave_minibar-1.26.fb2k-component)

Thanks @Zao !
This is a big step forward to see whole playlist in browser window as single page.
However as you can guess most usable version would be display on foobar app window module ;)

Playing in these contests is following playlist by press enter and then music stops, select next, wait team to be ready and press enter.
If selecting next would give picture of next track waveform too I would be sold.

But yes, since there is lot of waiting for next team and standalone images are in same order than playlists there is time to see starting levels of next track. Therefore this is working solution to me. Thanks!
Title: Re: foo_wave_seekbar
Post by: askold on 2017-10-24 14:26:29
Zao,
could you build foo_wave_minibar for non-SSE2 CPU?
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-10-24 16:15:12
@askold Meh. Maybe. At least you're not asking for a build without CMOV.
It's definitely not going to run on XP. The pain around building and working with foo_wave_seekbar made sure of that.

As for restricting instruction set beyond the default of VS's stock SSE2... I'll have to think about that.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-10-24 19:19:19
Please note that that's Case's own unofficial build and it may very well burn your house down.

The code is not necessarily functioning as it should on Windows XP. I write it with a baseline OS in mind when looking up functionality in documentation, and consider the caveats in behaviour that apply to those OSes. At some point, documentation drops the extant platforms.

Just because it compiles doesn't mean that it behaves properly and you're running such builds at your own risk. There's more to it than just flipping some switch in the IDE and seeing if the executable starts. Such changes are also getting increasingly harder to test, as there's not a single machine in my household anymore that can support a vanilla XP installation.

As for foo_wave_seekbar, it still nominally targets XP because it has done it historically, but that's also why I don't work on it anymore as even setting up the build environment for it obliterates an evening or two, let alone actually writing code for it.
Title: Re: foo_wave_seekbar
Post by: 西门浪子哥 on 2017-10-25 12:37:52
Here's a statically linked compile that works on Windows XP and doesn't require SSE2:
Thanks for supporting XP
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-10-25 12:55:13
I should mention here that as the minibar is not hardware accelerated and draws with GDI, it has a significant impact on system responsiveness.
I would not recommend running it while you're playing games or want your websites to scroll smoothly, as it is rather violent against the graphics system.

I have intentionally not promoted that component in the wild because it's intended for a narrow circle of people with specific quirks.
Title: Re: foo_wave_seekbar
Post by: 西门浪子哥 on 2017-10-25 13:23:27
I understand!Thank you!
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-11-18 18:18:48
I have specific problem with my foobar. I don't know how to determine which component - foo_input_ffmpeg or foo_waveform_seekbar fails. The problem is that several files played back through foo_input_ffmpeg (video files in various containers) don't display waveform seekbar in my DUI. Or to be exact - I see progress in producing the waveform, but after reaching certain point it disappears. Those files definitely report some errors at the very end of the files. So - this may be some slight problem with error handling in any of these 2 components.

Here:
https://1drv.ms/u/s!AizQnez18-j2dShrVxmuiytDduo
I gathered together all these problem causing files, together with list of errors that they produce and configuration files for both components. Additionally there are 2 files that do not brake waveform generation, despite there are also errors produced while files are played back.
My foobar is v 1.3.17 b3. My OS is Win7 PL x64 SP1 MSDNAA sourced, with all security updates installed. Graphic card is nVidia GTX 1050Ti with drivers version 382.05. Problem is first observed in this config (foo_input_ffmpeg as component that supports these video files). In the past I didn't had this kind of issues (when foo_input_ds was used for the same purpose and I didn't have problems with DirectShow and files were played back smoothly). If any more details are needed - please let me know.
I am asking both Zao (here) and Peter (in other thread) to take a look at this situation.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-11-18 23:15:41
I can't tell much from my side. I get an `std::runtime_error` from my decoder, and I bail out as it is assumedly hosed.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-11-19 09:51:22
I don't get exactly what you mean :)

But wouldn't it be possible to somehow retain the view of what was properly decoded / imaged before "runtime_error" occurred? I think this is the problem, as I can see that waveform is generated (progressively) and then at ca 95% it disappears, like decoded/calculated data were discarded... I would accept waveform being not complete - especially if some small popup with message about problem was displayed. What is funny - this happens (but without popup) for example for any incomplete download if it is attempted to be played by mistake. Waveform seekbar generates garbled waveform (truncated, contiguous but concatenated from several chunks that come from various places of file). I think that for the files from the package (and any other that may have similar problem) it would be OK to apply the same behavior as for incomplete dowloads.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-11-19 10:52:14
As reported in other thread, archive with Mvids was broken. Probably, because .cfg files were added to ready archive with Mvids - repack was unsuccessful.
I took down previous file and added new one, tested, with .md5 inside (for unpacked files) and .md5 outside (for the download).
7ZIP: https://1drv.ms/u/s!AizQnez18-j2dxtQR5Ds5OoxoPo
MD5: https://1drv.ms/u/s!AizQnez18-j2dtTfo9jSFLyAmMM

Also I found something strange. When I play pure Adaptive Muti Rate file (.amr) through FFMPEG I got it's Waveform created in the seekbar. But when I play .3gp file with Adaptive Multi Rate audio Waveform is not created. In the console I can find this for a single file (file path is intentionally manually banked in part):
Opening track for playback: "(...)\SE E15i\MOV00009.3gp"
Launching ffprobe:
"C:\Program Files\foobar2000\encoders\ffprobe.exe" -of xml -show_format -show_streams -hide_banner "(...)\SE E15i\MOV00009.3gp"
Launching ffmpeg:
"C:\Program Files\foobar2000\encoders\ffmpeg.exe" -i "(...)\SE E15i\MOV00009.3gp" -f w64 -acodec pcm_f32le -
Audioscrobbler: Track is not in Media Library - not submitting to Audioscrobbler.
Launching ffprobe:
"C:\Program Files\foobar2000\encoders\ffprobe.exe" -of xml -show_format -show_streams -hide_banner "(...)\SE E15i\MOV00009.3gp"
Launching ffmpeg:
"C:\Program Files\foobar2000\encoders\ffmpeg.exe" -i "(...)\SE E15i\MOV00009.3gp" -f w64 -acodec pcm_f32le -
Wave cache: generic exception (Not yet implemented in FFmpeg, patches welcome) for "(...)\SE E15i\MOV00009.3gp"


What is the difference between AMR-NB present in .amr container and in .3gp container, which causes the latter to be not displayed as waveform?
Title: Re: foo_wave_seekbar
Post by: Rollin on 2017-11-19 17:51:35
What is the difference between AMR-NB present in .amr container and in .3gp container, which causes the latter to be not displayed
I tried some 3gp files with amr audio and waveform is displayed correctly.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-11-19 19:05:34
I'll start with a disclaimer that I have no intent to fix the code or make any release. It took me over an hour to set up an environment that could build foo_wave_seekbar at all this time, and it's one that isn't fit for making releases with.

If you look closer at the Westbam track, you'll notice that both the playlist, the builtin seekbar and my seekbar agrees that it's around two seconds long. This information is based on what the decoder says about the song length. If I ask about track information, it tells me "oh 88704 samples at a sample rate of 44100".

As this can be an approximation sometimes, I have logic to either pad with silence or truncate, depending on if it the track decodes shorter or longer than expected. Normally this is fine as the difference is a few hundred samples at most.

A difference between the player and my component is that I need a reasonably accurate track length up-front due to how my analysis works. I split the file into parts that are individually filled as I decode. That information needs to be known before I start. The player can just keep decoding until the file ends, producing up to an infinite amount of bonus audio.

As for recovering interrupted playback, I don't believe in producing bogus waveforms. This component kind of has a base assumption that the source is capable of producing what it promises.

For the undersized file, it might be possible to try to decode a bit further than the promised sample count, just to see if the file seems to be overlong enough to make a difference in the waveform. If so, decode to the true end and use that as the sample count for a completely new run of the file. That would work for your 2s track, but would be extremely amusing on infinite songs like looping tracker modules, so nothing one can naïvely implement.

For files that throw exceptions, I assume all are fatal. I cannot distinguish between error kinds there, unless you're supposed to just try to continue decoding and hope for the best.

As some bloke mentioned in the other thread, consider fixing your files.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-11-19 21:18:16
@Rollin: well, OK... I can leave with that, still good to know that it is something that possibly can be fixed if I dig deeper.
EDIT:
I see that there are no waveforms from 3gp files recorded only with Sony Ericsson E15i (Android based), also known as Xperia X8 if I am not mistaken. Files recorded with other phones (some Nokia, Sony Ericsson - various models non-Android based, some camera) work fine and indeed display waveforms... LOL...

@Zao : if problem with Westbam Mvid is that file itself is malformed and incorrectly reports its length / ffmpeg can not read it properly and pass it to foobar - OK, I have no pretensions that it can not be fixed - totally bad input = bad output
But for other supposedly broken files from the package I only ask for not discarding data that were calculated for initial blocks and displayed before error occurred. Their length is reported properly so base condition for waveform seekbar component exist. I intentionally added there 1 file or 2 files, that display full wavefom, despite they also throw decoding/playback error at the very end. Also I noticed that incomplete downloads still allow to display not disappearing waveform, despite they are also malformed at the time when they still download and playback decoders throw errors on them.

Of course I don't expect anything to be fixed immediately. Just when next release will be planned for whatever reason, you can consider also not clearing seekbar when certain errors occur, but leaving empty space in it instead - as for incomplete downloads happens now.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-11-21 20:41:06
Some additional note:
I went to Windows 10 installation, because of Forza Horizon. Additionally I dug through foobar installation on that OS. I cleaned up components in similar manner as under Windows 7, with one exception  - I left there unconfigured foo_input_ffmpeg and I left there working foo_input_ds. I tested there a bunch of old Mvids not remuxed to .mkv , awaiting for final removal.

Observations:
First of all - waveform seekbar works there very well (as it was usually, before I overloaded foobar with DLLs). All waveforms, for all supported video files are displayed and they don't disappear at any circumstances.
Then:
There are some files which are barely seekable (audio is reset to beginning upon any seek operation). But that changes when LAV Filters are re-installed from their separate installer (see below).
There are some files which incorrectly report their length, even after LAV reinstallation - they are cut by 20, 30, 45 seconds. What is specific: when all video files are played in foobar, in notification area I have just LAV Splitter and LAV Audio Decoder icons. But when some of these "broken" files come to its premature end - these icons start quickly appearing and disappearing with LAV Video Decoder showing up 2-3 times for an eye-blink. Waveform seekbar shows their waveform cut, accordingly to length reported on playlist, which is rather proper behavior.
That Westbam - Hard Times mvid reports proper length and is properly seekable, with proper waveform in seekbar displayed... So it is totally different to what is achieved through foo_input_ffmpeg as a data feed for foo_waveform_seekbar.

What I can say - both systems were installed at the same time, so I used the same KLCP installer on both, and used the same settings for installation. So I suppose this is KLCP installer that messes something in system (not the first one, but not all of them are such buggy). It may be also something with recent version of LAV filters, as in both cases (Win 7 & Win 10) installing just LAV Filters taken directly from their source doesn't change situation that much. I suspect it because afaik both KLCP installer and direct LAV installer install LAV in the same version, so that may suggest that it is this exact version of LAV to be blamed.

What is important to note: seems that foo_waveform_seekbar is really reliable here and only wrong data feed causes it to work in an unusual way. However, as noted in my previous message - it would be OK if waveform parts that are successfully calculated were kept, and parts of file where waveform can not be calculated due to errors in data fed to seekbar component, were simply left blank. Instead of blanking full seekbar.
By the way - I got some idea / feature proposal. Maybe if for some reason for certain file waveform creation is completely impossible (CD Audio, infinite loop, .3gp file recorded with SE E15i, whatever else) there could be displayed simple text on the waveform seekbar:
"Waveform unavailabe". Or more detailed way: "Waveform unavailable (unsupported file or location)". Just a small thing to add, when there will be a bigger reason to release newer version :)
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-11-23 21:21:11
Our forum friend Rollin has found working solution for all these files that have bugs when decoded through foo_input_ffmpeg:
https://hydrogenaud.io/index.php/topic,114855.msg948011.html#msg948011
Quote
you can add -loglevel 0 to Additional arguments. This should fix disappearing of waveform for files from your archive when decoding with foo_input_ffmpeg.
Rollin - once again thank you :)


EDIT:
WOW. After adding that -loglevel 0 switch to 3GP config I also have waveform seekbar available for those "faulty" .3gp files from SE E15i mobile phone... So that is really a huge thing!
Title: Re: foo_wave_seekbar
Post by: Case on 2017-12-07 09:45:56
Is there any way to set waveform to be displayed when track is selected in playlist?
Before track is actually started.
You could give a try to my modified version of zao's Waveform Minibar. It allows configuring whether to show the waveform for playing track or for selected track. All configuration currently lives in Preferences -> Advanced -> Display -> Waveform Minibar (mod).
The component doesn't require SSE instructions and works on Windows XP.
Download link: http://www.saunalahti.fi/~cse/foobar2000/foo_wave_minibar_mod.fb2k-component (http://www.saunalahti.fi/~cse/foobar2000/foo_wave_minibar_mod.fb2k-component)
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-12-08 15:22:39
Is there any way to set waveform to be displayed when track is selected in playlist?
Before track is actually started.
You could give a try to my modified version of zao's Waveform Minibar. It allows configuring whether to show the waveform for playing track or for selected track. All configuration currently lives in Preferences -> Advanced -> Display -> Waveform Minibar (mod).
The component doesn't require SSE instructions and works on Windows XP.
Download link: http://www.saunalahti.fi/~cse/foobar2000/foo_wave_minibar_mod.fb2k-component (http://www.saunalahti.fi/~cse/foobar2000/foo_wave_minibar_mod.fb2k-component)

Please note that this is his fork/mod of my minibar component. It has different unique identifiers against foobar2000, a different database name, and has been audited by Case to build and work on XP without SSE. That's not the case with my own components, it's extra work that Case has performed.

If it breaks, blame him. 8)
Title: Re: foo_wave_seekbar
Post by: Case on 2017-12-09 18:43:14
I released a new version of the modified minibar component. It's now available on the component repository (http://www.foobar2000.org/components/view/foo_wave_minibar_mod).

Configuration is now moved away from the advanced preferences and can be found in Tools section of the preferences window. Colors are now by default based on the player's user interface theme.
Title: Re: foo_wave_seekbar
Post by: TuNk77 on 2017-12-16 19:40:07
Hello Case!
I just wanted you to know that my antivirus (Bitdefender), thinks that your component is a virus.

(https://i.imgur.com/YlzzDQ0.png)
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-12-16 19:50:59
Looking at the claimed "threat" name, this is most probably a false positive based on overly generous heuristics. More often than not, particularly if you go out of your way to target older platforms or build in different ways than normal, they'll think you're doing something fishy. Why would anyone legitimate ever bother to run without a CRT runtime, for example? :)

If you're still concerned, you may want to throw the component at some online service that tests with a horde of different AV products, to see if there's actual consensus or just an false positive.

You can give say virustotal.com an URL to have it scan it without you having to download it to your machine.

(https://i.imgur.com/62UsxfK.png)
Title: Re: foo_wave_seekbar
Post by: Case on 2017-12-16 20:12:30
Thanks for the notification, TuNk77. It's a false positive, all the VirusTotal detections apart from MAX are using the same BitDefender's engine. I have reported the false positive and expect it to be fixed soon.
Title: Re: foo_wave_seekbar
Post by: Case on 2017-12-18 05:51:40
Got email this morning that the file was found to be clean and databases are fixed.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-12-18 08:02:15
Maybe it is bit off topic, but... Why when I came here to see today's last answer (given by Case) I see this above quick reply window and below last message in thread:
Quote
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
?? Is there something broken within the forum engine?

EDIT:
And it disappeared after I posted above message.
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-12-18 08:05:16
@EpicForever It was probably confused when a recent spam message was removed.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2017-12-26 21:25:40
Question: is there possibility to cancel analysis queue? Accidentally I messed something when trying to type something for search purposes, which ended up in selecting whole playlist (long one...) and ordering to analyze waveform signatures of all these files...
If there is no such possibility now - could this be added somewhere (in Preferences/Tools or in Advanced Preferences / tools, or when right clicking on waveform seekbar itself)?
Title: Re: foo_wave_seekbar
Post by: Zao on 2017-12-27 09:48:41
@EpicForever There is (as far as I remember) no built-in way of purging the scan queue.
It is stored in the wavecache.db database when the player is not running, and resumed from there when launching again.

You can "simply" download the sqlite3.exe command line client (or some other SQLite database interface), run « sqlite3.exe wavecache.db » and type (without the quotes, but with the semicolon) « DELETE FROM job; »

The download site for sqlite3 is at https://www.sqlite.org/download.html (https://www.sqlite.org/download.html) and the executable is in the sqlite-tools-win32-x86-3210000.zip package.

As mentioned earlier, don't have any hopes of a feature update of that component.
Title: Re: foo_wave_seekbar
Post by: wcs13 on 2018-01-10 02:54:14
Hi,
Windows XP and SSE aside, how can the average user choose between Zao's original seekbar and case's minibar ?
Are there any benefits in choosing one or the other ? (besides the fact that Case's looks simpler and with less options)
Are the databases the same size for the same number of sampled songs ?
Etc.
Thanks !
Title: Re: foo_wave_seekbar
Post by: Zao on 2018-01-10 05:48:45
It's funny that you say "Case's minibar", considering that I wrote both original components. Case altered the minibar adding a bit of configuration and features into "minibar mod".  :))

The origin of the minibar component was a bit of annoyance about how cumbersome and legacy-laden the seekbar had become, so I wrote a new one from scratch that satisfied the requirements of the primary user (Case) and existed as a private component for quite a while. It only appeared in public when it appeared to be suitable for other users, first in the IRC channel and eventually linked in this thread.

As such, it's made in a way simpler way. It doesn't do any D3D or D2D acceleration of visuals, doesn't have any shader/effect customization, and it downmixes multi-channel content. Until Case's work, all the minibar configuration was via "advanced preferences" and expected that you knew what you were doing.

Feature-wise, there's some compatibility breaks I were able to make and some quality improvements. The scanning process itself is pretty much the same, as that's just calling into decoders and handling when they return garbage.

Minibar's stored waveforms are 4096 samples of three 16-bit integers, instead of the 2048 samples of three 32-bit floats of the seekbar. Minibar doesn't compress them, but compression didn't really save much space anyway. Minibar uses lighter compression, but as compression doesn't have too much of an effect, it's fine.

As mentioned, minibar draws the visuals with GDI in software, but uses a way better resampling algorithm to fit the datapoints to the width of the window. The seekbar just did point sampling or trilinear interpolation, while the minibar does a high quality image-based resize of the source data to better reflect the source data.

In short, there's way less features and complexity in the minibar, but if it does what you want, I'd strongly recommend using that as that has a chance of getting updates, unlike the seekbar.
Title: Re: foo_wave_seekbar
Post by: wcs13 on 2018-01-10 13:26:05
I also said Zao's ORIGINAL seekbar. I couldn't just say "Zao's original seekbar and Zao's minibar", could I ? Ah... developer's ego... ^^
Relax man. I love your seekbar and I've praised YOUR work more than once in this thread already.
So thanks AGAIN for all that. ;)
Title: Re: foo_wave_seekbar
Post by: GeSomeone on 2018-01-10 13:40:17
I think Zao's reaction was pretty relaxed (did you even saw the smiley, wcs13?). And thanks Zoa for clearing this up.
Title: Re: foo_wave_seekbar
Post by: wcs13 on 2018-01-10 14:53:42
Mine was relaxed too. Did you even see my "^^" ? ;)
And thanks to Zao (yes, again, lol) for all his explanations. Everything's clearer now.

For the record, there is only one thing I find weird about minibar :
With Zao's original seekbar, AFAIK when foobar starts, we don't see a waveform until a song is played. We see only a central horizontal line, which is nice.
With minibar, when foobar starts, we see the waveform of the song that was selected last in previous foobar session before closing foobar, even though that song isn't selected anymore when foobar starts, and even though that song wasn't played. EVER.
And NO, the "show waveform for selected track instead of playing track" preference wasn't selected. Ever either.
Because of that, I don't think it's an intended behaviour, so maybe it's a glitch ?
I'd prefer minibar to behave like waveform seekbar when foobar starts. Thanks in advance @Case !
Title: Re: foo_wave_seekbar
Post by: Case on 2018-01-10 16:30:30
It shows the waveform of current track. It's the track foobar2000 has its internal cursor at and it's the track that will play if you hit Play. I see no sense in artifically making the component more stupid by showing nothingness instead. Also blank UI elements aren't pretty.

Did you know that it's not only a seekbar that you use to seek in a track while playing? You can also click anywhere on the waveform while stopped and playback will start from that position.

With that said if seeing the waveform of current track after player start is a showstopper feature for you I can add an option to disable it. But it really makes no sense in my head. But it wouldn't be a line because line means silent track. It would be blank.
Title: Re: foo_wave_seekbar
Post by: wcs13 on 2018-01-10 18:02:38
Thanks for your reply. Well, here's what disturbs me : since my minibar is configured to show the waveform from playing track, I don't see why it would ever show the waveform from a track that I have never ever played (let me emphasize that even if I selected it from previous session, I never played it). Makes no sense to me. ;)

I see three solutions to that :
- Either display a blank (you say blank UI elements aren't pretty, but for example I wouldn't like the Text Display component to display something if there's no track selected - it's not about being pretty but about making sense ;) )
- Or display something instead (a "[no selection]" or "[no playing track]" message (depending on the selected option in minibar preferences), a picture of a flying cat, whatever you want  :P  )
- Or have foobar visually highlight the last selected track from last session at startup, so it matches the displayed waveform

But the third solution would only make sense if minibar was configured to show waveform for selected track instead of playing track. So in my case it wouldn't make sense.
So yes, very honestly, an option to display a blank would be better for me. Sorry for bothering you and thanks for your understanding. :)
Title: Re: foo_wave_seekbar
Post by: Case on 2018-01-10 20:20:26
Posted a new version with option to not show the waveform on player start.
Title: Re: foo_wave_seekbar
Post by: GoaLitiuM on 2018-01-17 02:16:34
I just tried the Minibar version of the seekbar and I quite like it more than the original one, but one thing that bothers me is that the seekbar itself is causing some minor stuttering with games and while dragging any windows in main screen when the foobar window with Minibar seekbar enabled is on my other monitor. Windows 10 task manager also shows elevated GPU usage when the window is active, and it goes down the instant I minimize foobar.

EDIT: I think the main cause of this is that the Minibar seekbar is constantly rendering and updating its view even when the playback is paused. Zao's seekbar also seems to cause some stuttering when D3D9 or D3D2 frontend is selected, but GDI is stutter free. Would it be possible to add some kind of setting to limit how often the seekbar is being updated to avoid this?
Title: Re: foo_wave_seekbar
Post by: Zao on 2018-01-17 10:19:26
I've also observed this GPU drain and have not really found any way to mitigate it if you still want smooth painting.
The choices available as a child window is very limited and the only way to reduce it is indeed to draw less often.

The GDI mode in foo_wave_seekbar has a much lower update rate than the other two frontends. foo_wave_minibar doesn't have any control at all, as it was made to not be complicated. The difference between GDI and minibar is strange, as they're pretty much the same kind of painting logic.

It wouldn't surprise me if this is something that newer Windows 10 builds introduced too, considering that I've never had any trouble in the past with either component.

As for resolving this, I've got no clue. Drawing rapidly as a child window in foobar2000 is a right mess and you have to either be wasteful or careful to not starve the message pump. It's one of the reasons why I never bothered to make any dockable visualisations as the perf just isn't there.

Edit: I wonder how to benchmark this... run a stable game on the side and see how much mud it sucks?
Title: Re: foo_wave_seekbar
Post by: GoaLitiuM on 2018-01-17 18:08:11
I've had this stuttering ever since Windows 8 days, and it seems to only happen with multiple monitors both running at different refresh rates. Running a game in windowed mode with framerate capped at refreshrate, or moving a window around is how I usually spot the stuttering.

I personally don't care how smoothly the seekbar moves, most of the time I have foobar open it's open in my other screen and without any focus on it. The slow update rate of ~5Hz or so should be enough to mitigate the issue at least for me.
Title: Re: foo_wave_seekbar
Post by: Case on 2018-01-20 20:41:18
GoaLitiuM, if you wish to give a shot to my modfied version (http://www.foobar2000.org/components/view/foo_wave_minibar_mod) of Minibar its latest version has configurable frame rate and it stops screen updates when playback is paused or stopped.
Title: Re: foo_wave_seekbar
Post by: GoaLitiuM on 2018-01-21 14:37:42
GoaLitiuM, if you wish to give a shot to my modfied version (http://www.foobar2000.org/components/view/foo_wave_minibar_mod) of Minibar its latest version has configurable frame rate and it stops screen updates when playback is paused or stopped.
This is much better! How fast did it used to update before the change? It stutters much less now than before (about the same as foo_wave_seekbar in GDI mode), but there doesn't seem to be any difference with 5fps vs 60fps for the stuttering. Both plugins still stutter when the playback is paused though, and sometimes the minibar doesn't refresh the view when transitioning from paused to stopped state.
Title: Re: foo_wave_seekbar
Post by: Case on 2018-01-21 16:25:28
60 fps has been the default. The update logic has been a bit different from zao's original version but I don't think it should affect stuttering.

Do you have some visualizations or anything else weird in the UI? Once you hit stop or pause the component draws a few frames and then stops the refresh timer. Minibar at that point won't consume any CPU or GPU resources.
 
I replicated the state update bug, btw. I'll get it fixed but perhaps not today. Movie night.

Edit: fixed. Updated versions available.
Title: Re: foo_wave_seekbar
Post by: Kraeved on 2018-02-22 08:21:56
Dear Case, I regret to inform you that AAC LC files are not processed, i.e. viewport for waveform is totally filled (https://sub.god.jp/f/OrMHl7e0.png) with one (grey) colour.
Could you be so kind to fix it?
Title: Re: foo_wave_seekbar
Post by: Zao on 2018-02-22 15:12:01
@Kraeved Do you have an sample file that fails to scan, and what kind of output do you get in the Console when this happens?
Title: Re: foo_wave_seekbar
Post by: Case on 2018-02-22 15:33:58
@Kraeved - problem with raw AAC files is that they don't report length and don't support seeking (Peter's decision). Here's a test version that shows the waveform for such files anyway. It doesn't show any progress though. Would showing progress for unseekable files still make sense or would blank seekbar be preferred?

Edit: attachment removed.
Title: Re: foo_wave_seekbar
Post by: Kraeved on 2018-02-22 20:52:36
Zao, here goes the sample file (https://transfer.sh/t1bon/Dave%20Wesley%20-%20Pretermission%20v6.aac) as you requested. Story behind it as follows: I downloaded a videoclip via youtube-dl, then extracted its AAC LC encoded sound stream via ffmpeg to cut the visual weight off. No doubt I would prefer to avoid further transcoding to other lossy formats if possible.

Case, thank you for a quick fix, it surely soothes the tormented soul a bit, at least it enables me to see what happens, albeit not to control. Thing is I keep native seekbar hidden and use your waveform element to seek playable files instead. Thus, the inability to seek (even non-accurately via imaginable checkbox in Advanced settings) infuriates me (and others (https://hydrogenaud.io/index.php/topic,92617.0.html)) as I feel paralyzed (remember Stephen Hawking?), given that AAC is more widespread than, for example, MPC. Oh, Peter…

It seems the best bet so far is to put AAC into M4A container like this ffmpeg -i file.aac -acodec copy file.m4a
Title: Re: foo_wave_seekbar
Post by: Zao on 2018-02-22 23:28:09
I was going to suggest muxing it into a container based on your email, but it seems that you have already suggested it yourself now. :)

The reason the seekbar originally filters out tracks that doesn't support seek is that it's a good filter against weirdo formats that probably won't work anyway, and ones that tend to not advertise a correct length.

With some effort, or worst case, a two-pass analysis, they _could_ be processed to get a waveform but as you've observed, they still wouldn't seek right.
Title: Re: foo_wave_seekbar
Post by: Case on 2018-02-23 07:39:18
@Kraeved : the restrictions are just political push to get people to use proper container with the files. The ADTS AAC stream is similar to MP3 and requires parsing the bitstream to build seektable and extract track length. It was supported in foobar2000 v0.8 days and I have tried to get him to restore it, but without success.

The recommended way to proceed is to convert the files to MP4. The container allows instant seeking without building seektables manually and it allows using proper tagging. The ffmpeg method you used is lossless.

Another option with foobar2000 v1.4 is to use FFmpeg Decoder Wrapper (http://www.foobar2000.org/components/view/foo_input_ffmpeg) component and add *.AAC format to be handled by it. You can enable APEv2 tagging for the files without harming their use at least in most PC programs. This method requires setting the FFmpeg decoder component to be preferred over the built-in decoders in foobar2000.

But I'm still unsure what to do with Minibar (mod) component. Supporting files without length info properly requires changing the database format so I could store the length there without need to decode the file again each time. Another option is to do as the test version, possibly with added progress display. Or do as the original design was intented to work and show nothing but blank.
Title: Re: foo_wave_seekbar
Post by: Kraeved on 2018-02-23 08:09:44
Spoiler (click to show/hide)

Case, I believe the waveform should be shown if there is any sound bits within the file. Otherwise user would feel lost, because something is definitely pouring from the headphones and the status bar shows the elapsed time. A small question sign inside a faded circle somewhere in the right corner of the waveform with a tooltip explaining the inability to seek would complete the picture. Also, adding an option whether or not to “process formats without duration” might mitigate your worries about lengthy files, right?
Title: Re: foo_wave_seekbar
Post by: Case on 2018-02-23 09:06:22
I'll see how to improve the situation after work. I also had a crazy idea to allow seeking in unseekable local files. I can inject a DSP that brute-force decodes the file to the point user wants to seek to and then remove the DSP from the chain.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2018-02-23 10:04:12
@Case : Sounds like idea for foo_dsp_hacks. Reminds of similar plug fo UI ;-) . Nasty :-)
@Kraeved : I also wanted things to "work as I wish without changing files" to mitigate workload if I accidentally get big bunch of "problematic files". But you can see even in this thread history, that I changed my mind. I have had large collection of mvids in various containers (avi, mpg, etc.), from which I wanted to play audio in foobar. To mitigate certain problems I remuxed its whole to mkv containers using batch processing. Quick and easy process. Where remux was impossible (due to errors) I just configured foobar for certain file extensions to be decoded via foo_input_ffmpeg. No insisting on "avi must work" or "mpg/mpeg/m2v must work". We should use solutions that exist instead on keeping stuck in problematic situation. Especially if we have knowledge (about lossless remuxing, existing plugins, etc.).
Title: Re: foo_wave_seekbar
Post by: Case on 2018-02-23 16:21:51
@Kraeved : new version of Minibar mod is up. It now shows the waveform for files without length and allows seeking in them.
Title: Re: foo_wave_seekbar
Post by: Kraeved on 2018-02-25 15:29:47
Case, it seems a dirty workaround has its price as I faced a shutdown of Foobar2000 after trying to open CUE sheet pointing to non-existent files (https://transfer.sh/JUeGR/Depeche%20Mode%20-%20Spirit.cue).
Title: Re: foo_wave_seekbar
Post by: Case on 2018-02-25 16:43:10
Thanks for reporting. Fixed.
Title: Re: foo_wave_seekbar
Post by: Kraeved on 2018-02-28 01:06:25
Case, by the way, why the waveform of a lengthy file is still generated without regard to my order to stop the playback?
Title: Re: foo_wave_seekbar
Post by: Case on 2018-02-28 06:43:24
Stopping playback doesn't mean you won't play the file again. If the file is in your library the final scan will be stored in the database and the next time you come to the file the waveform is shown instantly. If the file is not in the library the waveform will still be cached for as long as the player is running. It works as designed.

I have realized scanning the waveforms can be slow on slow machines. For example on my test emulated Pentium 2 one has to wait quite long to see results. I may add an option to abort background scans that take longer than configured time.
Title: Re: foo_wave_seekbar
Post by: vidumec on 2018-02-28 11:15:41
may i suggest adding the ability to scroll over the seekbar to jump back/forth within the track, like in the original wave seekbar?
Title: Re: foo_wave_seekbar
Post by: Case on 2018-02-28 20:21:42
Wheel seeking is enabled in the just released 1.0.11 version (http://www.foobar2000.org/components/view/foo_wave_minibar_mod). By default one notch worth of wheeling seeks by 10 seconds. Configuration allows selecting the duration or changing the seek to use percentage of track length instead of static seconds.
Title: Re: foo_wave_seekbar
Post by: aeidein on 2018-02-28 21:41:17
Hi Case, I switched over to Waveform Minibar.  The edges are a lot harder whereas with the original waveform seekbar, they were quite a bit softer; any way to get a little blending/blurring around the edges?
Title: Re: foo_wave_seekbar
Post by: Case on 2018-03-01 06:36:19
Blurring like in the default DX9 waveform can't be done. You can get somewhat softer look by changing the colors to have less contrast and adjust the fill color closer to the background color. I'm sure you'll get used to the different looks.
Title: Re: foo_wave_seekbar
Post by: GeSomeone on 2018-03-03 11:58:56
Wheel seeking is enabled in the just released 1.0.11 version
Can it be disabled, like in the original?
Title: Re: foo_wave_seekbar
Post by: Case on 2018-03-03 17:51:01
Yes @GeSomeone - just set the seek amount to zero.
(https://i.imgur.com/Od8l5ZR.png)
Title: Re: foo_wave_seekbar
Post by: Dandruff on 2018-03-18 23:43:49
Will foo_wave_seekbar still work with upcoming foobar2000 v1.4 ?
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2018-03-19 06:41:04
Why not? It works in all 9 published betas of v 1.4.
Title: Re: foo_wave_seekbar
Post by: Dandruff on 2018-03-19 13:02:09
I thought there are some changes in 1.4 that requires all plugins to get updated!?
Title: Re: foo_wave_seekbar
Post by: Vicas on 2018-03-19 13:20:58
Old plugins can work on new versions of foobar but new versions of plugins can't work on old version of foobar.
Title: Re: foo_wave_seekbar
Post by: Zao on 2018-03-19 13:21:09
To my knowledge, there are no compatibility breaks.
It's the other way around, if you leverage functionality in the SDK that requires 1.4 in components, they won't work in older foobars.

If I ever get around updating it, it may end up using the new functionality. You should keep your foobars updated anyway, and if there's something holding you back, let Peter know.
Title: Re: foo_wave_seekbar
Post by: Dandruff on 2018-03-19 13:24:36
Ok. Thanks!
Title: Re: foo_wave_seekbar
Post by: Peter on 2018-03-19 13:40:21
The current SDK can be configured to produce either v1.4+ components or v1.3+ components. Configuring the SDK for v1.3+ disables SDK features that specifically require v1.4+ to work.

Furthermore, the v1.4 series are compatible with all components made for the v1.3 series.
Title: Re: foo_wave_seekbar
Post by: Dandruff on 2018-03-19 13:45:26
Ok, thanks for the clarification!
Title: Re: foo_wave_seekbar
Post by: Daeron on 2018-05-27 00:21:40
Any chance of implementing essentially a user-defined vertical axis scaler for foo_wave_minibar?

My current foo_wave_seekbar is on the left (the one im currently using) and minibar on the right:
(https://i.imgur.com/KiwjYI1.png)

Notably the former is off center with a code I picked up somewhere in this topic, then (I think) slightly modified it to stretch out further. The result is that minibar's waveform produces a consistently smaller (less tall) image. I would prefer if it occupied more of its panel with actual content for aesthetical reasons. I don't care if this might result in clipping. I would only increase it by lets say 5% so the majority of tracks would roughly fill the entire window height-wise, eliminating the unused whitespace.

The code im currently using in foo_wave_seekbar for reference:
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;
float3 track_magnitude  : TRACKMAGNITUDE;

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( float2 tc, float cursorPos )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex1D(sTex, tc.x);
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
float below = tc.y - minmaxrms.r;
float above = tc.y - minmaxrms.g;
float factor = min(abs(below), abs(above));
bool outside = (below < 0 || above > 0);
bool inside_rms = abs(tc.y) <= minmaxrms.b;
bool played = cursorPos < tc.x;
float4 inside_color = played ? textColor : highlightColor;
float4 bgColor = backgroundColor;

float4 wave = outside
? bgColor
: inside_color
;

return saturate(wave);
}

float4 reflect_evaluate( float2 tc, float cursorPos)
{
float baseline = -1.0/3.0;
float low_unscale = 3.0/2.0;
float high_unscale = 3.0/4.0;
bool mirrored = tc.y < baseline;
if (mirrored) {
tc.y = baseline - tc.y;
tc.y = tc.y * low_unscale;
}
else {
tc.y = tc.y - baseline;
tc.y = tc.y * high_unscale;
}
float mag = max(-track_magnitude.r, track_magnitude.g);
if (mag > 0.95) {
tc.y = lerp(0, mag/0.95, tc.y);
}
float boost = mirrored ? 1.3 : 1.0;
float gradient = lerp(0.7, 1.0, tc.y);
return boost * gradient * evaluate(tc, cursorPos);
}

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 = reflect_evaluate(input.tc, cursorPos);
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();
}
}
Title: Re: foo_wave_seekbar
Post by: Case on 2018-05-27 12:48:48
I just released a new version of minibar (mod) component that has the ability to scale the waveform. The default selection contains real size scale and a setting to normalize the waveform and you can manually type a scale value from 0.1 to 10.0.
Title: Re: foo_wave_seekbar
Post by: Zao on 2018-05-27 13:43:18
The best way of handling feature requests - waiting for Case to bite on the bait with his mod.  :))
Title: Re: foo_wave_seekbar
Post by: Daeron on 2018-05-27 21:02:14
Thanks for the update! Seems to do all I wanted.
Title: Re: foo_wave_seekbar
Post by: Nighted on 2018-05-29 04:08:10
Hello, I haven't read through the entire thread but I'd be surprised if this hasn't been requested already:

Reverse scroll wheel option please. I find that it's the exact opposite direction of what I'm used to.
Title: Re: foo_wave_seekbar
Post by: Zao on 2018-05-29 10:17:48
Nighted: Which component would this be for? The thread kind of covers both my foo_wave_seekbar, my foo_wave_minibar and Case's Minibar mod.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2018-05-29 13:57:29
Case's mod should have separate thread to avoid confusions.
Title: Re: foo_wave_seekbar
Post by: Case on 2018-05-29 16:38:44
I made a new thread. Not sure if it would be a good idea for a mod to move related posts there. The new thread is here (https://hydrogenaud.io/index.php/topic,116045.0.html).
Title: Re: foo_wave_seekbar
Post by: Sergey77 on 2018-06-02 13:34:46
Hello Everyone!

Dear Zao and Case,
Thank you for the Components Waveform Seekbar and Waveform Minibar (mod). It is very important for us, ordinary users such as me.
That gives us freedom of choice design of our favorite fb2k (infinite thanks to Peter for his great project).
Now let me ask, why panels Waveform Seekbar and Waveform Minibar (mod) are "silent" when I use a stream radio or foo_youtube stream?
While other visualizations are working.
Can this be somehow corrected?
If this isn't possible, then I suggest to add Spectrogram visualization mode for this panels (as for DUI see attached pic.) when work with a stream radio or foo_youtube stream.
I will be glad to see your feedback.

Thanks.
Title: Re: foo_wave_seekbar
Post by: lvqcl on 2018-06-02 13:54:49
But they're not visualizations, they're seekbars.
Title: Re: foo_wave_seekbar
Post by: Sergey77 on 2018-06-02 14:20:36
But they're not visualizations, they're seekbars.
During stream playback - could be as visualization. Why not? There is no Spectrogram visualization in CUI like in DUI.
But OK if that can't be combined.
Title: Re: foo_wave_seekbar
Post by: EpicForever on 2018-06-03 21:10:56
There is spectrogram in CUI... I use it quite frequently... And it can be combined (spectrogram as image for seekbar, instead waveform) using WSH panel mod. I remember that someone (marc2003?) has posted screenshot and most likely even code how to achieve this. But I don't think that I will be able to find it for you. You need to dig it on your own.
Title: Re: foo_wave_seekbar
Post by: Zao on 2018-06-04 07:40:02
@Sergey77: I've considered for my components to have some sort of "short history" display for streaming audio showing the last 30 seconds or something, but it doesn't fit into the central data idea of self-contained waveforms, nor does any of the operations on it like seeking make sense.

As has been recommended, in CUI you could use some sort of programmable stack component, which would show the seekbar component for seekable tracks, and some other visualisation/element for streaming content.
Title: Re: foo_wave_seekbar
Post by: Sergey77 on 2018-06-04 20:45:41
There is spectrogram in CUI... I use it quite frequently...
I meant Specrogram as item layout (or as item of toolbars) of CUI (i.e. not popup window).
And it can be combined (spectrogram as image for seekbar, instead waveform) using WSH panel mod. I remember that someone (marc2003?) has posted screenshot and most likely even code how to achieve this. But I don't think that I will be able to find it for you. You need to dig it on your own.
@EpicForever, thanks for the support and the desire to help! Don't need to spend your time for finding, of course.
I think that if developers want they will create it someday, and we will just wait ;)
In general, this idea came to me only because the panels (Waveform Seekbar and Waveform Minibar (mod)) look "empty" during playback of a stream, and I don't like it, so I suggested. No practical good from this I didn't think to get, only for fb2k design.

@Sergey77: I've considered for my components to have some sort of "short history" display for streaming audio showing the last 30 seconds or something, but it doesn't fit into the central data idea of self-contained waveforms, nor does any of the operations on it like seeking make sense.

As has been recommended, in CUI you could use some sort of programmable stack component, which would show the seekbar component for seekable tracks, and some other visualisation/element for streaming content.
@Zao, thank you for your attention, comment and recommendation.

Hero Members, I was very glad to see your replies!

Best regards.

Title: Re: foo_wave_seekbar
Post by: tedych on 2019-06-14 21:34:12
I have always been struggling finding recent version download link for this component (waveform seekbar).
It's always a pain to find the latest version. Why not updating the component page in foobar2000 website? The last version there dates back in 2014.
I currently have 0.2.45.4 downloaded ages ago and i remember it had some bugs fixed then, after 0.2.45.
Is there a new version and could someone post a link to the latest version please?
I'm with an old 1.3.x foobar and I need to finally update to get some new functionality after testing it in a VM. And I'd wish the latest version of this component if possible.
Title: Re: foo_wave_seekbar
Post by: Zao on 2019-06-14 23:03:08
tedych: I've not trusted the stability of the test versions of later releases I've made to put it up in public, particular as some of them lost XP compatibility as I didn't have enough of the toolchain needed to build them right.

Uploading them into the updater would mean that I have to deal with the fallout of it possibly breaking some subset of users, that's all.
Title: Re: foo_wave_seekbar
Post by: tedych on 2019-06-15 08:32:48
Ok, but XP is far back in history already not being updated anymore. There could be just a link to a XP version for anybody who might want it (small subset I believe).
Anyway, 0.2.45.4 has been working very fine for me in the last 2(or 3?) years, foobar2000 being 24/7. I hope it will work fine in 1.4.4 as well. So I assume there is no newer (beta, test) version than what I already have.
Thanks.
Title: Re: foo_wave_seekbar
Post by: tedych on 2019-06-21 09:04:05
As I don't care anymore about XP, and if I got it right, XP compatibility was the main point not pushing the latest test versions to official channel/page, I just installed 0.2.45.4 in the latest foobar2000 1.4.4. A week later, it is rock stable for me again, 24/7 :) .
I remember back then you have fixed some glitches in .4 we had with the "official" 0.2.45 version.
Without this component foobar2000 would have been like having one blind eye :) .
Title: Re: foo_wave_seekbar
Post by: udege on 2019-07-05 21:54:37

Screendump explained
The fx are running at the same time in two popup panels; fbuser's component (http://www.foobar2000.org/components/view/foo_popup_panels) seems ideal when comparing different waveform effects.
For illustrative purposes and as an possible appetizer for others I've activated the time scales as well as the time axis in the upper panel.
The tick sizes have been increased as well for the same reason.

Hello! It looks very cool! Could you share the code? All links from Just_Addict are no longer available ...
Title: Re: foo_wave_seekbar
Post by: sveakul on 2019-07-06 04:37:14
In general, this idea came to me only because the panels (Waveform Seekbar and Waveform Minibar (mod)) look "empty" during playback of a stream, and I don't like it, so I suggested. No practical good from this I didn't think to get, only for fb2k design

Sergey77 I agree with you that it would be nice to be able to have a "placeholder" image appear for streams instead of empty blank, as "nature abhors a vacuum".  Another player with a seekable spectrogram that of course doesn't work for streams has the option to display a user-selectable fixed image there for streams, much easier on the eyes than a blank  :)
Title: Re: foo_wave_seekbar
Post by: Sergey77 on 2019-07-06 09:05:43
Empty UI elements suck but these components are waveform seekbars, not spectrogram visualizers. If I used streaming audio more than to quickly test something, I'd probably be more willing to hack together something.
@sveakul, It's been a year since this quote. And if @Case still did not use streaming audio more than before, we still only have to wait... :)
Title: Re: foo_wave_seekbar
Post by: Zao on 2019-07-06 22:14:01
Hello! It looks very cool! Could you share the code? All links from Just_Addict are no longer available ...

Their gists work fine for me, you might be in a region or on an ISP that blocks or is blocked from github.
I mirrored the four files at http://www.acc.umu.se/~zao/foobar2000/foo_wave_seekbar/
Title: Re: foo_wave_seekbar
Post by: udege on 2019-07-07 21:52:29
Their gists work fine for me, you might be in a region or on an ISP that blocks or is blocked from github.
I mirrored the four files at http://www.acc.umu.se/~zao/foobar2000/foo_wave_seekbar/

Oh! Thank you so much for the quick response and for your work! I meant a little different ... I wrote about another code, how did this look like:
(http://i.imgur.com/NehSAw1l.jpg)
It's from here https://hydrogenaud.io/index.php/topic,77490.msg922397.html#msg922397 (https://hydrogenaud.io/index.php/topic,77490.msg922397.html#msg922397)
Title: Re: foo_wave_seekbar
Post by: anyone on 2019-10-14 09:13:35
@Zao

I am looking for a way to make my Waveform Seekbar bigger, current it only a tiny bit line above the playlist, any idea to achieve this?

Title: Re: foo_wave_seekbar
Post by: frogworth on 2019-10-14 11:02:22
I am looking for a way to make my Waveform Seekbar bigger, current it only a tiny bit line above the playlist, any idea to achieve this?
The seekbar just fills any UI Element you put it in. If you're using the Default UI, you need to enable Layout Editing Mode and then either you can resize the element that you've got the seekbar in or you can cut your entire layout, add an extra horizontal splitter, put your layout in the lower one and the seekbar in the upper (or whatever - endless choices).

If you're using Columns UI there'd be a similar process - I don't really know it.
Title: Re: foo_wave_seekbar
Post by: anyone on 2019-10-19 09:27:19
The seekbar just fills any UI Element you put it in. If you're using the Default UI, you need to enable Layout Editing Mode and then either you can resize the element that you've got the seekbar in or you can cut your entire layout, add an extra horizontal splitter, put your layout in the lower one and the seekbar in the upper (or whatever - endless choices).

I finally find my problem, as I used toolbar element for the waveform seeker, which size stick with toolbar size and can't  adjustable.

thanks for your guide, this helps me to layout waveform seekbar in UI element after I disable the toolbar one.
Title: Re: foo_wave_seekbar
Post by: Dandruff on 2019-10-20 23:14:32
With some themes it seems to be impossible to resize elements. Just has the same issue. Loaded a different theme and replaced an element with the Waveform seekbar and the resizing was possible ....
Title: Re: foo_wave_seekbar
Post by: studio13 on 2020-04-24 13:56:59
Hello I'm using your seekbar component a lot really appreciate the work.

I have two questions ..

1) Where do I get latest ? http://www.foobar2000.org/components/view/foo_wave_seekbar or do I use GITHub ?
2) How do I for a new waveform to be created ? The Rescan all waveforms option doesn't seem to work for me. Maybe I am not using it right ? What's the method for forcing new waveforms to be created ? (I do a lot of audio editing and the waveforms in Foobar/seekbar are not updated after I edit. In fact they will never update until I change the file path).

Thanks
Title: Re: foo_wave_seekbar
Post by: Zao on 2020-04-24 22:36:18
@studio13
1) That's a tricky question. The latest version uploaded to the components site is indeed 0.2.45. There's later patch releases available which I've made that may address bugs, but could have problems which have made me not update the "stable" version in the components repository. You can fetch them from URLs like https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.45.6.fb2k-component
There's patch versions 1, 2, 3, 4, 6. Don't ask about .5  :))

While you technically could compile one yourself with the source code, not even I have an environment handy that is capable of building with all the custom dependencies and weird toolchains that it requires, unless one of the build VMs have survived.

2) There's an option in advanced preferences to "Always rescan track if requested by user" which defaults to off. If that's enabled the component should honor explicit requests to scan waveforms. This seems to be broken in 0.2.45.6, so try 0.2.45.4 maybe or checking the option in the released version.

This "foo_wave_seekbar" component is pretty dead, can't change much about it without breaking it for legacy users, all new effort went into a lighter rewrite called "foo_wave_minibar" which @Case now maintains as a mod version with popular user-requested features.

You may want to give it a try, might be good enough for your use cases: https://www.foobar2000.org/components/view/foo_wave_minibar_mod
Title: Re: foo_wave_seekbar
Post by: anamorphic on 2020-04-25 05:29:27
2) How do I for a new waveform to be created ? The Rescan all waveforms option doesn't seem to work for me.
Just to further note, rather than doing that, for individual tracks there are two options in right-click track > Utilities menu - 'Extract...' and 'Remove...'

With the option Zao mentioned enabled, I believe 'Extract...' does rescan although there is no visible indication because my waveforms are no different (not edited). The 'Remove...' one certainly works as when clicking play again I can see it rescan.

I'm one of the fanatics who thinks this seekbar looks a lot nicer than the other one. :D
Title: Re: foo_wave_seekbar
Post by: studio13 on 2020-04-27 14:55:25
Thanks @Zao and @anamorphic for the tips really appreciate it
Title: Re: foo_wave_seekbar
Post by: robertospeed on 2020-08-01 11:00:26
Waveform Seekbar unfortunately when I listen to DST64 files it takes up a lot of CPU, is there a way to solve this problem?
I really like the Waveform Seekbar.
Title: Re: foo_wave_seekbar
Post by: kode54 on 2020-08-02 00:58:03
There are successive permanent ways to solve it.

1) You can convert your DST64 files to DSD64 files, losing the compression.

or

2) You can recompress your DST64 files to WavPack DSD files, using the WavPack command line compressor. It's not quite as efficient at compression, but it's loads faster at both compression and decompression than DST is. DST barely achieves real time on modern systems by decompressing multiple blocks in parallel threads.

or, the destructive third option

3) You can decompress your DST64 and produce PCM output, which will be even faster to decode. This won't compress nearly as efficiently as just DSD, as DSD to PCM is a lossy process, and you have to downsample, so further loss. Tread with caution.
Title: Re: foo_wave_seekbar
Post by: robertospeed on 2020-08-02 08:12:07
There are successive permanent ways to solve it.

1) You can convert your DST64 files to DSD64 files, losing the compression.

or

2) You can recompress your DST64 files to WavPack DSD files, using the WavPack command line compressor. It's not quite as efficient at compression, but it's loads faster at both compression and decompression than DST is. DST barely achieves real time on modern systems by decompressing multiple blocks in parallel threads.

or, the destructive third option

3) You can decompress your DST64 and produce PCM output, which will be even faster to decode. This won't compress nearly as efficiently as just DSD, as DSD to PCM is a lossy process, and you have to downsample, so further loss. Tread with caution.
I thank you for the advice, but I prefer to keep the DST64 as they are, they would be in SACD ISO and I know how to convert them etc., however, I repeat I like to leave them as they are, and in any case also the DSD64 occupies a lot of CPU, only for a few seconds compared to the DST64, then it also depends on the processor, luckily I have a ryzen 7 2700x, but the bottom line is not this, I like the Waveform Seekbar and I believe that unfortunately this problem cannot be solved is it? sin.
Title: Re: foo_wave_seekbar
Post by: kode54 on 2020-08-02 08:26:29
DST64 needs all of the threads of your processor to decode for playback, background decoding will just slow things down even more. The only thing you can do is disable the waveform scanning for DST64 files.
Title: Re: foo_wave_seekbar
Post by: Zao on 2020-08-02 08:30:10
If your odd archival audio format require all the cores of the system to decode in around realtime, you may want to configure the number of parallel threads for foo_wave_seekbar to one, and maybe consider scanning your tracks offline if you want to prevent interruptions during playback.

You could also as kode says go and transform it losslessly to a format more suitable for realtime use, but I'm not touching that discussion with a ten foot pole.
Title: Re: foo_wave_seekbar
Post by: robertospeed on 2020-08-02 08:57:09
DST64 needs all of the threads of your processor to decode for playback, background decoding will just slow things down even more. The only thing you can do is disable the waveform scanning for DST64 files.
I don't know how to disable in DST64 and then I no longer see the waveform in DST64?
Title: Re: foo_wave_seekbar
Post by: robertospeed on 2020-08-02 08:59:35
If your odd archival audio format require all the cores of the system to decode in around realtime, you may want to configure the number of parallel threads for foo_wave_seekbar to one, and maybe consider scanning your tracks offline if you want to prevent interruptions during playback.

You could also as kode says go and transform it losslessly to a format more suitable for realtime use, but I'm not touching that discussion with a ten foot pole.
better explain why I'm Italian and I don't understand English well, I use a translator, can you explain exactly how to do it?
Title: Re: foo_wave_seekbar
Post by: frogworth on 2020-08-02 09:06:15
maybe consider scanning your tracks offline if you want to prevent interruptions during playback.
better explain why I'm Italian and I don't understand English well, I use a translator, can you explain exactly how to do it?

Not sure if this is what you're looking for, but if it's just high CPU whenever it's calculating the waveform, you could do it ahead by highlighting the tracks, right-clicking and selecting "Extract Seekbar Signature" under Utilities.
(https://www.frogworth.com/ExtractSeekbar.png)
The waveforms will be cached once they've been extracted and your CPU can be used to decode the audio instead.
Title: Re: foo_wave_seekbar
Post by: robertospeed on 2020-08-02 09:18:28
frogworth , yes, I did as you say, but first, to scan all the tracks, always put the CPU under strain
Title: Re: foo_wave_seekbar
Post by: Just_Addict on 2020-08-03 02:24:37
frogworth , yes, I did as you say, but first, to scan all the tracks, always put the CPU under strain

As was already explained to you, the decoding of DTS64 inherently will put a big load on your CPU, whether that is to _play_ those files, or to _analyze_ them to extract the Seekbar signatures.

So you will never, ever escape that conundrum... the upside is, once you have done this "Extract Seekbar..." once, it will not need to be done again and when playing those files, your CPU will not suffer extra load from other things than from decoding the file for output.

Sometimes I don't understand people, they spend bucketloads of money on powerful CPU's but when that power actually gets used, they complain that it is using too much CPU power, go figure...
Title: Re: foo_wave_seekbar
Post by: kode54 on 2020-08-03 04:45:07
Also, I don't know the point of keeping SA-CD ISOs. The only thing likely to play them ever again is either software on a computer, or burned, a modded PS3, the same thing used to extract the originals.

You can keep your ISOs for archival purposes, but I really would recommend using WavPack to store the individual tracks for playback purposes. The bonus is, you can even edit the tags easily.
Title: Re: foo_wave_seekbar
Post by: robertospeed on 2020-08-03 18:57:52
 like to keep the sacd iso because I burn it to DVD, I have a blu-ray player that also reads the burned sacd, then the sacd iso in dst format you say that I should convert them to DSD file? or in WavPack? but I have a powerful CPU and it doesn't worry me as Just_Addict says.
Title: Re: foo_wave_seekbar
Post by: kode54 on 2020-08-04 01:12:50
Yes, you have a powerful CPU. The decoding will only be painful for the entire process of waveform scanning, where you're likely to be able to scan one or two files at once, at slightly better than real time. I hope you don't have a whole lot of files to scan, that will take almost as long as it takes to listen to them.
Title: Re: foo_wave_seekbar
Post by: robertospeed on 2020-08-04 15:32:10
Yes, you have a powerful CPU. The decoding will only be painful for the entire process of waveform scanning, where you're likely to be able to scan one or two files at once, at slightly better than real time. I hope you don't have a whole lot of files to scan, that will take almost as long as it takes to listen to them.

Which program should I use to convert DST64 to WavPack? BatchEncoder? and to have the tags do cue + WavPack?
foobar doesn't do this kind of conversion right? as BatchEncoder.
Please illuminate yourself.
Title: Re: foo_wave_seekbar
Post by: dts350z on 2020-12-12 19:19:39
Is there a way to completely defeat storing of all waveform signatures?

I'm doing development of upmix programs and 99 times out of 100 I need to remove the signature to see the new one because I have modified the file and it has the same filename.

Thanks!
Title: Re: foo_wave_seekbar
Post by: frogworth on 2020-12-12 23:19:29
Is there a way to completely defeat storing of all waveform signatures?

You can make the wavecache.db file read only. 99% sure that would do it.
Title: Re: foo_wave_seekbar
Post by: dts350z on 2020-12-13 04:01:42
Is there a way to completely defeat storing of all waveform signatures?

You can make the wavecache.db file read only. 99% sure that would do it.

Yeah that seems to work. Thanks!!!
Title: Re: foo_wave_seekbar
Post by: Michael Z Freeman on 2021-06-26 17:26:40
Could somebody please post a screenshot?
(http://www.acc.umu.se/~zao/seekbar19.png)
[/quote]

Hi. Where is the shader code to show the waveforms as shown in the above image ? I've tried fiddling with the colour setting but all I get is a flat colour displayed on the waveform, ie. it does not have all the subtle blending. Anyone ?
Title: Re: foo_wave_seekbar
Post by: Michael Z Freeman on 2021-07-13 17:04:49
I found out I had the colours set wrong after my previous post. However turning any colour selects off does not give that yellow coloured waveform. What I'm really looking for is some "jazzed" up settings for the "Frontend Settings" where you put the code in. I could not find very little when going through this entire thread or on the net. Cheers.
Title: Re: foo_wave_seekbar
Post by: Zao on 2021-07-13 18:01:07
Unchecked colour boxes are not fixed colours, they're taken directly from the player theme colours of the same names.
The screenshot probably used the DUI colour theme "Gray Orange" which has the following parameters (RGB):

(https://i.imgur.com/yuKmKUh.png)

There's indeed no central gallery to find and share effect files with each other, the bundled effect is likely quite close to how it looked back in those days, it looks somewhat similar with the above parameters.

I had some plans and attempts at creating such a place, but it did not pan out before the end of maintenance of this component.

There's a few effect files scattered across this thread, but overall the system was simultaneously too complicated and powerful, exposing too much to users. While there were some impressive effects created, many of them had subtle errors in them which made it almost impossible for me to alter the component as it could silently break the looks of people's players.

As for foobar2000 component development, it's pretty dead to me personally.
For my old components there's pressure to support super ancient operating systems and the player is still a 32-bit process, making it quite a second-class citizen these days when it comes to development.

These days, I would have to build special-purpose virtual machine or run on old hardware to compile the component again.
Title: Re: foo_wave_seekbar
Post by: Michael Z Freeman on 2021-07-14 16:33:55
There's a few effect files scattered across this thread, but overall the system was simultaneously too complicated and powerful, exposing too much to users. While there were some impressive effects created, many of them had subtle errors in them which made it almost impossible for me to alter the component as it could silently break the looks of people's players.

As for foobar2000 component development, it's pretty dead to me personally.
For my old components there's pressure to support super ancient operating systems and the player is still a 32-bit process, making it quite a second-class citizen these days when it comes to development.

These days, I would have to build special-purpose virtual machine or run on old hardware to compile the component again.

Should I be using some other plugin ? What about JScript panel (http://"https://hydrogenaud.io/index.php?topic=110499.0") ? There's something at the end of the thread about displaying waveforms. I know for a fact that HTML5 can have custom shader effects over page components.
Title: Re: foo_wave_seekbar
Post by: Zao on 2021-07-14 16:39:54
A big part of the my two components (this one and Case's mod of the minibar) is to automatically or explicitly decode tracks behind the scenes to precompute a simplified idea of the waveform, which is subsequently visualised.

The visualisation is straightforward enough, but you have no way to generate or access those datasets from the outside.

Fun fact - in the beginning this component was split into two distinct components, one that handled the database cache and generation aspects, and one that dealt with the UI element. Those were merged eventually as trying to keep them in sync was inconvenient.
Title: Re: foo_wave_seekbar
Post by: marc2k3 on 2021-07-14 17:06:58
re: JScript Panel it's very crude. It passes the filename of the playing track to ffmpeg which decodes the file and pipes the output to Sox which generates a spectrogram image saved as png which is cached indefinitely and used as a background image for the seekbar. It's possible to customise the SoX options/clear the cache using the right click menu.

By default, it looks like this...

(https://i.imgur.com/arJqYWm.png)

It's very much limited to using gdiplus for displaying images.
Title: Re: foo_wave_seekbar
Post by: Michael Z Freeman on 2021-07-14 17:59:31
Looks good !

I can't find it now, but you can generate a waveform using javascript.

I used sox at one point do add waveforms to a Linux file browser.

None of the DJ mixer software puts these waveforms in the music library browser apart from Pioneer Rekordbox and I don't think foobar2000 can have them as a column in playlist. This is important for identifying tracks alongside a proper cover. Can you tell I started DJ'ing with boxes of vinyl ? And yes I could identify a track by remembering the pattern of the vinyl grooves. Anyway I digress.
Title: Re: foo_wave_seekbar
Post by: LL25255252 on 2021-11-21 22:10:23
It seems that when deleting a track its entry is not deleted from the waveform database.
I've noticed it when I had 2 tracks with the same metadata (the second track is an Audacity enhanced version of the first track) . After I deleted the first track I started playing the second. To my surprise the plugin used the waveform of the first track without processing the playing track.
Title: Re: foo_wave_seekbar
Post by: frogworth on 2022-09-06 05:23:53
So I presume @Zao that this is dead and there's no way you'll make a 64bit version?

I ask because Case's choice to make the minibar mono only means it's really not feature-equivalent with this one, and just doesn't satisfy the needs of a lot of us.
I have no performance issues with this original component.
Title: Re: foo_wave_seekbar
Post by: srdn on 2022-09-06 10:10:31
A long time ago I copied this code on some site
X

Spoiler (click to show/hide)
Title: Re: foo_wave_seekbar
Post by: fooball on 2022-09-06 11:52:56
...and just doesn't satisfy the needs of a lot of us.
Sorry to seem picky, but what does "a lot of us" mean?  "Some of us" might be the more accurate phrase, unless someone has the statistics.
Title: Re: foo_wave_seekbar
Post by: frogworth on 2022-09-06 13:22:06
Sorry to seem picky, but what does "a lot of us" mean?  "Some of us" might be the more accurate phrase, unless someone has the statistics.
Well it's all anecdotal unless we do a poll, and even then it's hardly scientific. But there were certainly a fair few enquiries when Case released the mod, and he was so definitive about it that it basically shut down any further discussion at least over there. His choice of course.

I also realise that upgrading this to 64bit is highly unlikely, but I did want to just put it out there.
Title: Re: foo_wave_seekbar
Post by: Zao on 2022-09-06 15:49:04
So I presume @Zao that this is dead and there's no way you'll make a 64bit version?

I ask because Case's choice to make the minibar mono only means it's really not feature-equivalent with this one, and just doesn't satisfy the needs of a lot of us.
I have no performance issues with this original component.

Fun fact - I wrote the original minibar (which Case then took over and improved) as a fresh start with an intentionally reduced feature set. This was both due to the maintenance burden of historical design choices and to feel out how it would be different if done without legacy constraints. It turned out quite well and I'm generally pleased with the direction and stewardship Case has put into it.

Sorry to seem picky, but what does "a lot of us" mean?  "Some of us" might be the more accurate phrase, unless someone has the statistics.
Well it's all anecdotal unless we do a poll, and even then it's hardly scientific. But there were certainly a fair few enquiries when Case released the mod, and he was so definitive about it that it basically shut down any further discussion at least over there. His choice of course.

I also realise that upgrading this to 64bit is highly unlikely, but I did want to just put it out there.

Theoretically it could probably be built as x64, but it would need an audit of the codebase for portability issues as it's written in an era where a 64-bit foobar was a running joke and as such it may have some explicit or implicit assumptions about data types.

On the chance of seeing a recompile of it - I haven't even touched the new foobar200 SDK nor have I tested the new fb2k versions more than briefly. There's also the problem that the tail end of development on this component had a tendency to break in new ways every time I touched it, I don't have much confidence in that a new build would be reliable.
It's also rough to build for anyone else given the quite weird ancient dependencies needed.

As I'm swamped with other projects which I can barely give any attention to, I'm not super keen on picking something as support-heavy like this up again even though it has a happy and loyal following beyond my wildest beliefs.

All in all, the old rationale I've posted a couple of times holds, this component is forever stuck with bad design decisions like exposing ill-formed D3D9 shader source to end users which puts a big mute on the desire to touch it again.
Title: Re: foo_wave_seekbar
Post by: frogworth on 2022-09-07 03:26:34
Thanks Zao, certainly makes sense.
Title: Re: foo_wave_seekbar
Post by: Zao on 2022-10-17 07:21:46
@frogworth So... thanks to people like you on the boards, on GitHub and on IRC wishing for this component to carry on I've done some occasional work in the last month to get it building and it is mostly functional. Some loose thoughts around it all follow here.

I'd like to make any eventual release of this experiment a 0.3 version, breaking away from some of the old constraints like which data I store in the cache, the need to write raw HLSL effects, and a revamped customization user interface leveraging Dear ImGui. I have absolutely no idea about the timeline of all this and how the final component will work.

I've ported the Direct3D 9 frontend to Direct3D 11 and as such some of the more complicated old effects may need some fixing to build with a more conformant effect compiler. I've not yet figured out the user story around that. This would raise the minimal spec needed for the component a bit, not sure how far but probably Win7 or Win10 with Direct3D 11.

It's too much development effort to keep everything old around and if I have to cut things out I might as well do it right from the start to avoid having to support it for another decade, the old component and 32-bit foobar is still around for people stuck in the far past.

I'd like to turn the current kind of shader effect into a bit of a legacy thing, instead favouring some sort of layer stacking model where you compose simpler layers like a background, a waveform, a highlight, a progress indicator, etc. That's still quite in the air, haven't prototyped anything around that yet.

WIP screenshot from just last night where I got multiple elements working again:
(https://i.imgur.com/dSGypRs.png)
Title: Re: foo_wave_seekbar
Post by: frogworth on 2022-10-17 09:38:08
Amaaaazing news, @Zao, this is great to hear and looks good!
I do think that in order to support a 64bit host, breaking from a lot of backward compatibility with effects etc is totally understandable.
I'll be happy if it supports showing multi-channel waveforms really :)

Now I have to find those Infected Mushroom remixes...
Title: Re: foo_wave_seekbar
Post by: baloneyboy on 2022-10-17 21:06:37
@Zao That's awesome! Thanks! This component is currently the only thing which keeps me from upgrading.
Title: Re: foo_wave_seekbar
Post by: Hakker on 2022-10-18 12:39:10
@Zao gotta do a shout out for touching it again man. Personally I used GDI rendering, but really we settle for Vulkan or DX12 nowadays as well  ;)  ;)
Seriously though I'm thanking you for even attempting it. if dx9 has to go for stability then really just gut it out as many probably won't even have it installed anymore. The main reason people here ask about it is the per channel seekbar.
Title: Re: foo_wave_seekbar
Post by: mudlord on 2022-10-19 20:44:47
Personally I used GDI rendering, but really we settle for Vulkan or DX12 nowadays as well  ;)  ;)

No....You don't need VK just to render 2 triangles.
Title: Re: foo_wave_seekbar
Post by: Zao on 2022-10-20 09:29:55
[...] but really we settle for Vulkan or DX12 nowadays as well  ;)  ;)

Hah, not quite going that overkill in terms of API even if it would be a neat diversion if I had infinite time and competence. ^_^
For me the sweet spot is D3D11 as it has great vendor support, tends to work everywhere once it works on my machine and gets rid of many of the legacy aspects of D3D9 like most types of device loss and fighting the overly restrictive shader models.

For hobby development that's more oriented around shipping something usable rather than personal improvement and chasing the leading edge, I strongly recommend that people start with an established non-ancient API like D3D11 or OpenGL 4.6. They have their quirks but the benefit in being able to actually do things is of great value.

I'm sure that there'll be some people who have Interesting Setups that will run into problems with this revamped component but we'll figure that out once we get there. The big unknown I have right now is whether existing effects will work reliably, and whether it'll matter in the end when I flesh out the new customisation system.

For all you GDI/D2D folks, the migration path is definitely easier as long as I remember you exist.
Title: Re: foo_wave_seekbar
Post by: baloneyboy on 2022-10-20 19:51:41
For all you GDI/D2D folks, the migration path is definitely easier as long as I remember you exist.
I've always used D2D
(https://thumbs4.imagebam.com/44/64/a8/MEFRV6Y_t.jpg) (https://www.imagebam.com/view/MEFRV6Y)
Title: Re: foo_wave_seekbar
Post by: komhst on 2023-06-06 23:02:27
After manually removing the bonjour service and clearing the registry, the foo_wave_seekbar component doesn't load anymore and I get the following message as soon as I open foobar:

Failed to load DLL: foo_wave_seekbar.dll
Reason: A dynamic link library (DLL) initialization routine failed. 

I tried to reinstall the component but nothing happened, the problem remains.

Do you know how to solve the problem or which is the registry key I have to add in order to make it load again?
Title: Re: foo_wave_seekbar
Post by: Zao on 2023-06-07 09:47:26
I can't really assist with problems that arise from intentionally destroying parts of your system, but it's possible that you have damaged something required by the component's VC++ runtime.
Maybe try reinstalling some x86 Visual Studio C++ runtimes and see if it changes anything?

There's not much else in the way of direct dependencies in this component but it's definitely on the more complex side of things when it comes to background processing and other tangentially network related things but I don't remember if all that stuff is initiated that early.
Title: Re: foo_wave_seekbar
Post by: sld on 2023-06-07 09:54:12
So happy to know that this component isn't dead yet. Thanks zao (早?) for providing it back then.
This is what I've been used to seeing on 32-bit Foobar2000... a very familiar scheme now:

(https://i.ibb.co/28y0fDm/firefox-a49ac8.png)
Title: Re: foo_wave_seekbar
Post by: komhst on 2023-06-07 11:25:36
I can't really assist with problems that arise from intentionally destroying parts of your system, but it's possible that you have damaged something required by the component's VC++ runtime.
Maybe try reinstalling some x86 Visual Studio C++ runtimes and see if it changes anything?

There's not much else in the way of direct dependencies in this component but it's definitely on the more complex side of things when it comes to background processing and other tangentially network related things but I don't remember if all that stuff is initiated that early.

I didn't touch anything else than deleting paths "C:\Program Files(X86)\bonjour\...." from different parts of the registry.
Everything else runs smoothly on the PC
Title: Re: foo_wave_seekbar
Post by: Ojos Azules on 2023-06-08 07:50:11
[Feature Request]

Show chapter markers from metadata and CUE Sheet.


https://en.wikipedia.org/wiki/Cue_sheet_(computing)
Title: Re: foo_wave_seekbar
Post by: Zao on 2023-06-08 17:29:06
I'm not quite sure how that would work in practice, considering that if you open a CUE sheet the media file is split up into separate playlist entries already.

Is there some sort of ancillary scheme where you have a bundled-but-unused CUE sheet or other kind of markers in custom metadata, and is it a common/standard concept or something personal?
Title: Re: foo_wave_seekbar
Post by: Ojos Azules on 2023-06-09 06:30:05
a bundled-but-unused CUE sheet or other kind of markers in custom metadata, and is it a common/standard concept or something personal?
> a bundled-but-unused CUE sheet or other kind of markers in custom metadata, and is it a common/standard concept or something personal?

CUESHEET can be put in metadata field CUESHEET and it is a common practice
Title: Re: foo_wave_seekbar
Post by: Zao on 2023-06-09 12:53:41
I'm still a bit confused - as whenever you open a media file with an embedded or external cue sheet, foobar2000 should split it up into separate virtual tracks according to the sheet.
I am not aware of any situation where you can get it to open the file as-is without processing the sheet.

Could you describe your workflow in which such a thing happens?
I'll probably not get around to doing such a feature in this phase of the project but I'd like to understand the problem.
Title: Re: foo_wave_seekbar
Post by: Ojos Azules on 2023-06-17 08:36:44
I'm still a bit confused - as whenever you open a media file with an embedded or external cue sheet, foobar2000 should split it up into separate virtual tracks according to the sheet.
I am not aware of any situation where you can get it to open the file as-is without processing the sheet.
Could you describe your workflow in which such a thing happens?
I'll probably not get around to doing such a feature in this phase of the project but I'd like to understand the problem.

Seekbar will show markers when played from .cuesheet file but not when played from .flac or markers will be shown when cuesheet is in file as metadata.
Title: Re: foo_wave_seekbar
Post by: borzov on 2023-06-30 21:49:36
This might be a silly question but why does my seekbar have top and bottom padding? Is there a way to make it fill all available space?
Title: Re: foo_wave_seekbar
Post by: Daeron on 2023-07-01 04:54:11
Right click on waveform > Configure > Waveform scale: Normalize should help somewhat.

Or maybe it's only available in the waveform minibar (mod) plugin, I don't quite remember.

Or if you are using something like the Panel Stack Splitter plugin to assemble your layout (not sure if you do), that might also lock the size of the panel to a certain size.
Title: Re: foo_wave_seekbar
Post by: borzov on 2023-07-01 10:24:45
Yes, normalization is an option in the mod only, and it doesn't affect it either.
I'm only using Columns UI, no PSS.
It looks fine if I insert it anywhere else except in the toolbar which is where I want it
Title: Re: foo_wave_seekbar
Post by: Zao on 2023-07-01 18:21:09
The parts not filled in with the black background are not part of the component. You've got to figure out what in your CUI setup is making the actual component region smaller than you expect.
The component itself is quite straightforwardly putting itself in the position and size that the CUI host tells it to be in. There is of course the chance of API misuse from my side but I don't see anything obvious.
Title: Re: foo_wave_seekbar
Post by: Zao on 2023-07-02 03:22:22
It's not just foo_wave_seekbar that stays true to the original toolbar thickness when you alter the button size to make the toolbar thicker:
(https://i.imgur.com/d76G3OY.png)

Looking at my source code, I can tell CUI about my preferred min/max sizes via WM_GETMINMAXINFO but it seems to favour the minimum height I specify even if the maximum height is higher.

I would guess that the buttons work the way they do because they probably set the minimum size, something I don't want to add a setting for, rather having the toolbar fit my element according to my size wishes.
Title: Re: foo_wave_seekbar
Post by: Zao on 2023-07-06 03:43:54
This might be a silly question but why does my seekbar have top and bottom padding? Is there a way to make it fill all available space?
Yes, normalization is an option in the mod only, and it doesn't affect it either.
I'm only using Columns UI, no PSS.
It looks fine if I insert it anywhere else except in the toolbar which is where I want it
I've done some tests and checked with the CUI developer - with the way CUI's toolbar (Windows' Rebar) is made there doesn't seem to be any straightforward way of "growing to the size of the largest child" which I believe is the behaviour that you seek.
The only workaround from me is that I can see here would be that my component then needs explicit width/height controls much like the button strip.
It might be possible to also design a host component that has the requested minimum bounds and which transparently hosts any single component like mine inside, assuming that you can put hosts in toolbars.

In any way, seekbar development is at quite a standstill from my end so I hope you're not holding your breath here :)
Title: Re: foo_wave_seekbar
Post by: borzov on 2023-07-06 05:14:16
Thanks for looking into this. I modified it a bit and I think I'm okay with the way everything looks now
Title: Re: foo_wave_seekbar
Post by: Zao on 2023-07-14 11:14:09
I wrapped up the progress I had and rolled a 0.3.0 alpha 1 build of the v2 D3D11 experiment. It installs on x86 and x64 players.
I recommend that you don't run this in a foobar2000 profile that you care about as I leave no guarantee that it will work and that the data format for the config or anything will stay the same; it's very experimental.

https://github.com/zao/foo_wave_seekbar/releases/tag/0.3.0-alpha-1
Title: Re: foo_wave_seekbar
Post by: frogworth on 2023-07-14 11:58:43
All hail @Zao!
I am willing to risk it - i.e. backup my entire profile lol... I do run foobar2000 in portable mode, so it's easy to backup and replace.
But I will try x64 since that's where things are going, and this component was the main thing holding me back (I think!)

Will try sometime this weekend. Thanks heaps for even getting it to this experimental stage.
Title: Re: foo_wave_seekbar
Post by: kutuzof on 2023-07-14 12:16:55
My D3D11 does not display anything.

fb2k v2.1 [x86]
Windows 10 [x64]

sorry delete the post
Title: Re: foo_wave_seekbar
Post by: a3aan on 2023-07-15 14:55:34
I wrapped up the progress I had and rolled a 0.3.0 alpha 1 build of the v2 D3D11 experiment. It installs on x86 and x64 players.
..
I just tried it and it works fine for me with D2D1, D3D11 and GDI. (I always liked the look of GDI best.)
Title: Re: foo_wave_seekbar
Post by: Hakker on 2023-07-16 19:21:02
Tried it in Foobar 2.00 x64 version and can confirm at least GDI works, Direct2D also, but I couldn't check Direct 3D 11 so fast since I don't seem to have it installed and quite frankly I also use GDI.
Title: Re: foo_wave_seekbar
Post by: iskatel on 2023-08-06 17:38:44
I wrapped up the progress I had and rolled a 0.3.0 alpha 1 build of the v2 D3D11 experiment. It installs on x86 and x64 players.
I recommend that you don't run this in a foobar2000 profile that you care about as I leave no guarantee that it will work and that the data format for the config or anything will stay the same; it's very experimental.

https://github.com/zao/foo_wave_seekbar/releases/tag/0.3.0-alpha-1
Windows 10 Pro (19045), GTX 970 (536.67 DCH), foobar2000 V2.0 [x64]

Direct2D 1.0: Spoiler (click to show/hide)

Direct3D 11: Spoiler (click to show/hide)

GDI: Spoiler (click to show/hide)

I use Direct3D 11 - works perfect for me. Thank you!

P.S.: little bug: Spoiler (click to show/hide)
I'm not sure if this is a foo_wave_seekbar bug.
Title: Re: foo_wave_seekbar
Post by: Stem75 on 2023-11-03 13:54:16
Quick tested and it is working ok under windows 7 x64 , foobar2000 v2 x86-x64.

Only in D3D11 i can't use frontend settings, but i guess it's my system to blame.
Title: Re: foo_wave_seekbar
Post by: evil roy on 2023-11-05 22:56:18
Does anyone know where to find somewhere to download the Visual Studio 2012 Update 1?  Or if there is another version that will work?
Title: Re: foo_wave_seekbar
Post by: korth on 2023-11-05 23:17:17
Of course you're not soliciting TOS#9 (https://hydrogenaud.io/index.php/topic,3974.html).

https://visualstudio.microsoft.com/free-developer-offers/
Title: Re: foo_wave_seekbar
Post by: Zao on 2023-11-06 19:29:55
If you're asking about the runtime redistributable, heaven knows anymore as the 0.2 Seekbar is incredibly ancient.
Probably this one: https://www.microsoft.com/en-us/download/details.aspx?id=30679
Title: Re: foo_wave_seekbar
Post by: FaceCrap on 2023-12-31 11:41:14
I wrapped up the progress I had and rolled a 0.3.0 alpha 1 build of the v2 D3D11 experiment. It installs on x86 and x64 players.
Lost my old account here. Was pretty much still on 1.5.3.

Installed both the 2.0 and 2.1 (both flavors) and tried your pre-release in each...
DxDiag says I got DirectX3D 12, so could be I'm missing something else, but as soon as I make the wavebar visible (either by adding it as panel or as toolbar) it just brings down FB2K hard.
Both 2.0 and 2.1 and for both x86 and x64 versions
Title: Contacting component creator?
Post by: Neccros on 2024-02-04 18:12:56
I have a component (Waveform Seekbar) that's only 32bit but the creator has made a bunch of others that are both 32 and 64. I want to see what the best way to contact them??

Wanted to ask them if they will ever update it with a 64 bit version.

Thanks!
Title: Re: foo_wave_seekbar
Post by: marc2k3 on 2024-02-04 19:53:34
https://github.com/zao/foo_wave_seekbar/releases/tag/0.3.0-alpha-1
Title: Re: foo_wave_seekbar
Post by: Neccros on 2024-02-04 22:02:38
https://github.com/zao/foo_wave_seekbar/releases/tag/0.3.0-alpha-1
ooooh!! Thank you!