Quick Sign In:  

Forum: VirtualDJ Plugins

Topic: Having some trouble with get_loaded_song 'user 1'
EDIT: Never mind, I got it working.

---------

After I quick search, I read in another post that you should be able to get the User 1 field from a song with "deck 1 get_loaded_song 'user 1', but for some reason it isn't working for me.

Here is my function:

std::string CvdjMixmaster::GetDeckSongLightshow(int deckIndex)
{
const int MAX_SIZE = 256;
char lightshow[MAX_SIZE];
std::string command = "deck " + std::to_string(deckIndex) + " get_loaded_song 'user 1'";
HRESULT hr = GetStringInfo(command.c_str(), lightshow, MAX_SIZE);

if (hr == S_OK) {
return std::string(lightshow);
}
else {
// Log error code and command for debugging
std::string errorMsg = "Error fetching lightshow for deck " + std::to_string(deckIndex) + ": HRESULT " + std::to_string(hr);
return errorMsg;
}
}


If I change the relevant line to say:

std::string command = "deck " + std::to_string(deckIndex) + " get_loaded_song 'genre'";


It delivers the correct genre as expected.

But when I do 'user 1' instead of 'genre' it returns:

"Error fetching lightshow for deck 1: HRESULT 1"

So far I have tried the variations 'user 1', 'User 1', 'user1', and 'User1', all to no avail.

Any help would be appreciated.

 

Posted Tue 21 May 24 @ 11:23 pm