diff options
author | Taybin Rutkin <taybin@taybin.com> | 2006-03-10 17:09:59 +0000 |
---|---|---|
committer | Taybin Rutkin <taybin@taybin.com> | 2006-03-10 17:09:59 +0000 |
commit | 1e668dfaf2392226db306ccfdaf7dbb6e45a0db4 (patch) | |
tree | 820180c180d98fbbffb1ad4dca4de9238aad6b22 /libs/ardour/sndfilesource.cc | |
parent | 0896e2e63f0f331904ab9e9005190c9e7288b084 (diff) |
ExternalSource refactoring.
git-svn-id: svn://localhost/trunk/ardour2@373 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/sndfilesource.cc')
-rw-r--r-- | libs/ardour/sndfilesource.cc | 55 |
1 files changed, 5 insertions, 50 deletions
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index 350a9c2ef1..5db5f95c35 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000 Paul Davis + Copyright (C) 2006 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,33 +18,21 @@ $Id$ */ -#include <string> -#include <sys/stat.h> -#include <unistd.h> -#include <sys/time.h> - -#include <pbd/mountpoint.h> #include <ardour/sndfilesource.h> #include "i18n.h" using namespace ARDOUR; -string SndFileSource::peak_dir = ""; - SndFileSource::SndFileSource (const XMLNode& node) - : Source (node) + : ExternalSource (node) { - if (set_state (node)) { - throw failed_constructor(); - } - init (_name, true); - SourceCreated (this); /* EMIT SIGNAL */ + SourceCreated (this); /* EMIT SIGNAL */ } SndFileSource::SndFileSource (const string& idstr, bool build_peak) - : Source(build_peak) + : ExternalSource(idstr, build_peak) { init (idstr, build_peak); @@ -110,7 +98,7 @@ SndFileSource::init (const string& idstr, bool build_peak) SndFileSource::~SndFileSource () { - GoingAway (this); /* EMIT SIGNAL */ + GoingAway (this); /* EMIT SIGNAL */ if (sf) { sf_close (sf); @@ -122,12 +110,6 @@ SndFileSource::~SndFileSource () } jack_nframes_t -SndFileSource::read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const -{ - return read (dst, start, cnt, workbuf); -} - -jack_nframes_t SndFileSource::read (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const { int32_t nread; @@ -178,30 +160,3 @@ SndFileSource::read (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char return nread; } -string -SndFileSource::peak_path (string audio_path) -{ - /* XXX hardly bombproof! fix me */ - - struct stat stat_file; - struct stat stat_mount; - - string mp = mountpoint (audio_path); - - stat (audio_path.c_str(), &stat_file); - stat (mp.c_str(), &stat_mount); - - char buf[32]; - snprintf (buf, sizeof (buf), "%ld-%ld-%d.peak", stat_mount.st_ino, stat_file.st_ino, channel); - - string res = peak_dir; - res += buf; - - return res; -} - -string -SndFileSource::old_peak_path (string audio_path) -{ - return peak_path (audio_path); -} |