This project is read-only.

The release contains a WinForm application that anybody with the Microsoft.NET Framework 3.5 or higher installed can simply use.  If you want to create your own front-end program that uses the MediaManipulatorAPI DLL to interface with iTunes, here's a simple look at the publicly-available functionality within the assembly.  Note that you will also need the Interop.iTunesLib.dll included in the source code.

Properties

Public ReadOnly Property ITunesLibrary
Provides access to the iTunes Library object.

Methods

Public Function EmbedArtwork(ByVal strWorkFilePath As String) As Integer
Embeds the first artwork file that iTunes has associated with each .mp3 file into the actual .mp3 files. Skips files that already have embedded artwork.

  • strWorkFilePath - The path to a folder to be used for temporary storage during the embedding process.
  • Returns a count of the number of errors that occurred due to missing artwork or media files.

Public Function GetPlaylistNames() As List(Of String)
Gets a list containing all of the iTunes playlist names.

  • Returns a list of strings containing all iTunes playlist names.

Public Sub ExportPlaylists(ByVal playlistNames As List(Of String),
ByVal outputFolderPath As String,
ByVal sortType As PlaylistSortTypes,
ByVal formats As List(Of PlaylistFileFormats),
ByVal strReplaceRegEx As String,
ByVal strReplaceText As string)
Exports a set of iTunes playlists into one or more playlist file formats.

  • playlistNames - The names of the iTunes playlist(s) to export.
  • outputFolderPath - The folder to which the playlist(s) should be exported.
  • sortType - The type of sorting to apply to the songs in the playlist(s).
  • formats - The formats of the playlist file(s) to create.
  • strReplaceRegEx - A regular expression to search for in each file path in the playlist(s)being exported.
  • strReplaceText - The text to replace any text in the file paths in the playlist(s) being exported that matches the replacement regular expression.
  • The purpose of the replace functionality is to allow something like media files on a mapped drive where iTunes understands m:/folder/file.mp3 but the system intended to use the exported playlists requires the UNC path - //computer/share/file.mp3.

Public Sub ExportSongs(ByVal playlistNames As List(Of String),
ByVal outputFolderPath As String,
ByVal boolOverwrite as Boolean,
Optional ByVal namingFormat As SongNamingFormats = SongNamingFormats.LEAVE)
Exports the actual files from one or more iTunes playlists into a target folder while also providing functionality to customize the output file names.

  • playlistNames - The names of the iTunes playlist(s) whose songs should be exported.
  • outputFolderPath - The folder to which the songs should be exported.
  • boolOverwrite - Indicates whether an existing, matching files should be overwritten.
  • namingFormat - The naming format to use for the songs being exported.

Enumerations

Public Enum PlaylistSortTypes
The types of sorting that the API can do when exporting a playlist.

  • ARTIST = 0
  • SONG = 1
  • ALBUM = 2

Public Enum PlaylistFileFormats
The supported output file formats types when exporting a playlist.

  • M3U = 0

Public Enum SongNamingFormats
The supported naming formats when exporting songs.

  • LEAVE = 0
  • ARTIST_SONG = 1
  • ARTIST_ALBUM_SONG = 2

Events

Public Event OnArtworkEmbedding(ByVal messages As List(Of String))
The artwork embedding process raises this message for each media file. You can handle it to display relevant messages to the user.

  • messages - All messages generated by the current iteration of the embedding process loop.

Public Event OnPlaylistExporting(ByVal messages As List(Of String))
The playlist exporting processes raise this message for each playlist file. You can handle it to display relevant messages to the user.

  • messages - All messages generated by the current iteration of the exporting process loop.

Last edited Oct 15, 2012 at 10:13 PM by cmaterick, version 8

Comments

No comments yet.