PageRenderTime 173ms CodeModel.GetById 50ms app.highlight 40ms RepoModel.GetById 50ms app.codeStats 1ms

/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
20#include "playlist/dynamic/GeneratorInterface.h"
21
22#include "utils/Logger.h"
23#include "Source.h"
24
25
26Tomahawk::GeneratorInterface::GeneratorInterface( QObject* parent )
27    : QObject( parent )
28{
29}
30
31
32Tomahawk::GeneratorInterface::~GeneratorInterface()
33{
34}
35
36
37QList< Tomahawk::dyncontrol_ptr >
38Tomahawk::GeneratorInterface::controls()
39{
40//     if( m_controls.isEmpty() ) { // return a default control (so the user can add more)
41//         return QList< Tomahawk::dyncontrol_ptr >() << createControl();
42//     }
43
44    return m_controls;
45}
46
47
48QPixmap
49Tomahawk::GeneratorInterface::logo()
50{
51    return QPixmap();
52}
53
54
55void
56Tomahawk::GeneratorInterface::addControl( const Tomahawk::dyncontrol_ptr& control )
57{
58    m_controls << control;
59}
60
61
62void
63Tomahawk::GeneratorInterface::clearControls()
64{
65    m_controls.clear();
66}
67
68
69void
70Tomahawk::GeneratorInterface::setControls( const QList< Tomahawk::dyncontrol_ptr >& controls )
71{
72    m_controls = controls;
73}
74
75
76void
77Tomahawk::GeneratorInterface::removeControl( const Tomahawk::dyncontrol_ptr& control )
78{
79    m_controls.removeAll( control );
80}
81
82
83Tomahawk::dyncontrol_ptr
84Tomahawk::GeneratorInterface::createControl( const QString& type )
85{
86    Q_UNUSED( type );
87    Q_ASSERT( false );
88    return dyncontrol_ptr();
89}