mirror of
https://github.com/Goldenkrew3000/OSSP_OpenSource.git
synced 2025-12-20 00:34:44 +10:00
The app is technically functional
This commit is contained in:
35
src/player/playQueue.cpp
Normal file
35
src/player/playQueue.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#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();
|
||||
}
|
||||
Reference in New Issue
Block a user