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