Accesso rapido:  

Forum: General Discussion

Topic: VDJScript Select (load) by path?
I've been messing around with some ways to use the Network Control plugin to load a song by the path into the karaoke list (with the singer's name would be nice) but I get stuck right from the start. I would think that there is some sort of select-by-path in the browser command but I have yet to find it

Something like:
karaoke_add append 'c:\song.mp3' edit_singer 'Magic Mike'


I find commands that seem like they would work but they all require the file to be selected in the browser first... so, is there a command (perhaps not documented) to select a file by path in the browser first?

Anybody wanna write a plugin that does this for me? The plugin would be pretty basic, option to add an API URL that would ping every 10 seconds and it would respond with JSON containing file paths and singer name to get added into the karaoke list or side list if it's not karaoke. Message me with a bid/quote if you are interested.
 

Inviato Sun 01 Oct 23 @ 9:40 am
locoDogPRO InfinityModeratorMember since 2013
karaoke_add'c:\song.mp3' & browser_window karaoke & browser_scroll bottom & edit_singer 'Magic Mike'
 

Inviato Sun 01 Oct 23 @ 10:59 am
Thanks for the reply but this doesn't seem to do anything but while on the subject, is there any type of error or debugging?
 

Inviato Sun 01 Oct 23 @ 3:36 pm
locoDogPRO InfinityModeratorMember since 2013
sorry typo and I forgot how to edit singer in list to specific name

karaoke_add 'c:\song.mp3' & browser_window karaoke & browser_scroll bottom & browsed_song 'singer' 'Magic Mike'

Depends on what you want to debug, really there's only value display
something like this
get_text "mike" & param_add "1" & param_cast & debug.

Have you tried easyKRM?, that does a lot of karaoke workflow
 

Inviato Sun 01 Oct 23 @ 4:06 pm
I'm just trying to come up with an easy way to connect my song request web app to VDJ. The ask-the-DJ thing is not cutting it... I just want to drop the request directly into the side list or karaoke. Perhaps you'd be interested in incorporating such a feature into easyKRM? GET -> URL -> Response in JSON.
 

Inviato Sun 01 Oct 23 @ 4:21 pm
locoDogPRO InfinityModeratorMember since 2013
 

Inviato Sun 01 Oct 23 @ 4:26 pm
That is close but I think ultimately I would want it to be simpler and a uni-tasker with little to no effort from the host other than providing their URL in the settings. Good to know it's at least possible though.

I've tried my hand at creating a plugin but C is not my strong suit.
 

Inviato Sun 01 Oct 23 @ 4:34 pm
Going a little nutty here, why is this not creating a user input field to paste in their URL?

#ifndef MYPLUGIN8_H
#define MYPLUGIN8_H

// we include stdio.h only to use the sprintf() function
// we define _CRT_SECURE_NO_WARNINGS for the warnings of the sprintf() function
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

#include "vdjPlugin8.h"

#define ID_STRING_URL 1

class CMyPlugin8 : public IVdjPlugin8
{
public:
HRESULT VDJ_API OnLoad();
HRESULT VDJ_API OnGetPluginInfo(TVdjPluginInfo8* infos);
ULONG VDJ_API Release();
HRESULT VDJ_API OnGetUserInterface(TVdjPluginInterface8* pluginInterface);
HRESULT VDJ_API OnParameter(int id);
HRESULT VDJ_API OnGetParameterString(int id, char* outParam, int outParamSize);

private:
char apiURL[256];
};

#endif


#include "MyPlugin8.h"

//-----------------------------------------------------------------------------
HRESULT VDJ_API CMyPlugin8::OnLoad()
{
// Declare a string parameter for API URL, allowing the user to input it
DeclareParameterString(apiURL, ID_STRING_URL, "Your API URL", "API URL", sizeof(apiURL));
return S_OK;
}
//-----------------------------------------------------------------------------
HRESULT VDJ_API CMyPlugin8::OnGetPluginInfo(TVdjPluginInfo8* infos)
{
infos->PluginName = "MyPlugin";
infos->Author = "Me";
infos->Description = "This plugin will connect your API to retrieve pending song requests.";
infos->Version = "1.0";
infos->Flags = 0x00;
infos->Bitmap = NULL;

return S_OK;
}
//---------------------------------------------------------------------------
ULONG VDJ_API CMyPlugin8::Release()
{
delete this;
return S_OK;
}
//---------------------------------------------------------------------------
HRESULT VDJ_API CMyPlugin8::OnGetUserInterface(TVdjPluginInterface8* pluginInterface)
{
pluginInterface->Type = VDJINTERFACE_DEFAULT;
return S_OK;
}
//---------------------------------------------------------------------------
HRESULT VDJ_API CMyPlugin8::OnParameter(int id)
{
if (id == ID_STRING_URL)
{
// Handle the change in apiURL here
// For example, you might want to make an API call, validate the URL, etc.
// The updated URL is stored in apiURL
}
return S_OK;
}
//---------------------------------------------------------------------------
HRESULT VDJ_API CMyPlugin8::OnGetParameterString(int id, char* outParam, int outParamSize)
{
// You might want to return the current URL if requested
if (id == ID_STRING_URL && outParam != nullptr)
{
snprintf(outParam, outParamSize, "%s", apiURL);
}
return S_OK;
}

 

Inviato Mon 02 Oct 23 @ 1:39 am
@locodog ... you dah dog man... with your help, I've managed to get my plugin mostly working. I really love C will never be said by me.

Do you have any suggestions on where to put status messages? I was thinking about putting in the settings (gear icon) of the plugin but I can't manage any better than:

DeclareParameterString(statusMessage, ID_STRING_MESSAGE, "Status", "\nStatus", sizeof(statusMessage));
DeclareParameterString(apiURL, ID_STRING_URL, "API URL", "\nURL", sizeof(apiURL));

which is just sort of smashing them in. I went through all the verbs, nothing seemed appropriate. I just want somewhere to see if stuff is sparkling and happinating etc.
 

Inviato Mon 02 Oct 23 @ 7:59 am
locoDogPRO InfinityModeratorMember since 2013
You could make a custom gui version of the plugin.
 

Inviato Mon 02 Oct 23 @ 8:58 am