Skip to main content
Topic: Is it possible to make a "now playing" playlist? (Read 16600 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Is it possible to make a "now playing" playlist?

The playback queue is nice, but if I play a song from within another playlist, e.g. the browser playlist, they don't get added to the playback queue. Besides, you can't play tracks in the playback queue like a standard playlist (e.g. you can't play songs in the middle). What I want is to automatically create a playlist where every song I play gets added, some way or another. Like most other media programs, e.g. MediaMonkey. Is this possible?

Is it possible to make a "now playing" playlist?

Reply #1
The playback queue is nice, but if I play a song from within another playlist, e.g. the browser playlist, they don't get added to the playback queue. Besides, you can't play tracks in the playback queue like a standard playlist (e.g. you can't play songs in the middle). What I want is to automatically create a playlist where every song I play gets added, some way or another. Like most other media programs, e.g. MediaMonkey. Is this possible?


i think i want something similar

how do you view the playback queue for starters?

Is it possible to make a "now playing" playlist?

Reply #2
I am able to add various songs from various playlists in any arbitrary order to the playback queue (right click song, choose "add to playback queue") and foobar will jump around playlists and play the songs in the order I chose, what is it you are trying to do?

Your description sounds more like a playback history than a playback queue. Have you considered creating an additional playlist, name is something like "now playing", then instead of adding your desired songs to the playback queue use the "send to playlist" option and send the tracks to this new playlist?

Is it possible to make a "now playing" playlist?

Reply #3
Your description sounds more like a playback history than a playback queue. Have you considered creating an additional playlist, name is something like "now playing", then instead of adding your desired songs to the playback queue use the "send to playlist" option and send the tracks to this new playlist?


that sounds good
is there any way of clearing a playlist when leaving foobar?

Is it possible to make a "now playing" playlist?

Reply #4
Sounds good, yes. But is it any way to make double-clicking a song in any playlist (specifically the browser playlist) send them to another playlist? I'm using Colums UI.

Is it possible to make a "now playing" playlist?

Reply #5
I think what you like to have is something like in Winamp: the Media Library Tracklist (it is not a playlist in winamp 2 or 5!!) from where you can add songs to the Playlist Editor. The browser playlist or other autosend playlists are not similar to the ML Tracklist but more similar to the playlist in the Playlist editor: just imagine you browse inside Winamps ML artists and albums and the result is not listed under these panes but immediately in the playlist editor. That is foobars behaviour, it doesn't have such a tracklist.

In short: No it is not possible and it won't be! It would break the concept of multiple playlists.

I think a good solution is if 1.) somedays somebody releases a plugin that simulates such a tracklist in foobar and 2.) the devs of Playlisttree/Albumlist Panel/Quicksearch Toolbar/... are going to support this then.

What you can do now is to use an additional panel for titles although it's not the best solution

Is it possible to make a "now playing" playlist?

Reply #6
MiSP: I know of know way to modify the default doubleclick behavior in the playlist other than writing your own playlist component. However if you are trying to emulate similar behavior to winamp's media library as g-stankovic describes above you can accomplish this with the Album List Panle component available here.

File> Preferences> Display> Columns UI> "Layout" Tab
- Add the panel to your layout wherever you like.

File> New Playlist (Ctrl+N)
- Create a "Now Playing" playlist as we discussed before (use any name you like)

File> Preferences> Media Library> Album List Panel
- Set the "Auto send to playlist" field to the name of the playlist you created above
- Change the "Double-click action" to "Send to autosend playlist"

I know of no way to disable the playlist auto-saving. Perhaps you should make a formal feature request, it seems like something easy enough to implement. You can, however, easily clear the playlist at any time with:
Edit> Clear

With this setup you can browse your library in the album list panel and then use it to add songs to your master "now playing" playlist. This would be very similar to the way winamp's media library and playlist interact, with the added benefit of being able to organize that library in a tree format. If you would prefer to browse your directory structure instead of your media library there is another component foo_uie_explorer that is very similar to the album list compnent.

Is it possible to make a "now playing" playlist?

Reply #7
I'm using foo_playlist_tree, and I'm not turning away from that. It seems like the best I can do is just place "Send to specified playlist" at the top of the context menu. It's a bit mucky though, I'd prefer something else.

As for Winamp, I have no idea how that works there. Last time I used Winamp was many years ago.

Is it possible to make a "now playing" playlist?

Reply #8
File> Preferences> Media Library> Album List Panel
- Set the "Auto send to playlist" field to the name of the playlist you created above
- Change the "Double-click action" to "Send to autosend playlist"


i don't have either of these settings?

Is it possible to make a "now playing" playlist?

Reply #9
Greenbeast: Have you installed the Album List Panel component? It is available from musicmusic's component page here. And sorry I missed your earlier question yet again. to view songs in your playback queue you should try foo_uie_queuemanager.

Is it possible to make a "now playing" playlist?

Reply #10
thankyou

i've been using the suggestion of a 'now playing' playlist and its working relatively well

unfortunately queue manager gives me this when i open foobar

Failed to load DLL: foo_uie_queuemanager.dll
Reason: A dynamic link library (DLL) initialization routine failed.


and even after setting the other too options the double-click action doesn't do anything to tracks

Is it possible to make a "now playing" playlist?

Reply #11
As for the queuemanager not loading, it sounds like you either have a corrupted download (redownload it) or you are missing a dependency, I believe that component uses .NET, you can get it here.

As for the queue clicking.
File> Preferences> Display> Columns UI> Playlist View> "General" Tab
Set "Action to perform when middle clicking on a playlist item:" to "Add to playback queue"

This will allow you to use your middle mouse button (push down on your scrollwheel) to quickly add tracks to your playback queue. Unless you use something like queuemanager though, it will be difficult to know if a track was successfully added to the queue.

If you have cwb_hooks installed (available here) then you can adjust the titleformatting of your playlist display to let you know about the track's position in the queue like this:

Code: [Select]
$if(%cwb_queueindex%,Q:$char(91)%cwb_queueindexes%$char(47)%cwb_queuelength%$char(93),)

Is it possible to make a "now playing" playlist?

Reply #12
It seems like the best I can do is just place "Send to specified playlist" at the top of the context menu. It's a bit mucky though, I'd prefer something else.

For what it's worth, I wrote a simple custom component with two functions for the context menu:
Send to Now Playing - clears the "Now Playing" playlist and sends the current selection to "Now Playing"
Append to Now Playing - adds the current selection to "Now Playing"

Nothing special, but it just makes it easier to manipulate the current playing selection in my config. Here is the code, if you are interested:

Code: [Select]
#include "../SDK/foobar2000.h"
#include "../helpers/helpers.h"


/*-----------------------------------------------
Providing information about a component.
Viewed under Preferences > Components.
-------------------------------------------------*/
DECLARE_COMPONENT_VERSION(
// component name
"Playlist Context Menu Helpers",
// component version
"0.1.3",
// about text, use \n to separate multiple lines
// If you don't want any about text, set this parameter to NULL.
"Context menu playlist helpers\n"
"for foobar2000 v0.9\n"
"\n"
"contributors:\n"
"John Bell\n")



/*-----------------------------------------------
Component initialize and release
on_init is called after main window has been created,
on_quit is called before main window is destroyed
-------------------------------------------------*/
class initquit_foo_playlist_helpers : public initquit {

virtual void on_init()
{
// foobar2000 has a 'playing' playlist and an 'active' playlist
// force the playing playlist to "Now Playing"
static_api_ptr_t<playlist_manager> pm;
pfc::string8 playlist("Now Playing");
t_size play_ndx = pm->find_playlist(playlist, playlist.length());
pm->set_playing_playlist(play_ndx);
//pm->playback_order_set_active(0);  //resets the order to start at the top
}

//virtual void on_quit() {}
};
static initquit_factory_t< initquit_foo_playlist_helpers > foo_initquit;


/*-----------------------------------------------
Context menu item implementations
-------------------------------------------------*/
class contextmenu_commands_foo_playlist_helpers : public contextmenu_item_simple
{
enum menu_index {
mnuSendToNowPlaying,
mnuAppendToNowPlaying
};

virtual unsigned get_num_items() {
return 2;
}

virtual GUID get_item_guid(unsigned p_index) {
static const GUID guid_context_send_to_now_playing = { 0xd3499f7c, 0xebf3, 0x4d98, { 0x94, 0xaf, 0x36, 0x5a, 0x95, 0x5d, 0x12, 0x2c } };
static const GUID guid_context_append_to_now_playing = { 0x6afbf8c0, 0x828f, 0x4d06, { 0xa4, 0x96, 0xa2, 0x39, 0x76, 0xe8, 0x6b, 0x8e } };

if( p_index == mnuSendToNowPlaying )
return guid_context_send_to_now_playing;

else if( p_index == mnuAppendToNowPlaying )
return guid_context_append_to_now_playing;

return pfc::guid_null;
}

virtual void get_item_name(unsigned p_index,pfc::string_base& p_out) {
if( p_index == mnuSendToNowPlaying )
p_out = "Send to Now Playing";
else if( p_index == mnuAppendToNowPlaying )
p_out = "Append to Now Playing";
}

virtual void get_item_default_path(unsigned p_index,pfc::string_base& p_out) {
if( p_index == mnuSendToNowPlaying )
p_out = "";
else if( p_index == mnuAppendToNowPlaying )
p_out = "";
}

virtual bool get_item_description(unsigned p_index,pfc::string_base& p_out) {
if( p_index == mnuSendToNowPlaying ) {
p_out = "Clears the Now Playing playlist and then sends the selected item(s) to the Now Playing playlist";
return true;
}
else if( p_index == mnuAppendToNowPlaying ) {
p_out = "Appends item(s) to the Now Playing playlist";
return true;
}
return false;
}

virtual void context_command(unsigned p_index,const pfc::list_base_const_t<metadb_handle_ptr>& p_data,const GUID& p_caller) {
if( core_api::assert_main_thread() )
{
if( p_index == mnuSendToNowPlaying || p_index == mnuAppendToNowPlaying )
{
static_api_ptr_t<playlist_manager> pm;
pfc::string8 playlist("Browser");
t_size browser_ndx = pm->find_playlist(playlist, playlist.length());
playlist = "Now Playing";
t_size play_ndx = pm->find_playlist(playlist, playlist.length());
metadb_handle_list list;
pm->playlist_get_selected_items(browser_ndx, list);
if( p_index == mnuSendToNowPlaying ) {
pm->set_playing_playlist(play_ndx);
pm->playlist_clear(play_ndx);
}
pm->playlist_add_items(play_ndx, list, bit_array_false());
}
}
}

};

// We need to create a service factory for our menu item class,
// otherwise the menu commands won't be known to the system.
static contextmenu_item_factory_t< contextmenu_commands_foo_playlist_helpers > foo_menu;


Since you use the playist tree component to make your selections this code will not work for you, I think. I'm offering it for others that may be browsing this post, and for you, you might be able to tweak it to work with the playlist tree component, I don't know.

I can upload the compiled dll if you want but I would recommend compiling it yourself for a couple reasons:
0) It's simple to do, thanks to foobar's extremely well designed API and published base projects.
1) This code hard codes the browser playlist to "Browser" and the now playing playlist to "Now Playing", so you'll have to setup your config accordingly. Also, it sets the playing playlist to the "Now Playing" playlist when foobar2000 starts up, which may not be what you want.
2) I have no intention of actively supporting this as a bona fide component, not only do I not have the time, but by the nature of this type of component (a Playlist Helpers component), every config would want something different.
3) It gives you a simple template to add any other customizations you want.

Is it possible to make a "now playing" playlist?

Reply #13
could you upload the dll please, it sound slike it might be useful
i have my two playlists as Browser and Now Playing already

Is it possible to make a "now playing" playlist?

Reply #14
Sounds good, yes. But is it any way to make double-clicking a song in any playlist (specifically the browser playlist) send them to another playlist? I'm using Colums UI.
if people have not been able to tell from the 10+ threads i've created on this topic, i've been trying to do this for forever


i've hit a minor breakthrough, i'll tell you how its done when i've got it all sorted out.


until then, please, keep giving suggestions just in case mine doesnt work.

It seems like the best I can do is just place "Send to specified playlist" at the top of the context menu. It's a bit mucky though, I'd prefer something else.

For what it's worth, I wrote a simple custom component with two functions for the context menu:
Send to Now Playing - clears the "Now Playing" playlist and sends the current selection to "Now Playing"
Append to Now Playing - adds the current selection to "Now Playing"

Nothing special, but it just makes it easier to manipulate the current playing selection in my config. Here is the code, if you are interested:

Code: [Select]
#include "../SDK/foobar2000.h"
#include "../helpers/helpers.h"


/*-----------------------------------------------
Providing information about a component.
Viewed under Preferences > Components.
-------------------------------------------------*/
DECLARE_COMPONENT_VERSION(
// component name
"Playlist Context Menu Helpers",
// component version
"0.1.3",
// about text, use \n to separate multiple lines
// If you don't want any about text, set this parameter to NULL.
"Context menu playlist helpers\n"
"for foobar2000 v0.9\n"
"\n"
"contributors:\n"
"John Bell\n")



/*-----------------------------------------------
Component initialize and release
on_init is called after main window has been created,
on_quit is called before main window is destroyed
-------------------------------------------------*/
class initquit_foo_playlist_helpers : public initquit {

virtual void on_init()
{
// foobar2000 has a 'playing' playlist and an 'active' playlist
// force the playing playlist to "Now Playing"
static_api_ptr_t<playlist_manager> pm;
pfc::string8 playlist("Now Playing");
t_size play_ndx = pm->find_playlist(playlist, playlist.length());
pm->set_playing_playlist(play_ndx);
//pm->playback_order_set_active(0);  //resets the order to start at the top
}

//virtual void on_quit() {}
};
static initquit_factory_t< initquit_foo_playlist_helpers > foo_initquit;


/*-----------------------------------------------
Context menu item implementations
-------------------------------------------------*/
class contextmenu_commands_foo_playlist_helpers : public contextmenu_item_simple
{
enum menu_index {
mnuSendToNowPlaying,
mnuAppendToNowPlaying
};

virtual unsigned get_num_items() {
return 2;
}

virtual GUID get_item_guid(unsigned p_index) {
static const GUID guid_context_send_to_now_playing = { 0xd3499f7c, 0xebf3, 0x4d98, { 0x94, 0xaf, 0x36, 0x5a, 0x95, 0x5d, 0x12, 0x2c } };
static const GUID guid_context_append_to_now_playing = { 0x6afbf8c0, 0x828f, 0x4d06, { 0xa4, 0x96, 0xa2, 0x39, 0x76, 0xe8, 0x6b, 0x8e } };

if( p_index == mnuSendToNowPlaying )
return guid_context_send_to_now_playing;

else if( p_index == mnuAppendToNowPlaying )
return guid_context_append_to_now_playing;

return pfc::guid_null;
}

virtual void get_item_name(unsigned p_index,pfc::string_base& p_out) {
if( p_index == mnuSendToNowPlaying )
p_out = "Send to Now Playing";
else if( p_index == mnuAppendToNowPlaying )
p_out = "Append to Now Playing";
}

virtual void get_item_default_path(unsigned p_index,pfc::string_base& p_out) {
if( p_index == mnuSendToNowPlaying )
p_out = "";
else if( p_index == mnuAppendToNowPlaying )
p_out = "";
}

virtual bool get_item_description(unsigned p_index,pfc::string_base& p_out) {
if( p_index == mnuSendToNowPlaying ) {
p_out = "Clears the Now Playing playlist and then sends the selected item(s) to the Now Playing playlist";
return true;
}
else if( p_index == mnuAppendToNowPlaying ) {
p_out = "Appends item(s) to the Now Playing playlist";
return true;
}
return false;
}

virtual void context_command(unsigned p_index,const pfc::list_base_const_t<metadb_handle_ptr>& p_data,const GUID& p_caller) {
if( core_api::assert_main_thread() )
{
if( p_index == mnuSendToNowPlaying || p_index == mnuAppendToNowPlaying )
{
static_api_ptr_t<playlist_manager> pm;
pfc::string8 playlist("Browser");
t_size browser_ndx = pm->find_playlist(playlist, playlist.length());
playlist = "Now Playing";
t_size play_ndx = pm->find_playlist(playlist, playlist.length());
metadb_handle_list list;
pm->playlist_get_selected_items(browser_ndx, list);
if( p_index == mnuSendToNowPlaying ) {
pm->set_playing_playlist(play_ndx);
pm->playlist_clear(play_ndx);
}
pm->playlist_add_items(play_ndx, list, bit_array_false());
}
}
}

};

// We need to create a service factory for our menu item class,
// otherwise the menu commands won't be known to the system.
static contextmenu_item_factory_t< contextmenu_commands_foo_playlist_helpers > foo_menu;


Since you use the playist tree component to make your selections this code will not work for you, I think. I'm offering it for others that may be browsing this post, and for you, you might be able to tweak it to work with the playlist tree component, I don't know.

I can upload the compiled dll if you want but I would recommend compiling it yourself for a couple reasons:
0) It's simple to do, thanks to foobar's extremely well designed API and published base projects.
1) This code hard codes the browser playlist to "Browser" and the now playing playlist to "Now Playing", so you'll have to setup your config accordingly. Also, it sets the playing playlist to the "Now Playing" playlist when foobar2000 starts up, which may not be what you want.
2) I have no intention of actively supporting this as a bona fide component, not only do I not have the time, but by the nature of this type of component (a Playlist Helpers component), every config would want something different.
3) It gives you a simple template to add any other customizations you want.
for us non-coders, can you explain how to compile it ourselves?

Is it possible to make a "now playing" playlist?

Reply #15
Now if only we could make the default playlist command "Replace 'Now Playing' and play." Maybe someone could adopt jonpb's code and make a full-fledged component...

Is it possible to make a "now playing" playlist?

Reply #16
That would be utterly wonderful. It's a shame that no-one has come up with a Now Playing-plugin before.

Is it possible to make a "now playing" playlist?

Reply #17
if i knew code, i wouldve done this ages ago, as soon as i got foobar. coming from any media player other than iTunes to foobar is really weird, because you no longer have a now playing box.

Is it possible to make a "now playing" playlist?

Reply #18
I should emphasize that this code doesn't really do very much. Send to Now Playing does the same thing as if you clicked on Send to Playlist, entered "Now Playing" and checked the Clear Playlist checkbox, Append does the same thing but with the Clear Playlist checkbox unchecked. That being said I hope you enjoy it.

You can get the code and the compiled dll here (removed).
I updated the link with mquander's compile (thanks again mquander), as my machine is not currently in a state where I can compile and test the dll on XP. I also changed the name of the project to foo_npmenustuff, mquander's name, which I like better, stands for Now Playing Menu Stuff (I assume, or perhaps "non se·qui·tur playlist menu stuff", perhaps)

Drop the foo_npmenustuff.dll into your components folder and you'll see the two new context menu items.

If you want to make changes to the code, to compile it first download MS Visual C++ Express from http://msdn.microsoft.com/vstudio/express/
Next download the foobar2000 SDK from here http://www.foobar2000.org/

You should read the readme, but if you have never coded before it probably won't make much sense.

Unzip foo_playlist_helpers.7z to your foobar downloaded SDK\foobar2000 folder. The folder structure should look like this:
SDK
-  foobar2000
-  -  foo_npmenustuff

Open the file foo_playlist_helpers.sln in Visual C++. If the folder structure is correct you'll see 5 projects in this solution:
foo_playlist_helpers
foobar2000_components_client
foobar2000_SDK
foobar_sdk_helpers
pfc

Only foo_npmenustuff is currently flagged to build, you may need to recompile the others since they are statically linked and all need to be linking to the same CRT. If so, go to Build-->Configuration Manager and make sure all projects are configured for Release and all flagged to build. Once you have all the projects compiled you can remove the flags to build on all the other projects.

happy coding!

And by the way, you should check out foosion's tutorials for details on how to code with the foobar2000 sdk.

If you are still having problems compiling it you can pm me, since those questions, I assume, are slightly off-topic for this thread.

Is it possible to make a "now playing" playlist?

Reply #19
now to make it so that a double click does this as the default action instead of doubleclick meaning play!

Is it possible to make a "now playing" playlist?

Reply #20
I should emphasize that this code doesn't really do very much. Send to Now Playing does the same thing as if you clicked on Send to Playlist, entered "Now Playing" and checked the Clear Playlist checkbox, Append does the same thing but with the Clear Playlist checkbox unchecked. That being said I hope you enjoy it.

You can get the code and the compiled dll here.

Drop the foo_playlist_helpers.dll into your components folder and you'll see the two new context menu items.

If you want to make changes to the code, to compile it first download MS Visual C++ Express from http://msdn.microsoft.com/vstudio/express/
Next download the foobar2000 SDK from here http://www.foobar2000.org/

You should read the readme, but if you have never coded before it probably won't make much sense.

Unzip foo_playlist_helpers.7z to your foobar downloaded SDK\foobar2000 folder. The folder structure should look like this:
SDK
-  foobar2000
-  -  foo_playlist_helpers

Open the file foo_playlist_helpers.sln in Visual C++. If the folder structure is correct you'll see 5 projects in this solution:
foo_playlist_helpers
foobar2000_components_client
foobar2000_SDK
foobar_sdk_helpers
pfc

Only foo_playlist_helpers is currently flagged to build, you may need to recompile the others since they are statically linked and all need to be linking to the same CRT. If so, go to Build-->Configuration Manager and make sure all projects are configured for Release and all flagged to build. Once you have all the projects compiled you can remove the flags to build on all the other projects.

happy coding!

And by the way, you should check out foosion's tutorials for details on how to code with the foobar2000 sdk.

If you are still having problems compiling it you can pm me, since those questions, I assume, are slightly off-topic for this thread.


Can you make it work from the active playlist regardless of its name, please?
Now it works only from the "Browser" playlist.

Thanks.

Is it possible to make a "now playing" playlist?

Reply #21
I'm getting this error when I run foobar:

Failed to load DLL: foo_playlist_helpers.dll
Reason: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

Is it possible to make a "now playing" playlist?

Reply #22
what version of foo do you have? do you have .net 2.0 ?

Is it possible to make a "now playing" playlist?

Reply #23
Foobar v0.9.4.1 and yes, I have .net 2.0
I'll try reinstalling .net I guess and see if that helps.

Is it possible to make a "now playing" playlist?

Reply #24
Foobar v0.9.4.1 and yes, I have .net 2.0
I'll try reinstalling .net I guess and see if that helps.


same here and i've just installed .net 2.0

 
SimplePortal 1.0.0 RC1 © 2008-2019