qm-dsp  1.8
Segmenter.cpp
Go to the documentation of this file.
00001 /*
00002  *  Segmenter.cpp
00003  *
00004  *  Created by Mark Levy on 04/04/2006.
00005  *  Copyright 2006 Centre for Digital Music, Queen Mary, University of London.
00006 
00007     This program is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU General Public License as
00009     published by the Free Software Foundation; either version 2 of the
00010     License, or (at your option) any later version.  See the file
00011     COPYING included with this distribution for more information.
00012  *
00013  */
00014 
00015 #include <iomanip>
00016 
00017 #include "Segmenter.h"
00018 
00019 ostream& operator<<(ostream& os, const Segmentation& s)
00020 {
00021         os << "structure_name : begin_time end_time\n";
00022         
00023         for (int i = 0; i < s.segments.size(); i++)
00024         {
00025                 Segment seg = s.segments[i];
00026                 os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate) 
00027                         << '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n";
00028         }
00029         
00030         return os;
00031 }