Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Squeezebox Server Driver - Part 2
#1
This is a continuation of the original Squeezebox / SqueezeCenter driver thread.

I'm starting a new one so I can control the contents of this first post and keep it updated with the latest info and version of the driver.

Example templates for the driver can be found here: http://www.charmedquark.com/vb_forum/sho...stcount=46

Basics

The database portion of the driver handles 4 basic lists of information: albums, artists, tracks, and genres.

These lists are exposed as Stringlist fields named (surprisingly) Albums, Artists, Tracks, and Genres.

At driver load time, if the 'Use Database' box was checked at driver install, each of these stringLists is populated from the SqueezeCenter server. Along with each list is field with the count of the number of items in the list: AlbumCount, ArtistCount, TrackCount, and GenreCount.

The lists are loaded 20 items at a time - the first 20 items load along with the item count immediately and the rest of the list is populated in the background until all items have been loaded. The track list is only initially loaded with the tracks from the first album in the album list since that list could be huge if filled with all tracks in the database and there usually isn't a need to get all tracks at one time.

To get specific info about a list item, there are 4 fields to request the details about a list entry: RefreshAlbumInfo, RefreshArtistInfo, RefreshTrackInfo, and RefreshGenreInfo. These fields take a zero based index into its respective list as an argument. For example, if you have the list of tracks for an album, then doing a RefreshTrackInfo with index 0 will fill in TrackTitle, TrackAlbum, TrackArtist, TrackAlbumArtworkURL, TrackDuration, TrackYear, and TrackCookie, for the first track in the Tracks list. The Cookie fields may be used directly as arguments to PlayMedia, EnqueueMedia, and AddFavorite. A TrackCookie passed to PlayMedia plays that track, an album cookie plays all tracks in that album, an artist cookie plays all tracks by that artist, and a Genre cookie plays all tracks in that Genre.

Each of the lists may be filtered by the other lists. For example, tracks may be filtered by artist, and/or album, and/or genre. To filter the tracks list by a given album, set the TrackAlbumFilter to the index of the Album in the Album list you which to filter by. For example, to get the Tracks for the first Album in the Albums list, set the TrackAlbumFilter to 0 and then set the RefreshDatabase field to Track. The tracks list will now contain the list of the tracks of the first album. To get all albums for an artist, set the AlbumArtistFilter field to the index of the artist in the artist that you want the albums for. Set the ClearFilters field to All, Album, Artist, Track, or Genre to clear the filters for all lists or a specific list. A RefreshDatabase is then required to get the unfiltered list(s).

Additionally, each list may be filtered by a search criteria using the search filters available on each list. The fields AlbumSearchFilter, ArtistSearchFilter, TrackSearchFilter, and GenreSearchFilter may be set to a string to further qualify the associated list contents. For example, setting AlbumSearchFilter to "Th" and doing a RefreshDatabase(Album) would result in the Albums list containing all albums that contained a word starting with "Th". These filters may be combined with any of the other list filters to narrow the category lists.

Artwork

Album artwork is available via a http request from the SqueezeCenter server. The detail information for albums, artists, tracks, and playlists contains fields for the artwork urls. Use a web image widget to display the artwork.

Search

The Search field takes a search string and returns a Stringlist of search results in the... wait for it... SearchResults field. The results are separated into categories of Album, Artist, Genre, and Track. A write to the RefreshSearchInfo field with an index into the search results will fill in the SearchType, SearchCookie, and SearchIndex for the selected SearchResult along with the info that is appropriate for the type of result.

The SearchCookie can be direcly used with PlayMedia, EnqueueMedia, or AddFavorite.

The SearchType field returns one of Album, Artist, Track, Genre, Track, or None. You can use the SearchType contents to know which info to look at for a given result and what type of template to use to drill down into the results.

SearchIndex is the index into the list where the item resides. The list that the index refers to is indicated by the SearchType field. For example, if SearchType is Album and the index is 27, then the selected result is at index 27 in the Albums list. Note that the index refers to the unfiltered list index of all types except Tracks which only contains the tracks that match the search string.

Some of the stringlist entries contain headings that are used to categorize the results. A RefreshSearchInfo with the index of a heading will return a SearchType of None. These heading names may be changed via the SearchResultsHeadings fields if they need to be translated to another language or you want them to say something else. The SearchResultsHeadings field takes a comma separated list of strings in Album,Artist,Track,Genre format.

Playlists

The driver has new capabilities to manipulate current and saved playlists.

Writing to the SavePlaylist field with a playlist name as the argument will save the current playlist in the player as a saved playlist. Saved playlists can be removed by writing to the RemovePlaylist field with the index of the playlist in the Playlists field as the parameter.

The tracks for a saved playlist may be retrieved by using the TrackPlaylistFilter. This works like other filters except that it overrides all of the other filters that may be in effect for the tracks list. Set the TrackPlaylistFilter to the index of the playlist in the Playlists field for which you wish to get the tracks. A RefreshDatabase(Tracks) will then populate the Tracks list with the tracks for that playlist.

The details (Title, Album, Artist, Duration, etc) for each of these tracks are accessed in the same way as any other track in the track list: write to RefreshTrackInfo with the index of the track you would like details for.

Tracks in the playlist may be moved up or down by writing to the TrackMoveUp and TrackMoveDown fields with the index of the track to move. Tracks may be removed from the playlist by writing to the TrackRemove field with the track index. These fields only work on a track list that has been filtered by playlist.

Track details for the current player playlist may be accessed by writing to the RefreshPlaylistInfo field with the index of the track in the playlist. The detail information appears in the fields PlaylistTitle, PlaylistAlbum, PlaylistArtist, PlaylistYear, PlaylistDuration, and PlaylistAlbumArtworkURL.

Music Services and Radio

The Radios and Services support in the driver makes use of 4 main lists: Services, ServiceItems, Radios, and RadioItems.
The Services and Radios lists are similar and represent the top level choices for each collection.
Performing a RefreshServices and RefreshRadios will update these lists and the count fields for each.

Below the main lists are the item lists: ServiceItems and RadioItems. These lists are multi-purpose and can be nested.
A RefreshRadioItems or RefreshServiceItems will drill down into the Radios or Services list at the index into the main list specified.
This will fill in the count, level (how deep you are nested), hasImages (does this item list contain icons), and name fields.
A RefreshRadioItemInfo or RefreshServiceItemInfo will update the Item name, cookie, type, hasItems, and isAudio fields.
The types that are possible for each item are search, playlist, and link. The boolean hasItems field tells whether or not there
are sub-items below this item. The boolean isAudio field tells whether this is a playable item or not. If it is, you can use the cookie
with the PlayMedia or EnqueueMedia fields to play the item. Note that an item entry can be an Audio field while at the same time have sub-items such as an Album.

To move down into a sub-item list, use the OpenServiceItem or OpenRadioItem field. This will fill in the item list with the new contents
and update the count, the level, whether the list has images, and the item name. To move back up from a nested list, use the CloseServiceItem or
CloseRadioItem field. Again, this will fill in the parent list, count, level, hasImages, and name fields.

If an item is a search item type, set the search filter field to the search string before calling OpenRadioItem or OpenSearchItem.

Use v3.60 with CQC Server 3.3.6 and below.

Use v3.65 with CQC Server 3.3.7 and above.

Use v3.8 with CQC 4.2 and above.

Use v3.90 with CQC 4.3.919 and above.


Attached Files
.cqcdrvpack   SqueezeCenter-3.60.CQCDrvPack (Size: 52.22 KB / Downloads: 49)
.cqcdrvpack   SqueezeCenter-3.65.CQCDrvPack (Size: 52.88 KB / Downloads: 33)
.cqcdrvpack   SqueezeCenter-3.8.CQCDrvPack (Size: 53.02 KB / Downloads: 58)
.cqcdrvpack   SqueezeCenter-3.90.CQCDrvPack (Size: 53.62 KB / Downloads: 33)
Reply
#2
I have updated the first post with v3.60 of the driver.
The changes are:

Make RefreshList field always write
Add TrackArtists field
Add TrackYears field
Add TrackDurations field
Force Mac addresses to lowercase
Add PlaylistMoveUp and PlaylistMoveDown
Fix problem with deleting last item in playlist in jukebox mode with server v7.4.x
Add CurAlbumIndex, CurArtistIndex, and CurGenreIndex fields
Add ArtistArtworkURL, GenreArtworkURL. and PlaylistsArtworkURL fields
Add RefreshPlaylistsInfo field
Add PlaylistsName and PlaylistsCookie fields
Add SearchResultsArtworkURL, SearchResultsDetail1, SearchResultsDetail2, and SearchResultsDetail3 fields

This driver should work with existing template sets.

I will be releasing a new template set soon that takes advantage of the new features in the driver.
Reply
#3
Driver v3.60 really added to first post this time.
Reply
#4
I tried to use the Import Package command on Music-NowPlaying.CQCTmplPack and got the following error:

"The package installation failed"
with an error detail saying:
"3 is not a valid format version in a 'TCQCInfContainer' object"

Any suggestions on how to import this template? All of your other templates imported without a problem.

Thanks
Reply
#5
SoundVideoDesign Wrote:I tried to use the Import Package command on Music-NowPlaying.CQCTmplPack and got the following error:

"The package installation failed"
with an error detail saying:
"3 is not a valid format version in a 'TCQCInfContainer' object"

Any suggestions on how to import this template? All of your other templates imported without a problem.

Thanks

That one got updated from a later version of CQC (3.1.30) and can't be imported by earlier versions of CQC. I'm working on getting the previous version back. Until then, you can use the old Now Playing or upgrade to the latest Beta of CQC
Reply
#6
jkish Wrote:That one got updated from a later version of CQC (3.1.30) and can't be imported by earlier versions of CQC. I'm working on getting the previous version back. Until then, you can use the old Now Playing or upgrade to the latest Beta of CQC

At this point, just wait until tonight and 3.2 will officially be there and you can upgrade to that.
Dean Roddey
Software Geek Extraordinaire
Reply
#7
Is there a way to remove local radio statios from the Squeeze list? I only use about 5, and hate having to scroll through 80 just to get to them.
Reply
#8
Sacedog Wrote:Is there a way to remove local radio statios from the Squeeze list? I only use about 5, and hate having to scroll through 80 just to get to them.

No, not currently.

I could build in a feature that would allow you to "delete' stations from the list which would add them to an exclusion file that the driver could use to prune the list when it is fetched. This could be done from the IV to delete the stations, but to restore, you would have to delete or edit the exclusion file.
Reply
#9
I just add the ones that I like to my favorites
Reply
#10
Hi

I tried loading the new example templates in the Admin Interface. All work except for "Music-NowPlaying", which will not load giving an error message "3 is not a valid format version in Inf Container". Could you upload them again please.

I am currently on 3.1.0 but will update to 3.2.0 in a few days time.

Thanks

PJG
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Monoprice Blackbird 4x4 HDMI Switcher - Driver request batwater 9 3,866 10-14-2017, 05:30 PM
Last Post: rtarver
  XBMC Driver wuench 419 110,106 07-02-2017, 11:04 AM
Last Post: Dean Roddey
  IMAP Email Driver whozeawhat 11 1,671 06-14-2017, 11:53 AM
Last Post: whozeawhat
  Which JVC Projector Driver indygreg 29 5,119 05-12-2017, 08:29 AM
Last Post: Dean Roddey
  Amazon Echo Hue Simulator Driver wuench 101 20,323 05-02-2017, 09:38 AM
Last Post: Dean Roddey
  SageTV Player V2 Driver chmilar 6 1,329 04-14-2017, 03:36 PM
Last Post: chmilar
  SageTV Driver George M 16 2,520 02-16-2017, 07:10 PM
Last Post: Dean Roddey
  ADA Suite 16 driver assistance zane 3 1,136 01-17-2017, 06:27 AM
Last Post: zane
  Sage Media Server driver (beta) Fonceur 696 116,025 01-06-2017, 05:34 PM
Last Post: Dean Roddey
  Need some help with developing a driver adamalli 11 2,161 01-02-2017, 07:00 AM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 2 Guest(s)