mirror of
https://github.com/Goldenkrew3000/OSSP_OpenSource.git
synced 2025-12-19 00:04:44 +10:00
36 lines
674 B
C++
36 lines
674 B
C++
#include <string.h>
|
|
#include <string>
|
|
#include <deque>
|
|
#include "playQueue.hpp"
|
|
|
|
#include <iostream> // debug
|
|
|
|
// NOTE: Acronym is OpenSubsonicPlayerQueue
|
|
|
|
std::deque<std::string> OSSPQ_Items;
|
|
|
|
int internal_OSSPQ_Init() {
|
|
//
|
|
}
|
|
|
|
int internal_OSSPQ_AppendToEnd(char* id) {
|
|
std::string cpp_id(id);
|
|
OSSPQ_Items.push_back(cpp_id);
|
|
return 0;
|
|
}
|
|
|
|
char* internal_OSSPQ_PopFromFront() {
|
|
if (OSSPQ_Items.empty()) {
|
|
// No items in play queue
|
|
return NULL;
|
|
}
|
|
|
|
char* id = strdup(OSSPQ_Items.front().c_str()); // Heap allocate id
|
|
OSSPQ_Items.pop_front();
|
|
return id;
|
|
}
|
|
|
|
int internal_OSSPQ_GetItemCount() {
|
|
return OSSPQ_Items.size();
|
|
}
|