PageRenderTime 47ms CodeModel.GetById 16ms app.highlight 15ms RepoModel.GetById 1ms app.codeStats 0ms

/strigi-0.7.7/libstreamanalyzer/lib/throughanalyzers/oggthroughanalyzer.h

#
C Header | 65 lines | 36 code | 7 blank | 22 comment | 0 complexity | 14d7d2ecd64e08c0844ed8447599622b MD5 | raw file
Possible License(s): LGPL-2.0
 1/* This file is part of Strigi Desktop Search
 2 *
 3 * Copyright (C) 2006 Jos van den Oever <jos@vandenoever.info>
 4 *
 5 * This library is free software; you can redistribute it and/or
 6 * modify it under the terms of the GNU Library General Public
 7 * License as published by the Free Software Foundation; either
 8 * version 2 of the License, or (at your option) any later version.
 9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB.  If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef OGGTHROUGHANALYZER_H
22#define OGGTHROUGHANALYZER_H
23
24#include <strigi/streamthroughanalyzer.h>
25#include <strigi/fieldtypes.h>
26#include <map>
27
28// ogg according to http://tools.ietf.org/html/rfc3533
29// and http://xiph.org/ogg/doc/rfc3534.txt
30// and http://xiph.org/vorbis/doc/v-comment.html
31
32class OggThroughAnalyzerFactory;
33class OggThroughAnalyzer : public Strigi::StreamThroughAnalyzer {
34private:
35    Strigi::AnalysisResult* indexable;
36    const OggThroughAnalyzerFactory* factory;
37public:
38    OggThroughAnalyzer(const OggThroughAnalyzerFactory* f) :factory(f) {}
39    ~OggThroughAnalyzer() {}
40    void setIndexable(Strigi::AnalysisResult*);
41    Strigi::InputStream *connectInputStream(Strigi::InputStream *in);
42    bool isReadyWithStream();
43    const char* name() const { return "OggThroughAnalyzer"; }
44};
45
46class OggThroughAnalyzerFactory
47        : public Strigi::StreamThroughAnalyzerFactory {
48friend class OggThroughAnalyzer;
49private:
50    std::map<std::string, const Strigi::RegisteredField*> fields;
51    const Strigi::RegisteredField* artistField;
52    const Strigi::RegisteredField* albumField;
53    const Strigi::RegisteredField* composerField;
54    const Strigi::RegisteredField* performerField;
55    const char* name() const {
56        return "OggThroughAnalyzer";
57    }
58    Strigi::StreamThroughAnalyzer* newInstance() const {
59        return new OggThroughAnalyzer(this);
60    }
61    void registerFields(Strigi::FieldRegister&);
62};
63
64
65#endif