com.bugvm.apple.mediaplayer.MPMusicPlayerController Maven / Gradle / Ivy
The newest version!
/*
* Copyright (C) 2013-2015 RoboVM AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.bugvm.apple.mediaplayer;
/**/
import java.io.*;
import java.nio.*;
import java.util.*;
import com.bugvm.objc.*;
import com.bugvm.objc.annotation.*;
import com.bugvm.objc.block.*;
import com.bugvm.rt.*;
import com.bugvm.rt.annotation.*;
import com.bugvm.rt.bro.*;
import com.bugvm.rt.bro.annotation.*;
import com.bugvm.rt.bro.ptr.*;
import com.bugvm.apple.foundation.*;
import com.bugvm.apple.uikit.*;
import com.bugvm.apple.coregraphics.*;
/* */
/**/
/**
* @since Available in iOS 3.0 and later.
*/
/* */
/**/@Library("MediaPlayer") @NativeClass/* */
/**/public/* */ class /**/MPMusicPlayerController/* */
extends /**/NSObject/* */
/**/implements MPMediaPlayback/* */ {
public static class Notifications {
/**
* @since Available in iOS 3.2 and later.
*/
public static NSObject observeIsPreparedToPlayDidChange(MPMusicPlayerController object, final VoidBlock1 block) {
return NSNotificationCenter.getDefaultCenter().addObserver(IsPreparedToPlayDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1() {
@Override
public void invoke (NSNotification a) {
block.invoke((MPMediaPlayback) a.getObject());
}
});
}
public static NSObject observePlaybackStateDidChange(MPMusicPlayerController object, final VoidBlock1 block) {
return NSNotificationCenter.getDefaultCenter().addObserver(PlaybackStateDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1() {
@Override
public void invoke (NSNotification a) {
block.invoke((MPMusicPlayerController) a.getObject());
}
});
}
public static NSObject observeNowPlayingItemDidChange(MPMusicPlayerController object, final VoidBlock1 block) {
return NSNotificationCenter.getDefaultCenter().addObserver(NowPlayingItemDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1() {
@Override
public void invoke (NSNotification a) {
block.invoke((MPMusicPlayerController) a.getObject());
}
});
}
public static NSObject observeVolumeDidChange(MPMusicPlayerController object, final VoidBlock1 block) {
return NSNotificationCenter.getDefaultCenter().addObserver(VolumeDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1() {
@Override
public void invoke (NSNotification a) {
block.invoke((MPMusicPlayerController) a.getObject());
}
});
}
}
/**/public static class MPMusicPlayerControllerPtr extends Ptr {}/* */
/**/static { ObjCRuntime.bind(MPMusicPlayerController.class); }/* */
/**//* */
/**/
public MPMusicPlayerController() {}
protected MPMusicPlayerController(SkipInit skipInit) { super(skipInit); }
/* */
/**/
@Property(selector = "playbackState")
public native MPMusicPlaybackState getPlaybackState();
@Property(selector = "repeatMode")
public native MPMusicRepeatMode getRepeatMode();
@Property(selector = "setRepeatMode:")
public native void setRepeatMode(MPMusicRepeatMode v);
@Property(selector = "shuffleMode")
public native MPMusicShuffleMode getShuffleMode();
@Property(selector = "setShuffleMode:")
public native void setShuffleMode(MPMusicShuffleMode v);
/**
* @since Available in iOS 3.0 and later.
* @deprecated Deprecated in iOS 7.0.
*/
@Deprecated
@Property(selector = "volume")
public native float getVolume();
/**
* @since Available in iOS 3.0 and later.
* @deprecated Deprecated in iOS 7.0.
*/
@Deprecated
@Property(selector = "setVolume:")
public native void setVolume(float v);
@Property(selector = "nowPlayingItem")
public native MPMediaItem getNowPlayingItem();
@Property(selector = "setNowPlayingItem:")
public native void setNowPlayingItem(MPMediaItem v);
/**
* @since Available in iOS 5.0 and later.
*/
@Property(selector = "indexOfNowPlayingItem")
public native @MachineSizedUInt long getIndexOfNowPlayingItem();
@Property(selector = "isPreparedToPlay")
public native boolean isPreparedToPlay();
@Property(selector = "currentPlaybackTime")
public native double getCurrentPlaybackTime();
@Property(selector = "setCurrentPlaybackTime:")
public native void setCurrentPlaybackTime(double v);
@Property(selector = "currentPlaybackRate")
public native float getCurrentPlaybackRate();
@Property(selector = "setCurrentPlaybackRate:")
public native void setCurrentPlaybackRate(float v);
/* */
/**//* */
/**/
/**
* @since Available in iOS 3.2 and later.
*/
@GlobalValue(symbol="MPMediaPlaybackIsPreparedToPlayDidChangeNotification", optional=true)
public static native NSString IsPreparedToPlayDidChangeNotification();
@GlobalValue(symbol="MPMusicPlayerControllerPlaybackStateDidChangeNotification", optional=true)
public static native NSString PlaybackStateDidChangeNotification();
@GlobalValue(symbol="MPMusicPlayerControllerNowPlayingItemDidChangeNotification", optional=true)
public static native NSString NowPlayingItemDidChangeNotification();
@GlobalValue(symbol="MPMusicPlayerControllerVolumeDidChangeNotification", optional=true)
public static native NSString VolumeDidChangeNotification();
@Method(selector = "applicationMusicPlayer")
public static native MPMusicPlayerController getApplicationMusicPlayer();
@Method(selector = "systemMusicPlayer")
public static native MPMusicPlayerController getSystemMusicPlayer();
/**
* @since Available in iOS 3.0 and later.
* @deprecated Deprecated in iOS 8.0.
*/
@Deprecated
@Method(selector = "iPodMusicPlayer")
public static native MPMusicPlayerController getIPodMusicPlayer();
@Method(selector = "setQueueWithQuery:")
public native void setQueue(MPMediaQuery query);
@Method(selector = "setQueueWithItemCollection:")
public native void setQueue(MPMediaItemCollection itemCollection);
@Method(selector = "skipToNextItem")
public native void skipToNextItem();
@Method(selector = "skipToBeginning")
public native void skipToBeginning();
@Method(selector = "skipToPreviousItem")
public native void skipToPreviousItem();
@Method(selector = "beginGeneratingPlaybackNotifications")
public native void beginGeneratingPlaybackNotifications();
@Method(selector = "endGeneratingPlaybackNotifications")
public native void endGeneratingPlaybackNotifications();
@Method(selector = "prepareToPlay")
public native void prepareToPlay();
@Method(selector = "play")
public native void play();
@Method(selector = "pause")
public native void pause();
@Method(selector = "stop")
public native void stop();
@Method(selector = "beginSeekingForward")
public native void beginSeekingForward();
@Method(selector = "beginSeekingBackward")
public native void beginSeekingBackward();
@Method(selector = "endSeeking")
public native void endSeeking();
/* */
}