Patch submission...
Rudy Desjardins <[email protected]> Tue, 11 Jan 2005 11:03:08 -0500
| Newsgroups | gmane.comp.multimedia.xmms.devel |
|---|---|
| Message-ID | <[email protected]> |
Ok, no one has let me know one way or another what the 'correct'
way to submit a patch is, if there is one, so I just checked out
the latest source from cvs, applied my changes, then did a diff -u
to generate this patch. Hope this is okay (explanation of patch is
at bottom, if you can't figure it out from the code):
(diff -u disk_writer.c.bak disk_writer.c)
<start-patch-code>
--- disk_writer.c.bak 2004-02-25 16:17:43.000000000 -0500
+++ disk_writer.c 2005-01-11 10:43:03.000000000 -0500
@@ -27,6 +27,7 @@
#include <gtk/gtk.h>
#include <stdio.h>
#include <string.h>
+#include <time.h>
#include "xmms/plugin.h"
#include "libxmms/xmmsctrl.h"
@@ -160,7 +161,10 @@
title = g_strdup_printf("xmms-%d", pos);
}
}
- filename = g_strdup_printf("%s/%s.wav", file_path,
g_basename(title));
+
+ time_t *current_time;
+
+ filename = g_strdup_printf("%s/%d.%s.wav", file_path,
time(current_time), g_basename(title));
g_free(title);
output_file = fopen(filename, "wb");
<end-patch-code>
Basically, all this does is modify the disk_writer output plugin
(part of xmms base install) to prepend a timestamp to the name of
the file it's writing. I just wanted to be able to run two
instances of xmms (via "allow multiple instances" option) and then
hit 'play' on the second one, which is outputting to disk_writer,
when I wanna record what I'm hearing. Without this mod, every time
you write a file you have to go and rename it or move it,
otherwise the diskwriter plugin will overwrite it next time you
want to record (I realize this is kind of a weird thing, since the
diskwriter dynamically generates the filename based on what it's
playing, however when you're recording from a 'net radio station
for instance, you'll normally end up with the same filename for
each station, and it will overwrite itself everytime you try to
record).
Anyways, that's it, pretty basic... if anyone finds this useful,
enjoy! And if there are any xmms developers here, please feel free
to include this in the next release if you find it worthwhile.
Thanks!