INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Update smartlist (SDK)  (Read 2611 times)

Messiahs

  • Galactic Citizen
  • ****
  • Posts: 432
Update smartlist (SDK)
« 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

GrantDG

  • World Citizen
  • ***
  • Posts: 199
Re: Update smartlist (SDK)
« Reply #1 on: August 18, 2009, 04:06:39 am »

*bump*

Any response from the JRiver team on this one?
Logged
Looking to control J River Media Center from your Windows Phone?: Look for nMedium & nMedium Play in the WP store

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3105
Re: Update smartlist (SDK)
« Reply #2 on: August 18, 2009, 07:22:46 am »

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()
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

prod

  • Citizen of the Universe
  • *****
  • Posts: 958
  • Play nice
Re: Update smartlist (SDK)
« Reply #3 on: September 16, 2009, 05:41:24 am »

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);

Code: [Select]
[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;

Code: [Select]
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.
Logged
Pages: [1]   Go Up