Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

o provide absolute path.

  • Loading branch information...
commit 5476cc293efe30aef48a0002c9c9b2d4c39337c0 1 parent e9c07dd
@hzeller authored
Showing with 20 additions and 9 deletions.
  1. +12 −3 README
  2. +2 −1  convolver.cc
  3. +3 −3 filter-interface.h
  4. +3 −2 fuse-convolve.c
View
15 README
@@ -2,11 +2,20 @@ A fuse filesystem that takes an original path to wav and flac files and provides
these files that are convolved on the fly using the zita convolver (usually
used in jconvolve)
-To compile and install on Ubuntu
+** To compile on Ubuntu **
$ sudo aptitude install libsndfile-dev libflac-dev libzita-convolver-dev libfuse-dev
$ make
- $ sudo make install
-Provide a filesystem.
+** Run **
+./fuse-convolve filter.conf /path/to/original/fileystem /mnt/mountpoint -f
+
+The '-f' lets it run in foreground (useful, since right now this spits out
+some debugging information.
+
+Access fileystem under /mnt/mountpoint, e.g.
+ mplayer /mnt/mountpoint/foo.flac
+
+(purely readonly; only reading files is supported).
+
View
3  convolver.cc
@@ -30,7 +30,8 @@ class FileFilter : public filter_interface_t {
virtual ~FileFilter() {}
};
-// Very simple filter that just passes the original file through.
+// Very simple filter that just passes the original file through. Used for
+// everything that is not a sound-file.
class PassThroughFilter : public FileFilter {
public:
PassThroughFilter(int filedes, const char *path) : filedes_(filedes) {
View
6 filter-interface.h
@@ -20,13 +20,13 @@
#ifdef __cplusplus
extern "C" {
-#endif
+#endif /* __cplusplus */
struct filter_interface_t {};
// Create a new filter given the open filedescriptor and the path. Returns
// that filter in an opaque FilterInterface*
-struct filter_interface_t *create_filter(int filedes, const char *path);
+struct filter_interface_t *create_filter(int filedes, const char *orig_path);
// Read from the given filter at the file-offset "offset, up to "size" bytes
// into "buffer". Returns number of bytes read or a negative errno value.
@@ -39,5 +39,5 @@ int close_filter(struct filter_interface_t *filter);
#ifdef __cplusplus
} // extern "C"
-#endif
+#endif /* __cplusplus */
View
5 fuse-convolve.c
@@ -97,7 +97,8 @@ static int fuseconv_readlink(const char *path, char *buf, size_t size) {
static int fuseconv_open(const char *path, struct fuse_file_info *fi) {
fprintf(stderr, "HZ ===== open('%s')\n", path);
char path_buf[PATH_MAX];
- const int fd = open(assemble_orig_path(path_buf, path), fi->flags);
+ const char *orig_path = assemble_orig_path(path_buf, path);
+ const int fd = open(orig_path, fi->flags);
// We want to return partial reads. That way, we can separate reading the
// ID3-tags from the stream.
@@ -110,7 +111,7 @@ static int fuseconv_open(const char *path, struct fuse_file_info *fi) {
// The file-handle has the neat property to be 64 bit - so we can actually
// store a pointer in there :) (Yay, someone was thinking while developing
// that API).
- fi->fh = (uint64_t) create_filter(fd, path);
+ fi->fh = (uint64_t) create_filter(fd, orig_path);
return 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.