On Saturday 27 May 2006 03:11 pm, Joe Stewart wrote:
> On Saturday 02 October 2004 17:27, Andraz Tori wrote:
> > So... Cinelerra now has this plugin that enables to edit SVG pictures
> > in sodipodi and then seamlessly use them in cinelerra as an overlay
> > (implemented by plugin).
> >
> > Now, since it seems that sodipodi is gone sniffing the dasies, i am
> > wondering is someone proficent enough in GTK coding to be willing to
> > port the patch from sodipodi to inkscape?
> >
> > basically it adds a GUI button 'e' when started with special command
> > line, uses a shift+cntrl+e keycombo for this button, and does the
> > shared memory passtrough of the rendered picture to cinelerra...
> >
> > anyone new who would like to get to the dark side of the pushing
> > cinelerra even further?
>
> Better late than never, right? Here's the patch, ported to the latest SVN
> build of Inkscape.
>
> -Joe
And, here's a patch for Cinelerra-CV, to change the SVG plugin to use Inkscape
instead of Sodipodi. Other than naming changes, the only change I made is to
add is_synthesis() to svg.C so that the overlay could be rendered by itself
instead of requiring existing content in the track.
If there is anyone out there still using a patched Sodipodi who does not wish
to recompile Inkscape, you can still use the new plugin, just create a
symlink for inkscape in your bin directory to point to the sodipodi binary.
-Joe
diff -ru -x 'Makefile*' -x '*.l*' -x entries hvirtual.orig/plugins/svg/svg.C hvirtual.new/plugins/svg/svg.C
--- hvirtual.orig/plugins/svg/svg.C 2006-05-21 14:11:01.000000000 -0400
+++ hvirtual.new/plugins/svg/svg.C 2006-05-27 15:15:15.000000000 -0400
@@ -120,8 +120,9 @@
overlayer = 0;
}
-char* SvgMain::plugin_title() { return N_("SVG via Sodipodi"); }
+char* SvgMain::plugin_title() { return N_("SVG via Inkscape"); }
int SvgMain::is_realtime() { return 1; }
+int SvgMain::is_synthesis() { return 1; }
NEW_PICON_MACRO(SvgMain)
@@ -252,7 +253,7 @@
need_reconfigure = 1;
char command[1024];
sprintf(command,
- "sodipodi --without-gui --cinelerra-export-file=%s %s",
+ "inkscape --without-gui --cinelerra-export-file=%s %s",
filename_raw, config.svg_file);
printf(_("Running command %s\n"), command);
system(command);
@@ -267,7 +268,7 @@
// file exists, ... lock it, mmap it and check time_of_creation
- lockf(fh_raw, F_LOCK, 0); // Blocking call - will wait for sodipodi to finish!
+ lockf(fh_raw, F_LOCK, 0); // Blocking call - will wait for inkscape to finish!
fstat (fh_raw, &st_raw);
raw_buffer = (unsigned char *)mmap (NULL, st_raw.st_size, PROT_READ, MAP_SHARED, fh_raw, 0);
raw_data = (struct raw_struct *) raw_buffer;
@@ -281,7 +282,7 @@
}
if (raw_data->struct_version > 1)
{
- printf (_("Unsupported version of RAWC file %s. This means your Sodipodi uses newer RAWC format than Cinelerra. Please upgrade Cinelerra.\n"), filename_raw);
+ printf (_("Unsupported version of RAWC file %s. This means your Inkscape uses newer RAWC format than Cinelerra. Please upgrade Cinelerra.\n"), filename_raw);
lockf(fh_raw, F_ULOCK, 0);
close(fh_raw);
return (0);
diff -ru -x 'Makefile*' -x '*.l*' -x entries hvirtual.orig/plugins/svg/svg.h hvirtual.new/plugins/svg/svg.h
--- hvirtual.orig/plugins/svg/svg.h 2006-05-21 14:11:01.000000000 -0400
+++ hvirtual.new/plugins/svg/svg.h 2006-05-27 15:15:15.000000000 -0400
@@ -40,6 +40,7 @@
// required for all realtime plugins
int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
int is_realtime();
+ int is_synthesis();
char* plugin_title();
int show_gui();
void raise_window();
diff -ru -x 'Makefile*' -x '*.l*' -x entries hvirtual.orig/plugins/svg/svgwin.C hvirtual.new/plugins/svg/svgwin.C
--- hvirtual.orig/plugins/svg/svgwin.C 2006-05-21 14:11:01.000000000 -0400
+++ hvirtual.new/plugins/svg/svgwin.C 2006-05-27 15:15:15.000000000 -0400
@@ -303,7 +303,7 @@
char filename_raw[1024];
char filename_fifo[1024];
struct fifo_struct fifo_buf;
- SvgSodipodiThread *sodipodi_thread = new SvgSodipodiThread(client, window);
+ SvgInkscapeThread *inkscape_thread = new SvgInkscapeThread(client, window);
strcpy(filename_raw, client->config.svg_file);
strcat(filename_raw, ".raw");
@@ -319,9 +319,9 @@
}
fh_fifo = open(filename_fifo, O_RDWR);
fifo_buf.action = 0;
- sodipodi_thread->fh_fifo = fh_fifo;
- sodipodi_thread->start();
- while (sodipodi_thread->running() && (!quit_now)) {
+ inkscape_thread->fh_fifo = fh_fifo;
+ inkscape_thread->start();
+ while (inkscape_thread->running() && (!quit_now)) {
// pausetimer.delay(200); // poll file every 200ms
read(fh_fifo, &fifo_buf, sizeof(fifo_buf));
@@ -338,16 +338,16 @@
// }
} else
if (fifo_buf.action == 2) {
- printf(_("Sodipodi has exited\n"));
+ printf(_("Inkscape has exited\n"));
} else
if (fifo_buf.action == 3) {
printf(_("Plugin window has closed\n"));
- delete sodipodi_thread;
+ delete inkscape_thread;
close(fh_fifo);
return;
}
}
- sodipodi_thread->join();
+ inkscape_thread->join();
close(fh_fifo);
window->editing_lock.lock();
window->editing = 0;
@@ -355,28 +355,28 @@
}
-SvgSodipodiThread::SvgSodipodiThread(SvgMain *client, SvgWin *window)
+SvgInkscapeThread::SvgInkscapeThread(SvgMain *client, SvgWin *window)
: Thread(1)
{
this->client = client;
this->window = window;
}
-SvgSodipodiThread::~SvgSodipodiThread()
+SvgInkscapeThread::~SvgInkscapeThread()
{
- // what do we do? kill sodipodi?
+ // what do we do? kill inkscape?
cancel();
}
-void SvgSodipodiThread::run()
+void SvgInkscapeThread::run()
{
-// Runs the sodipodi
+// Runs the inkscape
char command[1024];
char filename_raw[1024];
strcpy(filename_raw, client->config.svg_file);
strcat(filename_raw, ".raw");
- sprintf(command, "sodipodi --cinelerra-export-file=%s %s",
+ sprintf(command, "inkscape --cinelerra-export-file=%s %s",
filename_raw, client->config.svg_file);
printf(_("Running external SVG editor: %s\n"), command);
enable_cancel();
diff -ru -x 'Makefile*' -x '*.l*' -x entries hvirtual.orig/plugins/svg/svgwin.h hvirtual.new/plugins/svg/svgwin.h
--- hvirtual.orig/plugins/svg/svgwin.h 2006-05-21 14:11:01.000000000 -0400
+++ hvirtual.new/plugins/svg/svgwin.h 2006-05-27 15:15:15.000000000 -0400
@@ -90,11 +90,11 @@
SvgWin *window;
};
-class SvgSodipodiThread : public Thread
+class SvgInkscapeThread : public Thread
{
public:
- SvgSodipodiThread(SvgMain *client, SvgWin *window);
- ~SvgSodipodiThread();
+ SvgInkscapeThread(SvgMain *client, SvgWin *window);
+ ~SvgInkscapeThread();
void run();
SvgMain *client;
SvgWin *window;