#include "ardour/source.h"
#include "ardour/transient_detector.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace ARDOUR;
int
Source::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("name")) != 0) {
_name = prop->value();
void
Source::set_been_analysed (bool yn)
{
- {
+ if (yn) {
+ if (0 == load_transients (get_transients_path())) {
+ yn = false;
+ }
+ }
+ if (yn != _analysed) {
Glib::Threads::Mutex::Lock lm (_analysis_lock);
_analysed = yn;
}
-
- if (yn) {
- load_transients (get_transients_path());
- AnalysisChanged(); // EMIT SIGNAL
- }
+ AnalysisChanged(); // EMIT SIGNAL
}
int
Source::load_transients (const string& path)
{
+ int rv = 0;
FILE *tf;
if (! (tf = g_fopen (path.c_str (), "rb"))) {
return -1;
while (!feof (tf) && !ferror(tf)) {
double val;
if (1 != fscanf (tf, "%lf", &val)) {
+ rv = -1;
break;
}
}
::fclose (tf);
+ return rv;
}
string