Class AVAudioSequencer

  • All Implemented Interfaces:
    NSObject

    public class AVAudioSequencer
    extends NSObject
    AVAudioSequencer A collection of MIDI events organized into AVMusicTracks, plus a player to play back the events.
    • Constructor Detail

      • AVAudioSequencer

        protected AVAudioSequencer​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • beatsForHostTimeError

        public double beatsForHostTimeError​(long inHostTime,
                                            org.moe.natj.general.ptr.Ptr<NSError> outError)
        beatsForHostTime:error: Returns the beat that will be (or was) played at the specified host time. This call is only valid if the player is playing and will return 0 with an error if the player is not playing or if the starting time of the player was after the specified host time. The method uses the sequence's tempo map to retrieve a beat time from the starting and specified host time.
      • beatsForSeconds

        public double beatsForSeconds​(double seconds)
        beatsForSeconds: Get the beat position (timestamp) for the given time in the track
      • currentPositionInBeats

        public double currentPositionInBeats()
        [@property] currentPositionInBeats The current playback position in beats Setting this positions the sequencer's player to the specified beat. This can be set while the player is playing, in which case playback will resume at the new position.
      • currentPositionInSeconds

        public double currentPositionInSeconds()
        [@property] currentPositionInSeconds The current playback position in seconds Setting this positions the sequencer's player to the specified time. This can be set while the player is playing, in which case playback will resume at the new position.
      • dataWithSMPTEResolutionError

        public NSData dataWithSMPTEResolutionError​(long SMPTEResolution,
                                                   org.moe.natj.general.ptr.Ptr<NSError> outError)
        dataWithSMPTEResolution:error: Return a data object containing the events from the sequence All details regarding the SMPTE resolution apply here as well. The returned NSData lifetime is controlled by the client.
      • hostTimeForBeatsError

        public long hostTimeForBeatsError​(double inBeats,
                                          org.moe.natj.general.ptr.Ptr<NSError> outError)
        hostTimeForBeats:error: Returns the host time that will be (or was) played at the specified beat. This call is only valid if the player is playing and will return 0 with an error if the player is not playing or if the starting position of the player (its "starting beat") was after the specified beat. The method uses the sequence's tempo map to translate a beat time from the starting time and beat of the player.
      • init

        public AVAudioSequencer init()
        init Initialize a new sequencer, which will not be connected to an audio engine. This is used to create a sequencer whose tracks will only send events to external MIDI endpoints.
        Overrides:
        init in class NSObject
      • initWithAudioEngine

        public AVAudioSequencer initWithAudioEngine​(AVAudioEngine engine)
        initWithAudioEngine: Initialize a new sequencer, handing it the audio engine.
      • isPlaying

        public boolean isPlaying()
        [@property] playing Indicates whether or not the sequencer's player is playing Returns TRUE if the sequencer's player has been started and not stopped. It may have "played" past the end of the events in the sequence, but it is still considered to be playing (and its time value increasing) until it is explicitly stopped.
      • loadFromDataOptionsError

        public boolean loadFromDataOptionsError​(NSData data,
                                                long options,
                                                org.moe.natj.general.ptr.Ptr<NSError> outError)
        loadFromData:options:error: Parse the data and add the its events to the sequence
        Parameters:
        data - the data to load from
        options - determines how the contents are mapped to tracks inside the sequence
        outError - on exit, if an error occurs, a description of the error
      • loadFromURLOptionsError

        public boolean loadFromURLOptionsError​(NSURL fileURL,
                                               long options,
                                               org.moe.natj.general.ptr.Ptr<NSError> outError)
        loadFromURL:options:error: Load the file referenced by the URL and add the events to the sequence
        Parameters:
        fileURL - the URL to the file
        options - determines how the file's contents are mapped to tracks inside the sequence
        outError - on exit, if an error occurs, a description of the error
      • prepareToPlay

        public void prepareToPlay()
        prepareToPlay Get ready to play the sequence by prerolling all events Happens automatically on play if it has not already been called, but may produce a delay in startup.
      • rate

        public float rate()
        [@property] rate The playback rate of the sequencer's player 1.0 is normal playback rate. Rate must be > 0.0.
      • secondsForBeats

        public double secondsForBeats​(double beats)
        secondsForBeats: Get the time in seconds for the given beat position (timestamp) in the track
      • setCurrentPositionInBeats

        public void setCurrentPositionInBeats​(double value)
        [@property] currentPositionInBeats The current playback position in beats Setting this positions the sequencer's player to the specified beat. This can be set while the player is playing, in which case playback will resume at the new position.
      • setCurrentPositionInSeconds

        public void setCurrentPositionInSeconds​(double value)
        [@property] currentPositionInSeconds The current playback position in seconds Setting this positions the sequencer's player to the specified time. This can be set while the player is playing, in which case playback will resume at the new position.
      • setRate

        public void setRate​(float value)
        [@property] rate The playback rate of the sequencer's player 1.0 is normal playback rate. Rate must be > 0.0.
      • startAndReturnError

        public boolean startAndReturnError​(org.moe.natj.general.ptr.Ptr<NSError> outError)
        startAndReturnError: Start the sequencer's player If the AVAudioSequencer has not been prerolled, it will pre-roll itself and then start. When the sequencer is associated with an audio engine, the sequencer's player will only play if the audio engine is running.
      • stop

        public void stop()
        stop Stop the sequencer's player Stopping the player leaves it in an un-prerolled state, but stores the playback position so that a subsequent call to startAndReturnError will resume where it left off. This action will not stop an associated audio engine.
      • tempoTrack

        public AVMusicTrack tempoTrack()
        [@property] tempoTrack The tempo track Each sequence has a single tempo track. All tempo events are placed into this track (as well as other appropriate events (for instance, the time signature from a MIDI file). The tempo track can be edited and iterated upon as any other track. Non-tempo events in a tempo track are ignored.
      • tracks

        public NSArray<? extends AVMusicTrack> tracks()
        [@property] tracks An NSArray containing all the tracks in the sequence Track indices count from 0, and do not include the tempo track.
      • userInfo

        public NSDictionary<java.lang.String,​?> userInfo()
        [@property] userInfo A dictionary containing meta-data derived from a sequence The dictionary can contain one or more of the kAFInfoDictionary_* keys specified in
      • writeToURLSMPTEResolutionReplaceExistingError

        public boolean writeToURLSMPTEResolutionReplaceExistingError​(NSURL fileURL,
                                                                     long resolution,
                                                                     boolean replace,
                                                                     org.moe.natj.general.ptr.Ptr<NSError> outError)
        writeToURL:SMPTEResolution:replaceExisting:error: Create and write a MIDI file from the events in the sequence Only MIDI events are written when writing to the MIDI file. MIDI files are normally beat based, but can also have a SMPTE (or real-time rather than beat time) representation. The relationship between "tick" and quarter note for saving to Standard MIDI File - pass in zero to use default - this will be the value that is currently set on the tempo track
        Parameters:
        fileURL - the path for the file to be created
        resolution - the relationship between "tick" and quarter note for saving to a Standard MIDI File - pass in zero to use default - this will be the value that is currently set on the tempo track
        replace - if the file already exists, YES will cause it to be overwritten with the new data. Otherwise the call will fail with a permission error.
        outError - on exit, if an error occurs, a description of the error