OSDN Git Service

Do not close the application in shutdownComputer(), if hibernation was requested.
[x264-launcher/x264-launcher.git] / src / ipc.h
index 7f9fef1..d03ec04 100644 (file)
--- a/src/ipc.h
+++ b/src/ipc.h
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Simple x264 Launcher
-// Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2020 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 
 #pragma once
 
-#include <QThread>
-#include <QMutex>
-
-class QSharedMemory;
-class QStringList;
-class QSystemSemaphore;
-
-class IPCCore;
-class IPCReceiveThread;
-class IPCSendThread;
-
 //IPC Commands
-static const int IPC_OPCODE_PING     = 0;
-static const int IPC_OPCODE_ADD_FILE = 1;
-static const int IPC_OPCODE_ADD_JOB  = 2;
-static const int IPC_OPCODE_MAX      = 3;
-
-///////////////////////////////////////////////////////////////////////////////
-// IPC Handler Class
-///////////////////////////////////////////////////////////////////////////////
-
-class IPC : public QObject
-{
-       Q_OBJECT
-
-public:
-       IPC(void);
-       ~IPC(void);
-
-       bool initialize(bool &firstInstance);
-       bool sendAsync(const int &command, const QStringList &args);
-       bool isInitialized(void);
-       bool isListening(void);
-
-public slots:
-       bool startListening(void);
-       bool stopListening(void);
-
-signals:
-       void receivedCommand(const int &command, const QStringList &args);
-
-protected:
-       IPCCore *m_ipcCore;
-       IPCReceiveThread *m_recvThread;
-       QMutex m_mutex;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Utility Classes
-///////////////////////////////////////////////////////////////////////////////
-
-class IPCSendThread : public QThread
-{
-       Q_OBJECT
-       friend class IPC;
-
-protected:
-       IPCSendThread(IPCCore *ipc, const int &command, const QStringList &args);
-       IPCSendThread::~IPCSendThread(void);
-
-       inline bool result(void) { return m_result; }
-       virtual void run(void);
-
-private:
-       volatile bool m_result;
-       IPCCore *const m_ipc;
-       const int m_command;
-       const QStringList *m_args;
-};
-
-class IPCReceiveThread : public QThread
-{
-       Q_OBJECT
-       friend class IPC;
-
-protected:
-       IPCReceiveThread(IPCCore *ipc);
-
-       inline void stop(void) { m_stopped = true; }
-       virtual void run(void);
-
-signals:
-       void receivedCommand(const int &command, const QStringList &args);
-
-private:
-       void receiveLoop(void);
-       volatile bool m_stopped;
-       IPCCore *const m_ipc;
-};
+static const quint32 IPC_OPCODE_NOOP     = 0;
+static const quint32 IPC_OPCODE_PING     = 1;
+static const quint32 IPC_OPCODE_ADD_FILE = 2;
+static const quint32 IPC_OPCODE_ADD_JOB  = 3;
+static const quint32 IPC_OPCODE_MAX      = 4;
+
+//IPC Flags
+static const quint32 IPC_FLAG_FORCE_START   = 0x00000001;
+static const quint32 IPC_FLAG_FORCE_ENQUEUE = 0x00000002;