FoofyFox Sandstorm 2
General-purpose Discord bot in C++
SSMsgVoice.h
Go to the documentation of this file.
1#ifndef SSMSGVOICE_H_
2#define SSMSGVOICE_H_
3
10#include "SSGlobals.h"
11
12namespace ffss {
14private:
15 std::set<dpp::snowflake> guilds;
16
17 inline bool _connection(dpp::voiceconn* vc_state, const dpp::message_create_t &ev);
18 inline bool _user_connected(
19 decltype(dpp::guild::voice_members)::iterator user_vc,
20 dpp::guild *g,
21 const dpp::message_create_t &ev);
22
23 struct _VoiceThread {
24 decltype(guilds) &gs;
25 dpp::snowflake guild_id;
26 dpp::cluster &bot;
27 dpp::voiceconn *vc_state;
28 void operator()();
29 _VoiceThread(decltype(gs) gs, decltype(guild_id) guild_id, decltype(bot) bot, decltype(vc_state) vc_state);
30 };
31public:
32
40 void connect(dpp::cluster &bot, const dpp::message_create_t &ev);
41
50 void disconnect(dpp::cluster &bot, const dpp::message_create_t &ev);
51 // pass by value because of thread
63 void play(dpp::cluster &bot, const dpp::message_create_t ev,
64 const std::string &pcm_name, const std::string &pcm_data);
65
73 size_t get_tracks_remaining(const dpp::message_create_t &ev);
74
82 void skip(const dpp::message_create_t &ev);
83
91 void stop(const dpp::message_create_t &ev);
92
100 void pause(const dpp::message_create_t &ev);
101
109 void resume(const dpp::message_create_t &ev);
110};
111}
112
113#endif /* SSMSGVOICE_H_ */
Global declarations for Sandstorm.
Definition: SSMsgVoice.h:13
void resume(const dpp::message_create_t &ev)
Resume the track queue.
Definition: SSMsgVoice.cpp:148
size_t get_tracks_remaining(const dpp::message_create_t &ev)
Get the number of tracks remaining in the queue of the requesting user's server.
Definition: SSMsgVoice.cpp:77
void skip(const dpp::message_create_t &ev)
Skip to the next track.
Definition: SSMsgVoice.cpp:129
void pause(const dpp::message_create_t &ev)
Pause the track queue.
Definition: SSMsgVoice.cpp:141
void play(dpp::cluster &bot, const dpp::message_create_t ev, const std::string &pcm_name, const std::string &pcm_data)
Play a new track.
Definition: SSMsgVoice.cpp:87
void connect(dpp::cluster &bot, const dpp::message_create_t &ev)
Connects the bot to a voice channel that the user requesting is in.
Definition: SSMsgVoice.cpp:29
void disconnect(dpp::cluster &bot, const dpp::message_create_t &ev)
Disconnects the bot to a voice channel that the user requesting is in.
Definition: SSMsgVoice.cpp:66
void stop(const dpp::message_create_t &ev)
Clear the track queue.
Definition: SSMsgVoice.cpp:135
FoofyFox Sandstorm (ffss) namespace.
Definition: SSMsgHandler.cpp:3