Example: /MacCF/iTunes Playlists

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCF/iTunes Playlists


Required plugins for this example: MBS MacCF Plugin, MBS Util Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCF/iTunes Playlists

This example is the version from Sun, 17th Mar 2012.

Project "iTunes Playlists.xojo_binary_project"
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() dim c as CFObjectMBS c=LoadMusicDictionary if c=nil then MsgBox "Failed to load the file ""iTunes Music Library.xml""." else TheLib=CFDictionaryMBS(c) ShowPlaylists end if End EventHandler
Function LoadMusicDictionary() As CFObjectMBS dim c as CFObjectMBS dim data as CFBinaryDataMBS dim f as FolderItem dim u as CFURLMBS dim b as BinaryStream dim s as string f=MusicDocumentsFolderMBS(-32763) f=f.Child("iTunes") f=f.Child("iTunes Music Library.xml") b=f.OpenAsBinaryFile(false) s=b.Read(B.Length) 'MsgBox str(len(S)) data=NewCFBinaryDataMBSStr(s) c=NewCFObjectMBSFromXML(data) Return c Exception End Function
Sub ShowPlaylists() dim a as CFArrayMBS dim o as CFObjectMBS dim i,c as integer dim d as CFDictionaryMBS dim s as CFStringMBS dim b as CFArrayMBS o=TheLib.Value(NewCFStringMBS("Playlists")) a=CFArrayMBS(o) c=a.Count-1 for i=0 to c o=a.Item(i) d=CFDictionaryMBS(o) // it's a dictionary o=d.Value(NewCFStringMBS("Name")) s=CFStringMBS(o) List.AddRow s.str o=d.Value(NewCFStringMBS("Playlist Items")) if o<>Nil then // items exist? b=CFArrayMBS(o) List.Cell(List.LastIndex,1)=str(b.Count) end if next Exception End Sub
Property Protected TheLib As CFDictionaryMBS
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

The items on this page are in the following plugins: MBS MacCF Plugin.


💬 Ask a question or report a problem