INTERACT FORUM
Windows => Plug-in Development => Topic started by: Messiahs on February 01, 2008, 10:10:14 am
-
Hi,
is it possible to update a smartlist via SDK ?
eg. If i select the smartlist "100 Random songs" 5 times (via SDK), every result is the same.
If i open JR and select the view "100 Random songs" the result is different.
Is there a way like "MJPlaylistAutomation.update()" ?
thanks
Markus
-
*bump*
Any response from the JRiver team on this one?
-
If you access the files via a ViewItem then the file list is updated each time. For example: MJAutomation.GetViewItem("Playlists\\Smartlists\\100 Random Songs").GetFiles()
-
For the sake of complete-ness, you can refresh all smartlists by sending a command to MC using the Windows PostMessage method.
Here's a couple of C# code segments... first you've got to declare the PostMessage method in your chosen class so you can use it (and also declare the MC constants you want to use);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool PostMessage(IntPtr hWnd, uint Msg, uint wParam, uint lParam);
// MC specific constants
public const uint WM_MC_COMMAND = 33768;
public const uint MCC_REFRESH = 22007;
Then use the method to send the refresh command to MC;
PostMessage(new IntPtr(mc.GetWindowHandle()), WM_MC_COMMAND, MCC_REFRESH, 0);
Where mc is your MCAutomation object.
This can be used for loads of other stuff, there's more info here in the wiki (http://wiki.jrmediacenter.com/index.php/Media_Center_Core_Commands).