openshot-audio  0.1.4
juce_ConnectedChildProcess.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_CONNECTEDCHILDPROCESS_H_INCLUDED
26 #define JUCE_CONNECTEDCHILDPROCESS_H_INCLUDED
27 
28 //==============================================================================
48 {
49 public:
54 
56  virtual ~ChildProcessSlave();
57 
74  bool initialiseFromCommandLine (const String& commandLine,
75  const String& commandLineUniqueID,
76  int timeoutMs = 0);
77 
78  //==============================================================================
84  virtual void handleMessageFromMaster (const MemoryBlock&) = 0;
85 
89  virtual void handleConnectionMade();
90 
96  virtual void handleConnectionLost();
97 
103  bool sendMessageToMaster (const MemoryBlock&);
104 
105 private:
106  struct Connection;
107  friend struct Connection;
109  ScopedPointer<Connection> connection;
110 
112 };
113 
114 //==============================================================================
133 {
134 public:
139 
141  virtual ~ChildProcessMaster();
142 
158  bool launchSlaveProcess (const File& executableToLaunch,
159  const String& commandLineUniqueID,
160  int timeoutMs = 0);
161 
165  virtual void handleMessageFromSlave (const MemoryBlock&) = 0;
166 
170  virtual void handleConnectionLost();
171 
177  bool sendMessageToSlave (const MemoryBlock&);
178 
179 private:
180  ChildProcess childProcess;
181 
182  struct Connection;
183  friend struct Connection;
185  ScopedPointer<Connection> connection;
186 
188 };
189 
190 
191 #endif // JUCE_CONNECTEDCHILDPROCESS_H_INCLUDED
Definition: juce_ConnectedChildProcess.cpp:84
Definition: juce_ChildProcess.h:40
Definition: juce_MemoryBlock.h:38
Definition: juce_String.h:43
Definition: juce_ConnectedChildProcess.cpp:173
Definition: juce_ConnectedChildProcess.h:47
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_ScopedPointer.h:70
Definition: juce_ConnectedChildProcess.h:132
Definition: juce_ContainerDeletePolicy.h:44
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_File.h:45