This commit is contained in:
2023-12-28 01:32:04 +09:00
parent 52c4bdf3d4
commit 5f08bc4c09
12 changed files with 129 additions and 28 deletions

View File

@@ -16,6 +16,17 @@ void BumbleCeepp::enqueue(struct FQueueElement Element) {
QueueMutex.unlock();
}
struct FQueueElement BumbleCeepp::QueueDelete(int Index) {
QueueMutex.lock();
auto iter = MusicQueue.begin();
std::advance(iter, Index);
auto ReturnValue = *iter;
MusicQueue.erase(iter);
QueueMutex.unlock();
return ReturnValue;
}
void BumbleCeepp::QueuePlay(){
if (QueuePlaying) {
return;
@@ -33,11 +44,6 @@ void BumbleCeepp::QueuePlay(){
FQueueElement Music = MusicQueue.front();
QueueMutex.unlock();
std::cout << "Queue:\n";
for (auto iter = MusicQueue.begin(); iter != MusicQueue.end(); iter++) {
std::cout << iter->title << "\n";
}
dpp::voiceconn* v = JoinedShared->get_voice(Music.guild_id);
if (!v || !v->voiceclient || !v->voiceclient->is_ready()) {
return;
@@ -95,6 +101,10 @@ void BumbleCeepp::QueuePlay(){
while(v->voiceclient->is_playing()) {}
QueueMutex.lock();
if (MusicQueue.empty()) {
QueueMutex.unlock();
break;
}
MusicQueue.pop_front();
QueueMutex.unlock();