Skip to content

Commit

Permalink
Cleanup CoreMedia (#683).
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueRiverInteractive committed Jan 20, 2015
1 parent 15f0490 commit 747be52
Show file tree
Hide file tree
Showing 59 changed files with 8,291 additions and 2,036 deletions.
1,365 changes: 961 additions & 404 deletions cocoatouch/src/main/bro-gen/coremedia.yaml

Large diffs are not rendered by default.

25 changes: 9 additions & 16 deletions cocoatouch/src/main/bro-gen/foundation.yaml
Expand Up @@ -292,43 +292,38 @@ classes:
methods: methods:
'-attribute:atIndex:effectiveRange:': '-attribute:atIndex:effectiveRange:':
name: getAttribute name: getAttribute
visibility: protected
parameters: parameters:
attrName: attrName:
type: NSString type: NSString
'-attribute:atIndex:longestEffectiveRange:inRange:': '-attribute:atIndex:longestEffectiveRange:inRange:':
name: getAttribute name: getAttribute
visibility: protected
parameters: parameters:
attrName: attrName:
type: NSString type: NSString
'-attributesAtIndex:effectiveRange:': '-attributesAtIndex:effectiveRange:':
name: getAttributes name: getAttributesDictionary
return_type: NSAttributedStringAttributes return_type: 'NSDictionary<NSString, NSObject>'
'-attributesAtIndex:longestEffectiveRange:inRange:': '-attributesAtIndex:longestEffectiveRange:inRange:':
name: getAttributes name: getAttributesDictionary
return_type: NSAttributedStringAttributes return_type: 'NSDictionary<NSString, NSObject>'
'-attributedSubstringFromRange:': '-attributedSubstringFromRange:':
name: substring name: substring
'-initWithString:attributes:': '-initWithString:attributes:':
name: init name: init
parameters: parameters:
attrs: attrs:
type: NSAttributedStringAttributes type: 'NSDictionary<NSString, NSObject>'
'-init.*': '-init.*':
name: init name: init
'-enumerateAttributesInRange:options:usingBlock:': '-enumerateAttributesInRange:options:usingBlock:':
name: enumerateAttributes0 name: enumerateAttributes
visibility: protected
'-enumerateAttribute:inRange:options:usingBlock:': '-enumerateAttribute:inRange:options:usingBlock:':
name: enumerateAttribute0 name: enumerateAttribute
visibility: protected
parameters: parameters:
attrName: attrName:
type: NSString type: NSString
'-isEqualToAttributedString:': '-isEqualToAttributedString:':
name: equalsTo name: equalsTo
visibility: protected
NSAutoreleasePool: # DONE NSAutoreleasePool: # DONE
methods: methods:
'-drain': {} '-drain': {}
Expand Down Expand Up @@ -2007,21 +2002,19 @@ classes:
trim_after_first_colon: true trim_after_first_colon: true
parameters: parameters:
attrs: attrs:
type: NSAttributedStringAttributes type: 'NSDictionary<NSString, NSObject>'
'-addAttribute:value:range:': '-addAttribute:value:range:':
trim_after_first_colon: true trim_after_first_colon: true
visibility: protected
parameters: parameters:
name: name:
type: NSString type: NSString
'-addAttributes:range:': '-addAttributes:range:':
trim_after_first_colon: true trim_after_first_colon: true
parameters: parameters:
attrs: attrs:
type: NSAttributedStringAttributes type: 'NSDictionary<NSString, NSObject>'
'-removeAttribute:range:': '-removeAttribute:range:':
trim_after_first_colon: true trim_after_first_colon: true
visibility: protected
parameters: parameters:
name: name:
type: NSString type: NSString
Expand Down
Expand Up @@ -48,18 +48,23 @@ public static CFMutableArray create() {
return createMutable(null, 0, getTypeCallBacks()); return createMutable(null, 0, getTypeCallBacks());
} }


@Override
public void add(NativeObject value) { public void add(NativeObject value) {
appendValue(value.as(VoidPtr.class)); appendValue(value.as(VoidPtr.class));
} }
@Override
public void insert(@MachineSizedSInt long idx, NativeObject value) { public void insert(@MachineSizedSInt long idx, NativeObject value) {
insertValueAtIndex(idx, value.as(VoidPtr.class)); insertValueAtIndex(idx, value.as(VoidPtr.class));
} }
@Override
public void replace(@MachineSizedSInt long idx, NativeObject value) { public void replace(@MachineSizedSInt long idx, NativeObject value) {
setValueAtIndex(idx, value.as(VoidPtr.class)); setValueAtIndex(idx, value.as(VoidPtr.class));
} }
@Override
public void remove(@MachineSizedSInt long idx) { public void remove(@MachineSizedSInt long idx) {
removeValueAtIndex(idx); removeValueAtIndex(idx);
} }
@Override
public void clear() { public void clear() {
removeAllValues(); removeAllValues();
} }
Expand Down
Expand Up @@ -51,12 +51,15 @@ public static CFMutableDictionary create(long capacity) {
return createMutable(null, capacity, getTypeKeyCallBacks(), getTypeValueCallBacks()); return createMutable(null, capacity, getTypeKeyCallBacks(), getTypeValueCallBacks());
} }


@Override
public void put(NativeObject key, NativeObject value) { public void put(NativeObject key, NativeObject value) {
setValue(key.as(VoidPtr.class), value.as(VoidPtr.class)); setValue(key.as(VoidPtr.class), value.as(VoidPtr.class));
} }
@Override
public void remove(NativeObject key) { public void remove(NativeObject key) {
removeValue(key.as(VoidPtr.class)); removeValue(key.as(VoidPtr.class));
} }
@Override
public void clear() { public void clear() {
removeAllValues(); removeAllValues();
} }
Expand Down
@@ -0,0 +1,113 @@
/*
* Copyright (C) 2014 Trillian Mobile 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 org.robovm.apple.coremedia;

/*<imports>*/
import java.io.*;
import java.nio.*;
import java.util.*;
import org.robovm.objc.*;
import org.robovm.objc.annotation.*;
import org.robovm.objc.block.*;
import org.robovm.rt.*;
import org.robovm.rt.bro.*;
import org.robovm.rt.bro.annotation.*;
import org.robovm.rt.bro.ptr.*;
import org.robovm.apple.foundation.*;
import org.robovm.apple.corefoundation.*;
import org.robovm.apple.dispatch.*;
import org.robovm.apple.coreaudio.*;
import org.robovm.apple.coreanimation.*;
import org.robovm.apple.coregraphics.*;
import org.robovm.apple.corevideo.*;
import org.robovm.apple.audiotoolbox.*;
/*</imports>*/

/*<javadoc>*/
/*</javadoc>*/
/*<annotations>*/@Library("CoreMedia")/*</annotations>*/
/*<visibility>*/public/*</visibility>*/ class /*<name>*/CMAttachmentBearer/*</name>*/
extends /*<extends>*/CFType/*</extends>*/
/*<implements>*//*</implements>*/ {

/*<ptr>*/public static class CMAttachmentBearerPtr extends Ptr<CMAttachmentBearer, CMAttachmentBearerPtr> {}/*</ptr>*/
/*<bind>*/static { Bro.bind(CMAttachmentBearer.class); }/*</bind>*/
/*<constants>*//*</constants>*/
/*<constructors>*/
protected CMAttachmentBearer() {}
/*</constructors>*/
/*<properties>*//*</properties>*/
/*<members>*//*</members>*/
/**
* @since Available in iOS 4.0 and later.
*/
public static CFType getAttachment(CFType target, String key) {
return getAttachment(target, key, null);
}
/**
* @since Available in iOS 4.0 and later.
*/
public static CMAttachmentMode getModeOfAttachment(CFType target, String key) {
IntPtr ptr = new IntPtr();
getAttachment(target, key, ptr);
return CMAttachmentMode.valueOf(ptr.get());
}

/**
* @since Available in iOS 4.0 and later.
*/
public static CFDictionary getAttachments(CFType target, CMAttachmentMode attachmentMode) {
return getAttachments(null, target, attachmentMode);
}

/*<methods>*/
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="CMSetAttachment", optional=true)
public static native void setAttachment(CFType target, String key, CFType value, CMAttachmentMode attachmentMode);
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="CMGetAttachment", optional=true)
private static native CFType getAttachment(CFType target, String key, IntPtr attachmentModeOut);
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="CMRemoveAttachment", optional=true)
public static native void removeAttachment(CFType target, String key);
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="CMRemoveAllAttachments", optional=true)
public static native void removeAllAttachments(CFType target);
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="CMCopyDictionaryOfAttachments", optional=true)
private static native CFDictionary getAttachments(CFAllocator allocator, CFType target, CMAttachmentMode attachmentMode);
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="CMSetAttachments", optional=true)
public static native void setAttachments(CFType target, CFDictionary theAttachments, CMAttachmentMode attachmentMode);
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="CMPropagateAttachments", optional=true)
public static native void propagateAttachments(CMAttachmentBearer source, CMAttachmentBearer destination);
/*</methods>*/
}
Expand Up @@ -54,52 +54,100 @@ public static CMAudioFormatDescription create(AudioStreamBasicDescription asbd,
create(null, asbd, layoutSize, layout, magicCookieSize, magicCookie, extensions, ptr); create(null, asbd, layoutSize, layout, magicCookieSize, magicCookie, extensions, ptr);
return ptr.get(); return ptr.get();
} }
/**
* @since Available in iOS 8.0 and later.
*/
public static CMAudioFormatDescription createFromBigEndianSoundDescriptionData(BytePtr soundDescriptionData, @MachineSizedUInt long soundDescriptionSize, CMSoundDescriptionFlavor soundDescriptionFlavor) {
CMAudioFormatDescription.CMAudioFormatDescriptionPtr ptr = new CMAudioFormatDescription.CMAudioFormatDescriptionPtr();
createFromBigEndianSoundDescriptionData(null, soundDescriptionData, soundDescriptionSize, soundDescriptionFlavor, ptr);
return ptr.get();
}
/**
* @since Available in iOS 8.0 and later.
*/
public static CMAudioFormatDescription createFromBigEndianSoundDescriptionBlockBuffer(CMBlockBuffer soundDescriptionBlockBuffer, CMSoundDescriptionFlavor soundDescriptionFlavor) {
CMAudioFormatDescription.CMAudioFormatDescriptionPtr ptr = new CMAudioFormatDescription.CMAudioFormatDescriptionPtr();
createFromBigEndianSoundDescriptionBlockBuffer(null, soundDescriptionBlockBuffer, soundDescriptionFlavor, ptr);
return ptr.get();
}


/**
* @since Available in iOS 4.0 and later.
*/
public CMAudioCodecType getAudioCodecType() {
return CMAudioCodecType.valueOf(getMediaSubType());
}
/**
* @since Available in iOS 4.0 and later.
*/
public VoidPtr getMagicCookie() { public VoidPtr getMagicCookie() {
return getMagicCookie(null); return getMagicCookie(null);
} }

/**
* @since Available in iOS 4.0 and later.
*/
public @MachineSizedUInt long getMagicCookieSize() { public @MachineSizedUInt long getMagicCookieSize() {
MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); MachineSizedUIntPtr ptr = new MachineSizedUIntPtr();
getMagicCookie(ptr); getMagicCookie(ptr);
return ptr.get(); return ptr.get();
} }

/**
* @since Available in iOS 4.0 and later.
*/
public AudioChannelLayout getChannelLayout() { public AudioChannelLayout getChannelLayout() {
return getChannelLayout(null); return getChannelLayout(null);
} }

/**
* @since Available in iOS 4.0 and later.
*/
public @MachineSizedUInt long getChannelLayoutSize() { public @MachineSizedUInt long getChannelLayoutSize() {
MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); MachineSizedUIntPtr ptr = new MachineSizedUIntPtr();
getChannelLayout(ptr); getChannelLayout(ptr);
return ptr.get(); return ptr.get();
} }

/**
* @since Available in iOS 4.0 and later.
*/
public AudioFormatListItem getFormatList() { public AudioFormatListItem getFormatList() {
return getFormatList(null); return getFormatList(null);
} }

/**
* @since Available in iOS 4.0 and later.
*/
public @MachineSizedUInt long getFormatListSize() { public @MachineSizedUInt long getFormatListSize() {
MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); MachineSizedUIntPtr ptr = new MachineSizedUIntPtr();
getFormatList(ptr); getFormatList(ptr);
return ptr.get(); return ptr.get();
} }

/**
public static CMAudioFormatDescription createSummary(NSArray<?> formatDescriptionArray) { * @since Available in iOS 4.0 and later.
*/
public static CMAudioFormatDescription createSummary(@org.robovm.rt.bro.annotation.Marshaler(CFArray.AsListMarshaler.class) List<CMAudioFormatDescription> formatDescriptionArray) {
CMAudioFormatDescriptionPtr ptr = new CMAudioFormatDescriptionPtr(); CMAudioFormatDescriptionPtr ptr = new CMAudioFormatDescriptionPtr();
createSummary(null, formatDescriptionArray, 0, ptr); createSummary(null, formatDescriptionArray, 0, ptr);
return ptr.get(); return ptr.get();
} }

/**
public boolean equals(CMAudioFormatDescription desc2, CMAudioFormatDescriptionMask equalityMask) { * @since Available in iOS 4.0 and later.
return equals(desc2, equalityMask, null); */
public boolean equalsTo(CMAudioFormatDescription desc2, CMAudioFormatDescriptionMask equalityMask) {
return equalsTo(desc2, equalityMask, null);
} }
/**
* @since Available in iOS 8.0 and later.
*/
public CMBlockBuffer copyAsBigEndianSoundDescriptionBlockBuffer(CMAudioFormatDescription audioFormatDescription, CMSoundDescriptionFlavor soundDescriptionFlavor) {
CMBlockBuffer.CMBlockBufferPtr ptr = new CMBlockBuffer.CMBlockBufferPtr();
copyAsBigEndianSoundDescriptionBlockBuffer(null, this, soundDescriptionFlavor, ptr);
return ptr.get();
}

/*<methods>*/ /*<methods>*/
/** /**
* @since Available in iOS 4.0 and later. * @since Available in iOS 4.0 and later.
*/ */
@Bridge(symbol="CMAudioFormatDescriptionCreate", optional=true) @Bridge(symbol="CMAudioFormatDescriptionCreate", optional=true)
protected static native int create(CFAllocator allocator, AudioStreamBasicDescription asbd, @MachineSizedUInt long layoutSize, AudioChannelLayout layout, @MachineSizedUInt long magicCookieSize, VoidPtr magicCookie, NSDictionary<NSString, ?> extensions, CMAudioFormatDescription.CMAudioFormatDescriptionPtr outDesc); private static native int create(CFAllocator allocator, AudioStreamBasicDescription asbd, @MachineSizedUInt long layoutSize, AudioChannelLayout layout, @MachineSizedUInt long magicCookieSize, VoidPtr magicCookie, NSDictionary<NSString, ?> extensions, CMAudioFormatDescription.CMAudioFormatDescriptionPtr outDesc);
/** /**
* @since Available in iOS 4.0 and later. * @since Available in iOS 4.0 and later.
*/ */
Expand All @@ -109,17 +157,17 @@ public boolean equals(CMAudioFormatDescription desc2, CMAudioFormatDescriptionMa
* @since Available in iOS 4.0 and later. * @since Available in iOS 4.0 and later.
*/ */
@Bridge(symbol="CMAudioFormatDescriptionGetMagicCookie", optional=true) @Bridge(symbol="CMAudioFormatDescriptionGetMagicCookie", optional=true)
protected native VoidPtr getMagicCookie(MachineSizedUIntPtr cookieSizeOut); private native VoidPtr getMagicCookie(MachineSizedUIntPtr cookieSizeOut);
/** /**
* @since Available in iOS 4.0 and later. * @since Available in iOS 4.0 and later.
*/ */
@Bridge(symbol="CMAudioFormatDescriptionGetChannelLayout", optional=true) @Bridge(symbol="CMAudioFormatDescriptionGetChannelLayout", optional=true)
protected native AudioChannelLayout getChannelLayout(MachineSizedUIntPtr layoutSize); private native AudioChannelLayout getChannelLayout(MachineSizedUIntPtr layoutSize);
/** /**
* @since Available in iOS 4.0 and later. * @since Available in iOS 4.0 and later.
*/ */
@Bridge(symbol="CMAudioFormatDescriptionGetFormatList", optional=true) @Bridge(symbol="CMAudioFormatDescriptionGetFormatList", optional=true)
protected native AudioFormatListItem getFormatList(MachineSizedUIntPtr formatListSize); private native AudioFormatListItem getFormatList(MachineSizedUIntPtr formatListSize);
/** /**
* @since Available in iOS 4.0 and later. * @since Available in iOS 4.0 and later.
*/ */
Expand All @@ -134,26 +182,26 @@ public boolean equals(CMAudioFormatDescription desc2, CMAudioFormatDescriptionMa
* @since Available in iOS 4.0 and later. * @since Available in iOS 4.0 and later.
*/ */
@Bridge(symbol="CMAudioFormatDescriptionCreateSummary", optional=true) @Bridge(symbol="CMAudioFormatDescriptionCreateSummary", optional=true)
protected static native int createSummary(CFAllocator allocator, NSArray<?> formatDescriptionArray, int flags, CMAudioFormatDescription.CMAudioFormatDescriptionPtr summaryFormatDescriptionOut); private static native int createSummary(CFAllocator allocator, @org.robovm.rt.bro.annotation.Marshaler(CFArray.AsListMarshaler.class) List<CMAudioFormatDescription> formatDescriptionArray, int flags, CMAudioFormatDescription.CMAudioFormatDescriptionPtr summaryFormatDescriptionOut);
/** /**
* @since Available in iOS 4.0 and later. * @since Available in iOS 4.0 and later.
*/ */
@Bridge(symbol="CMAudioFormatDescriptionEqual", optional=true) @Bridge(symbol="CMAudioFormatDescriptionEqual", optional=true)
protected native boolean equals(CMAudioFormatDescription desc2, CMAudioFormatDescriptionMask equalityMask, IntPtr equalityMaskOut); private native boolean equalsTo(CMAudioFormatDescription desc2, CMAudioFormatDescriptionMask equalityMask, IntPtr equalityMaskOut);
/** /**
* @since Available in iOS 8.0 and later. * @since Available in iOS 8.0 and later.
*/ */
@Bridge(symbol="CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionData", optional=true) @Bridge(symbol="CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionData", optional=true)
public static native int createFromBigEndianSoundDescriptionData(CFAllocator allocator, BytePtr soundDescriptionData, @MachineSizedUInt long soundDescriptionSize, String soundDescriptionFlavor, CMAudioFormatDescription.CMAudioFormatDescriptionPtr audioFormatDescriptionOut); private static native int createFromBigEndianSoundDescriptionData(CFAllocator allocator, BytePtr soundDescriptionData, @MachineSizedUInt long soundDescriptionSize, CMSoundDescriptionFlavor soundDescriptionFlavor, CMAudioFormatDescription.CMAudioFormatDescriptionPtr audioFormatDescriptionOut);
/** /**
* @since Available in iOS 8.0 and later. * @since Available in iOS 8.0 and later.
*/ */
@Bridge(symbol="CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionBlockBuffer", optional=true) @Bridge(symbol="CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionBlockBuffer", optional=true)
public static native int createFromBigEndianSoundDescriptionBlockBuffer(CFAllocator allocator, CMBlockBuffer soundDescriptionBlockBuffer, String soundDescriptionFlavor, CMAudioFormatDescription.CMAudioFormatDescriptionPtr audioFormatDescriptionOut); private static native int createFromBigEndianSoundDescriptionBlockBuffer(CFAllocator allocator, CMBlockBuffer soundDescriptionBlockBuffer, CMSoundDescriptionFlavor soundDescriptionFlavor, CMAudioFormatDescription.CMAudioFormatDescriptionPtr audioFormatDescriptionOut);
/** /**
* @since Available in iOS 8.0 and later. * @since Available in iOS 8.0 and later.
*/ */
@Bridge(symbol="CMAudioFormatDescriptionCopyAsBigEndianSoundDescriptionBlockBuffer", optional=true) @Bridge(symbol="CMAudioFormatDescriptionCopyAsBigEndianSoundDescriptionBlockBuffer", optional=true)
public static native int copyAsBigEndianSoundDescriptionBlockBuffer(CFAllocator allocator, CMAudioFormatDescription audioFormatDescription, String soundDescriptionFlavor, CMBlockBuffer.CMBlockBufferPtr soundDescriptionBlockBufferOut); private static native int copyAsBigEndianSoundDescriptionBlockBuffer(CFAllocator allocator, CMAudioFormatDescription audioFormatDescription, CMSoundDescriptionFlavor soundDescriptionFlavor, CMBlockBuffer.CMBlockBufferPtr soundDescriptionBlockBufferOut);
/*</methods>*/ /*</methods>*/
} }

0 comments on commit 747be52

Please sign in to comment.