/src/libtomahawk/playlist/dynamic/GeneratorInterface.cpp

http://github.com/tomahawk-player/tomahawk · C++ · 89 lines · 47 code · 21 blank · 21 comment · 0 complexity · beae98aa830672251d459cb90cd937f0 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. * Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
  5. *
  6. * Tomahawk 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 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Tomahawk is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include "playlist/dynamic/GeneratorInterface.h"
  20. #include "utils/Logger.h"
  21. #include "Source.h"
  22. Tomahawk::GeneratorInterface::GeneratorInterface( QObject* parent )
  23. : QObject( parent )
  24. {
  25. }
  26. Tomahawk::GeneratorInterface::~GeneratorInterface()
  27. {
  28. }
  29. QList< Tomahawk::dyncontrol_ptr >
  30. Tomahawk::GeneratorInterface::controls()
  31. {
  32. // if( m_controls.isEmpty() ) { // return a default control (so the user can add more)
  33. // return QList< Tomahawk::dyncontrol_ptr >() << createControl();
  34. // }
  35. return m_controls;
  36. }
  37. QPixmap
  38. Tomahawk::GeneratorInterface::logo()
  39. {
  40. return QPixmap();
  41. }
  42. void
  43. Tomahawk::GeneratorInterface::addControl( const Tomahawk::dyncontrol_ptr& control )
  44. {
  45. m_controls << control;
  46. }
  47. void
  48. Tomahawk::GeneratorInterface::clearControls()
  49. {
  50. m_controls.clear();
  51. }
  52. void
  53. Tomahawk::GeneratorInterface::setControls( const QList< Tomahawk::dyncontrol_ptr >& controls )
  54. {
  55. m_controls = controls;
  56. }
  57. void
  58. Tomahawk::GeneratorInterface::removeControl( const Tomahawk::dyncontrol_ptr& control )
  59. {
  60. m_controls.removeAll( control );
  61. }
  62. Tomahawk::dyncontrol_ptr
  63. Tomahawk::GeneratorInterface::createControl( const QString& type )
  64. {
  65. Q_UNUSED( type );
  66. Q_ASSERT( false );
  67. return dyncontrol_ptr();
  68. }