/lua/CocosDenshion_support/LuaSimpleAudioEngine.cpp

https://github.com/ciaranj/cocos2d-x · C++ · 780 lines · 715 code · 35 blank · 30 comment · 40 complexity · fbdc2c9ab590a85d254c5d2561a583e5 MD5 · raw file

  1. /*
  2. ** Lua binding: SimpleAudioEngine
  3. ** Generated automatically by tolua++-1.0.92 on Tue Aug 16 22:48:34 2011.
  4. */
  5. #ifndef __cplusplus
  6. #include "stdlib.h"
  7. #endif
  8. #include "string.h"
  9. #include "tolua++.h"
  10. #include "LuaSimpleAudioEngine.h"
  11. #include "SimpleAudioEngine.h"
  12. /* Exported function */
  13. TOLUA_API int tolua_SimpleAudioEngine_open (lua_State* tolua_S);
  14. /* function to release collected object via destructor */
  15. #ifdef __cplusplus
  16. static int tolua_collect_CocosDenshion__SimpleAudioEngine (lua_State* tolua_S)
  17. {
  18. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  19. delete self;
  20. return 0;
  21. }
  22. #endif
  23. /* function to register type */
  24. static void tolua_reg_types (lua_State* tolua_S)
  25. {
  26. tolua_usertype(tolua_S,"CocosDenshion::SimpleAudioEngine");
  27. }
  28. /* method: new of class CocosDenshion::SimpleAudioEngine */
  29. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_new00
  30. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_new00(lua_State* tolua_S)
  31. {
  32. #ifndef TOLUA_RELEASE
  33. tolua_Error tolua_err;
  34. if (
  35. !tolua_isusertable(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  36. !tolua_isnoobj(tolua_S,2,&tolua_err)
  37. )
  38. goto tolua_lerror;
  39. else
  40. #endif
  41. {
  42. {
  43. CocosDenshion::SimpleAudioEngine* tolua_ret = (CocosDenshion::SimpleAudioEngine*) new CocosDenshion::SimpleAudioEngine();
  44. tolua_pushusertype(tolua_S,(void*)tolua_ret,"CocosDenshion::SimpleAudioEngine");
  45. }
  46. }
  47. return 1;
  48. #ifndef TOLUA_RELEASE
  49. tolua_lerror:
  50. tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
  51. return 0;
  52. #endif
  53. }
  54. #endif //#ifndef TOLUA_DISABLE
  55. /* method: new_local of class CocosDenshion::SimpleAudioEngine */
  56. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_new00_local
  57. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_new00_local(lua_State* tolua_S)
  58. {
  59. #ifndef TOLUA_RELEASE
  60. tolua_Error tolua_err;
  61. if (
  62. !tolua_isusertable(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  63. !tolua_isnoobj(tolua_S,2,&tolua_err)
  64. )
  65. goto tolua_lerror;
  66. else
  67. #endif
  68. {
  69. {
  70. CocosDenshion::SimpleAudioEngine* tolua_ret = (CocosDenshion::SimpleAudioEngine*) new CocosDenshion::SimpleAudioEngine();
  71. tolua_pushusertype_and_takeownership(tolua_S,(void *)tolua_ret,"CocosDenshion::SimpleAudioEngine");
  72. }
  73. }
  74. return 1;
  75. #ifndef TOLUA_RELEASE
  76. tolua_lerror:
  77. tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
  78. return 0;
  79. #endif
  80. }
  81. #endif //#ifndef TOLUA_DISABLE
  82. /* method: delete of class CocosDenshion::SimpleAudioEngine */
  83. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_delete00
  84. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_delete00(lua_State* tolua_S)
  85. {
  86. #ifndef TOLUA_RELEASE
  87. tolua_Error tolua_err;
  88. if (
  89. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  90. !tolua_isnoobj(tolua_S,2,&tolua_err)
  91. )
  92. goto tolua_lerror;
  93. else
  94. #endif
  95. {
  96. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  97. #ifndef TOLUA_RELEASE
  98. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'",NULL);
  99. #endif
  100. delete self;
  101. }
  102. return 0;
  103. #ifndef TOLUA_RELEASE
  104. tolua_lerror:
  105. tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
  106. return 0;
  107. #endif
  108. }
  109. #endif //#ifndef TOLUA_DISABLE
  110. /* method: sharedEngine of class CocosDenshion::SimpleAudioEngine */
  111. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_sharedEngine00
  112. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_sharedEngine00(lua_State* tolua_S)
  113. {
  114. #ifndef TOLUA_RELEASE
  115. tolua_Error tolua_err;
  116. if (
  117. !tolua_isusertable(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  118. !tolua_isnoobj(tolua_S,2,&tolua_err)
  119. )
  120. goto tolua_lerror;
  121. else
  122. #endif
  123. {
  124. {
  125. CocosDenshion::SimpleAudioEngine* tolua_ret = (CocosDenshion::SimpleAudioEngine*) CocosDenshion::SimpleAudioEngine::sharedEngine();
  126. tolua_pushusertype(tolua_S,(void*)tolua_ret,"CocosDenshion::SimpleAudioEngine");
  127. }
  128. }
  129. return 1;
  130. #ifndef TOLUA_RELEASE
  131. tolua_lerror:
  132. tolua_error(tolua_S,"#ferror in function 'sharedEngine'.",&tolua_err);
  133. return 0;
  134. #endif
  135. }
  136. #endif //#ifndef TOLUA_DISABLE
  137. /* method: end of class CocosDenshion::SimpleAudioEngine */
  138. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_end00
  139. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_end00(lua_State* tolua_S)
  140. {
  141. #ifndef TOLUA_RELEASE
  142. tolua_Error tolua_err;
  143. if (
  144. !tolua_isusertable(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  145. !tolua_isnoobj(tolua_S,2,&tolua_err)
  146. )
  147. goto tolua_lerror;
  148. else
  149. #endif
  150. {
  151. {
  152. CocosDenshion::SimpleAudioEngine::end();
  153. }
  154. }
  155. return 0;
  156. #ifndef TOLUA_RELEASE
  157. tolua_lerror:
  158. tolua_error(tolua_S,"#ferror in function 'end'.",&tolua_err);
  159. return 0;
  160. #endif
  161. }
  162. #endif //#ifndef TOLUA_DISABLE
  163. /* method: setResource of class CocosDenshion::SimpleAudioEngine */
  164. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_setResource00
  165. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_setResource00(lua_State* tolua_S)
  166. {
  167. #ifndef TOLUA_RELEASE
  168. tolua_Error tolua_err;
  169. if (
  170. !tolua_isusertable(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  171. !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  172. !tolua_isnoobj(tolua_S,3,&tolua_err)
  173. )
  174. goto tolua_lerror;
  175. else
  176. #endif
  177. {
  178. const char* pszZipFileName = ((const char*) tolua_tostring(tolua_S,2,0));
  179. {
  180. CocosDenshion::SimpleAudioEngine::setResource(pszZipFileName);
  181. }
  182. }
  183. return 0;
  184. #ifndef TOLUA_RELEASE
  185. tolua_lerror:
  186. tolua_error(tolua_S,"#ferror in function 'setResource'.",&tolua_err);
  187. return 0;
  188. #endif
  189. }
  190. #endif //#ifndef TOLUA_DISABLE
  191. /* method: preloadBackgroundMusic of class CocosDenshion::SimpleAudioEngine */
  192. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_preloadBackgroundMusic00
  193. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_preloadBackgroundMusic00(lua_State* tolua_S)
  194. {
  195. #ifndef TOLUA_RELEASE
  196. tolua_Error tolua_err;
  197. if (
  198. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  199. !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  200. !tolua_isnoobj(tolua_S,3,&tolua_err)
  201. )
  202. goto tolua_lerror;
  203. else
  204. #endif
  205. {
  206. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  207. const char* pszFilePath = ((const char*) tolua_tostring(tolua_S,2,0));
  208. #ifndef TOLUA_RELEASE
  209. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'preloadBackgroundMusic'",NULL);
  210. #endif
  211. {
  212. self->preloadBackgroundMusic(pszFilePath);
  213. }
  214. }
  215. return 0;
  216. #ifndef TOLUA_RELEASE
  217. tolua_lerror:
  218. tolua_error(tolua_S,"#ferror in function 'preloadBackgroundMusic'.",&tolua_err);
  219. return 0;
  220. #endif
  221. }
  222. #endif //#ifndef TOLUA_DISABLE
  223. /* method: playBackgroundMusic of class CocosDenshion::SimpleAudioEngine */
  224. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_playBackgroundMusic00
  225. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_playBackgroundMusic00(lua_State* tolua_S)
  226. {
  227. #ifndef TOLUA_RELEASE
  228. tolua_Error tolua_err;
  229. if (
  230. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  231. !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  232. !tolua_isboolean(tolua_S,3,1,&tolua_err) ||
  233. !tolua_isnoobj(tolua_S,4,&tolua_err)
  234. )
  235. goto tolua_lerror;
  236. else
  237. #endif
  238. {
  239. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  240. const char* pszFilePath = ((const char*) tolua_tostring(tolua_S,2,0));
  241. bool bLoop = ((bool) tolua_toboolean(tolua_S,3,false));
  242. #ifndef TOLUA_RELEASE
  243. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'playBackgroundMusic'",NULL);
  244. #endif
  245. {
  246. self->playBackgroundMusic(pszFilePath,bLoop);
  247. }
  248. }
  249. return 0;
  250. #ifndef TOLUA_RELEASE
  251. tolua_lerror:
  252. tolua_error(tolua_S,"#ferror in function 'playBackgroundMusic'.",&tolua_err);
  253. return 0;
  254. #endif
  255. }
  256. #endif //#ifndef TOLUA_DISABLE
  257. /* method: stopBackgroundMusic of class CocosDenshion::SimpleAudioEngine */
  258. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_stopBackgroundMusic00
  259. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_stopBackgroundMusic00(lua_State* tolua_S)
  260. {
  261. #ifndef TOLUA_RELEASE
  262. tolua_Error tolua_err;
  263. if (
  264. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  265. !tolua_isboolean(tolua_S,2,1,&tolua_err) ||
  266. !tolua_isnoobj(tolua_S,3,&tolua_err)
  267. )
  268. goto tolua_lerror;
  269. else
  270. #endif
  271. {
  272. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  273. bool bReleaseData = ((bool) tolua_toboolean(tolua_S,2,false));
  274. #ifndef TOLUA_RELEASE
  275. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'stopBackgroundMusic'",NULL);
  276. #endif
  277. {
  278. self->stopBackgroundMusic(bReleaseData);
  279. }
  280. }
  281. return 0;
  282. #ifndef TOLUA_RELEASE
  283. tolua_lerror:
  284. tolua_error(tolua_S,"#ferror in function 'stopBackgroundMusic'.",&tolua_err);
  285. return 0;
  286. #endif
  287. }
  288. #endif //#ifndef TOLUA_DISABLE
  289. /* method: pauseBackgroundMusic of class CocosDenshion::SimpleAudioEngine */
  290. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_pauseBackgroundMusic00
  291. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_pauseBackgroundMusic00(lua_State* tolua_S)
  292. {
  293. #ifndef TOLUA_RELEASE
  294. tolua_Error tolua_err;
  295. if (
  296. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  297. !tolua_isnoobj(tolua_S,2,&tolua_err)
  298. )
  299. goto tolua_lerror;
  300. else
  301. #endif
  302. {
  303. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  304. #ifndef TOLUA_RELEASE
  305. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'pauseBackgroundMusic'",NULL);
  306. #endif
  307. {
  308. self->pauseBackgroundMusic();
  309. }
  310. }
  311. return 0;
  312. #ifndef TOLUA_RELEASE
  313. tolua_lerror:
  314. tolua_error(tolua_S,"#ferror in function 'pauseBackgroundMusic'.",&tolua_err);
  315. return 0;
  316. #endif
  317. }
  318. #endif //#ifndef TOLUA_DISABLE
  319. /* method: resumeBackgroundMusic of class CocosDenshion::SimpleAudioEngine */
  320. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_resumeBackgroundMusic00
  321. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_resumeBackgroundMusic00(lua_State* tolua_S)
  322. {
  323. #ifndef TOLUA_RELEASE
  324. tolua_Error tolua_err;
  325. if (
  326. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  327. !tolua_isnoobj(tolua_S,2,&tolua_err)
  328. )
  329. goto tolua_lerror;
  330. else
  331. #endif
  332. {
  333. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  334. #ifndef TOLUA_RELEASE
  335. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'resumeBackgroundMusic'",NULL);
  336. #endif
  337. {
  338. self->resumeBackgroundMusic();
  339. }
  340. }
  341. return 0;
  342. #ifndef TOLUA_RELEASE
  343. tolua_lerror:
  344. tolua_error(tolua_S,"#ferror in function 'resumeBackgroundMusic'.",&tolua_err);
  345. return 0;
  346. #endif
  347. }
  348. #endif //#ifndef TOLUA_DISABLE
  349. /* method: rewindBackgroundMusic of class CocosDenshion::SimpleAudioEngine */
  350. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_rewindBackgroundMusic00
  351. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_rewindBackgroundMusic00(lua_State* tolua_S)
  352. {
  353. #ifndef TOLUA_RELEASE
  354. tolua_Error tolua_err;
  355. if (
  356. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  357. !tolua_isnoobj(tolua_S,2,&tolua_err)
  358. )
  359. goto tolua_lerror;
  360. else
  361. #endif
  362. {
  363. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  364. #ifndef TOLUA_RELEASE
  365. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'rewindBackgroundMusic'",NULL);
  366. #endif
  367. {
  368. self->rewindBackgroundMusic();
  369. }
  370. }
  371. return 0;
  372. #ifndef TOLUA_RELEASE
  373. tolua_lerror:
  374. tolua_error(tolua_S,"#ferror in function 'rewindBackgroundMusic'.",&tolua_err);
  375. return 0;
  376. #endif
  377. }
  378. #endif //#ifndef TOLUA_DISABLE
  379. /* method: willPlayBackgroundMusic of class CocosDenshion::SimpleAudioEngine */
  380. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_willPlayBackgroundMusic00
  381. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_willPlayBackgroundMusic00(lua_State* tolua_S)
  382. {
  383. #ifndef TOLUA_RELEASE
  384. tolua_Error tolua_err;
  385. if (
  386. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  387. !tolua_isnoobj(tolua_S,2,&tolua_err)
  388. )
  389. goto tolua_lerror;
  390. else
  391. #endif
  392. {
  393. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  394. #ifndef TOLUA_RELEASE
  395. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'willPlayBackgroundMusic'",NULL);
  396. #endif
  397. {
  398. bool tolua_ret = (bool) self->willPlayBackgroundMusic();
  399. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  400. }
  401. }
  402. return 1;
  403. #ifndef TOLUA_RELEASE
  404. tolua_lerror:
  405. tolua_error(tolua_S,"#ferror in function 'willPlayBackgroundMusic'.",&tolua_err);
  406. return 0;
  407. #endif
  408. }
  409. #endif //#ifndef TOLUA_DISABLE
  410. /* method: isBackgroundMusicPlaying of class CocosDenshion::SimpleAudioEngine */
  411. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_isBackgroundMusicPlaying00
  412. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_isBackgroundMusicPlaying00(lua_State* tolua_S)
  413. {
  414. #ifndef TOLUA_RELEASE
  415. tolua_Error tolua_err;
  416. if (
  417. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  418. !tolua_isnoobj(tolua_S,2,&tolua_err)
  419. )
  420. goto tolua_lerror;
  421. else
  422. #endif
  423. {
  424. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  425. #ifndef TOLUA_RELEASE
  426. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'isBackgroundMusicPlaying'",NULL);
  427. #endif
  428. {
  429. bool tolua_ret = (bool) self->isBackgroundMusicPlaying();
  430. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  431. }
  432. }
  433. return 1;
  434. #ifndef TOLUA_RELEASE
  435. tolua_lerror:
  436. tolua_error(tolua_S,"#ferror in function 'isBackgroundMusicPlaying'.",&tolua_err);
  437. return 0;
  438. #endif
  439. }
  440. #endif //#ifndef TOLUA_DISABLE
  441. /* method: getBackgroundMusicVolume of class CocosDenshion::SimpleAudioEngine */
  442. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_getBackgroundMusicVolume00
  443. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_getBackgroundMusicVolume00(lua_State* tolua_S)
  444. {
  445. #ifndef TOLUA_RELEASE
  446. tolua_Error tolua_err;
  447. if (
  448. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  449. !tolua_isnoobj(tolua_S,2,&tolua_err)
  450. )
  451. goto tolua_lerror;
  452. else
  453. #endif
  454. {
  455. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  456. #ifndef TOLUA_RELEASE
  457. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getBackgroundMusicVolume'",NULL);
  458. #endif
  459. {
  460. float tolua_ret = (float) self->getBackgroundMusicVolume();
  461. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  462. }
  463. }
  464. return 1;
  465. #ifndef TOLUA_RELEASE
  466. tolua_lerror:
  467. tolua_error(tolua_S,"#ferror in function 'getBackgroundMusicVolume'.",&tolua_err);
  468. return 0;
  469. #endif
  470. }
  471. #endif //#ifndef TOLUA_DISABLE
  472. /* method: setBackgroundMusicVolume of class CocosDenshion::SimpleAudioEngine */
  473. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_setBackgroundMusicVolume00
  474. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_setBackgroundMusicVolume00(lua_State* tolua_S)
  475. {
  476. #ifndef TOLUA_RELEASE
  477. tolua_Error tolua_err;
  478. if (
  479. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  480. !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
  481. !tolua_isnoobj(tolua_S,3,&tolua_err)
  482. )
  483. goto tolua_lerror;
  484. else
  485. #endif
  486. {
  487. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  488. float volume = ((float) tolua_tonumber(tolua_S,2,0));
  489. #ifndef TOLUA_RELEASE
  490. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setBackgroundMusicVolume'",NULL);
  491. #endif
  492. {
  493. self->setBackgroundMusicVolume(volume);
  494. }
  495. }
  496. return 0;
  497. #ifndef TOLUA_RELEASE
  498. tolua_lerror:
  499. tolua_error(tolua_S,"#ferror in function 'setBackgroundMusicVolume'.",&tolua_err);
  500. return 0;
  501. #endif
  502. }
  503. #endif //#ifndef TOLUA_DISABLE
  504. /* method: getEffectsVolume of class CocosDenshion::SimpleAudioEngine */
  505. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_getEffectsVolume00
  506. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_getEffectsVolume00(lua_State* tolua_S)
  507. {
  508. #ifndef TOLUA_RELEASE
  509. tolua_Error tolua_err;
  510. if (
  511. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  512. !tolua_isnoobj(tolua_S,2,&tolua_err)
  513. )
  514. goto tolua_lerror;
  515. else
  516. #endif
  517. {
  518. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  519. #ifndef TOLUA_RELEASE
  520. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getEffectsVolume'",NULL);
  521. #endif
  522. {
  523. float tolua_ret = (float) self->getEffectsVolume();
  524. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  525. }
  526. }
  527. return 1;
  528. #ifndef TOLUA_RELEASE
  529. tolua_lerror:
  530. tolua_error(tolua_S,"#ferror in function 'getEffectsVolume'.",&tolua_err);
  531. return 0;
  532. #endif
  533. }
  534. #endif //#ifndef TOLUA_DISABLE
  535. /* method: setEffectsVolume of class CocosDenshion::SimpleAudioEngine */
  536. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_setEffectsVolume00
  537. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_setEffectsVolume00(lua_State* tolua_S)
  538. {
  539. #ifndef TOLUA_RELEASE
  540. tolua_Error tolua_err;
  541. if (
  542. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  543. !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
  544. !tolua_isnoobj(tolua_S,3,&tolua_err)
  545. )
  546. goto tolua_lerror;
  547. else
  548. #endif
  549. {
  550. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  551. float volume = ((float) tolua_tonumber(tolua_S,2,0));
  552. #ifndef TOLUA_RELEASE
  553. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setEffectsVolume'",NULL);
  554. #endif
  555. {
  556. self->setEffectsVolume(volume);
  557. }
  558. }
  559. return 0;
  560. #ifndef TOLUA_RELEASE
  561. tolua_lerror:
  562. tolua_error(tolua_S,"#ferror in function 'setEffectsVolume'.",&tolua_err);
  563. return 0;
  564. #endif
  565. }
  566. #endif //#ifndef TOLUA_DISABLE
  567. /* method: playEffect of class CocosDenshion::SimpleAudioEngine */
  568. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_playEffect00
  569. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_playEffect00(lua_State* tolua_S)
  570. {
  571. #ifndef TOLUA_RELEASE
  572. tolua_Error tolua_err;
  573. if (
  574. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  575. !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  576. !tolua_isboolean(tolua_S,3,1,&tolua_err) ||
  577. !tolua_isnoobj(tolua_S,4,&tolua_err)
  578. )
  579. goto tolua_lerror;
  580. else
  581. #endif
  582. {
  583. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  584. const char* pszFilePath = ((const char*) tolua_tostring(tolua_S,2,0));
  585. bool bLoop = ((bool) tolua_toboolean(tolua_S,3,false));
  586. #ifndef TOLUA_RELEASE
  587. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'playEffect'",NULL);
  588. #endif
  589. {
  590. unsigned int tolua_ret = (unsigned int) self->playEffect(pszFilePath,bLoop);
  591. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  592. }
  593. }
  594. return 1;
  595. #ifndef TOLUA_RELEASE
  596. tolua_lerror:
  597. tolua_error(tolua_S,"#ferror in function 'playEffect'.",&tolua_err);
  598. return 0;
  599. #endif
  600. }
  601. #endif //#ifndef TOLUA_DISABLE
  602. /* method: stopEffect of class CocosDenshion::SimpleAudioEngine */
  603. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_stopEffect00
  604. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_stopEffect00(lua_State* tolua_S)
  605. {
  606. #ifndef TOLUA_RELEASE
  607. tolua_Error tolua_err;
  608. if (
  609. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  610. !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
  611. !tolua_isnoobj(tolua_S,3,&tolua_err)
  612. )
  613. goto tolua_lerror;
  614. else
  615. #endif
  616. {
  617. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  618. unsigned int nSoundId = ((unsigned int) tolua_tonumber(tolua_S,2,0));
  619. #ifndef TOLUA_RELEASE
  620. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'stopEffect'",NULL);
  621. #endif
  622. {
  623. self->stopEffect(nSoundId);
  624. }
  625. }
  626. return 0;
  627. #ifndef TOLUA_RELEASE
  628. tolua_lerror:
  629. tolua_error(tolua_S,"#ferror in function 'stopEffect'.",&tolua_err);
  630. return 0;
  631. #endif
  632. }
  633. #endif //#ifndef TOLUA_DISABLE
  634. /* method: preloadEffect of class CocosDenshion::SimpleAudioEngine */
  635. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_preloadEffect00
  636. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_preloadEffect00(lua_State* tolua_S)
  637. {
  638. #ifndef TOLUA_RELEASE
  639. tolua_Error tolua_err;
  640. if (
  641. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  642. !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  643. !tolua_isnoobj(tolua_S,3,&tolua_err)
  644. )
  645. goto tolua_lerror;
  646. else
  647. #endif
  648. {
  649. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  650. const char* pszFilePath = ((const char*) tolua_tostring(tolua_S,2,0));
  651. #ifndef TOLUA_RELEASE
  652. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'preloadEffect'",NULL);
  653. #endif
  654. {
  655. self->preloadEffect(pszFilePath);
  656. }
  657. }
  658. return 0;
  659. #ifndef TOLUA_RELEASE
  660. tolua_lerror:
  661. tolua_error(tolua_S,"#ferror in function 'preloadEffect'.",&tolua_err);
  662. return 0;
  663. #endif
  664. }
  665. #endif //#ifndef TOLUA_DISABLE
  666. /* method: unloadEffect of class CocosDenshion::SimpleAudioEngine */
  667. #ifndef TOLUA_DISABLE_tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_unloadEffect00
  668. static int tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_unloadEffect00(lua_State* tolua_S)
  669. {
  670. #ifndef TOLUA_RELEASE
  671. tolua_Error tolua_err;
  672. if (
  673. !tolua_isusertype(tolua_S,1,"CocosDenshion::SimpleAudioEngine",0,&tolua_err) ||
  674. !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  675. !tolua_isnoobj(tolua_S,3,&tolua_err)
  676. )
  677. goto tolua_lerror;
  678. else
  679. #endif
  680. {
  681. CocosDenshion::SimpleAudioEngine* self = (CocosDenshion::SimpleAudioEngine*) tolua_tousertype(tolua_S,1,0);
  682. const char* pszFilePath = ((const char*) tolua_tostring(tolua_S,2,0));
  683. #ifndef TOLUA_RELEASE
  684. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'unloadEffect'",NULL);
  685. #endif
  686. {
  687. self->unloadEffect(pszFilePath);
  688. }
  689. }
  690. return 0;
  691. #ifndef TOLUA_RELEASE
  692. tolua_lerror:
  693. tolua_error(tolua_S,"#ferror in function 'unloadEffect'.",&tolua_err);
  694. return 0;
  695. #endif
  696. }
  697. #endif //#ifndef TOLUA_DISABLE
  698. /* Open function */
  699. TOLUA_API int tolua_SimpleAudioEngine_open (lua_State* tolua_S)
  700. {
  701. tolua_open(tolua_S);
  702. tolua_reg_types(tolua_S);
  703. tolua_module(tolua_S,NULL,0);
  704. tolua_beginmodule(tolua_S,NULL);
  705. tolua_module(tolua_S,"CocosDenshion",0);
  706. tolua_beginmodule(tolua_S,"CocosDenshion");
  707. #ifdef __cplusplus
  708. tolua_cclass(tolua_S,"SimpleAudioEngine","CocosDenshion::SimpleAudioEngine","",tolua_collect_CocosDenshion__SimpleAudioEngine);
  709. #else
  710. tolua_cclass(tolua_S,"SimpleAudioEngine","CocosDenshion::SimpleAudioEngine","",NULL);
  711. #endif
  712. tolua_beginmodule(tolua_S,"SimpleAudioEngine");
  713. tolua_function(tolua_S,"new",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_new00);
  714. tolua_function(tolua_S,"new_local",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_new00_local);
  715. tolua_function(tolua_S,".call",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_new00_local);
  716. tolua_function(tolua_S,"delete",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_delete00);
  717. tolua_function(tolua_S,"sharedEngine",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_sharedEngine00);
  718. tolua_function(tolua_S,"end",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_end00);
  719. tolua_function(tolua_S,"setResource",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_setResource00);
  720. tolua_function(tolua_S,"preloadBackgroundMusic",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_preloadBackgroundMusic00);
  721. tolua_function(tolua_S,"playBackgroundMusic",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_playBackgroundMusic00);
  722. tolua_function(tolua_S,"stopBackgroundMusic",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_stopBackgroundMusic00);
  723. tolua_function(tolua_S,"pauseBackgroundMusic",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_pauseBackgroundMusic00);
  724. tolua_function(tolua_S,"resumeBackgroundMusic",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_resumeBackgroundMusic00);
  725. tolua_function(tolua_S,"rewindBackgroundMusic",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_rewindBackgroundMusic00);
  726. tolua_function(tolua_S,"willPlayBackgroundMusic",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_willPlayBackgroundMusic00);
  727. tolua_function(tolua_S,"isBackgroundMusicPlaying",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_isBackgroundMusicPlaying00);
  728. tolua_function(tolua_S,"getBackgroundMusicVolume",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_getBackgroundMusicVolume00);
  729. tolua_function(tolua_S,"setBackgroundMusicVolume",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_setBackgroundMusicVolume00);
  730. tolua_function(tolua_S,"getEffectsVolume",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_getEffectsVolume00);
  731. tolua_function(tolua_S,"setEffectsVolume",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_setEffectsVolume00);
  732. tolua_function(tolua_S,"playEffect",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_playEffect00);
  733. tolua_function(tolua_S,"stopEffect",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_stopEffect00);
  734. tolua_function(tolua_S,"preloadEffect",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_preloadEffect00);
  735. tolua_function(tolua_S,"unloadEffect",tolua_SimpleAudioEngine_CocosDenshion_SimpleAudioEngine_unloadEffect00);
  736. tolua_endmodule(tolua_S);
  737. tolua_endmodule(tolua_S);
  738. tolua_endmodule(tolua_S);
  739. return 1;
  740. }
  741. #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
  742. TOLUA_API int luaopen_SimpleAudioEngine (lua_State* tolua_S) {
  743. return tolua_SimpleAudioEngine_open(tolua_S);
  744. };
  745. #endif