~ubuntu-branches/ubuntu/maverick/amarok/maverick-backports

« back to all changes in this revision

Viewing changes to src/transcoding/TranscodingPropertyWidget.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2011-03-03 10:20:39 UTC
  • mfrom: (126.1.8 natty)
  • Revision ID: james.westby@ubuntu.com-20110303102039-a408rug513n4qbin
Tags: 2:2.4.0-0ubuntu4~maverick1
* Source backprt to maverick (LP: #728447)
  - Drop version requirement on libindicate-qt-dev build-dep

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************************
 
2
 * Copyright (c) 2010 Téo Mrnjavac <teo@kde.org>                                        *
 
3
 *                                                                                      *
 
4
 * This program is free software; you can redistribute it and/or modify it under        *
 
5
 * the terms of the GNU General Public License as published by the Free Software        *
 
6
 * Foundation; either version 2 of the License, or (at your option) any later           *
 
7
 * version.                                                                             *
 
8
 *                                                                                      *
 
9
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
 
10
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
 
11
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
 
12
 *                                                                                      *
 
13
 * You should have received a copy of the GNU General Public License along with         *
 
14
 * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
 
15
 ****************************************************************************************/
 
16
 
 
17
#include "TranscodingPropertyWidget.h"
 
18
 
 
19
#include "TranscodingPropertySliderWidget.h"
 
20
#include "TranscodingPropertySpinBoxWidget.h"
 
21
#include "TranscodingPropertyComboBoxWidget.h"
 
22
 
 
23
#include "core/support/Debug.h"
 
24
 
 
25
namespace Transcoding
 
26
{
 
27
 
 
28
PropertyWidget *
 
29
PropertyWidget::create( Property &property, QWidget * parent )
 
30
{
 
31
    switch( property.type() )
 
32
    {
 
33
    case Property::NUMERIC:
 
34
        return new PropertySpinBoxWidget( property, parent );
 
35
    case Property::LIST:
 
36
        return new PropertyComboBoxWidget( property, parent );
 
37
    case Property::TRADEOFF:
 
38
        return new PropertySliderWidget( property, parent );
 
39
    default:
 
40
        debug() << "Muy bad!";
 
41
        return 0;
 
42
    }
 
43
}
 
44
 
 
45
} //namespace Transcoding