Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hendriks73/jitlibrary
Java API for the native Apple iTunes Library Framework for Music.app and iTunes (macOS)
https://github.com/hendriks73/jitlibrary
apple itunes itunes-library java macos music objective-c
Last synced: about 1 month ago
JSON representation
Java API for the native Apple iTunes Library Framework for Music.app and iTunes (macOS)
- Host: GitHub
- URL: https://github.com/hendriks73/jitlibrary
- Owner: hendriks73
- License: lgpl-2.1
- Created: 2021-09-30T12:18:55.000Z (over 3 years ago)
- Default Branch: dev
- Last Pushed: 2023-04-13T11:57:38.000Z (almost 2 years ago)
- Last Synced: 2024-11-17T13:06:22.445Z (3 months ago)
- Topics: apple, itunes, itunes-library, java, macos, music, objective-c
- Language: Java
- Homepage:
- Size: 493 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)
[](https://maven-badges.herokuapp.com/maven-central/com.tagtraum/jitlibrary)
[](https://github.com/hendriks73/jitlibrary/actions)
[](https://codecov.io/gh/hendriks73/jitlibrary/branch/main)# jITLibrary
*jITLibrary* is a thin wrapper around the Apple
[iTunes Library Framework](https://developer.apple.com/documentation/ituneslibrary/itlibrary),
which - despite its name - can also be used to access *Music.app* data.
Note that the API is read-only, just like Apple's framework. For write access,
see [Obstmusic](https://github.com/japlscript/obstmusic) or
[Obstunes](https://github.com/japlscript/obstunes).## Important
You **must**
[code sign](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html)
your app to retrieve information with this framework, and
iTunes library access is read-only. This framework is available to users with
iTunes 11 or later (also Music.app).
## Installation
jITLibrary is released via [Maven](https://maven.apache.org).
You can install it via the following dependency:```xml
com.tagtraum
jitlibrary
```
## Java Module
jITLibrary is shipped as a Java module
(see [JPMS](https://en.wikipedia.org/wiki/Java_Platform_Module_System))
with the name `tagtraum.jitlibrary`.## Usage
Once you have obtained an [ITLibrary](https://hendriks73.github.io/jitlibrary/com/tagtraum/jitlibrary/ITLibrary.html)
instance you may access its `ITMediaItem`s and `ITPlaylist`s as you like.Example:
```java
import com.tagtraum.jitlibrary.*;public class ListAllMediaItems {
public static void main(final String args) throws Exception {
// get library (blocking call)
final ITLibrary itLibrary = ITLibrary.getInstance(true);
// get the natively backed collection
final ITLibMediaItems allMediaItems = itLibrary.getAllMediaItems();
// print size if library
final int length = allMediaItems.size();
System.out.println("Library size: " + length);// iterate over the library and print names and artists
for (int i=0; i