Mercurial > hg > qm-dsp
comparison dsp/segmentation/Segmenter.cpp @ 18:8e90a56b4b5f
* merge in segmentation code from soundbite plugin/library repository
author | cannam |
---|---|
date | Wed, 09 Jan 2008 10:46:25 +0000 |
parents | |
children | 67899fda84f5 |
comparison
equal
deleted
inserted
replaced
17:a120ac7b26b2 | 18:8e90a56b4b5f |
---|---|
1 /* | |
2 * Segmenter.cpp | |
3 * soundbite | |
4 * | |
5 * Created by Mark Levy on 04/04/2006. | |
6 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. All rights reserved. | |
7 * | |
8 */ | |
9 | |
10 #include <iomanip> | |
11 | |
12 #include "Segmenter.h" | |
13 | |
14 ostream& operator<<(ostream& os, const Segmentation& s) | |
15 { | |
16 os << "structure_name : begin_time end_time\n"; | |
17 | |
18 for (int i = 0; i < s.segments.size(); i++) | |
19 { | |
20 Segment seg = s.segments[i]; | |
21 os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate) | |
22 << '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n"; | |
23 } | |
24 | |
25 return os; | |
26 } |