r0nny1l
r0nny1l

Reputation: 172

C# iTuneslib COM only showing collection classes

After adding a reference to iTunes1.13typelibrary, and adding the
using ituneslib;
In the program, I created the itunesApp class, but in the iTunesLib namespace, there are no options for classes such as IITPlayList or the track class, the only classes that show up are the collections. How do I access those classes?

Upvotes: 1

Views: 1184

Answers (2)

xdumaine
xdumaine

Reputation: 10339

Answer from comment: you can declare objects of these types, they just don't show up in intellisense. an example of this is here:

foreach (IITPlaylist pl in iTunes.LibrarySource.Playlists)
{
      foreach (IITTrack tr in pl.Tracks)
      {
           //do work 
      }
}

this code loops through each track in each playlist

Upvotes: 2

Vitaliy
Vitaliy

Reputation: 2804

It is not clear from your question what you gonna do with the iTunes SDK. Sample application you can get here

Note: C# in iTunes SDK is supported via COM Interop. There're no managed interfaces in iTunes SDK and you have to release objects yourself to avoid memory leaks. When you access some iTunes SDK objects it launches iTunes application. Collections doesn't support IEnumerable interface, so you can't use foreach statement. It is very slow in the collections enumeration.

Upvotes: 0

Related Questions