123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- #ifndef NULLSOFT_API_QUEUE_H
- #define NULLSOFT_API_QUEUE_H
- #if (_MSC_VER <= 1200)
- typedef int intptr_t;
- #endif
- enum PLAYLIST_TYPE {M3U_PLAYLIST=0x0, PLS_PLAYLIST=0x1, M3U8_PLAYLIST=0x2};
- enum MOVE_MODE {MOVE_TOP_OF_LIST=-2, MOVE_UP_LIST=-1, MOVE_DOWN_LIST=1, MOVE_END_OF_LIST=2, MOVE_END_TO_START=3 };
- #ifdef __cplusplus
- #include <bfc/dispatch.h>
- class api_queue : public Dispatchable
- {
- protected:
- api_queue() {}
- ~api_queue() {}
- public:
-
- BOOL AddItemToQueue(int item, int update_now, wchar_t* file);
- void RemoveQueuedItem(int item, int no_update=0);
- void ClearQueue(void);
-
- int GetNumberOfQueuedItems(void);
- int GetQueuedItemFromIndex(int idx);
- wchar_t* GetQueuedItemFilePath(int item);
- int GetQueuedItemPlaylistPosition(int item);
- int IsItemQueuedMultipleTimes(int item, int test_only);
-
-
-
-
- void RandomiseQueue(void);
-
- void RefreshQueue(void);
- BOOL LoadPlaylistIntoQueue(wchar_t* playlist_file, int reset_queue);
- BOOL SaveQueueToPlaylist(wchar_t* playlist_file, int playlist_type);
-
- int EnableQueueAdvance(int enabled);
- int IsQueueAdvanceEnabled(void);
- public:
- DISPATCH_CODES
- {
- API_QUEUE_ADDITEMTOQUEUE = 1,
- API_QUEUE_REMOVEQUEUEDITEM = 2,
- API_QUEUE_CLEARQUEUE = 3,
- API_QUEUE_GETNUMBEROFQUEUEDITEMS = 10,
- API_QUEUE_GETQUEUEDITEMFROMINDEX = 11,
- API_QUEUE_GETQUEUEDITEMFILEPATH = 12,
- API_QUEUE_GETQUEUEDITEMPLAYLISTPOSITION = 13,
- API_QUEUE_ISITEMQUEUEDMULTIPLETIMES = 14,
-
-
-
- API_QUEUE_RANDOMISEQUEUE = 20,
- API_QUEUE_REFRESHQUEUE = 21,
- API_QUEUE_LOADPLAYLISTINTOQUEUE = 22,
- API_QUEUE_SAVEQUEUETOPLAYLIST = 23,
- API_QUEUE_ENABLEQUEUEADVANCE = 30,
- API_QUEUE_ISQUEUEADVANCEENABLED = 31
- };
- };
- inline BOOL api_queue::AddItemToQueue(int item, int update_now, wchar_t* file)
- {
- return _call(API_QUEUE_ADDITEMTOQUEUE, (BOOL)0, item, update_now, file);
- }
- inline void api_queue::RemoveQueuedItem(int item, int no_update)
- {
- _voidcall(API_QUEUE_REMOVEQUEUEDITEM, item, no_update);
- }
- inline void api_queue::ClearQueue(void)
- {
- _voidcall(API_QUEUE_CLEARQUEUE);
- }
- inline int api_queue::GetNumberOfQueuedItems(void)
- {
- return _call(API_QUEUE_GETNUMBEROFQUEUEDITEMS, (int)0);
- }
- inline int api_queue::GetQueuedItemFromIndex(int idx)
- {
- return _call(API_QUEUE_GETQUEUEDITEMFROMINDEX, (int)0, idx);
- }
- inline wchar_t* api_queue::GetQueuedItemFilePath(int item)
- {
- return _call(API_QUEUE_GETQUEUEDITEMFILEPATH, (wchar_t*)0, item);
- }
- inline int api_queue::GetQueuedItemPlaylistPosition(int item)
- {
- return _call(API_QUEUE_GETQUEUEDITEMPLAYLISTPOSITION, (int)0, item);
- }
- inline int api_queue::IsItemQueuedMultipleTimes(int item, int test_only)
- {
- return _call(API_QUEUE_ISITEMQUEUEDMULTIPLETIMES, (int)0, item, test_only);
- }
- inline void api_queue::RandomiseQueue(void)
- {
- _voidcall(API_QUEUE_RANDOMISEQUEUE);
- }
- inline void api_queue::RefreshQueue(void)
- {
- _voidcall(API_QUEUE_REFRESHQUEUE);
- }
- inline int api_queue::LoadPlaylistIntoQueue(wchar_t* playlist_file, int reset_queue)
- {
- return _call(API_QUEUE_LOADPLAYLISTINTOQUEUE, (int)0, playlist_file, reset_queue);
- }
- inline int api_queue::SaveQueueToPlaylist(wchar_t* playlist_file, int playlist_type)
- {
- return _call(API_QUEUE_SAVEQUEUETOPLAYLIST, (int)0, playlist_file, playlist_type);
- }
- inline int api_queue::EnableQueueAdvance(int enabled)
- {
- return _call(API_QUEUE_ENABLEQUEUEADVANCE, (int)0, enabled);
- }
- inline int api_queue::IsQueueAdvanceEnabled(void)
- {
- return _call(API_QUEUE_ISQUEUEADVANCEENABLED, (int)0);
- }
- #endif
- static const GUID QueueManagerApiGUID =
- { 0x7dc8c14f, 0xf27f, 0x48e8, { 0xa3, 0xd1, 0x60, 0x2b, 0xb3, 0x19, 0x6e, 0x40 } };
- #endif
|