summaryrefslogtreecommitdiffstats
path: root/src/bindings
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-06 23:49:17 +0000
committerDavid Robillard <d@drobilla.net>2010-01-06 23:49:17 +0000
commitcb5e934666e128e27faa95587fbdecf01f0e324d (patch)
tree1e694e2812381efbb3eb4b5ace2cdecc118b29f6 /src/bindings
parent092eb35edb999a9dd809e197d7dd9a4ebb0d6bd5 (diff)
downloadingen-cb5e934666e128e27faa95587fbdecf01f0e324d.tar.gz
ingen-cb5e934666e128e27faa95587fbdecf01f0e324d.tar.bz2
ingen-cb5e934666e128e27faa95587fbdecf01f0e324d.zip
Do all logging output via Raul streams.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2349 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/ingen_bindings.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/bindings/ingen_bindings.cpp b/src/bindings/ingen_bindings.cpp
index 82df3f90..913416c8 100644
--- a/src/bindings/ingen_bindings.cpp
+++ b/src/bindings/ingen_bindings.cpp
@@ -1,5 +1,5 @@
-#include <iostream>
#include "python2.4/Python.h"
+#include "raul/log.hpp"
#include "ingen_bindings.hpp"
#include "engine/Engine.hpp"
#include "module/World.hpp"
@@ -7,25 +7,24 @@
bool
run(Ingen::Shared::World* world, const char* filename)
{
- ingen_world = world;
-
- FILE* fd = fopen(filename, "r");
- if (fd) {
- cerr << "Executing script " << filename << endl;
- Py_Initialize();
- PyRun_SimpleFile(fd, filename);
- Py_Finalize();
- return true;
- } else {
- cerr << "Unable to open script " << filename << endl;
- return false;
- }
+ ingen_world = world;
+
+ FILE* fd = fopen(filename, "r");
+ if (fd) {
+ info << "Executing script " << filename << endl;
+ Py_Initialize();
+ PyRun_SimpleFile(fd, filename);
+ Py_Finalize();
+ return true;
+ } else {
+ error << "Unable to open script " << filename << endl;
+ return false;
+ }
}
struct IngenBindingsModule : public Ingen::Shared::Module {
void load(Ingen::Shared::World* world) {
world->script_runners.insert(make_pair("application/x-python", &run));
- //lib->make_resident();
}
};
@@ -44,8 +43,8 @@ ingen_module_load() {
void
script_iteration(Ingen::Shared::World* world)
{
- if (world->local_engine)
- world->local_engine->main_iteration();
+ if (world->local_engine)
+ world->local_engine->main_iteration();
}
} // extern "C"