Segmenter.cpp
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 /*
3  * Segmenter.cpp
4  *
5  * Created by Mark Levy on 04/04/2006.
6  * Copyright 2006 Centre for Digital Music, Queen Mary, University of London.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version. See the file
12  COPYING included with this distribution for more information.
13  *
14  */
15 
16 #include <iomanip>
17 
18 #include "Segmenter.h"
19 
20 using std::ostream;
21 
22 ostream& operator<<(ostream& os, const Segmentation& s)
23 {
24  os << "structure_name : begin_time end_time\n";
25 
26  for (int i = 0; i < int(s.segments.size()); i++) {
27  Segment seg = s.segments[i];
28  os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate)
29  << '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n";
30  }
31 
32  return os;
33 }
int start
Definition: Segmenter.h:26
int samplerate
Definition: Segmenter.h:35
int end
Definition: Segmenter.h:27
ostream & operator<<(ostream &os, const Segmentation &s)
Definition: Segmenter.cpp:22
std::vector< Segment > segments
Definition: Segmenter.h:36
int type
Definition: Segmenter.h:28