mirror of
https://github.com/HappyTanuki/BumbleCee.git
synced 2025-10-26 09:55:14 +00:00
완성?
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user