1
0

ScriptObjectService.cpp 1007 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "ScriptObjectService.h"
  2. #include <api/script/objects/rootobjcontroller.h>
  3. #include "SPlaylist.h"
  4. #include "SPlaylists.h"
  5. #include "SPlaylistsEnumerator.h"
  6. #include "SPlaylistManager.h"
  7. ScriptObjectController *script_root=0;
  8. PlaylistScriptController playlistController;
  9. PlaylistsScriptController playlistsController;
  10. PlaylistsEnumeratorScriptController playlistsEnumeratorController;
  11. PlaylistManagerScriptController playlistManagerController;
  12. ScriptObjectController *ScriptObjectService::getController(int n)
  13. {
  14. switch (n)
  15. {
  16. case 0:
  17. return &playlistController;
  18. case 1:
  19. return &playlistsController;
  20. case 2:
  21. return &playlistsEnumeratorController;
  22. case 3:
  23. return &playlistManagerController;
  24. }
  25. return 0;
  26. }
  27. void ScriptObjectService::onRegisterClasses(ScriptObjectController *rootController)
  28. {
  29. script_root = rootController;
  30. }
  31. #define CBCLASS ScriptObjectService
  32. START_DISPATCH;
  33. CB(GETCONTROLLER, getController);
  34. VCB(ONREGISTER, onRegisterClasses);
  35. END_DISPATCH;
  36. #undef CBCLASS