Mercurial > hg > qm-dsp
comparison dsp/segmentation/Segmenter.cpp @ 505:930b5b0f707d
Merge branch 'codestyle-and-tidy'
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Wed, 05 Jun 2019 12:55:15 +0100 |
parents | bb78ca3fe7de |
children |
comparison
equal
deleted
inserted
replaced
471:e3335cb213da | 505:930b5b0f707d |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
1 /* | 2 /* |
2 * Segmenter.cpp | 3 * Segmenter.cpp |
3 * | 4 * |
4 * Created by Mark Levy on 04/04/2006. | 5 * Created by Mark Levy on 04/04/2006. |
5 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. | 6 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. |
14 | 15 |
15 #include <iomanip> | 16 #include <iomanip> |
16 | 17 |
17 #include "Segmenter.h" | 18 #include "Segmenter.h" |
18 | 19 |
20 using std::ostream; | |
21 | |
19 ostream& operator<<(ostream& os, const Segmentation& s) | 22 ostream& operator<<(ostream& os, const Segmentation& s) |
20 { | 23 { |
21 os << "structure_name : begin_time end_time\n"; | 24 os << "structure_name : begin_time end_time\n"; |
22 | 25 |
23 for (int i = 0; i < int(s.segments.size()); i++) { | 26 for (int i = 0; i < int(s.segments.size()); i++) { |
24 Segment seg = s.segments[i]; | 27 Segment seg = s.segments[i]; |
25 os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate) | 28 os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate) |
26 << '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n"; | 29 << '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n"; |
27 } | 30 } |
28 | 31 |
29 return os; | 32 return os; |
30 } | 33 } |