Java Code Examples for com.jacob.com.Variant#isNull()

The following examples show how to use com.jacob.com.Variant#isNull() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IiTunes.java    From The-5zig-Mod with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns the currently targetd track.
 *
 * @return An ITTrack object corresponding to the currently targeted track.
 * Will be set to NULL if there is no currently targeted track.
 */
public IITTrack getCurrentTrack() {
	Variant variant = iTunes.getProperty("CurrentTrack");
	if (variant.isNull()) {
		return null;
	}
	Dispatch item = variant.toDispatch();
	IITTrack track = new IITTrack(item);
	if (track.getKind() == IITTrackKind.ITTrackKindFile) {
		return new IITFileOrCDTrack(item);
	} else if (track.getKind() == IITTrackKind.ITTrackKindCD) {
		return new IITFileOrCDTrack(item);
	} else if (track.getKind() == IITTrackKind.ITTrackKindURL) {
		return new ITURLTrack(item);
	} else {
		return track;
	}
}
 
Example 2
Source File: IiTunes.java    From The-5zig-Mod with MIT License 6 votes vote down vote up
/**
 * Returns the currently targetd track.
 *
 * @return An ITTrack object corresponding to the currently targeted track.
 * Will be set to NULL if there is no currently targeted track.
 */
public IITTrack getCurrentTrack() {
	Variant variant = iTunes.getProperty("CurrentTrack");
	if (variant.isNull()) {
		return null;
	}
	Dispatch item = variant.toDispatch();
	IITTrack track = new IITTrack(item);
	if (track.getKind() == IITTrackKind.ITTrackKindFile) {
		return new IITFileOrCDTrack(item);
	} else if (track.getKind() == IITTrackKind.ITTrackKindCD) {
		return new IITFileOrCDTrack(item);
	} else if (track.getKind() == IITTrackKind.ITTrackKindURL) {
		return new ITURLTrack(item);
	} else {
		return track;
	}
}
 
Example 3
Source File: IITArtworkCollection.java    From The-5zig-Mod with MIT License 5 votes vote down vote up
/**
 * Returns an ITArtwork object corresponding to the given index (1-based).
 *
 * @param index Index of the playlist to retrieve, must be less than or
 *              equal to <code>ITArtworkCollection.getCount()</code>.
 * @return Returns an ITArtwork object corresponding to the given index.
 * Will be set to NULL if no playlist could be retrieved.
 */
public IITArtwork getItem(int index) {
	Variant variant = Dispatch.call(object, "Item", index);
	if (variant.isNull()) {
		return null;
	}
	Dispatch item = variant.toDispatch();
	return new IITArtwork(item);
}
 
Example 4
Source File: IITArtworkCollection.java    From The-5zig-Mod with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Returns an ITArtwork object corresponding to the given index (1-based).
 *
 * @param index Index of the playlist to retrieve, must be less than or
 *              equal to <code>ITArtworkCollection.getCount()</code>.
 * @return Returns an ITArtwork object corresponding to the given index.
 * Will be set to NULL if no playlist could be retrieved.
 */
public IITArtwork getItem(int index) {
	Variant variant = Dispatch.call(object, "Item", index);
	if (variant.isNull()) {
		return null;
	}
	Dispatch item = variant.toDispatch();
	return new IITArtwork(item);
}
 
Example 5
Source File: IITArtworkCollection.java    From The-5zig-Mod with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Returns an ITArtwork object with the specified persistent ID. See the
 * documentation on ITObject for more information on persistent IDs.
 *
 * @param highID The high 32 bits of the 64-bit persistent ID.
 * @param lowID  The low 32 bits of the 64-bit persistent ID.
 * @return Returns an ITArtwork object with the specified persistent ID.
 * Will be set to NULL if no playlist could be retrieved.
 */
public IITArtwork getItemByPersistentID(int highID, int lowID) {
	Variant variant = Dispatch.call(object, "ItemByPersistentID", highID, lowID);
	if (variant.isNull()) {
		return null;
	}
	Dispatch item = variant.toDispatch();
	return new IITArtwork(item);
}
 
Example 6
Source File: IITArtworkCollection.java    From The-5zig-Mod with MIT License 3 votes vote down vote up
/**
 * Returns an ITArtwork object with the specified persistent ID. See the
 * documentation on ITObject for more information on persistent IDs.
 *
 * @param highID The high 32 bits of the 64-bit persistent ID.
 * @param lowID  The low 32 bits of the 64-bit persistent ID.
 * @return Returns an ITArtwork object with the specified persistent ID.
 * Will be set to NULL if no playlist could be retrieved.
 */
public IITArtwork getItemByPersistentID(int highID, int lowID) {
	Variant variant = Dispatch.call(object, "ItemByPersistentID", highID, lowID);
	if (variant.isNull()) {
		return null;
	}
	Dispatch item = variant.toDispatch();
	return new IITArtwork(item);
}