Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List Based Music Browsing
#1
I have refined my music based list browsing set up quite a bit and thought I would post it here for folks to peruse. The concept could come in handy for smaller form factor clients. The image below shows the main menu of the example template that is included as an attachment below.

[Image: listbasedmusicbrowsing.jpg]

The configuration in this template is made to somewhat emulate the ipod browsing paradigm. You can drill down into the various menus and at various levels you will have Play All/Add All options that will allow you to either play (clear first then play) or add music to a music renderer driver. This gives you the ability to add music to your playlist very easily. One way this may be used would be to create "Playlists" out of categories. Classify a given set of media under a specific category (Genre) and you can easily add every item in that category to a media driver's playlist. When selecting various collections and items you also have the ability to add/play individual collections and items as well. The setup gives you complete control over how you select music.

Another tool you have is the same ability as the CAB to scroll to a character. The underlying macro calls return a list of indices for where the first numeric and alpha characters of the current list can be found. Numeric and alpha characters cover the vast majority of what a first char would be. If something begins with some type of punctuation mark or symbol then it won't be able to scroll to it directly, but those will be at the top of the list anyhow.

The attachments below include the example template and the required macros. The template is part of a larger work that abstracts a lot of things so in order to test it out you need to open it up in the editor and in the OnPreload set GVar:AudioDriver to the audio driver whose repository you want to browse. In the macros there is a macro called GetPLItemIndex that will find the index of the currently playing item in a playlist. You feed it the name of the audio driver and the item cookie and it will return you the index if found or the maximum value of a Card4 if not. To use it you can set up a trigger on the CurItemCookie and in the triggered event action get the index of the currently playing item and write that out to a variable driver field. You can use that field in your template to display the currently playing song.

The macros are set up to provide a flat album list where you are only dealing with collections and no title sets. It should work with a cqc based repository, but hasn't been tested against it. Below are the definitions of the macros used in the template. Note that for the StartsWith parameter for GetArtists using "All Artists" has special meaning and is used for parsing results so if you have an artist with a name that actually starts with "All Artists" it will not be able to filter on that specifically. For the GetAlbums "All Albums' is reserved for StartsWith and "All Albums" and "All Artists" are reserved for the ArtistFilter. Also note great care should be taken when using these macros as the interface to the repositories isn't highly optimized for some of the filtering that is provided so if you have a large repository and aren't careful you could have a macro go away for a while. You should always test a macro in the editor before turning it loose on your interface.

GetAlbums
Code:
Method Start([In] String Repository,
                 [In] String CatCookie,
                 [In] String SortOrder,
                 [In] String ArtistFilter,
                 [In] String StartsWith,
                 [Out] String Artists,
                 [Out] String Names,
                 [Out] String Cookies,
                 [Out] String ScrollToIndices,
                 [Out] String AlbumCount) Returns Int4
Examples:
  • Get all albums for all artists who start with "Van" in the "All Music" category
    • GetAlbums(RepoMoniker,"1,2","Artist","Van","All Albums",Artists,Names,Cookies,Indices,Count)
  • Get albums that start with "Into" for all artists who start with "Van" in the "All Music" category
    • GetAlbums(RepoMoniker,"1,2","Artist","Van","Into",Artists,Names,Cookies,Indices,Count)

GetArtists
Code:
Method Start([In] String Repository,
                 [In] String CatCookie,
                 [In] String StartsWith,
                 [Out] String Artists,
                 [Out] String ScrollToIndices,
                 [Out] String ArtistCount) Returns Int4
Examples:
  • Get all artists in the "All Music" category
    • GetArtists(RepoMoniker,"1,2","All Artists",Indices,Count)
  • Get all artists in the "All Music" category who start with "Nickel"
    • GetArtists(RepoMoniker,"1,2","Nickel",Indices,Count)

GetCategories
Code:
Method Start([In] String Repository,
                 [In] String MediaType,
                 [In] Boolean NoEmpty,
                 [Out] String Names,
                 [Out] String Cookies,
                 [Out] String ScrollToIndices,
                 [Out] String CatCount) Returns Int4
Examples:
  • Get music categories
    • GetCategories(RepoMoniker,"Music",True,Names,Cookies,Indicies,Count)

GetItems & GetItems2*
Code:
Method Start([In] String Repository,
                 [In] String Cookies,
                 [In] Boolean Sort,
                 [Out] String ItemNames,
                 [Out] String ItemCookies,
                 [Out] String ItemLocs,
                 [Out] String ItemArtists,
                 [Out] String ItemColNames,
                 [Out] String ScrollToIndices,
                 [Out] String Count) Returns Int4
*GetItems2 returns ItemNames as "Name - Artist"
Examples:
  • Get all items in the "All Music" category - Could go away for a long time...not a good query
    • GetItems(RepoMoniker,"1,2",True,Names,Cookies,Locs,Artists,ColNames,Indices,Count)
  • Get all items in the Bluegrass category
    • GetItems(RepoMoniker,"1,21",True,Names,Cookies,Locs,Artists,ColNames,Indices,Count)
  • Get all items in the Bluegrass and Disco category
    • GetItems(RepoMoniker,"\"1,2\",\"1,10\"",True,Names,Cookies,Locs,Artists,ColNames,Indices,Count)

PlayMusic
Code:
Method Start([In] String Moniker,
                 [In] String Cookies,
                 [In] String Enqueue) Returns Int4
Examples:
  • Add all collections in the Bluegrass and Disco categories to the playlist
    • PlayMusic(AudioDriverMoniker,"\"1,2\",\"1,10\"","Enqueue")
  • Play all collections in the Bluegrass and Disco categories
    • PlayMusic(AudioDriverMoniker,"\"1,2\",\"1,10\"","Play")

GetPLItemIndex
Code:
Method Start([In] String Moniker,
               [In] String CurItemCookie,
               [Out] String FoundAt) Returns Int4

Addendum: I threw together a template that should work for small form factor devices. It includes the Play All and Add All at the Album song list level and selecting an individual song will add it to the playlist if not already there and then play it. Note that if you get to a song list by any other means then selecting an album you won't see a Play All and Add All as the list could potentially be too large and you could always do the Play/Add at the level above.

[Image: smallffmusicselect.jpg]


Attached Files
.zip   List Based Music Browsing.zip (Size: 31.96 KB / Downloads: 24)
.zip   Small Form Factor Music Select.zip (Size: 79.61 KB / Downloads: 13)
.cqcmacropack   lbmm_02212010.CQCMacroPack (Size: 17.6 KB / Downloads: 25)
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Reply
#2
JR - Nice job; I am going to DL it and try it out. I was 3/4 down this road and just could not find the time to get it to 100%. You may have done that for me! I may have a logic question or two for you.
Thanks,
Dave Bruner
Cool
Reply
#3
JR - Any chance that you can dump a list of variables out for import?
Thanks,
Dave Bruner
Cool
Reply
#4
If anyone downloaded the templates a little earlier there was a bug that would crash it if you reloaded the template when on the albums or items list.


Dave,
There really isn't anything to dump out. If you want to see the GVar's being used just open the action trace. Other than that it just needs a GVar to tell it what audio driver to use and its on its way. The whole thing has no dependency on driver based fields (other than the media repo image widget on the larger template). In order to user them all you need to do is open up the template in the editor and in the OnPreload set the GVar:AudioDriver to an audio driver on your system.
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Reply
#5
G'day

JR - looks great, I have always struggled to get my head around creating a template that could handle my music. I have tried to load it, and after adding the required audio driver, when i load the template i get this error:
Macro class '\MEng\User\CQC\Macros\Media\GetCategoryCookie' was not found

I have looked in that folder and the only files are as follows, i cant see the required GetCategoryCookie file it is looking for (but I might be barking up the wrong tree)
GetAlbums.mengc
GetArtists.mengc
GetCategories.mengc
GetItems.mengc
GetPLItemIndex.mengc
PlayMusic.mengc

Paul
Reply
#6
My bad. Forgot that one. The macropack above now contains that one as well.
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Reply
#7
JR

Tried that, and now i get a new error when I try and load the template.

Could not load user interface List Based Music Browsing. It will not be automatically reloaded the next time you log onto this machine.
And when I press the detail button, I see this error:
Macro 'MEng.User.CQC.Macros.Media.GetCategoryCookie' could not be

Thanks
Paul
Reply
#8
I just checked the macro pack i posted and it has all the macros. Check in \CQC\CQCData\DataServer\Macros\MEng\User\CQC\Macros\Media and see if it is there. Did you try and just reload a template or close out the IV and then reopen it. I have noticed that once the IV crashes on something like that you have to completely close out in order to be able to load the template back up.

Ok. I had one last macro still pointing at a media class I have. I got away from having a base library for stuff like this and just having everything self-contained. You get repetition of code, but you don't have to worry about problems like this when you forget to include a dependent library. That one that is up will really work...I promise.
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Reply
#9
Great, thanks it loads now. Cant tell if its playing as I am not at home, but will test it tonight.

Paul
Reply
#10
G'day

I have had a chance to test it and it work, and is so easy to use. Just 1 question, i have 2 File Tag Media Repo's, 1 had kids music, and another has normal music. This template works with kids repo (the first 1 i setup), but when i set it up for the second repo, when the template loads i get this error:

Token expansion failed during command processing

Variable LVar:AllEntry was not found

Can this template be used more then once? I changed the audio driver to the other driver that I use for the normal music.

Thanks

Paul
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Google Play Music integration sic0048 1 1,078 12-25-2018, 11:52 AM
Last Post: batwater
  Porting Auto-Gen Music Templates to Existing System TurboSam 4 3,270 08-31-2016, 01:08 PM
Last Post: TurboSam
  list browser? jkmonroe 4 2,243 10-03-2015, 10:36 AM
Last Post: jkmonroe
  How to put a pause in an Action list? Deane Johnson 10 4,296 11-30-2014, 11:22 AM
Last Post: Dean Roddey
  Static Browser List avtexan 4 2,775 09-26-2014, 09:46 PM
Last Post: avtexan
  Android based device Voice control of CQC How To Discussion Thread batwater 5 4,209 12-07-2013, 10:01 PM
Last Post: RichardU
  How TO: Australia based weather radar jdmevo123 0 3,310 12-02-2013, 03:52 PM
Last Post: jdmevo123
  what are people currently using for ripped music and dvd playback? capall 13 4,268 06-21-2013, 11:44 PM
Last Post: Dean Roddey
  Full Pre-Wire List IVB 32 8,098 05-22-2013, 11:42 AM
Last Post: umdivx
  URL-based actions? IVB 24 7,105 02-28-2013, 06:58 PM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)