#include <sndfile.h>
+#include <glib/gstdio.h>
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
#include "ardour/audiofilesource.h"
#include "ardour/debug.h"
-#include "ardour/sndfile_helpers.h"
#include "ardour/sndfilesource.h"
#include "ardour/session.h"
-#include "ardour/session_directory.h"
-#include "ardour/source_factory.h"
#include "ardour/filename_extensions.h"
// if these headers come before sigc++ is included
string AudioFileSource::peak_dir = "";
PBD::Signal0<void> AudioFileSource::HeaderPositionOffsetChanged;
-uint64_t AudioFileSource::header_position_offset = 0;
+framecnt_t AudioFileSource::header_position_offset = 0;
/* XXX maybe this too */
char AudioFileSource::bwf_serial_number[13] = "000000000000";
}
};
-Glib::StaticPrivate<SizedSampleBuffer> thread_interleave_buffer = GLIBMM_STATIC_PRIVATE_INIT;
+Glib::Threads::Private<SizedSampleBuffer> thread_interleave_buffer;
/** Constructor used for existing external-to-session files. */
AudioFileSource::AudioFileSource (Session& s, const string& path, Source::Flag flags)
/* note that external files have their own path as "origin" */
, FileSource (s, DataType::AUDIO, path, path, flags)
{
- /* note that origin remains empty */
-
if (init (_path, true)) {
throw failed_constructor ();
}
- cerr << "audiofile source created with path " << path << endl;
}
/** Constructor used for new internal-to-session files. */
if (set_state (node, Stateful::loading_state_version)) {
throw failed_constructor ();
}
-
+
if (init (_path, must_exist)) {
throw failed_constructor ();
}
{
DEBUG_TRACE (DEBUG::Destruction, string_compose ("AudioFileSource destructor %1, removable? %2\n", _path, removable()));
if (removable()) {
- unlink (_path.c_str());
- unlink (peakpath.c_str());
+ ::g_unlink (_path.c_str());
+ ::g_unlink (peakpath.c_str());
}
}
if (SndFileSource::get_soundfile_info (path, _info, error_msg) != 0) {
return true;
}
-
+
#ifdef HAVE_COREAUDIO
if (CoreAudioSource::get_soundfile_info (path, _info, error_msg) == 0) {
return true;
int
AudioFileSource::move_dependents_to_trash()
{
- return ::unlink (peakpath.c_str());
+ return ::g_unlink (peakpath.c_str());
}
void
AudioFileSource::setup_peakfile ()
{
if (!(_flags & NoPeakFile)) {
- return initialize_peakfile (_file_is_new, _path);
+ return initialize_peakfile (_path);
} else {
return 0;
}