remove debug output from last commit
[ardour.git] / gtk2_ardour / analysis_window.cc
index f742afd7274a9a66ee901236919c3962e75d198c..957dde3d1fcbcd60daf2ef9e9b519c942632bd96 100644 (file)
@@ -16,7 +16,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <gtkmm2ext/gtk_ui.h>
@@ -61,7 +60,7 @@ AnalysisWindow::AnalysisWindow()
        tlmodel = Gtk::ListStore::create(tlcols);
        track_list.set_model (tlmodel);
        track_list.append_column(_("Track"), tlcols.trackname);
-       track_list.append_column_editable(_("Visible"), tlcols.visible);
+       track_list.append_column_editable(_("Show"), tlcols.visible);
        track_list.set_headers_visible(true);
        track_list.set_reorderable(false);
        track_list.get_selection()->set_mode (Gtk::SELECTION_NONE);
@@ -221,16 +220,14 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
                Sample *buf    = (Sample *) malloc(sizeof(Sample) * fft_graph.windowSize());
                Sample *mixbuf = (Sample *) malloc(sizeof(Sample) * fft_graph.windowSize());
                float  *gain   = (float *)  malloc(sizeof(float) * fft_graph.windowSize());
-               char   *work   = (char *)   malloc(sizeof(char) * fft_graph.windowSize());
        
                Selection s = PublicEditor::instance().get_selection();
                TimeSelection ts = s.time;
                RegionSelection ars = s.regions;
        
-       
                for (TrackSelection::iterator i = s.tracks.begin(); i != s.tracks.end(); ++i) {
-                       ARDOUR::AudioPlaylist *pl
-                               = dynamic_cast<ARDOUR::AudioPlaylist*>((*i)->playlist());
+                       boost::shared_ptr<AudioPlaylist> pl
+                               = boost::dynamic_pointer_cast<AudioPlaylist>((*i)->playlist());
 
                        if (!pl)
                                continue;
@@ -247,9 +244,9 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
                        if (source_selection_ranges_rb.get_active()) {
 //                             cerr << "Analyzing ranges on track " << *&rui->route().name() << endl;
                                
-                               for (std::list<ARDOUR::AudioRange>::iterator j = ts.begin(); j != ts.end(); ++j) {
+                               for (std::list<AudioRange>::iterator j = ts.begin(); j != ts.end(); ++j) {
 
-                                       jack_nframes_t i = 0;
+                                       nframes_t i = 0;
                                        int n;
                        
                                        while ( i < (*j).length() ) {
@@ -261,7 +258,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
                                                        n = (*j).length() - i;
                                                }
                                
-                                               n = pl->read(buf, mixbuf, gain, work, (*j).start + i, n);
+                                               n = pl->read(buf, mixbuf, gain, (*j).start + i, n);
        
                                                if ( n < fft_graph.windowSize()) {
                                                        for (int j = n; j < fft_graph.windowSize(); j++) {
@@ -279,7 +276,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
                                
                                TimeAxisView *current_axis = (*i);
                                
-                               for (std::set<RegionView *>::iterator j = ars.begin(); j != ars.end(); ++j) {
+                               for (RegionSelection::iterator j = ars.begin(); j != ars.end(); ++j) {
                                        // Check that the region is actually audio (so we can analyze it)
                                        AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*j);
                                        if (!arv)
@@ -290,18 +287,18 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
                                                continue;
 
 //                                     cerr << " - " << (*j)->region().name() << ": " << (*j)->region().length() << " samples starting at " << (*j)->region().position() << endl;
-                                       jack_nframes_t i = 0;
+                                       nframes_t i = 0;
                                        int n;
 
-                                       while ( i < arv->region().length() ) {
+                                       while ( i < arv->region()->length() ) {
                                                // TODO: What about stereo+ channels? composite all to one, I guess
 
                                                n = fft_graph.windowSize();
-                                               if (i + n >= arv->region().length() ) {
-                                                       n = arv->region().length() - i;
+                                               if (i + n >= arv->region()->length() ) {
+                                                       n = arv->region()->length() - i;
                                                }
 
-                                               n = arv->audio_region().read_at(buf, mixbuf, gain, work, arv->region().position() + i, n);
+                                               n = arv->audio_region()->read_at(buf, mixbuf, gain, arv->region()->position() + i, n);
        
                                                if ( n < fft_graph.windowSize()) {
                                                        for (int j = n; j < fft_graph.windowSize(); j++) {
@@ -331,7 +328,6 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
        
                free(buf);
                free(mixbuf);
-               free(work);
 
                track_list_ready = true;
        } /* end lock */