INTERACT FORUM

Please login or register.

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

Author Topic: Request: COM SDK support for playing a playlist in a specific zone  (Read 2930 times)

Zoner

  • Regular Member
  • World Citizen
  • ***
  • Posts: 198
  • nothing more to say...

It seems that the COM SDK doesn't support playing a specific playlist in a specific zone.  There are only two Play() methods: one in MJPlaybackAutomation, which just plays whatever happens to be currently selected in Playing Now.  Since MJZoneAutomation has a GetPlayback() method, it is no problem to call this Play() method within a specific zone.  However if you want to play a specific playlist, then you need to call MJFilesAutomation::Play().  Unfortunately the only way to get hold of an MJFilesAutomation object for a non-playing playlist is via MJAutomation, and then no zone is specified.  As such, it's impossible to start a specific playlist in a specific zone, which is a pretty huge limitation.

A potential solution to this problem is to extend MJZoneAutomation with two new methods: GetPlaylists() and GetViewScheme().  Both would return a zone-specific object.  Alternatively, the existing MJFilesAutomation::Play() method should be extended to support a parameter specifying the zone.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3106
Re: Request: COM SDK support for playing a playlist in a specific zone
« Reply #1 on: November 08, 2005, 08:12:41 am »

If I understand your request, you can do this by just adding files to the current playlist for a given zone.  That is, "MJZoneAutomation.GetCurPlaylist().AddFile()" within a loop.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Zoner

  • Regular Member
  • World Citizen
  • ***
  • Posts: 198
  • nothing more to say...
Re: Request: COM SDK support for playing a playlist in a specific zone
« Reply #2 on: November 08, 2005, 08:45:57 am »

Thanks for your reply, but unfortunately I don't think that will work.  For starters, AddFile() accepts a string parameter (filename), not an MJFileAutomation object.  Secondly, even if an AddFile() method existed that could take an MJFileAutomation object, it would have to be called 10,000 times for a playlist like "Audio -- All" on my system, and I would guess that that would take quite a while.

If there was an AddFiles() method that accepted a Files object, then that would be perfect.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3106
Re: Request: COM SDK support for playing a playlist in a specific zone
« Reply #3 on: November 08, 2005, 09:44:51 am »

Well, I agree that it should be optimized by just accepting a MJFiles object, but you can of course easily get the filename from each MJFile and add them one at a time.  This is not ideal and may be slow but it does work.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Zoner

  • Regular Member
  • World Citizen
  • ***
  • Posts: 198
  • nothing more to say...
Re: Request: COM SDK support for playing a playlist in a specific zone
« Reply #4 on: November 08, 2005, 10:06:23 am »

Are you sure it's the same thing?  My impression was that you then add the file from the disk, not the file from your database, and they're seen as two different things.  As such, you don't get any of the database fields, like rating, and if you then rate the song, it won't affect the song in your database?  Or does MC automatically link the two?
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3106
Re: Request: COM SDK support for playing a playlist in a specific zone
« Reply #5 on: November 08, 2005, 12:52:27 pm »

It does seem to match the file up with the file in the library/database.  I just tried an experiment with a WAV file which stores no tags in the actual file and it can still get at the artist, album, and other tag information when I add the file in this way and I access the file later through the current playlist.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Zoner

  • Regular Member
  • World Citizen
  • ***
  • Posts: 198
  • nothing more to say...
Re: Request: COM SDK support for playing a playlist in a specific zone
« Reply #6 on: November 09, 2005, 01:28:10 am »

OK thanks very much for info.  I found a fast work-around, though - change the active zone, and then play the playlist.  Unfortunately it affects the MC GUI, but it works and is fast.
Logged

harleydude

  • Regular Member
  • Recent member
  • *
  • Posts: 10
  • Change this by choosing profile
Re: Request: COM SDK support for playing a playlist in a specific zone
« Reply #7 on: November 01, 2006, 09:21:32 pm »

Ok I give, what do you do to set the playlist.  I assume you call MJZonesAutomation.SetActiveZone() to the zone you want to have the playlist play in, but how do you tell it what playlist you want?

Thanks
Logged

Zoner

  • Regular Member
  • World Citizen
  • ***
  • Posts: 198
  • nothing more to say...
Re: Request: COM SDK support for playing a playlist in a specific zone
« Reply #8 on: November 01, 2006, 10:39:01 pm »

First clear playing now (with RemoveAllFiles), then call Playlist->GetFiles()->Play(0);
Logged
Pages: [1]   Go Up