diff options
author | Robin Gareus <robin@gareus.org> | 2014-02-19 03:38:43 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-02-19 03:38:43 +0100 |
commit | 1d39cf754355805d2281232905808670e32f7d6e (patch) | |
tree | b7c8c1bf7e719c2733ebf592ee79ed7fe06440f3 | |
parent | 05d7947795593bb5de348412acc5741052e8e3f9 (diff) |
move SystemExec to libpbd
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/transcode_ffmpeg.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/video_monitor.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/wscript | 1 | ||||
-rw-r--r-- | libs/pbd/pbd/system_exec.h (renamed from gtk2_ardour/system_exec.h) | 21 | ||||
-rw-r--r-- | libs/pbd/system_exec.cc (renamed from gtk2_ardour/system_exec.cc) | 11 | ||||
-rw-r--r-- | libs/pbd/wscript | 1 |
8 files changed, 27 insertions, 21 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index edc66a13b0..9781bd01d9 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -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" diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 1561a0102c..f2cbb0b2e0 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.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*); diff --git a/gtk2_ardour/transcode_ffmpeg.h b/gtk2_ardour/transcode_ffmpeg.h index 61267ac853..3d794ee880 100644 --- a/gtk2_ardour/transcode_ffmpeg.h +++ b/gtk2_ardour/transcode_ffmpeg.h @@ -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 (); diff --git a/gtk2_ardour/video_monitor.h b/gtk2_ardour/video_monitor.h index 59264fa012..6614ac9237 100644 --- a/gtk2_ardour/video_monitor.h +++ b/gtk2_ardour/video_monitor.h @@ -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 (); diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index d385da5a20..e7f6cc6946 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -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', diff --git a/gtk2_ardour/system_exec.h b/libs/pbd/pbd/system_exec.h index c69f957d95..f08191654d 100644 --- a/gtk2_ardour/system_exec.h +++ b/libs/pbd/pbd/system_exec.h @@ -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_ */ diff --git a/gtk2_ardour/system_exec.cc b/libs/pbd/system_exec.cc index 034ba90e40..38f86a04ad 100644 --- a/gtk2_ardour/system_exec.cc +++ b/libs/pbd/system_exec.cc @@ -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(); diff --git a/libs/pbd/wscript b/libs/pbd/wscript index 6b3e12b539..2a01c0cefe 100644 --- a/libs/pbd/wscript +++ b/libs/pbd/wscript @@ -74,6 +74,7 @@ libpbd_sources = [ 'stateful.cc', 'strreplace.cc', 'strsplit.cc', + 'system_exec.cc', 'textreceiver.cc', 'transmitter.cc', 'undo.cc', |