Help - Search - Members - Calendar
Full Version: New playlist context item / Message to other program
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
KaneMT
Hi there,

before spending a lot of time to get myself into the foobar2000 SDK I wanted to ask if the following is possible at all:

I want write a component which adds a new entry into the context menu of my playlist (EL-Playlist in this case). After choosing this entry the component should look for the path of the selected item(s) and send it's path and a code to a specific program running in the background.

When thinking about the code I guess this is isn't very hard at all.
But is it possible?

Thanks for you help!

Greetz, Kane
Yirkha
Sure, it is trivial.
CODE
#include "../SDK/foobar2000.h"

void DoMyCommand(metadb_handle_list_cref items)
{
  // TODO: Make this work even with more than one item, use some better inter-process communication, etc.
  uShellExecute(NULL, NULL, "MyProgram.exe", items[0]->get_location().get_path(), NULL, SW_SHOWNA);
}

const GUID guid_MyCommand = { !generate yourself! };
DECLARE_CONTEXT_MENU_ITEM(MenuItem_MyCommand, "My Command", "Utils", DoMyCommand, guid_MyCommand, "Sends path of selected track to My Program running in the background.");

DECLARE_COMPONENT_VERSION("My component", "1.0", "More information.");
KaneMT
Just as I hoped, thank you! smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.