PageRenderTime 96ms CodeModel.GetById 32ms RepoModel.GetById 2ms 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. #ifndef OGGTHROUGHANALYZER_H
  21. #define OGGTHROUGHANALYZER_H
  22. #include <strigi/streamthroughanalyzer.h>
  23. #include <strigi/fieldtypes.h>
  24. #include <map>
  25. // ogg according to http://tools.ietf.org/html/rfc3533
  26. // and http://xiph.org/ogg/doc/rfc3534.txt
  27. // and http://xiph.org/vorbis/doc/v-comment.html
  28. class OggThroughAnalyzerFactory;
  29. class OggThroughAnalyzer : public Strigi::StreamThroughAnalyzer {
  30. private:
  31. Strigi::AnalysisResult* indexable;
  32. const OggThroughAnalyzerFactory* factory;
  33. public:
  34. OggThroughAnalyzer(const OggThroughAnalyzerFactory* f) :factory(f) {}
  35. ~OggThroughAnalyzer() {}
  36. void setIndexable(Strigi::AnalysisResult*);
  37. Strigi::InputStream *connectInputStream(Strigi::InputStream *in);
  38. bool isReadyWithStream();
  39. const char* name() const { return "OggThroughAnalyzer"; }
  40. };
  41. class OggThroughAnalyzerFactory
  42. : public Strigi::StreamThroughAnalyzerFactory {
  43. friend class OggThroughAnalyzer;
  44. private:
  45. std::map<std::string, const Strigi::RegisteredField*> fields;
  46. const Strigi::RegisteredField* artistField;
  47. const Strigi::RegisteredField* albumField;
  48. const Strigi::RegisteredField* composerField;
  49. const Strigi::RegisteredField* performerField;
  50. const char* name() const {
  51. return "OggThroughAnalyzer";
  52. }
  53. Strigi::StreamThroughAnalyzer* newInstance() const {
  54. return new OggThroughAnalyzer(this);
  55. }
  56. void registerFields(Strigi::FieldRegister&);
  57. };
  58. #endif