/src/libtomahawk/infosystem/infoplugins/generic/echonestplugin.h

http://github.com/tomahawk-player/tomahawk · C Header · 88 lines · 53 code · 18 blank · 17 comment · 0 complexity · 6907267026762901599c5757930a454c MD5 · raw file

  1. /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
  2. *
  3. * Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
  4. *
  5. * Tomahawk is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * Tomahawk 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. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef ECHONESTPLUGIN_H
  19. #define ECHONESTPLUGIN_H
  20. #include "infosystem/infosystem.h"
  21. #include "infosystem/infosystemworker.h"
  22. #include <QObject>
  23. class QNetworkReply;
  24. namespace Echonest
  25. {
  26. class Artist;
  27. }
  28. namespace Tomahawk
  29. {
  30. namespace InfoSystem
  31. {
  32. class EchoNestPlugin : public InfoPlugin
  33. {
  34. Q_OBJECT
  35. public:
  36. EchoNestPlugin();
  37. virtual ~EchoNestPlugin();
  38. protected slots:
  39. virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
  40. virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data )
  41. {
  42. Q_UNUSED( caller );
  43. Q_UNUSED( type );
  44. Q_UNUSED( data );
  45. }
  46. virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
  47. {
  48. Q_UNUSED( criteria );
  49. Q_UNUSED( requestData );
  50. }
  51. private:
  52. void getSongProfile( const Tomahawk::InfoSystem::InfoRequestData &requestData, const QString &item = QString() );
  53. void getArtistBiography( const Tomahawk::InfoSystem::InfoRequestData &requestData );
  54. void getArtistFamiliarity( const Tomahawk::InfoSystem::InfoRequestData &requestData );
  55. void getArtistHotttnesss( const Tomahawk::InfoSystem::InfoRequestData &requestData );
  56. void getArtistTerms( const Tomahawk::InfoSystem::InfoRequestData &requestData );
  57. void getMiscTopTerms( const Tomahawk::InfoSystem::InfoRequestData &requestData );
  58. bool isValidArtistData( const Tomahawk::InfoSystem::InfoRequestData &requestData );
  59. bool isValidTrackData( const Tomahawk::InfoSystem::InfoRequestData &requestData );
  60. Echonest::Artist artistFromReply( QNetworkReply* );
  61. private slots:
  62. void getArtistBiographySlot();
  63. void getArtistFamiliaritySlot();
  64. void getArtistHotttnesssSlot();
  65. void getArtistTermsSlot();
  66. void getMiscTopSlot();
  67. };
  68. }
  69. }
  70. #endif // ECHONESTPLUGIN_H