PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/libtunepimp-0.5.3/lib/analyzer.h

#
C Header | 93 lines | 55 code | 12 blank | 26 comment | 0 complexity | 8ed2347893671a4119cfa6d7292e5d87 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, GPL-2.0, LGPL-2.0
  1. /*----------------------------------------------------------------------------
  2. libtunepimp -- The MusicBrainz tagging library.
  3. Let a thousand taggers bloom!
  4. Copyright (C) Robert Kaye 2003
  5. This file is part of libtunepimp.
  6. libtunepimp is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. libtunepimp 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
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with libtunepimp; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. $Id: analyzer.h 8359 2006-08-07 20:34:50Z luks $
  18. ----------------------------------------------------------------------------*/
  19. #ifndef __ANALYZER_H__
  20. #define __ANALYZER_H__
  21. #include "thread.h"
  22. #include "semaphore.h"
  23. #include "track.h"
  24. #include "plugin.h"
  25. #define ANALYZER_REDO_STRING "<redo>"
  26. enum PUIDResult
  27. {
  28. eOk,
  29. eFileNotFound,
  30. eDecodeError,
  31. eCannotConnect,
  32. eOutOfMemory,
  33. eNoPUID,
  34. eNoClientId,
  35. eOtherError
  36. };
  37. class TunePimp;
  38. class FileCache;
  39. class SubmitInfo;
  40. class WatchdogThread;
  41. class Plugins;
  42. class Track;
  43. class Analyzer : public Thread
  44. {
  45. public:
  46. Analyzer(TunePimp *tunePimp,
  47. Plugins *plugins,
  48. FileCache *cache,
  49. WatchdogThread *watchdog);
  50. virtual ~Analyzer(void);
  51. void wake(void);
  52. void threadMain(void);
  53. void setProxy(const std::string &proxyServer, short proxyPort)
  54. {
  55. this->proxyServer = proxyServer;
  56. this->proxyPort = proxyPort;
  57. };
  58. private:
  59. PUIDResult calculatePUID(Plugin *plugin, const std::string &fileName, std::string &err,
  60. std::string &puidId, unsigned long &duration, Metadata &mdata);
  61. void setError(Track *track, PUIDResult retVal);
  62. TunePimp *tunePimp;
  63. Plugins *plugins;
  64. FileCache *cache;
  65. bool exitThread;
  66. Semaphore *sem;
  67. unsigned lastWake;
  68. SubmitInfo *submitInfo;
  69. std::string proxyServer;
  70. short proxyPort;
  71. WatchdogThread *dog;
  72. };
  73. #endif