More OS X debug.
[dcpomatic.git] / src / lib / audio_analysis.cc
index 9d708bbfdd07f30e07327781cc328828a4ecce06..bc59bcccaa56539a6f8a4a1728c2d9e50e9e1a50 100644 (file)
@@ -48,6 +48,27 @@ AudioPoint::AudioPoint (istream& s)
        }
 }
 
+AudioPoint::AudioPoint (AudioPoint const & other)
+{
+       for (int i = 0; i < COUNT; ++i) {
+               _data[i] = other._data[i];
+       }
+}
+
+AudioPoint &
+AudioPoint::operator= (AudioPoint const & other)
+{
+       if (this == &other) {
+               return *this;
+       }
+       
+       for (int i = 0; i < COUNT; ++i) {
+               _data[i] = other._data[i];
+       }
+
+       return *this;
+}
+
 void
 AudioPoint::write (ostream& s) const
 {
@@ -62,9 +83,9 @@ AudioAnalysis::AudioAnalysis (int channels)
        _data.resize (channels);
 }
 
-AudioAnalysis::AudioAnalysis (string filename)
+AudioAnalysis::AudioAnalysis (boost::filesystem::path filename)
 {
-       ifstream f (filename.c_str ());
+       ifstream f (filename.string().c_str ());
 
        int channels;
        f >> channels;
@@ -107,10 +128,10 @@ AudioAnalysis::points (int c) const
 }
 
 void
-AudioAnalysis::write (string filename)
+AudioAnalysis::write (boost::filesystem::path filename)
 {
-       string tmp = filename + ".tmp";
-       
+       string tmp = filename.string() + ".tmp";
+
        ofstream f (tmp.c_str ());
        f << _data.size() << "\n";
        for (vector<vector<AudioPoint> >::iterator i = _data.begin(); i != _data.end(); ++i) {