joybox 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. data/.travis.yml +3 -0
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +4 -4
  4. data/README.md +66 -22
  5. data/Rakefile +22 -4
  6. data/app/ios/app_delegate.rb +48 -0
  7. data/app/osx/app_delegate.rb +26 -0
  8. data/app/osx/layers/game_layer.rb +5 -0
  9. data/app/osx/menu.rb +51 -0
  10. data/command/command/image.rb +26 -0
  11. data/command/command/string.rb +15 -0
  12. data/command/command/template.rb +59 -0
  13. data/command/command/tmx.rb +75 -0
  14. data/command/joybox_generate_command.rb +64 -110
  15. data/command/joybox_retina_command.rb +87 -0
  16. data/command/{joybox/templates → templates}/layer.erb +0 -0
  17. data/command/{joybox/templates → templates}/layer_spec.erb +0 -0
  18. data/command/{joybox/templates → templates}/scene.erb +0 -0
  19. data/command/{joybox/templates → templates}/scene_spec.erb +0 -0
  20. data/command/{joybox/templates → templates}/sprite.erb +0 -0
  21. data/command/{joybox/templates → templates}/sprite_spec.erb +0 -0
  22. data/ext/extconf.rb +34 -0
  23. data/joybox.gemspec +103 -50
  24. data/lib/joybox.rb +2 -0
  25. data/lib/joybox/joybox-ios.rb +18 -3
  26. data/lib/joybox/joybox-osx.rb +18 -2
  27. data/lib/joybox/version.rb +1 -1
  28. data/motion/joybox-ios/common/cg_point.rb +46 -16
  29. data/motion/joybox-ios/common/device.rb +56 -0
  30. data/motion/joybox-ios/common/ui_touch.rb +0 -2
  31. data/motion/joybox-ios/configuration/configuration.rb +10 -40
  32. data/motion/joybox-ios/configuration/file_utils.rb +0 -4
  33. data/motion/joybox-ios/configuration/gl_view.rb +14 -20
  34. data/motion/joybox-ios/configuration/texture_2d.rb +0 -4
  35. data/motion/joybox-ios/core/layer.rb +2 -8
  36. data/motion/joybox-ios/debug/proxy_view.rb +5 -5
  37. data/motion/joybox-ios/debug/{node.rb → repl.rb} +25 -19
  38. data/motion/joybox-ios/director.rb +15 -4
  39. data/motion/joybox-osx/common/ats_point.rb +45 -15
  40. data/motion/joybox-osx/common/device.rb +30 -0
  41. data/motion/joybox-osx/common/ns_event.rb +0 -1
  42. data/motion/joybox-osx/configuration/configuration.rb +6 -26
  43. data/motion/joybox-osx/configuration/gl_view.rb +16 -14
  44. data/motion/joybox-osx/core/layer.rb +45 -26
  45. data/motion/joybox-osx/debug/proxy_view.rb +5 -5
  46. data/motion/joybox-osx/debug/{node.rb → repl.rb} +13 -7
  47. data/motion/joybox-osx/director.rb +4 -3
  48. data/motion/joybox/actions/animate.rb +0 -1
  49. data/motion/joybox/actions/bezier.rb +2 -9
  50. data/motion/joybox/actions/blink.rb +1 -4
  51. data/motion/joybox/actions/callback.rb +19 -0
  52. data/motion/joybox/actions/d3/flip.rb +27 -0
  53. data/motion/joybox/actions/d3/jump.rb +30 -0
  54. data/motion/joybox/actions/d3/lens.rb +30 -0
  55. data/motion/joybox/actions/d3/shake.rb +32 -0
  56. data/motion/joybox/actions/d3/shatter.rb +30 -0
  57. data/motion/joybox/actions/d3/wave.rb +33 -0
  58. data/motion/joybox/actions/delay.rb +19 -0
  59. data/motion/joybox/actions/ease.rb +3 -21
  60. data/motion/joybox/actions/fade.rb +30 -6
  61. data/motion/joybox/actions/jump.rb +0 -5
  62. data/motion/joybox/actions/liquid.rb +28 -0
  63. data/motion/joybox/actions/move.rb +2 -9
  64. data/motion/joybox/actions/place.rb +0 -2
  65. data/motion/joybox/actions/repeat.rb +0 -2
  66. data/motion/joybox/actions/rotate.rb +2 -9
  67. data/motion/joybox/actions/scale.rb +2 -9
  68. data/motion/joybox/actions/sequence.rb +0 -1
  69. data/motion/joybox/actions/shuffle.rb +26 -0
  70. data/motion/joybox/actions/skew.rb +2 -11
  71. data/motion/joybox/actions/spawn.rb +0 -1
  72. data/motion/joybox/actions/split.rb +24 -0
  73. data/motion/joybox/actions/tint.rb +0 -5
  74. data/motion/joybox/actions/turn.rb +24 -0
  75. data/motion/joybox/actions/twirl.rb +30 -0
  76. data/motion/joybox/actions/visibility.rb +21 -0
  77. data/motion/joybox/actions/wave.rb +32 -0
  78. data/motion/joybox/animations/animation.rb +7 -11
  79. data/motion/joybox/audio/audio.rb +31 -0
  80. data/motion/joybox/audio/audio_effect.rb +69 -0
  81. data/motion/joybox/audio/background_audio.rb +77 -0
  82. data/motion/joybox/common/{gc_size.rb → cg_size.rb} +13 -12
  83. data/motion/joybox/common/color.rb +4 -13
  84. data/motion/joybox/common/initialize.rb +11 -0
  85. data/motion/joybox/common/ns_array.rb +15 -0
  86. data/motion/joybox/common/ns_string.rb +7 -0
  87. data/motion/joybox/common/numeric.rb +13 -4
  88. data/motion/joybox/common/screen.rb +4 -12
  89. data/motion/joybox/configuration/debug.rb +29 -0
  90. data/motion/joybox/core/layer.rb +0 -24
  91. data/motion/joybox/core/layer_color.rb +47 -0
  92. data/motion/joybox/core/node.rb +18 -8
  93. data/motion/joybox/core/scene.rb +0 -5
  94. data/motion/joybox/core/sprite.rb +43 -25
  95. data/motion/joybox/core/sprite_batch.rb +15 -6
  96. data/motion/joybox/core/sprite_frame_cache.rb +9 -58
  97. data/motion/joybox/debug/physics.rb +40 -0
  98. data/motion/joybox/debug/physics_draw.rb +191 -0
  99. data/motion/joybox/joybox.rb +9 -1
  100. data/motion/joybox/macros.rb +13 -13
  101. data/motion/joybox/physics/aabb.rb +28 -0
  102. data/motion/joybox/physics/body.rb +163 -68
  103. data/motion/joybox/physics/chain_shape.rb +71 -0
  104. data/motion/joybox/physics/circle_shape.rb +31 -0
  105. data/motion/joybox/physics/edge_shape.rb +37 -0
  106. data/motion/joybox/physics/filter.rb +17 -0
  107. data/motion/joybox/physics/fixture.rb +52 -0
  108. data/motion/joybox/physics/mass_data.rb +19 -0
  109. data/motion/joybox/physics/physics_sprite.rb +50 -16
  110. data/motion/joybox/physics/polygon_shape.rb +54 -0
  111. data/motion/joybox/physics/profile.rb +14 -0
  112. data/motion/joybox/physics/ray_cast_input.rb +30 -0
  113. data/motion/joybox/physics/ray_cast_output.rb +17 -0
  114. data/motion/joybox/physics/shape.rb +61 -0
  115. data/motion/joybox/physics/transform.rb +17 -0
  116. data/motion/joybox/physics/world.rb +101 -30
  117. data/motion/joybox/tmx/object_layer.rb +12 -0
  118. data/motion/joybox/tmx/tile_layer.rb +74 -0
  119. data/motion/joybox/tmx/tile_map.rb +112 -0
  120. data/motion/joybox/tmx/tile_set.rb +26 -0
  121. data/motion/joybox/tmx/tmx.rb +16 -0
  122. data/motion/joybox/ui/label.rb +44 -16
  123. data/motion/joybox/ui/menu.rb +7 -9
  124. data/motion/joybox/ui/menu_image.rb +11 -8
  125. data/motion/joybox/ui/menu_label.rb +14 -13
  126. data/resources/Default-568h@2x.png +0 -0
  127. data/resources/animation_frames-hd.plist +126 -0
  128. data/resources/animation_frames-ipadhd.plist +126 -0
  129. data/resources/animation_frames.plist +126 -0
  130. data/resources/animation_sprite_sheet-hd.png +0 -0
  131. data/resources/animation_sprite_sheet-ipadhd.png +0 -0
  132. data/resources/animation_sprite_sheet.png +0 -0
  133. data/resources/fps_images-hd.png +0 -0
  134. data/resources/fps_images-ipadhd.png +0 -0
  135. data/resources/fps_images.png +0 -0
  136. data/resources/sprite.png +0 -0
  137. data/resources/sprite_inverted.png +0 -0
  138. data/resources/sprite_sheet.png +0 -0
  139. data/spec/motion/joybox-ios/common/screen_spec.rb +21 -0
  140. data/spec/{main_spec.rb → motion/joybox-ios/main_spec.rb} +6 -2
  141. data/spec/motion/joybox-ios/ui/label_spec.rb +20 -0
  142. data/spec/motion/joybox-ios/ui/menu_label_spec.rb +15 -0
  143. data/spec/motion/joybox-ios/ui/menu_spec.rb +87 -0
  144. data/spec/motion/joybox-osx/common/screen_spec.rb +21 -0
  145. data/spec/motion/joybox-osx/main_spec.rb +13 -0
  146. data/spec/motion/joybox-osx/ui/label_spec.rb +18 -0
  147. data/spec/motion/joybox-osx/ui/menu_label_spec.rb +13 -0
  148. data/spec/motion/joybox-osx/ui/menu_spec.rb +87 -0
  149. data/spec/motion/joybox/actions/actions_spec.rb +11 -0
  150. data/spec/motion/joybox/actions/bezier_spec.rb +37 -0
  151. data/spec/motion/joybox/actions/blink_spec.rb +16 -0
  152. data/spec/motion/joybox/actions/fade_spec.rb +49 -0
  153. data/spec/motion/joybox/actions/jump_spec.rb +37 -0
  154. data/spec/motion/joybox/actions/move_spec.rb +37 -0
  155. data/spec/motion/joybox/actions/place_spec.rb +12 -0
  156. data/spec/motion/joybox/actions/rotate_spec.rb +35 -0
  157. data/spec/motion/joybox/actions/scale_spec.rb +43 -0
  158. data/spec/motion/joybox/actions/skew_spec.rb +43 -0
  159. data/spec/motion/joybox/common/cg_size_spec.rb +29 -0
  160. data/spec/motion/joybox/common/color_spec.rb +31 -0
  161. data/spec/motion/joybox/common/ns_string_spec.rb +8 -0
  162. data/spec/motion/joybox/common/numeric_spec.rb +13 -0
  163. data/spec/motion/joybox/core/node_spec.rb +36 -0
  164. data/spec/motion/joybox/core/sprite_batch_spec.rb +34 -0
  165. data/spec/motion/joybox/core/sprite_frame_cache_spec.rb +111 -0
  166. data/spec/motion/joybox/core/sprite_spec.rb +121 -0
  167. data/spec/motion/joybox/macros_spec.rb +280 -0
  168. data/spec/motion/joybox/physics/aabb_spec.rb +17 -0
  169. data/spec/motion/joybox/physics/body_spec.rb +318 -0
  170. data/spec/motion/joybox/physics/chain_shape_spec.rb +80 -0
  171. data/spec/motion/joybox/physics/circle_shape_spec.rb +63 -0
  172. data/spec/motion/joybox/physics/edge_shape_spec.rb +48 -0
  173. data/spec/motion/joybox/physics/fixture_spec.rb +106 -0
  174. data/spec/motion/joybox/physics/mass_data_spec.rb +13 -0
  175. data/spec/motion/joybox/physics/physics_sprite_spec.rb +50 -0
  176. data/spec/motion/joybox/physics/polygon_shape_spec.rb +92 -0
  177. data/spec/motion/joybox/physics/ray_cast_input_spec.rb +17 -0
  178. data/spec/motion/joybox/physics/ray_cast_output_spec.rb +13 -0
  179. data/spec/motion/joybox/physics/shape_spec.rb +50 -0
  180. data/spec/motion/joybox/physics/transform_spec.rb +13 -0
  181. data/spec/motion/joybox/physics/world_spec.rb +228 -0
  182. data/spec/motion/joybox/ui/label_spec.rb +53 -0
  183. data/spec/motion/joybox/ui/menu_image_spec.rb +51 -0
  184. data/spec/motion/joybox/ui/menu_label_spec.rb +68 -0
  185. data/spec/motion/joybox/ui/menu_spec.rb +26 -0
  186. data/spec/spec_helpers/cg_point.rb +5 -0
  187. data/spec/spec_helpers/cg_point_spec.rb +14 -0
  188. data/template/joybox-ios-example-repl/files/.gitignore +16 -0
  189. data/template/joybox-ios/files/.gitignore +16 -0
  190. data/template/joybox-osx-example-repl/files/.gitignore +16 -0
  191. data/template/joybox-osx/files/.gitignore +16 -0
  192. data/vendor/vendor-ios/box_2d/box_2d.bridgesupport +1201 -85
  193. data/vendor/vendor-ios/box_2d/box_2d_include/B2DAABB.h +21 -0
  194. data/vendor/vendor-ios/box_2d/box_2d_include/B2DBody.h +58 -13
  195. data/vendor/vendor-ios/box_2d/box_2d_include/B2DBodyDef.h +44 -0
  196. data/vendor/vendor-ios/box_2d/box_2d_include/B2DBodyTypes.h +20 -0
  197. data/vendor/vendor-ios/box_2d/box_2d_include/B2DChainShape.h +29 -0
  198. data/vendor/vendor-ios/box_2d/box_2d_include/B2DCircleShape.h +7 -0
  199. data/vendor/vendor-ios/box_2d/box_2d_include/B2DColor.h +23 -0
  200. data/vendor/vendor-ios/box_2d/box_2d_include/B2DContactFilter.h +24 -0
  201. data/vendor/vendor-ios/box_2d/box_2d_include/B2DContactListener.h +1 -1
  202. data/vendor/vendor-ios/box_2d/box_2d_include/B2DDestructionListener.h +24 -0
  203. data/vendor/vendor-ios/box_2d/box_2d_include/B2DDraw.h +54 -0
  204. data/vendor/vendor-ios/box_2d/box_2d_include/B2DEdgeShape.h +13 -2
  205. data/vendor/vendor-ios/box_2d/box_2d_include/B2DFilter.h +23 -0
  206. data/vendor/vendor-ios/box_2d/box_2d_include/B2DFixture.h +47 -0
  207. data/vendor/vendor-ios/box_2d/box_2d_include/B2DFixtureDef.h +29 -0
  208. data/vendor/vendor-ios/box_2d/box_2d_include/B2DMassData.h +23 -0
  209. data/vendor/vendor-ios/box_2d/box_2d_include/B2DPolygonShape.h +14 -1
  210. data/vendor/vendor-ios/box_2d/box_2d_include/B2DProfile.h +31 -0
  211. data/vendor/vendor-ios/box_2d/box_2d_include/B2DQueryCallback.h +24 -0
  212. data/vendor/vendor-ios/box_2d/box_2d_include/B2DRayCastCallback.h +24 -0
  213. data/vendor/vendor-ios/box_2d/box_2d_include/B2DRayCastInput.h +23 -0
  214. data/vendor/vendor-ios/box_2d/box_2d_include/B2DRayCastOutput.h +21 -0
  215. data/vendor/vendor-ios/box_2d/box_2d_include/B2DShape.h +23 -3
  216. data/vendor/vendor-ios/box_2d/box_2d_include/B2DShapeTypes.h +22 -0
  217. data/vendor/vendor-ios/box_2d/box_2d_include/B2DTransform.h +21 -0
  218. data/vendor/vendor-ios/box_2d/box_2d_include/B2DWorld.h +40 -19
  219. data/vendor/vendor-ios/box_2d/libBox2D.a +0 -0
  220. data/vendor/vendor-ios/cocos_2d/cocos_2d.bridgesupport +808 -1578
  221. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCActionEase.h +47 -0
  222. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCFontDefinition.h +85 -0
  223. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCLabelTTF.h +54 -6
  224. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCMenuItem.h +1 -0
  225. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCTMXLayer.h +2 -2
  226. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCTexture2D.h +4 -0
  227. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/ccTypes.h +51 -1
  228. data/vendor/vendor-ios/cocos_2d/libcocos2d.a +0 -0
  229. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader.bridgesupport +510 -0
  230. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBAnimationManager.h +149 -0
  231. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBKeyframe.h +40 -0
  232. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBReader.h +176 -0
  233. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBSequence.h +49 -0
  234. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBSequenceProperty.h +38 -0
  235. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCNode+CCBRelativePositioning.h +65 -0
  236. data/vendor/vendor-ios/cocos_builder_reader/libCocosBuilderReader.a +0 -0
  237. data/vendor/vendor-ios/cocos_denshion/cocos_denshion.bridgesupport +1001 -0
  238. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDAudioManager.h +243 -0
  239. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDConfig.h +60 -0
  240. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDOpenALSupport.h +77 -0
  241. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDXMacOSXSupport.h +232 -0
  242. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDXPropertyModifierAction.h +45 -0
  243. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CocosDenshion.h +440 -0
  244. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/SimpleAudioEngine.h +90 -0
  245. data/vendor/vendor-ios/cocos_denshion/libCocosDenshion.a +0 -0
  246. data/vendor/vendor-ios/kazmath/kazmath.bridgesupport +865 -0
  247. data/vendor/vendor-ios/kazmath/kazmath_include/GL/mat4stack.h +51 -0
  248. data/vendor/vendor-ios/kazmath/kazmath_include/GL/matrix.h +58 -0
  249. data/vendor/vendor-ios/kazmath/kazmath_include/aabb.h +53 -0
  250. data/vendor/vendor-ios/kazmath/kazmath_include/kazmath.h +39 -0
  251. data/vendor/vendor-ios/kazmath/kazmath_include/mat3.h +75 -0
  252. data/vendor/vendor-ios/kazmath/kazmath_include/mat4.h +93 -0
  253. data/vendor/vendor-ios/kazmath/kazmath_include/neon_matrix_impl.h +41 -0
  254. data/vendor/vendor-ios/kazmath/kazmath_include/plane.h +70 -0
  255. data/vendor/vendor-ios/kazmath/kazmath_include/quaternion.h +113 -0
  256. data/vendor/vendor-ios/kazmath/kazmath_include/ray2.h +50 -0
  257. data/vendor/vendor-ios/kazmath/kazmath_include/utility.h +74 -0
  258. data/vendor/vendor-ios/kazmath/kazmath_include/vec2.h +64 -0
  259. data/vendor/vendor-ios/kazmath/kazmath_include/vec3.h +68 -0
  260. data/vendor/vendor-ios/kazmath/kazmath_include/vec4.h +68 -0
  261. data/vendor/vendor-ios/kazmath/libkazmath.a +0 -0
  262. data/vendor/vendor-osx/box_2d/box_2d.bridgesupport +1199 -83
  263. data/vendor/vendor-osx/box_2d/box_2d_include/B2DAABB.h +21 -0
  264. data/vendor/vendor-osx/box_2d/box_2d_include/B2DBody.h +58 -13
  265. data/vendor/vendor-osx/box_2d/box_2d_include/B2DBodyDef.h +44 -0
  266. data/vendor/vendor-osx/box_2d/box_2d_include/B2DBodyTypes.h +20 -0
  267. data/vendor/vendor-osx/box_2d/box_2d_include/B2DChainShape.h +29 -0
  268. data/vendor/vendor-osx/box_2d/box_2d_include/B2DCircleShape.h +7 -0
  269. data/vendor/vendor-osx/box_2d/box_2d_include/B2DColor.h +23 -0
  270. data/vendor/vendor-osx/box_2d/box_2d_include/B2DContactFilter.h +24 -0
  271. data/vendor/vendor-osx/box_2d/box_2d_include/B2DContactListener.h +1 -1
  272. data/vendor/vendor-osx/box_2d/box_2d_include/B2DDestructionListener.h +24 -0
  273. data/vendor/vendor-osx/box_2d/box_2d_include/B2DDraw.h +54 -0
  274. data/vendor/vendor-osx/box_2d/box_2d_include/B2DEdgeShape.h +13 -2
  275. data/vendor/vendor-osx/box_2d/box_2d_include/B2DFilter.h +23 -0
  276. data/vendor/vendor-osx/box_2d/box_2d_include/B2DFixture.h +47 -0
  277. data/vendor/vendor-osx/box_2d/box_2d_include/B2DFixtureDef.h +29 -0
  278. data/vendor/vendor-osx/box_2d/box_2d_include/B2DMassData.h +23 -0
  279. data/vendor/vendor-osx/box_2d/box_2d_include/B2DPolygonShape.h +14 -1
  280. data/vendor/vendor-osx/box_2d/box_2d_include/B2DProfile.h +31 -0
  281. data/vendor/vendor-osx/box_2d/box_2d_include/B2DQueryCallback.h +24 -0
  282. data/vendor/vendor-osx/box_2d/box_2d_include/B2DRayCastCallback.h +24 -0
  283. data/vendor/vendor-osx/box_2d/box_2d_include/B2DRayCastInput.h +23 -0
  284. data/vendor/vendor-osx/box_2d/box_2d_include/B2DRayCastOutput.h +21 -0
  285. data/vendor/vendor-osx/box_2d/box_2d_include/B2DShape.h +23 -3
  286. data/vendor/vendor-osx/box_2d/box_2d_include/B2DShapeTypes.h +22 -0
  287. data/vendor/vendor-osx/box_2d/box_2d_include/B2DTransform.h +21 -0
  288. data/vendor/vendor-osx/box_2d/box_2d_include/B2DWorld.h +40 -19
  289. data/vendor/vendor-osx/box_2d/libBox2D.a +0 -0
  290. data/vendor/vendor-osx/cocos_2d/cocos_2d.bridgesupport +2820 -2633
  291. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionEase.h +47 -0
  292. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCFontDefinition.h +85 -0
  293. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelTTF.h +54 -6
  294. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenuItem.h +1 -0
  295. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXLayer.h +2 -2
  296. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexture2D.h +4 -0
  297. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCDirectorIOS.h +111 -0
  298. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCES2Renderer.h +83 -0
  299. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCESRenderer.h +54 -0
  300. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCGLView.h +175 -0
  301. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCTouchDelegateProtocol.h +75 -0
  302. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCTouchDispatcher.h +120 -0
  303. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCTouchHandler.h +93 -0
  304. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccTypes.h +65 -1
  305. data/vendor/vendor-osx/cocos_2d/libcocos2d.a +0 -0
  306. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader.bridgesupport +510 -0
  307. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBAnimationManager.h +149 -0
  308. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBKeyframe.h +40 -0
  309. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBReader.h +176 -0
  310. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBSequence.h +49 -0
  311. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBSequenceProperty.h +38 -0
  312. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCNode+CCBRelativePositioning.h +65 -0
  313. data/vendor/vendor-osx/cocos_builder_reader/libCocosBuilderReader.a +0 -0
  314. data/vendor/vendor-osx/cocos_denshion/cocos_denshion.bridgesupport +1001 -0
  315. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDAudioManager.h +243 -0
  316. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDConfig.h +60 -0
  317. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDOpenALSupport.h +77 -0
  318. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDXMacOSXSupport.h +232 -0
  319. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDXPropertyModifierAction.h +45 -0
  320. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CocosDenshion.h +440 -0
  321. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/SimpleAudioEngine.h +90 -0
  322. data/vendor/vendor-osx/cocos_denshion/libCocosDenshion.a +0 -0
  323. data/vendor/vendor-osx/kazmath/kazmath.bridgesupport +865 -0
  324. data/vendor/vendor-osx/kazmath/kazmath_include/GL/mat4stack.h +51 -0
  325. data/vendor/vendor-osx/kazmath/kazmath_include/GL/matrix.h +58 -0
  326. data/vendor/vendor-osx/kazmath/kazmath_include/aabb.h +53 -0
  327. data/vendor/vendor-osx/kazmath/kazmath_include/kazmath.h +39 -0
  328. data/vendor/vendor-osx/kazmath/kazmath_include/mat3.h +75 -0
  329. data/vendor/vendor-osx/kazmath/kazmath_include/mat4.h +93 -0
  330. data/vendor/vendor-osx/kazmath/kazmath_include/neon_matrix_impl.h +41 -0
  331. data/vendor/vendor-osx/kazmath/kazmath_include/plane.h +70 -0
  332. data/vendor/vendor-osx/kazmath/kazmath_include/quaternion.h +113 -0
  333. data/vendor/vendor-osx/kazmath/kazmath_include/ray2.h +50 -0
  334. data/vendor/vendor-osx/kazmath/kazmath_include/utility.h +74 -0
  335. data/vendor/vendor-osx/kazmath/kazmath_include/vec2.h +64 -0
  336. data/vendor/vendor-osx/kazmath/kazmath_include/vec3.h +68 -0
  337. data/vendor/vendor-osx/kazmath/kazmath_include/vec4.h +68 -0
  338. data/vendor/vendor-osx/kazmath/libkazmath.a +0 -0
  339. metadata +353 -57
  340. checksums.yaml +0 -15
  341. data/bin/joybox +0 -49
  342. data/command/joybox/USAGE +0 -24
  343. data/motion/joybox-ios/configuration/debug.rb +0 -27
  344. data/motion/joybox-ios/debug/debug.rb +0 -10
  345. data/motion/joybox-osx/configuration/debug.rb +0 -27
  346. data/motion/joybox-osx/configuration/sprite_view.rb +0 -91
  347. data/motion/joybox-osx/debug/debug.rb +0 -10
  348. data/motion/joybox/core/ns_object.rb +0 -8
  349. data/spec/lib/joybox/cocos2d/cocos2d_spec.rb +0 -7
  350. data/spec/lib/joybox/cocos2d/macros_spec.rb +0 -37
  351. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/cocos2d-ios-exceptions.bridgesupport +0 -39
  352. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/gen_cocos2d_bridgesupport.sh +0 -17
  353. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/gen_cocos2d_complement.sh +0 -17
@@ -0,0 +1,45 @@
1
+ /*
2
+ Copyright (c) 2010 Steve Oldmeadow
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in
12
+ all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
22
+ $Id$
23
+ */
24
+
25
+ #import "cocos2d.h"
26
+ #import "SimpleAudioEngine.h"
27
+
28
+ /** Base class for actions that modify audio properties
29
+ @since v 1.0
30
+ */
31
+ @interface CDXPropertyModifierAction : CCActionInterval {
32
+ CDPropertyModifier *modifier;
33
+ float lastSetValue;
34
+ }
35
+ /** creates the action */
36
+ +(id) actionWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier;
37
+
38
+ /** initializes the action */
39
+ -(id) initWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier;
40
+
41
+ +(void) fadeSoundEffects:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType)curve shouldStop:(BOOL) stop;
42
+ +(void) fadeSoundEffect:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType)curve shouldStop:(BOOL) stop effect:(CDSoundSource*) effect;
43
+ +(void) fadeBackgroundMusic:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType) curve shouldStop:(BOOL) stop;
44
+
45
+ @end
@@ -0,0 +1,440 @@
1
+ /*
2
+ Copyright (c) 2010 Steve Oldmeadow
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in
12
+ all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
22
+ $Id$
23
+ */
24
+
25
+
26
+
27
+ /**
28
+ @file
29
+ @b IMPORTANT
30
+ There are 3 different ways of using CocosDenshion. Depending on which you choose you
31
+ will need to include different files and frameworks.
32
+
33
+ @par SimpleAudioEngine
34
+ This is recommended for basic audio requirements. If you just want to play some sound fx
35
+ and some background music and have no interest in learning the lower level workings then
36
+ this is the interface to use.
37
+
38
+ Requirements:
39
+ - Firmware: OS 2.2 or greater
40
+ - Files: SimpleAudioEngine.*, CocosDenshion.*
41
+ - Frameworks: OpenAL, AudioToolbox, AVFoundation
42
+
43
+ @par CDAudioManager
44
+ CDAudioManager is basically a thin wrapper around an AVAudioPlayer object used for playing
45
+ background music and a CDSoundEngine object used for playing sound effects. It manages the
46
+ audio session for you deals with audio session interruption. It is fairly low level and it
47
+ is expected you have some understanding of the underlying technologies. For example, for
48
+ many use cases regarding background music it is expected you will work directly with the
49
+ backgroundMusic AVAudioPlayer which is exposed as a property.
50
+
51
+ Requirements:
52
+ - Firmware: OS 2.2 or greater
53
+ - Files: CDAudioManager.*, CocosDenshion.*
54
+ - Frameworks: OpenAL, AudioToolbox, AVFoundation
55
+
56
+ @par CDSoundEngine
57
+ CDSoundEngine is a sound engine built upon OpenAL and derived from Apple's oalTouch
58
+ example. It can playback up to 32 sounds simultaneously with control over pitch, pan
59
+ and gain. It can be set up to handle audio session interruption automatically. You
60
+ may decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine
61
+ because you require OS 2.0 compatibility.
62
+
63
+ Requirements:
64
+ - Firmware: OS 2.0 or greater
65
+ - Files: CocosDenshion.*
66
+ - Frameworks: OpenAL, AudioToolbox
67
+
68
+ */
69
+
70
+ #import <OpenAL/al.h>
71
+ #import <OpenAL/alc.h>
72
+ #import <AudioToolbox/AudioToolbox.h>
73
+ #import <Foundation/Foundation.h>
74
+ #import "CDConfig.h"
75
+
76
+
77
+ #if !defined(CD_DEBUG) || CD_DEBUG == 0
78
+ #define CDLOG(...) do {} while (0)
79
+ #define CDLOGINFO(...) do {} while (0)
80
+
81
+ #elif CD_DEBUG == 1
82
+ #define CDLOG(...) NSLog(__VA_ARGS__)
83
+ #define CDLOGINFO(...) do {} while (0)
84
+
85
+ #elif CD_DEBUG > 1
86
+ #define CDLOG(...) NSLog(__VA_ARGS__)
87
+ #define CDLOGINFO(...) NSLog(__VA_ARGS__)
88
+ #endif // CD_DEBUG
89
+
90
+
91
+ #import "CDOpenALSupport.h"
92
+
93
+ //Tested source limit on 2.2.1 and 3.1.2 with up to 128 sources and appears to work. Older OS versions e.g 2.2 may support only 32
94
+ #define CD_SOURCE_LIMIT 32 //Total number of sources we will ever want, may actually get less
95
+ #define CD_NO_SOURCE 0xFEEDFAC //Return value indicating playback failed i.e. no source
96
+ #define CD_IGNORE_AUDIO_SESSION 0xBEEFBEE //Used internally to indicate audio session will not be handled
97
+ #define CD_MUTE 0xFEEDBAB //Return value indicating sound engine is muted or non functioning
98
+ #define CD_NO_SOUND = -1;
99
+
100
+ #define CD_SAMPLE_RATE_HIGH 44100
101
+ #define CD_SAMPLE_RATE_MID 22050
102
+ #define CD_SAMPLE_RATE_LOW 16000
103
+ #define CD_SAMPLE_RATE_BASIC 8000
104
+ #define CD_SAMPLE_RATE_DEFAULT 44100
105
+
106
+ extern NSString * const kCDN_BadAlContext;
107
+ extern NSString * const kCDN_AsynchLoadComplete;
108
+
109
+ extern float const kCD_PitchDefault;
110
+ extern float const kCD_PitchLowerOneOctave;
111
+ extern float const kCD_PitchHigherOneOctave;
112
+ extern float const kCD_PanDefault;
113
+ extern float const kCD_PanFullLeft;
114
+ extern float const kCD_PanFullRight;
115
+ extern float const kCD_GainDefault;
116
+
117
+ enum bufferState {
118
+ CD_BS_EMPTY = 0,
119
+ CD_BS_LOADED = 1,
120
+ CD_BS_FAILED = 2
121
+ };
122
+
123
+ typedef struct _sourceGroup {
124
+ int startIndex;
125
+ int currentIndex;
126
+ int totalSources;
127
+ bool enabled;
128
+ bool nonInterruptible;
129
+ int *sourceStatuses;//pointer into array of source status information
130
+ } sourceGroup;
131
+
132
+ typedef struct _bufferInfo {
133
+ ALuint bufferId;
134
+ int bufferState;
135
+ void* bufferData;
136
+ ALenum format;
137
+ ALsizei sizeInBytes;
138
+ ALsizei frequencyInHertz;
139
+ } bufferInfo;
140
+
141
+ typedef struct _sourceInfo {
142
+ bool usable;
143
+ ALuint sourceId;
144
+ ALuint attachedBufferId;
145
+ } sourceInfo;
146
+
147
+ #pragma mark CDAudioTransportProtocol
148
+
149
+ @protocol CDAudioTransportProtocol <NSObject>
150
+ /** Play the audio */
151
+ -(BOOL) play;
152
+ /** Pause the audio, retain resources */
153
+ -(BOOL) pause;
154
+ /** Stop the audio, release resources */
155
+ -(BOOL) stop;
156
+ /** Return playback to beginning */
157
+ -(BOOL) rewind;
158
+ @end
159
+
160
+ #pragma mark CDAudioInterruptProtocol
161
+
162
+ @protocol CDAudioInterruptProtocol <NSObject>
163
+ /** Is audio mute */
164
+ -(BOOL) mute;
165
+ /** If YES then audio is silenced but not stopped, calls to start new audio will proceed but silently */
166
+ -(void) setMute:(BOOL) muteValue;
167
+ /** Is audio enabled */
168
+ -(BOOL) enabled;
169
+ /** If NO then all audio is stopped and any calls to start new audio will be ignored */
170
+ -(void) setEnabled:(BOOL) enabledValue;
171
+ @end
172
+
173
+ #pragma mark CDUtilities
174
+ /**
175
+ Collection of utilities required by CocosDenshion
176
+ */
177
+ @interface CDUtilities : NSObject
178
+ {
179
+ }
180
+
181
+ /** Fundamentally the same as the corresponding method is CCFileUtils but added to break binding to cocos2d */
182
+ +(NSString*) fullPathFromRelativePath:(NSString*) relPath;
183
+
184
+ @end
185
+
186
+
187
+ #pragma mark CDSoundEngine
188
+
189
+ /** CDSoundEngine is built upon OpenAL and works with SDK 2.0.
190
+ CDSoundEngine is a sound engine built upon OpenAL and derived from Apple's oalTouch
191
+ example. It can playback up to 32 sounds simultaneously with control over pitch, pan
192
+ and gain. It can be set up to handle audio session interruption automatically. You
193
+ may decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine
194
+ because you require OS 2.0 compatibility.
195
+
196
+ Requirements:
197
+ - Firmware: OS 2.0 or greater
198
+ - Files: CocosDenshion.*
199
+ - Frameworks: OpenAL, AudioToolbox
200
+
201
+ @since v0.8
202
+ */
203
+ @class CDSoundSource;
204
+ @interface CDSoundEngine : NSObject <CDAudioInterruptProtocol> {
205
+
206
+ bufferInfo *_buffers;
207
+ sourceInfo *_sources;
208
+ sourceGroup *_sourceGroups;
209
+ ALCcontext *context;
210
+ NSUInteger _sourceGroupTotal;
211
+ UInt32 _audioSessionCategory;
212
+ BOOL _handleAudioSession;
213
+ ALfloat _preMuteGain;
214
+ NSObject *_mutexBufferLoad;
215
+ BOOL mute_;
216
+ BOOL enabled_;
217
+
218
+ ALenum lastErrorCode_;
219
+ BOOL functioning_;
220
+ float asynchLoadProgress_;
221
+ BOOL getGainWorks_;
222
+
223
+ //For managing dynamic allocation of sources and buffers
224
+ int sourceTotal_;
225
+ int bufferTotal;
226
+
227
+ }
228
+
229
+ @property (readwrite, nonatomic) ALfloat masterGain;
230
+ @property (readonly) ALenum lastErrorCode;//Last OpenAL error code that was generated
231
+ @property (readonly) BOOL functioning;//Is the sound engine functioning
232
+ @property (readwrite) float asynchLoadProgress;
233
+ @property (readonly) BOOL getGainWorks;//Does getting the gain for a source work
234
+ /** Total number of sources available */
235
+ @property (readonly) int sourceTotal;
236
+ /** Total number of source groups that have been defined */
237
+ @property (readonly) NSUInteger sourceGroupTotal;
238
+
239
+ /** Sets the sample rate for the audio mixer. For best performance this should match the sample rate of your audio content */
240
+ +(void) setMixerSampleRate:(Float32) sampleRate;
241
+
242
+ /** Initializes the engine with a group definition and a total number of groups */
243
+ -(id)init;
244
+
245
+ /** Plays a sound in a channel group with a pitch, pan and gain. The sound could played looped or not */
246
+ -(ALuint) playSound:(int) soundId sourceGroupId:(int)sourceGroupId pitch:(float) pitch pan:(float) pan gain:(float) gain loop:(BOOL) loop;
247
+
248
+ /** Creates and returns a sound source object for the specified sound within the specified source group.
249
+ */
250
+ -(CDSoundSource *) soundSourceForSound:(int) soundId sourceGroupId:(int) sourceGroupId;
251
+
252
+ /** Stops playing a sound */
253
+ - (void) stopSound:(ALuint) sourceId;
254
+ /** Stops playing a source group */
255
+ - (void) stopSourceGroup:(int) sourceGroupId;
256
+ /** Stops all playing sounds */
257
+ -(void) stopAllSounds;
258
+ -(void) defineSourceGroups:(NSArray*) sourceGroupDefinitions;
259
+ -(void) defineSourceGroups:(int[]) sourceGroupDefinitions total:(NSUInteger) total;
260
+ -(void) setSourceGroupNonInterruptible:(int) sourceGroupId isNonInterruptible:(BOOL) isNonInterruptible;
261
+ -(void) setSourceGroupEnabled:(int) sourceGroupId enabled:(BOOL) enabled;
262
+ -(BOOL) sourceGroupEnabled:(int) sourceGroupId;
263
+ -(BOOL) loadBufferFromData:(int) soundId soundData:(ALvoid*) soundData format:(ALenum) format size:(ALsizei) size freq:(ALsizei) freq;
264
+ -(BOOL) loadBuffer:(int) soundId filePath:(NSString*) filePath;
265
+ -(void) loadBuffersAsynchronously:(NSArray *) loadRequests;
266
+ -(BOOL) unloadBuffer:(int) soundId;
267
+ -(ALCcontext *) openALContext;
268
+
269
+ /** Returns the duration of the buffer in seconds or a negative value if the buffer id is invalid */
270
+ -(float) bufferDurationInSeconds:(int) soundId;
271
+ /** Returns the size of the buffer in bytes or a negative value if the buffer id is invalid */
272
+ -(ALsizei) bufferSizeInBytes:(int) soundId;
273
+ /** Returns the sampling frequency of the buffer in hertz or a negative value if the buffer id is invalid */
274
+ -(ALsizei) bufferFrequencyInHertz:(int) soundId;
275
+
276
+ /** Used internally, never call unless you know what you are doing */
277
+ -(void) _soundSourcePreRelease:(CDSoundSource *) soundSource;
278
+
279
+ @end
280
+
281
+ #pragma mark CDSoundSource
282
+ /** CDSoundSource is a wrapper around an OpenAL sound source.
283
+ It allows you to manipulate properties such as pitch, gain, pan and looping while the
284
+ sound is playing. CDSoundSource is based on the old CDSourceWrapper class but with much
285
+ added functionality.
286
+
287
+ @since v1.0
288
+ */
289
+ @interface CDSoundSource : NSObject <CDAudioTransportProtocol, CDAudioInterruptProtocol> {
290
+ ALenum lastError;
291
+ @public
292
+ ALuint _sourceId;
293
+ ALuint _sourceIndex;
294
+ CDSoundEngine* _engine;
295
+ int _soundId;
296
+ float _preMuteGain;
297
+ BOOL enabled_;
298
+ BOOL mute_;
299
+ }
300
+ @property (readwrite, nonatomic) float pitch;
301
+ @property (readwrite, nonatomic) float gain;
302
+ @property (readwrite, nonatomic) float pan;
303
+ @property (readwrite, nonatomic) BOOL looping;
304
+ @property (readonly) BOOL isPlaying;
305
+ @property (readwrite, nonatomic) int soundId;
306
+ /** Returns the duration of the attached buffer in seconds or a negative value if the buffer is invalid */
307
+ @property (readonly) float durationInSeconds;
308
+
309
+ /** Stores the last error code that occurred. Check against AL_NO_ERROR */
310
+ @property (readonly) ALenum lastError;
311
+ /** Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine */
312
+ -(id)init:(ALuint) theSourceId sourceIndex:(int) index soundEngine:(CDSoundEngine*) engine;
313
+
314
+ @end
315
+
316
+ #pragma mark CDAudioInterruptTargetGroup
317
+
318
+ /** Container for objects that implement audio interrupt protocol i.e. they can be muted and enabled.
319
+ Setting mute and enabled for the group propagates to all children.
320
+ Designed to be used with your CDSoundSource objects to get them to comply with global enabled and mute settings
321
+ if that is what you want to do.*/
322
+ @interface CDAudioInterruptTargetGroup : NSObject <CDAudioInterruptProtocol> {
323
+ BOOL mute_;
324
+ BOOL enabled_;
325
+ NSMutableArray *children_;
326
+ }
327
+ -(void) addAudioInterruptTarget:(NSObject<CDAudioInterruptProtocol>*) interruptibleTarget;
328
+ @end
329
+
330
+ #pragma mark CDAsynchBufferLoader
331
+
332
+ /** CDAsynchBufferLoader
333
+ TODO
334
+ */
335
+ @interface CDAsynchBufferLoader : NSOperation {
336
+ NSArray *_loadRequests;
337
+ CDSoundEngine *_soundEngine;
338
+ }
339
+
340
+ -(id) init:(NSArray *)loadRequests soundEngine:(CDSoundEngine *) theSoundEngine;
341
+
342
+ @end
343
+
344
+ #pragma mark CDBufferLoadRequest
345
+
346
+ /** CDBufferLoadRequest */
347
+ @interface CDBufferLoadRequest: NSObject
348
+ {
349
+ NSString *filePath;
350
+ int soundId;
351
+ //id loader;
352
+ }
353
+
354
+ @property (readonly) NSString *filePath;
355
+ @property (readonly) int soundId;
356
+
357
+ - (id)init:(int) theSoundId filePath:(const NSString *) theFilePath;
358
+ @end
359
+
360
+ /** Interpolation type */
361
+ typedef enum {
362
+ kIT_Linear, //!Straight linear interpolation fade
363
+ kIT_SCurve, //!S curved interpolation
364
+ kIT_Exponential //!Exponential interpolation
365
+ } tCDInterpolationType;
366
+
367
+ #pragma mark CDFloatInterpolator
368
+ @interface CDFloatInterpolator: NSObject
369
+ {
370
+ float start;
371
+ float end;
372
+ float lastValue;
373
+ tCDInterpolationType interpolationType;
374
+ }
375
+ @property (readwrite, nonatomic) float start;
376
+ @property (readwrite, nonatomic) float end;
377
+ @property (readwrite, nonatomic) tCDInterpolationType interpolationType;
378
+
379
+ /** Return a value between min and max based on t which represents fractional progress where 0 is the start
380
+ and 1 is the end */
381
+ -(float) interpolate:(float) t;
382
+ -(id) init:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal;
383
+
384
+ @end
385
+
386
+ #pragma mark CDPropertyModifier
387
+
388
+ /** Base class for classes that modify properties such as pitch, pan and gain */
389
+ @interface CDPropertyModifier: NSObject
390
+ {
391
+ CDFloatInterpolator *interpolator;
392
+ float startValue;
393
+ float endValue;
394
+ id target;
395
+ BOOL stopTargetWhenComplete;
396
+
397
+ }
398
+ @property (readwrite, nonatomic) BOOL stopTargetWhenComplete;
399
+ @property (readwrite, nonatomic) float startValue;
400
+ @property (readwrite, nonatomic) float endValue;
401
+ @property (readwrite, nonatomic) tCDInterpolationType interpolationType;
402
+
403
+ -(id) init:(id) theTarget interpolationType:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal;
404
+ /** Set to a fractional value between 0 and 1 where 0 equals the start and 1 equals the end*/
405
+ -(void) modify:(float) t;
406
+
407
+ -(void) _setTargetProperty:(float) newVal;
408
+ -(float) _getTargetProperty;
409
+ -(void) _stopTarget;
410
+ -(Class) _allowableType;
411
+
412
+ @end
413
+
414
+ #pragma mark CDSoundSourceFader
415
+
416
+ /** Fader for CDSoundSource objects */
417
+ @interface CDSoundSourceFader : CDPropertyModifier{}
418
+ @end
419
+
420
+ #pragma mark CDSoundSourcePanner
421
+
422
+ /** Panner for CDSoundSource objects */
423
+ @interface CDSoundSourcePanner : CDPropertyModifier{}
424
+ @end
425
+
426
+ #pragma mark CDSoundSourcePitchBender
427
+
428
+ /** Pitch bender for CDSoundSource objects */
429
+ @interface CDSoundSourcePitchBender : CDPropertyModifier{}
430
+ @end
431
+
432
+ #pragma mark CDSoundEngineFader
433
+
434
+ /** Fader for CDSoundEngine objects */
435
+ @interface CDSoundEngineFader : CDPropertyModifier{}
436
+ @end
437
+
438
+
439
+
440
+