Skip to main content

Notice

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

Playback Statistics without Media Library

I'm using fb2k without a media library added.

Can I somehow display recently played files with foo_playcount?

Since there is no library the %last_played% search turns up empty. However, playcount still populates an exportable list with all the information. Can I somehow display this info in a tab?

Essentially I want to see a list with the last few played files.

Re: Playback Statistics without Media Library

Reply #1
What version of foobar2000?

Playback Statistics
Writes meta data when playing 30 - 40% of track length.

%first_played%
%last_played%
%play_count%

Columns:
[$date(%last_played%)]
[%play_count%]

This is another one, but it's standard for foobar2000 v2.0.
Can I use it with Columns?
$date(%file_created%)

Playlist Search
Menu > Edit > Search
-%last_played% DURING LAST 1 WEEK
-%last_played% DURING LAST 4 WEEKS

foobar2000 v2.1 preview 2023-07-10 : 32-bit.
Tested with Media Library initial state (without Media Library).

Playlist View (Default UI)


Text Display (JScript Panel 3)
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: Playback Statistics without Media Library

Reply #2
Thanks for your reply Air KEN.
A column with %last_played% is useful.
But Playlist search only searches, well, playlists.
None of these simply display the last played song.

This is with foobar 2.0


Re: Playback Statistics without Media Library

Reply #3
Playlist Search
Menu > Edit > Search
-%last_played% DURING LAST 1 WEEK
-%last_played% DURING LAST 4 WEEKS

Sorry These are just introductions.

All you have to do is put them all in Playlist View and sort them with %last_played%.

Menu > Edit > Sort > Sort by
%last_played% - %TITLE%

Columns:
Name: Last Played Parttern: [%last_played%]

If necessary
Playlist View  "Last Played" Column click
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: Playback Statistics without Media Library

Reply #4
If you have foobar2000 v2.0 32bit you can use the following components.

Navigator (foo_navigator)
https://hydrogenaud.io/index.php/topic,45616.msg819089.html#msg819089

Default UI Support
Columns UI panel Support.

Setting
Preferences > Tools > Navigator
Create "History" folder in Playlist Manager.
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: Playback Statistics without Media Library

Reply #5
Thanks for the thorough reply.
foo_navigator does mostly what I had in mind - pity it's no longer updated for current architectures.

Re: Playback Statistics without Media Library

Reply #6
Reply #1 https://hydrogenaud.io/index.php/topic,124473.msg1030248.html#msg1030248
> What version of foobar2000?

foobar2000 v2.0 64bit?
Why aren't you answering my questions?

What is the reason for using 64bit without building Media Library?

For your usage, I think 32bit is good because you can use old components.
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: Playback Statistics without Media Library

Reply #7
Thanks for the thorough reply.
foo_navigator does mostly what I had in mind - pity it's no longer updated for current architectures.
You can generate a text list of the last few (or more) played files by using foo_nowplaying2 configured in log format;  it's in 32 or 64 bit:
https://hydrogenaud.io/index.php/topic,124427.0.html .

If you have JSPanel 3, you can also use a simple script that generates a text file listing of last played files to any specified length.  You could also use JSP3 to make the contents from it (or the txt file from foo_nowplaying2) viewable in a tabbed window with the Text Reader sample built-in to JSP3.  The script for generating the initial Track History text file was kindly contributed by marc2k3 and follows; you will need to adjust the "var limit", "var tfo", and "var path" statements to fit your needs.
Code: [Select]
// ==PREPROCESSOR==
// @name "Playback History"
// @author "marc2003"
// @import "%fb2k_component_path%samples\js\lodash.min.js"
// ==/PREPROCESSOR==

var limit = 100;
var tfo = fb.TitleFormat(" [%artist% - ]%title%");
var path = "C:\\foobar2000-x64_v2.1\\Track History.txt";

/////////////////////////////////////////////////////////////////////////////////////////////////////////

var last = '';

function on_playback_new_track() {
log_it();
}

function on_playback_dynamic_info_track(type) {
if (type == 0) {
log_it();
}
}

function now_as_string() {
var now = Math.floor(Date.now() / 1000);
return utils.TimestampToDateString(now);
}

function log_it() {
var current = tfo.Eval();
if (current != last) {
last = current;

var text = utils.ReadUTF8(path);
var arr = _(text.trim().split("\r\n"))
.filter(function (item) { return item.length > 0; })
.takeRight(limit - 1)
.value();
arr.push(now_as_string() + " " + current);
utils.WriteTextFile(path, arr.join("\r\n"));
}
}

A pic of the JSP3 Text Reader sample is viewable here: https://jscript-panel.github.io/gallery/text-reader/ .

Re: Playback Statistics without Media Library

Reply #8
@sveakul
Hi :)

@name "Playback History"
When pasted on JSPanel 3, it is only white.
Are there any other settings required?

JScript Panel 3 3.3.1 (2023-07-09)
foobar2000 v2.1 preview 2023-07-20 : 32-bit | 64-bit
--------
foo_nowplaying2 is already using
"C:\nowplaying\nowplaying.txt"

var limit = 100;
var tfo = fb.TitleFormat(" [%artist% - ]%title%");
var path = "C:\\nowplaying\\nowplaying.txt";
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: Playback Statistics without Media Library

Reply #9
@sveakul
Hi :)

@name "Playback History"
When pasted on JSPanel 3, it is only white.
Are there any other settings required?

JScript Panel 3 3.3.1 (2023-07-09)
foobar2000 v2.1 preview 2023-07-20 : 32-bit | 64-bit
Hi!  After adding the script to the new JSP3 panel via Configure, it will remain "white" when you tab to it because there is no GUI, all the script does is write the text file with the name specified in the script to the location specified in the script, the contents being the playback history entries.  It acts as a replacement for foo_nowplaying2, and though you could use both at the same time the text file names must differ.  At the time I added it, there was no 64-bit replacement for foo _np_simple 1.9.1, and I wanted the same ability with 64-bit v2.

The comment I made about adding JSP3 Text Reader setup to display the contents of either log file from the above was "conceptual"--I haven't tried it but it seems from the sample description on the JSP3 site it could be done.  I prefer just scanning the text file in Notepad if I am trying to recall a particular song that was played.

Re: Playback Statistics without Media Library

Reply #10
@sveakul
Hi :)

@name "Playback History"
When pasted on JSPanel 3, it is only white.
Are there any other settings required?

JScript Panel 3 3.3.1 (2023-07-09)
foobar2000 v2.1 preview 2023-07-20 : 32-bit | 64-bit
Hi!  After adding the script to the new JSP3 panel via Configure, it will remain "white" when you tab to it because there is no GUI, all the script does is write the text file with the name specified in the script to the location specified in the script, the contents being the playback history entries.  It acts as a replacement for foo_nowplaying2, and though you could use both at the same time the text file names must differ.  At the time I added it, there was no 64-bit replacement for foo _np_simple 1.9.1, and I wanted the same ability with 64-bit v2.

The comment I made about adding JSP3 Text Reader setup to display the contents of either log file from the above was "conceptual"--I haven't tried it but it seems from the sample description on the JSP3 site it could be done.  I prefer just scanning the text file in Notepad if I am trying to recall a particular song that was played.
thank you.

C:\nowplaying\nowplay.txt
ar limit = 100;
var tfo = fb.TitleFormat(" [%artist% - ]%title%");
var path = "C:\\nowplaying\\nowplay.txt";

2023-07-25 08:37:46  BoA - ZIP
2023-07-25 08:39:08  Maisie Peters - The Good Witch
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: Playback Statistics without Media Library

Reply #11
Air KEN:  I'm glad you were able to set this up!  Can you please share what settings you used in the Text Reader to show the play history list in its window as you posted at https://i.imgur.com/NNUtmqr.png?  I could only get the currently playing item (the one at the top) to show from the Playback History's text file.  Thank you.

Re: Playback Statistics without Media Library

Reply #12
@sveakul
thank you for the advice.

Playback History + Now Playing 2 (foo_nowplaying2) + Text Reader Panel

Playback History: https://foobar2000.xrea.jp/up/files/up1529.zip

JScript Panel 3 (foo_jscript_panel3)
Download: https://github.com/marc2k3/jscript-panel/releases
Now Playing 2 (foo_nowplaying2)
Download: https://github.com/foxx1337/foo_nowplaying2/releases

I can leave Scrobbles Track history on Last.fm, etc. I can check the track that was played.

1.) Prepare for Now Playing 2 (foo_nowplaying2):
  C:\nowplaying folder
2.) Preferences > Tools > Now Playing 2 > File > 「...」click select "nowplaying.txt"
  C:\nowplaying\nowplaying.txt
3.) Preparing JScript Panel 3 Panel "Playback History" https://jscript-panel.github.io/gallery/text-reader/
  Import Playback History.txt
4.) Rewrite the first part.
var limit = 200;
var tfo = fb.TitleFormat("%title%[ - %artist%]");
var path = "C:\\nowplaying\\nowplay.txt";
5.) Preparing JScript Panel 3 Panel "Text Reader"
  Right click on Panel > Configure... > Samples > Text Reader
6.) Right click on Text Reader Panel > Custom path... > C:\nowplaying\nowplay.txt
7.) Play the track
  * Right click "Refresh" in Text Reader

Right click "Open containing folder" → Check C:\nowplaying\nowplay.txt

With JScript Panel 3 v3.3.0+, even foobar2000 v1.6.16 can work with Playback History + Now Playing 2 (foo_nowplaying2) + Text Reader Panel
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: Playback Statistics without Media Library

Reply #13
Thanks Air KEN, I found that I had not entered the path to the text file correctly in the Text Reader right-click options!

Just to clarify for others wishing to do this: you can use either foo_nowplaying2 OR the JSP3 "Playback History" custom script (it's not one of the included JSP3 samples) to actually write the history file with;  I prefer the JSP3 Playback History script because it allows controlling the maximum file length.  The Text Reader JSP3 sample will work just fine pointed at the text log file from either one of the sources.

Re: Playback Statistics without Media Library

Reply #14
How do you export all playback statistics at once with foo navigator?
I.e. get the data you can export via the context menu but for all played songs.

Re: Playback Statistics without Media Library

Reply #15
Another thing: Is there away to increase the history size limit for foo navigator beyond 1000?

 

Re: Playback Statistics without Media Library

Reply #16
Is there a good way to auto refresh the JSP3 text reader from within the script (say, on tab switch or track change)?