changeset 1664:3dc347b350ee trunk

[svn] Have output plugins use the VFS layer too.
author chainsaw
date Sun, 10 Sep 2006 14:28:45 -0700
parents 726fb8286a82
children de0a0927a5c2
files ChangeLog Plugins/Output/OSS/configure.c Plugins/Output/disk_writer/disk_writer.c
diffstat 3 files changed, 20 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Sep 10 14:01:14 2006 -0700
+++ b/ChangeLog	Sun Sep 10 14:28:45 2006 -0700
@@ -1,3 +1,11 @@
+2006-09-10 21:01:14 +0000  Tony Vroon <chainsaw@gentoo.org>
+  revision [2263]
+  Use the VFS layer.
+
+  Changes:        Modified:
+  +15 -14         trunk/Plugins/Input/sexypsf/Misc.c  
+
+
 2006-09-10 19:19:35 +0000  Tony Vroon <chainsaw@gentoo.org>
   revision [2261]
   Portability fix provided by Matti H?\195?\164m?\195?\164l?\195?\164inen (ccr/TNSP).
--- a/Plugins/Output/OSS/configure.c	Sun Sep 10 14:01:14 2006 -0700
+++ b/Plugins/Output/OSS/configure.c	Sun Sep 10 14:28:45 2006 -0700
@@ -28,6 +28,7 @@
 #include <string.h>
 
 #include <libaudacious/configdb.h>
+#include <libaudacious/vfs.h>
 
 
 static GtkWidget *configure_win = NULL;
@@ -123,15 +124,15 @@
 scan_devices(gchar * type, GtkWidget * option_menu, GtkSignalFunc sigfunc)
 {
     GtkWidget *menu, *item;
-    FILE *file;
+    VFSFile *file;
     gchar buffer[256], *temp, *tmp2;
     gboolean found = FALSE;
     gint index = 0;
 
     menu = gtk_menu_new();
 
-    if ((file = fopen("/dev/sndstat", "r"))) {
-        while (fgets(buffer, 255, file)) {
+    if ((file = vfs_fopen("/dev/sndstat", "r"))) {
+        while (vfs_fgets(buffer, 255, file)) {
             if (found && buffer[0] == '\n')
                 break;
             if (buffer[strlen(buffer) - 1] == '\n')
@@ -161,7 +162,7 @@
                 found = 1;
 
         }
-        fclose(file);
+        vfs_fclose(file);
     }
     else {
         item = gtk_menu_item_new_with_label(_("Default"));
--- a/Plugins/Output/disk_writer/disk_writer.c	Sun Sep 10 14:01:14 2006 -0700
+++ b/Plugins/Output/disk_writer/disk_writer.c	Sun Sep 10 14:28:45 2006 -0700
@@ -33,6 +33,7 @@
 #include "libaudacious/dirbrowser.h"
 #include "libaudacious/configdb.h"
 #include "libaudacious/util.h"
+#include "libaudacious/vfs.h"
 
 struct wavhead
 {
@@ -60,7 +61,7 @@
 static gboolean use_suffix = FALSE;
 
 static gchar *file_path = NULL;
-static FILE *output_file = NULL;
+static VFSFile *output_file = NULL;
 static struct wavhead header;
 static guint64 written = 0;
 static AFormat afmt;
@@ -166,7 +167,7 @@
 	filename = g_strdup_printf("%s/%s.wav", file_path, g_basename(title));
 	g_free(title);
 
-	output_file = fopen(filename, "wb");
+	output_file = vfs_fopen(filename, "wb");
 	g_free(filename);
 
 	if (!output_file)
@@ -188,7 +189,7 @@
 	header.byte_p_spl = GUINT16_TO_LE((GUINT16_FROM_LE(header.bit_p_spl) / (8 / nch)));
 	memcpy(&header.data_chunk, "data", 4);
 	header.data_length = GUINT32_TO_LE(0);
-	fwrite(&header, sizeof (struct wavhead), 1, output_file);
+	vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file);
 
 	return 1;
 }
@@ -254,7 +255,7 @@
 	if (afmt == FMT_S16_NE)
 		convert_buffer(ptr, length);
 #endif
-	written += fwrite(ptr, 1, length, output_file);
+	written += vfs_fwrite(ptr, 1, length, output_file);
 }
 
 static void disk_close(void)
@@ -265,9 +266,9 @@
 
 		header.data_length = GUINT32_TO_LE(written);
 		fseek(output_file, 0, SEEK_SET);
-		fwrite(&header, sizeof (struct wavhead), 1, output_file);
+		vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file);
 
-		fclose(output_file);
+		vfs_fclose(output_file);
 		written = 0;
 	}
 	output_file = NULL;