annotate dsp/segmentation/Segmenter.cpp @ 495:1bea13b8f951
Style fixes in constant-Q: avoid unsigned, reuse our Window class, fix
comments
author |
Chris Cannam <cannam@all-day-breakfast.com> |
date |
Fri, 31 May 2019 18:25:31 +0100 |
parents |
bb78ca3fe7de |
children |
|
rev |
line source |
cannam@484
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
c@243
|
2 /*
|
c@243
|
3 * Segmenter.cpp
|
c@243
|
4 *
|
c@243
|
5 * Created by Mark Levy on 04/04/2006.
|
c@309
|
6 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London.
|
c@309
|
7
|
c@309
|
8 This program is free software; you can redistribute it and/or
|
c@309
|
9 modify it under the terms of the GNU General Public License as
|
c@309
|
10 published by the Free Software Foundation; either version 2 of the
|
c@309
|
11 License, or (at your option) any later version. See the file
|
c@309
|
12 COPYING included with this distribution for more information.
|
c@243
|
13 *
|
c@243
|
14 */
|
c@243
|
15
|
c@243
|
16 #include <iomanip>
|
c@243
|
17
|
c@243
|
18 #include "Segmenter.h"
|
c@243
|
19
|
cannam@493
|
20 using std::ostream;
|
cannam@493
|
21
|
c@243
|
22 ostream& operator<<(ostream& os, const Segmentation& s)
|
c@243
|
23 {
|
c@414
|
24 os << "structure_name : begin_time end_time\n";
|
cannam@480
|
25
|
c@414
|
26 for (int i = 0; i < int(s.segments.size()); i++) {
|
cannam@480
|
27 Segment seg = s.segments[i];
|
cannam@480
|
28 os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate)
|
cannam@480
|
29 << '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n";
|
c@414
|
30 }
|
c@414
|
31
|
c@414
|
32 return os;
|
c@243
|
33 }
|