PlaylistScriptObject.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #ifndef NULLSOFT_GEN_FF_PLAYLISTSCRIPTOBJECT_H
  2. #define NULLSOFT_GEN_FF_PLAYLISTSCRIPTOBJECT_H
  3. #include "wa2frontend.h"
  4. class SPlaylist;
  5. #include <api/script/script.h>
  6. #include <api/script/objects/rootobj.h>
  7. #include <api/script/objects/rootobject.h>
  8. #include <api/script/objcontroller.h>
  9. #include <api/service/svcs/svc_scriptobji.h>
  10. // -----------------------------------------------------------------------------------------------------
  11. // ScriptObject Provider Service
  12. class PlaylistScriptObjectSvc : public svc_scriptObjectI {
  13. public:
  14. PlaylistScriptObjectSvc() {};
  15. virtual ~PlaylistScriptObjectSvc() {};
  16. static const char *getServiceName() { return "PlEdit maki object"; }
  17. virtual ScriptObjectController *getController(int n);
  18. };
  19. // -----------------------------------------------------------------------------------------------------
  20. // PlaylistScriptObject GUID
  21. // {345BEEBC-0229-4921-90BE-6CB6A49A79D9}
  22. static const GUID playlistScriptObjectGUID =
  23. { 0x345beebc, 0x229, 0x4921, { 0x90, 0xbe, 0x6c, 0xb6, 0xa4, 0x9a, 0x79, 0xd9 } };
  24. #define SPLAYLIST_SCRIPTPARENT RootObjectInstance
  25. // -----------------------------------------------------------------------------------------------------
  26. // ScriptObject Service
  27. class PlaylistScriptController : public ScriptObjectControllerI {
  28. public:
  29. virtual const wchar_t *getClassName() { return L"PlEdit"; }
  30. virtual const wchar_t *getAncestorClassName() { return L"Object"; }
  31. virtual ScriptObjectController *getAncestorController() { return rootScriptObjectController; }
  32. virtual int getNumFunctions();
  33. virtual const function_descriptor_struct *getExportedFunctions() { return exportedFunction; }
  34. virtual GUID getClassGuid() { return playlistScriptObjectGUID; }
  35. //virtual int getInstantiable() { return 0; }
  36. //virtual int getReferenceable() { return 0; }
  37. virtual ScriptObject *instantiate();
  38. virtual void destroy(ScriptObject *o);
  39. virtual void *encapsulate(ScriptObject *o);
  40. virtual void deencapsulate(void *o);
  41. private:
  42. static function_descriptor_struct exportedFunction[];
  43. };
  44. extern ScriptObjectController *playlistController;
  45. class SPlaylist : public SPLAYLIST_SCRIPTPARENT {
  46. public:
  47. SPlaylist();
  48. virtual ~SPlaylist();
  49. static PtrList < SPlaylist > SOList;
  50. static void onPleditModified();
  51. static void showEntry (int i);
  52. static void swap (int a, int b);
  53. static fileinfoW * getFileInfoStructW1 (int index);
  54. // Maki functions table
  55. static scriptVar script_vcpu_showCurrentlyPlayingEntry(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  56. static scriptVar script_vcpu_showEntry(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i);
  57. static scriptVar script_vcpu_getCurrentIndex(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  58. static scriptVar script_vcpu_getNumItems(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  59. static scriptVar script_vcpu_getTrackRating(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i);
  60. static scriptVar script_vcpu_setTrackRating(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i, scriptVar rating);
  61. static scriptVar script_vcpu_enqueueFile (SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar file);
  62. static scriptVar script_vcpu_clear(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  63. static scriptVar script_vcpu_removeTrack(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i);
  64. static scriptVar script_vcpu_swapTrack(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar track, scriptVar to);
  65. static scriptVar script_vcpu_moveUp(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar track);
  66. static scriptVar script_vcpu_moveDown(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar track);
  67. static scriptVar script_vcpu_moveTo(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar track, scriptVar to);
  68. static scriptVar script_vcpu_getTitle(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track);
  69. static scriptVar script_vcpu_getLength(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track);
  70. static scriptVar script_vcpu_getExtendedInfo(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track, scriptVar _name);
  71. static scriptVar script_vcpu_getNumSelectedItems(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  72. static scriptVar script_vcpu_getNextSelectedItem(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _num);
  73. static scriptVar script_vcpu_getFileName(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _num);
  74. static scriptVar script_vcpu_playTrack(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _num);
  75. static scriptVar script_vcpu_onPleditModified(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  76. private:
  77. static wchar_t staticStr[4096];
  78. };
  79. #endif