wa2core.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #ifndef __GENFF_CORE_H
  2. #define __GENFF_CORE_H
  3. #include <bfc/string/StringW.h>
  4. //#include "../studio/bfc/timerclient.h"
  5. #include <api/core/buttons.h>
  6. #include <api/syscb/callbacks/corecbi.h>
  7. #include <api/core/api_core.h>
  8. namespace Agave
  9. {
  10. #include "../Agave/Config/api_config.h"
  11. }
  12. #define STATUS_UNKNOWN -1
  13. #define STATUS_STOP 0
  14. #define STATUS_PLAY 1
  15. #define STATUS_PAUSE 2
  16. class Core : public api_coreI//, public CoreCallbackI
  17. { //, public TimerClientDI {
  18. public:
  19. Core();
  20. virtual ~Core();
  21. void gotCallback(int wParam, int forcecb = 0);
  22. void addCallback(CoreCallback *cb);
  23. void delCallback(CoreCallback *cb);
  24. // virtual void timerclient_timerCallback(int id);
  25. int getStatus();
  26. void userButton(int button);
  27. void setVolume(int vol);
  28. int getVolume();
  29. void setPosition(int ms);
  30. int getPosition();
  31. int getLength();
  32. void setPanning(int p);
  33. int getPanning();
  34. void setShuffle(int shuffle);
  35. int getShuffle();
  36. void setRepeat(int repeat);
  37. int getRepeat();
  38. int getSamplerate(int wa2_getinfo);
  39. int getBitrate(int wa2_getinfo);
  40. int getChannels(int wa2_getinfo);
  41. int getEqBand(int band);
  42. void setEqBand(int band, int val);
  43. int getEQStatus();
  44. void setEQStatus(int enable);
  45. int getEQAuto();
  46. void setEQAuto(int enable);
  47. int getEQPreamp();
  48. void setEQPreamp(int enable);
  49. const wchar_t *getTitle();
  50. void setTitle(const wchar_t * new_title);
  51. const wchar_t *getPlaystring();
  52. int getCurPlaylistEntry();
  53. static const wchar_t *getSongInfoText();
  54. static const wchar_t *getSongInfoTextTranslated();
  55. // api_core ------------------------------------------------------------------------
  56. virtual const wchar_t *core_getSupportedExtensions();
  57. virtual const wchar_t *core_getExtSupportedExtensions();
  58. virtual CoreToken core_create();
  59. virtual int core_free(CoreToken core);
  60. virtual int core_setNextFile(CoreToken core, const wchar_t *playstring);
  61. virtual int core_getStatus(CoreToken core);
  62. virtual const wchar_t *core_getCurrent(CoreToken core);
  63. virtual int core_getCurPlaybackNumber(CoreToken core);
  64. virtual int core_getPosition(CoreToken core);
  65. virtual int core_getWritePosition(CoreToken core);
  66. virtual int core_setPosition(CoreToken core, int ms);
  67. virtual int core_getLength(CoreToken core);
  68. virtual int core_getPluginData(const wchar_t *playstring, const wchar_t *name, wchar_t *data, int data_len, int data_type = 0);
  69. virtual unsigned int core_getVolume(CoreToken core);
  70. virtual void core_setVolume(CoreToken core, unsigned int vol);
  71. virtual int core_getPan(CoreToken core);
  72. virtual void core_setPan(CoreToken core, int val);
  73. virtual void core_addCallback(CoreToken core, CoreCallback *cb);
  74. virtual void core_delCallback(CoreToken core, CoreCallback *cb);
  75. virtual int core_getVisData(CoreToken core, void *dataptr, int sizedataptr);
  76. virtual int core_getLeftVuMeter(CoreToken core);
  77. virtual int core_getRightVuMeter(CoreToken core);
  78. virtual int core_registerSequencer(CoreToken core, ItemSequencer *seq);
  79. virtual int core_deregisterSequencer(CoreToken core, ItemSequencer *seq);
  80. virtual void core_userButton(CoreToken core, int button);
  81. virtual int core_getEqStatus(CoreToken core);
  82. virtual void core_setEqStatus(CoreToken core, int enable);
  83. virtual int core_getEqPreamp(CoreToken core);
  84. virtual void core_setEqPreamp(CoreToken core, int pre);
  85. virtual int core_getEqBand(CoreToken core, int band);
  86. virtual void core_setEqBand(CoreToken core, int band, int val);
  87. virtual int core_getEqAuto(CoreToken core);
  88. virtual void core_setEqAuto(CoreToken core, int enable);
  89. virtual void core_setCustomMsg(CoreToken core, const wchar_t *text);
  90. virtual void core_registerExtension(const wchar_t *extensions, const wchar_t *extension_name, const wchar_t *family = NULL);
  91. virtual const wchar_t *core_getExtensionFamily(const wchar_t *extension);
  92. virtual void core_unregisterExtension(const wchar_t *extensions);
  93. virtual const wchar_t *core_getTitle(CoreToken core);
  94. virtual void core_setTitle(const wchar_t *new_title);
  95. const wchar_t *core_getDecoderName(const wchar_t *Filename);
  96. virtual int core_getRating();
  97. virtual void core_setRating(int newRating);
  98. private:
  99. void sendCoreCallback(int message, int param1 = 0, int param2 = 0);
  100. StringW m_lasttitle;
  101. StringW m_playstring, m_lastfile;
  102. int m_laststatus;
  103. int m_lastpos;
  104. int m_lastvol;
  105. int m_lastpan;
  106. int m_lasteqband[10];
  107. int m_lastfreqband;
  108. int m_lasteq;
  109. int m_lasteqauto;
  110. int m_lasteqpreamp;
  111. int m_lastchan;
  112. int m_lastbitrate;
  113. int m_lastsamplerate;
  114. int m_lastpeentry;
  115. PtrList<CoreCallback> callbacks;
  116. ReentryFilterObject rf;
  117. Agave::api_config *config;
  118. };
  119. extern Core *g_Core;
  120. #endif