View audiounit_lib.py
from ctypes import * | |
from objc_util import c | |
AudioUnitRenderActionFlags=c_uint32 | |
OSStatus=c_int32 | |
OSType=c_uint32 | |
class SMPTETimeType(c_uint32): | |
kSMPTETimeType24 = 0 | |
kSMPTETimeType25 = 1 | |
kSMPTETimeType30Drop = 2 | |
kSMPTETimeType30 = 3 |
View turtle2.py
#\input texinfo | |
# coding: utf-8 | |
# ui-based iOS port of the turtle module (not 100% compatible with standard library | |
# turtle module, but most things beginners would use should work) | |
import ui | |
from math import * | |
import math | |
import time |
View mapscene.py
from scene import * | |
import sound | |
import random | |
import math | |
A = Action | |
mapsprites=['plc:Brown_Block','plc:Dirt_Block','plc:Grass_Block','plc:Plain_Block',] | |
def choose_random_node(): | |
tx=random.choice(mapsprites) | |
sn=SpriteNode(tx) |
View simple_recorder.py
import sound,ui | |
from sound import Recorder | |
from sound import Player | |
sound.set_volume(1) | |
filename='4.m4a' #could have this come from a textfield in the ui... | |
play_image=ui.Image('iob:play_256') | |
stop_image=ui.Image('iob:stop_256') | |
record_image=ui.Image('iob:ios7_circle_filled_256') |
View simple_recorder.py
import sound,ui | |
from sound import Recorder | |
from sound import Player | |
sound.set_volume(1) | |
filename='4.m4a' #could have this come from a textfield in the ui... | |
play_image=ui.Image('iob:play_256') | |
stop_image=ui.Image('iob:stop_256') | |
record_image=ui.Image('iob:ios7_circle_filled_256') |
View detector.py
# coding: utf-8 | |
# based on Cethric's image capture gist.... | |
FRAME_PROC_INTERVAL=15 #num frames to skip. 1=go as fast as possible, 5=every fifth frame | |
import ui | |
from objc_util import * | |
import ctypes | |
from objc_util import autoreleasepool | |
AVCaptureDevice = ObjCClass('AVCaptureDevice') | |
AVCaptureDeviceInput = ObjCClass('AVCaptureDeviceInput') | |
AVCaptureVideoDataOutput = ObjCClass('AVCaptureVideoDataOutput') |
View inputAccessoryExample.py
# coding: utf-8 | |
'''Creates a custom input accessory view, and attaches it to textfield and textview | |
this example demonstrates custom text buttons (emoji, etc), and custom actions | |
''' | |
from objc_util import * | |
import ui | |
'''set up top level view and textfield''' | |
v=ui.View(frame=[0,0,300,300],bg_color=(.92, .92, .92)) | |
tf=ui.TextField(frame=[10,10,200,30]) |
View Map View Demo2.py
# coding: utf-8 | |
''' | |
NOTE: This requires Pythonista 3 | |
Demo of a custom ui.View subclass that embeds a native map view using MapKit (via objc_util). Tap and hold the map to drop a pin. | |
The MapView class is designed to be reusable, but it doesn't implement *everything* you might need. I hope that the existing methods give you a basic idea of how to add new capabilities though. For reference, here's Apple's documentation about the underlying MKMapView class: http://developer.apple.com/library/ios/documentation/MapKit/reference/MKMapView_Class/index.html | |
adapted from original code by omz |
NewerOlder