1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version, but always including the *additional*
9 // restrictions defined in the "License.txt" file.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
23 #include "thread_ipc_recv.h"
31 #include <MUtils/Global.h>
32 #include <MUtils/IPCChannel.h>
33 #include <MUtils/OSSupport.h>
36 #include <QStringList>
37 #include <QApplication>
44 ////////////////////////////////////////////////////////////
45 // Constructor & Destructor
46 ////////////////////////////////////////////////////////////
48 IPCThread_Recv::IPCThread_Recv(MUtils::IPCChannel
*const ipcChannel
)
50 m_ipcChannel(ipcChannel
)
55 IPCThread_Recv::~IPCThread_Recv(void)
59 ////////////////////////////////////////////////////////////
61 ////////////////////////////////////////////////////////////
63 void IPCThread_Recv::run(void)
65 setTerminationEnabled(true);
66 AbstractThread::run();
69 int IPCThread_Recv::threadMain(void)
72 quint32 command
, flags
;
76 if(m_ipcChannel
->read(command
, flags
, params
))
78 if(command
!= IPC_OPCODE_NOOP
)
80 emit
receivedCommand(command
, params
, flags
);
85 qWarning("Failed to read next IPC message!");
93 ////////////////////////////////////////////////////////////
95 ////////////////////////////////////////////////////////////
97 void IPCThread_Recv::stop(void)
102 m_ipcChannel
->send(0, 0, QStringList());
106 ////////////////////////////////////////////////////////////
108 ////////////////////////////////////////////////////////////