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