Skip to main content

Notice

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

Re: foo_nowplaying2

Reply #25
How could i make a tracklist using this? I'm trying out "%title% %length_seconds%" and then pasting into excel i can create list of tracks: 'Song "A" Start: xx:xx End: yy:yy'. But that only works if i don't pause tracks or dont change them. Is there more flexible way of doing this? Like fetching time when each song starts playing?

Re: foo_nowplaying2

Reply #26
I would love to use this new component with OBS, but it won't write the needed text file. The Foobar console says:  "nowplaying2 failed to open "C:\Users\Mikel\Desktop\foobar2000_liveset\foobar2000-Nowplaying2.txt" for writing". The text file is there. What should I do?


Re: foo_nowplaying2

Reply #28
Y
It's not disputing the file's existence. Look again

Quote
failed to open <snip> for writing

Seems like the file is locked by some other process and can't be written to.
Yes, you were right. And I looked at the security settings of the text file. All users were allowed to read or write. I changed the foobar settings to open the program as an administrator. It didn't work. But finally the Win11 Security settings - Exploits -> Program prefs did the trick. I allowed Foobar2000 everything. Now it works.

Re: foo_nowplaying2

Reply #29
What would be nice is if this plugin had the ability to write playing artist/titles from radio streams containing that metadata, as the original foo_np_simple could/can used with foo_dyndec (unknown if the latter would be needed now).  I have a request put in at github that has been acknowedged by the developer, if anyone cares to give it a +1 over there:  https://github.com/foxx1337/foo_nowplaying2/issues/2


Re: foo_nowplaying2

Reply #31
Thanks, much appreciated!


Re: foo_nowplaying2

Reply #33
Version 4.0 released - https://github.com/foxx1337/foo_nowplaying2/releases/tag/v4.0

@marc2k3  and @sveakul  - done.

It remains for me to figure out a cool way for adding an exit string, as per request by @SushiKishi.

Cool, thanks! At first I thought it didn't work, because I was using the "log" tab, and apparently that one still doesn't work for streaming titles.

Another feature request🤭: append new entries to beginning of file in log mode

Re: foo_nowplaying2

Reply #34
That the plugin now works with stream metadata is welcome, but I'm trying to figure out how to add a preceding date/time stamp to the On New Track event in Log Mode; %datetime% : %artist% - %title% does NOT work.  A log file isn't worth much without it.  So, that, and a +1 to Pollux88 on requesting that the last played song be on TOP of the list.

Re: foo_nowplaying2

Reply #35
first of all, many thanks for your hard work.

Is it possible to add a datetime stamp to the log?

so instead of

%artist% - %title%

which results in:

Bill Evans Trio - Some Other Time
Wynton Marsalis - Skylark
Tord Gustavsen Trio - Melted Matter

[%date%-%time%]%artist% - %title%

?

maybe this functionality is already given/present, but i wasn't able to figure that out.

thanks!

/itsChris


Re: foo_nowplaying2

Reply #37
Here's an alternative if anyone wants to try it...

https://jscript-panel.github.io/gallery/play-log/

This requires a panel in your layout so don't even click if you don't want that. :P
Beautiful, marc2k3!  I see this is now included as a sample in the latest jscript3 download.

I have been using code contributed by you a while back to do "sort-of-the same-thing" but it requires using Text Reader as well to display the log in the GUI:

It sure has stood the test of time though even without the "easy options".  Using it right now actually--until I grab Play Log that is!  Attached your original code below for "historical purposes"  :)



Re: foo_nowplaying2

Reply #40
Updated to v4.1 - https://github.com/foxx1337/foo_nowplaying2/releases/tag/v4.1

This one adds strings on exit and enables the dynamic stream info updates in the Log tab too.
The problems others have brought up recently still remain with this version--how can the log entries be date/time stamped (%datetime% is NOT recognized, unlike the original np_simple), and how can the entries be logged latest first instead of last??

The immediate solution for those with jscript panel3 is its Play Log sample as mentioned above, but it would be nice to see this plugin at least retain the functionality of its predecessor.

 

Re: foo_nowplaying2

Reply #41
Here's a bit of code for implementing %datetime%.

First you need this...

Code: [Select]
#include <pfc/filetimetools.h>

class TitleFormatHook : public titleformat_hook
{
public:
bool process_field(titleformat_text_out* out, const char* field, size_t, bool& found_flag) final
{
if (stricmp_utf8(field, "datetime") == 0)
{
const auto ts = pfc::fileTimeNow();
const auto str = pfc::format_filetimestamp(ts);
out->write(titleformat_inputtypes::unknown, str);

found_flag = true;
return true;
}

found_flag = false;
return false;
}

bool process_function(titleformat_text_out*, const char*, size_t, titleformat_hook_function_params*, bool& found_flag) final
{
found_flag = false;
return false;
}
};

Then to use it. existing code might look like this.

Code: [Select]
playback_control::get()->playback_format_title(nullptr, str, obj, nullptr, playback_control::display_level_all);

The first nullptr is the title format hook arg so it can be updated like this...

Code: [Select]
TitleFormatHook hook;
playback_control::get()->playback_format_title(&hook, str, obj, nullptr, playback_control::display_level_all);