summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-01-14 21:47:32 +0000
committerDavid Robillard <d@drobilla.net>2012-01-14 21:47:32 +0000
commita2701525891f69cc810ed370dd54ac76944b1d0b (patch)
treebd605803eb386ab992b2ec59ab0971cd62468d58
parent692e851810156ce4bc4929ea803366c2fcb2ed94 (diff)
downloadingen-a2701525891f69cc810ed370dd54ac76944b1d0b.tar.gz
ingen-a2701525891f69cc810ed370dd54ac76944b1d0b.tar.bz2
ingen-a2701525891f69cc810ed370dd54ac76944b1d0b.zip
Replace some non-portable stuff with glib equivalents.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3947 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/gui/App.cpp4
-rw-r--r--src/gui/ConnectWindow.cpp3
-rw-r--r--src/gui/LoadPatchWindow.cpp6
-rw-r--r--src/ingen/main.cpp6
-rw-r--r--src/osc/OSCClientSender.cpp2
-rw-r--r--src/server/ingen_lv2.cpp5
6 files changed, 6 insertions, 20 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 4ee1fe74..448f3903 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -16,10 +16,8 @@
*/
#include <cassert>
-#include <string>
#include <fstream>
-#include <time.h>
-#include <sys/time.h>
+#include <string>
#include <gtk/gtkwindow.h>
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index 0b1aa47d..6c5402f5 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -17,9 +17,6 @@
#include <stdlib.h>
#include <string>
-#include <sys/resource.h>
-#include <sys/time.h>
-#include <time.h>
#include "raul/Process.hpp"
#include "raul/log.hpp"
diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp
index 33094bbd..64e6aa4e 100644
--- a/src/gui/LoadPatchWindow.cpp
+++ b/src/gui/LoadPatchWindow.cpp
@@ -15,8 +15,6 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <sys/types.h>
-#include <dirent.h>
#include <cassert>
#include <boost/optional.hpp>
#include <glibmm/miscutils.h>
@@ -86,10 +84,8 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject,
// Add global examples directory to "shortcut folders" (bookmarks)
const string examples_dir = Shared::data_file_path("patches");
- DIR* d = opendir(examples_dir.c_str());
- if (d != NULL) {
+ if (Glib::file_test(examples_dir, Glib::FILE_TEST_IS_DIR)) {
add_shortcut_folder(examples_dir);
- closedir(d);
}
}
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp
index 4fd477d2..4e7ba923 100644
--- a/src/ingen/main.cpp
+++ b/src/ingen/main.cpp
@@ -17,7 +17,6 @@
#include <signal.h>
#include <stdlib.h>
-#include <time.h>
#include <iostream>
#include <string>
@@ -27,6 +26,7 @@
#include <glibmm/convert.h>
#include <glibmm/miscutils.h>
#include <glibmm/thread.h>
+#include <glibmm/timer.h>
#include "raul/Configuration.hpp"
#include "raul/Path.hpp"
@@ -54,8 +54,6 @@ using namespace std;
using namespace Raul;
using namespace Ingen;
-static const timespec main_rate = { 0, 125000000 }; // 1/8 second
-
Ingen::Shared::World* world = NULL;
void
@@ -236,7 +234,7 @@ main(int argc, char** argv)
// Run engine main loop until interrupt
while (world->local_engine()->main_iteration()) {
- nanosleep(&main_rate, NULL);
+ Glib::usleep(125000); // 1/8 second
}
info << "Finished main loop" << endl;
}
diff --git a/src/osc/OSCClientSender.cpp b/src/osc/OSCClientSender.cpp
index ba098a61..a0b7979c 100644
--- a/src/osc/OSCClientSender.cpp
+++ b/src/osc/OSCClientSender.cpp
@@ -15,8 +15,6 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <unistd.h>
-
#include <cassert>
#include <string>
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index bc9e861f..e7a07e5a 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -17,7 +17,6 @@
*/
#include <stdlib.h>
-#include <time.h>
#include <string>
#include <vector>
@@ -25,6 +24,7 @@
#include <glib.h>
#include <glibmm/convert.h>
#include <glibmm/miscutils.h>
+#include <glibmm/timer.h>
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
@@ -234,9 +234,8 @@ public:
private:
virtual void _run() {
- static const timespec main_rate = { 0, 125000000 }; // 1/8 second
while (_engine->main_iteration()) {
- nanosleep(&main_rate, NULL);
+ Glib::usleep(125000); // 1/8 second
}
}