Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
f0242a7ad4 | |||
d2b70a89d0 | |||
680d78e173 |
6 changed files with 55 additions and 25 deletions
BIN
BPM-Studio-Net-Client-16x16.ico
Normal file
BIN
BPM-Studio-Net-Client-16x16.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 318 B |
BIN
BPM-Studio-Net-Client-32x32.ico
Normal file
BIN
BPM-Studio-Net-Client-32x32.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 766 B |
|
@ -22,3 +22,8 @@ FORMS += \
|
|||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
RESOURCES += \
|
||||
BPM-Studio-Net-Client.qrc
|
||||
|
||||
RC_ICONS = BPM-Studio-Net-Client-32x32.ico
|
||||
|
|
6
BPM-Studio-Net-Client.qrc
Normal file
6
BPM-Studio-Net-Client.qrc
Normal file
|
@ -0,0 +1,6 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>BPM-Studio-Net-Client-16x16.ico</file>
|
||||
<file>BPM-Studio-Net-Client-32x32.ico</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -7,18 +7,23 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->setInterval(1000);
|
||||
timer = new QTimer(this);
|
||||
timer->setInterval(5000);
|
||||
connect(timer,&QTimer::timeout,this,&MainWindow::holen_status);
|
||||
timer->start();
|
||||
|
||||
manager = new QNetworkAccessManager();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete timer;
|
||||
delete manager;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::holen_status(){
|
||||
status_loop="ja";
|
||||
//Autoplay
|
||||
befehl=befehl_getauto;
|
||||
sende_befehl();
|
||||
|
@ -55,12 +60,12 @@ void MainWindow::holen_status(){
|
|||
befehl=befehl_file;
|
||||
sende_befehl();
|
||||
ui->lineEdit_titel->setText((status.split("<br>")[0]));
|
||||
status_loop="nein";
|
||||
}
|
||||
|
||||
bool MainWindow::sende_befehl(){
|
||||
ausgabe=url + befehl;
|
||||
|
||||
manager = new QNetworkAccessManager(this);
|
||||
QNetworkRequest request(ausgabe);
|
||||
QNetworkReply *reply = manager->get(request);
|
||||
QEventLoop event_loop;
|
||||
|
@ -80,31 +85,45 @@ bool MainWindow::sende_befehl(){
|
|||
}
|
||||
|
||||
void MainWindow::on_pushButton_pause_clicked(){
|
||||
if(status_player1=="play"){
|
||||
befehl=befehl_pause1;
|
||||
sende_befehl();
|
||||
|
||||
}else if(status_player2=="play"){
|
||||
befehl=befehl_pause2;
|
||||
sende_befehl();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_play_clicked(){
|
||||
if(!(status_player1=="play") || !(status_player2=="play")){
|
||||
if(status_player1=="aus" || status_player1=="pause"){
|
||||
befehl=befehl_play1;
|
||||
if(status_auto=="an"){
|
||||
while(status_loop=="ja")
|
||||
ui->statusbar->showMessage("~");
|
||||
if(status_player1=="play"){
|
||||
befehl=befehl_pause1;
|
||||
sende_befehl();
|
||||
}else if(status_player2=="aus" || status_player2=="pause"){
|
||||
befehl=befehl_play2;
|
||||
}else if(status_player2=="play"){
|
||||
befehl=befehl_pause2;
|
||||
sende_befehl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_fade_clicked(){
|
||||
if(status_player1=="play" || status_player2=="play"){
|
||||
befehl=befehl_fade;
|
||||
sende_befehl();
|
||||
void MainWindow::on_pushButton_play_clicked(){
|
||||
if(status_auto=="an"){
|
||||
while(status_loop=="ja")
|
||||
ui->statusbar->showMessage("~");
|
||||
if(!(status_player1=="play") || !(status_player2=="play")){
|
||||
if(status_player1=="pause"){
|
||||
befehl=befehl_play1;
|
||||
sende_befehl();
|
||||
}else if(status_player2=="pause"){
|
||||
befehl=befehl_play2;
|
||||
sende_befehl();
|
||||
}else{
|
||||
befehl=befehl_play1;
|
||||
sende_befehl();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_fade_clicked(){
|
||||
if(status_auto=="an"){
|
||||
while(status_loop=="ja")
|
||||
ui->statusbar->showMessage("~");
|
||||
if(status_player1=="play" || status_player2=="play"){
|
||||
befehl=befehl_fade;
|
||||
sende_befehl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
#include <QtNetwork/QNetworkAccessManager>
|
||||
#include <QtNetwork/QNetworkRequest>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QPalette>
|
||||
#include <QTimer>
|
||||
#include <QThread>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
|
@ -33,12 +31,14 @@ private:
|
|||
|
||||
bool sende_befehl();
|
||||
|
||||
QTimer *timer;
|
||||
QNetworkAccessManager *manager;
|
||||
|
||||
QString ip="192.168.100.7";
|
||||
QString port="80";
|
||||
QString url="http://" + ip + ":" + port + "/";
|
||||
QString ausgabe;
|
||||
QString status_loop;
|
||||
QString status;
|
||||
QString status_player1;
|
||||
QString status_player2;
|
||||
|
|
Loading…
Add table
Reference in a new issue