move SystemExec to libpbd
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
#include "pbd/openuri.h"
|
||||
#include "pbd/file_utils.h"
|
||||
#include "pbd/localtime_r.h"
|
||||
#include "pbd/system_exec.h"
|
||||
|
||||
#include "gtkmm2ext/application.h"
|
||||
#include "gtkmm2ext/bindings.h"
|
||||
@@ -127,7 +128,6 @@ typedef uint64_t microseconds_t;
|
||||
#include "video_server_dialog.h"
|
||||
#include "add_video_dialog.h"
|
||||
#include "transcode_video_dialog.h"
|
||||
#include "system_exec.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
#include "pbd/xml++.h"
|
||||
#include "pbd/controllable.h"
|
||||
#include "pbd/system_exec.h"
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/frame.h>
|
||||
#include <gtkmm/label.h>
|
||||
@@ -92,7 +93,6 @@
|
||||
#include "theme_manager.h"
|
||||
|
||||
class VideoTimeLine;
|
||||
class SystemExec;
|
||||
class ArdourKeyboard;
|
||||
class AudioClock;
|
||||
class ButtonJoiner;
|
||||
@@ -626,7 +626,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
||||
|
||||
static UIConfiguration *ui_config;
|
||||
|
||||
SystemExec *video_server_process;
|
||||
PBD::SystemExec *video_server_process;
|
||||
|
||||
void handle_locations_change (ARDOUR::Location*);
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#define __ardour_transcode_ffmpeg_h__
|
||||
|
||||
#include <string>
|
||||
#include "pbd/system_exec.h"
|
||||
#include "ardour/types.h"
|
||||
#include "system_exec.h"
|
||||
|
||||
|
||||
/** @class TranscodeFfmpeg
|
||||
@@ -128,7 +128,7 @@ class TranscodeFfmpeg : public sigc::trackable
|
||||
#endif
|
||||
protected:
|
||||
std::string infile;
|
||||
SystemExec *ffcmd;
|
||||
PBD::SystemExec *ffcmd;
|
||||
|
||||
bool probe ();
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "pbd/system_exec.h"
|
||||
#include "ardour/ardour.h"
|
||||
#include "ardour/types.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/session_handle.h"
|
||||
#include "system_exec.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class Session;
|
||||
@@ -83,7 +83,7 @@ class VideoMonitor : public sigc::trackable , public ARDOUR::SessionHandlePtr, p
|
||||
|
||||
protected:
|
||||
PublicEditor *editor;
|
||||
SystemExec *process;
|
||||
PBD::SystemExec *process;
|
||||
float fps;
|
||||
void parse_output (std::string d, size_t s);
|
||||
void terminated ();
|
||||
|
||||
@@ -237,7 +237,6 @@ gtk2_ardour_sources = [
|
||||
'add_video_dialog.cc',
|
||||
'editor_videotimeline.cc',
|
||||
'video_timeline.cc',
|
||||
'system_exec.cc',
|
||||
'video_monitor.cc',
|
||||
'transcode_ffmpeg.cc',
|
||||
'transcode_video_dialog.cc',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Copyright (C) 2010 Paul Davis
|
||||
Author: Robin Gareus <robin@gareus.org>
|
||||
Copyright (C) 2010-2014 Robin Gareus <robin@gareus.org>
|
||||
|
||||
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
|
||||
@@ -17,8 +17,8 @@
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
#ifndef __ardour_system_exec_h__
|
||||
#define __ardour_system_exec_h__
|
||||
#ifndef _libpbd_system_exec_h_
|
||||
#define _libpbd_system_exec_h_
|
||||
|
||||
#ifndef STDIN_FILENO
|
||||
#define STDIN_FILENO 0
|
||||
@@ -42,13 +42,15 @@
|
||||
#include <string>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#ifdef NOPBD /* outside ardour */
|
||||
#ifdef NOPBD /* unit-test outside ardour */
|
||||
#include <sigc++/bind.h>
|
||||
#include <sigc++/signal.h>
|
||||
#else
|
||||
#include <pbd/signals.h>
|
||||
#include "pbd/signals.h"
|
||||
#endif
|
||||
|
||||
namespace PBD {
|
||||
|
||||
/** @class: SystemExec
|
||||
* @brief execute an external command
|
||||
*
|
||||
@@ -63,7 +65,7 @@
|
||||
* \ref Terminated is sent if the child application exits.
|
||||
*
|
||||
*/
|
||||
class SystemExec
|
||||
class LIBPBD_API SystemExec
|
||||
{
|
||||
public:
|
||||
/** prepare execution of a program with 'execve'
|
||||
@@ -205,6 +207,9 @@ class SystemExec
|
||||
|
||||
pthread_t thread_id_tt;
|
||||
bool thread_active;
|
||||
};
|
||||
|
||||
#endif /* __ardour_system_exec_h__ */
|
||||
}; /* end class */
|
||||
|
||||
}; /* end namespace */
|
||||
|
||||
#endif /* _libpbd_system_exec_h_ */
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
Copyright (C) 2010 Paul Davis
|
||||
Copyright 2005-2008 Lennart Poettering
|
||||
Author: Robin Gareus <robin@gareus.org>
|
||||
Copyright (C) 2010-2014 Robin Gareus <robin@gareus.org>
|
||||
Copyright (C) 2005-2008 Lennart Poettering
|
||||
|
||||
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
|
||||
@@ -43,11 +43,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "system_exec.h"
|
||||
#include "pbd/system_exec.h"
|
||||
|
||||
using namespace std;
|
||||
void * interposer_thread (void *arg);
|
||||
using namespace PBD;
|
||||
|
||||
static void * interposer_thread (void *arg);
|
||||
static void close_fd (int& fd) { if (fd >= 0) ::close (fd); fd = -1; }
|
||||
|
||||
#ifndef PLATFORM_WINDOWS
|
||||
@@ -206,7 +207,7 @@ SystemExec::~SystemExec ()
|
||||
pthread_mutex_destroy(&write_lock);
|
||||
}
|
||||
|
||||
void *
|
||||
static void *
|
||||
interposer_thread (void *arg) {
|
||||
SystemExec *sex = static_cast<SystemExec *>(arg);
|
||||
sex->output_interposer();
|
||||
@@ -74,6 +74,7 @@ libpbd_sources = [
|
||||
'stateful.cc',
|
||||
'strreplace.cc',
|
||||
'strsplit.cc',
|
||||
'system_exec.cc',
|
||||
'textreceiver.cc',
|
||||
'transmitter.cc',
|
||||
'undo.cc',
|
||||
|
||||
Reference in New Issue
Block a user