mirror of
https://github.com/gtalent/sc9k.git
synced 2025-01-23 00:33:36 -06:00
Upgrade OpenLPClient to target OpenLP 3
This commit is contained in:
parent
f4e0b5ab9f
commit
a0a1cd8af1
@ -6,6 +6,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <QHttpPart>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
@ -37,19 +38,19 @@ QString OpenLPClient::getNextSong() {
|
||||
}
|
||||
|
||||
void OpenLPClient::nextSlide() {
|
||||
get("/api/controller/live/next");
|
||||
post("/api/v2/controller/progress", R"({"action":"next"})");
|
||||
}
|
||||
|
||||
void OpenLPClient::prevSlide() {
|
||||
get("/api/controller/live/previous");
|
||||
post("/api/v2/controller/progress", R"({"action":"previous"})");
|
||||
}
|
||||
|
||||
void OpenLPClient::nextSong() {
|
||||
get("/api/service/next");
|
||||
post("/api/v2/service/progress", R"({"action":"next"})");
|
||||
}
|
||||
|
||||
void OpenLPClient::prevSong() {
|
||||
get("/api/service/previous");
|
||||
post("/api/v2/service/progress", R"({"action":"previous"})");
|
||||
}
|
||||
|
||||
void OpenLPClient::blankScreen() {
|
||||
@ -91,6 +92,12 @@ void OpenLPClient::get(QString const&urlExt) {
|
||||
m_nam->get(rqst);
|
||||
}
|
||||
|
||||
void OpenLPClient::post(QString const&url, QString const&data) {
|
||||
QNetworkRequest rqst(QUrl(m_baseUrl + url));
|
||||
rqst.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
m_nam->post(rqst, data.toUtf8());
|
||||
}
|
||||
|
||||
void OpenLPClient::requestSongList() {
|
||||
QUrl url(m_baseUrl + "/api/service/list?_=1626628079579");
|
||||
QNetworkRequest rqst(url);
|
||||
|
@ -60,6 +60,8 @@ class OpenLPClient: public QObject {
|
||||
private:
|
||||
void get(QString const&url);
|
||||
|
||||
void post(QString const&url, QString const&data);
|
||||
|
||||
void requestSongList();
|
||||
|
||||
void requestSlideList();
|
||||
|
Loading…
Reference in New Issue
Block a user