player.cpp 1.81 KB
Newer Older
1 2 3 4
/***************************************************************************
                          player.cpp  -  description
                             -------------------
    begin                : Sun Feb 17 2002
5
    copyright            : (C) 2002, 2003 by Scott Wheeler
6
    email                : wheeler@kde.org
7
***************************************************************************/
8 9 10 11 12 13 14 15 16 17

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

18 19 20
#include <kaction.h>
#include <klocale.h>

21
#include "player.h"
22 23
#include "artsplayer.h"
#include "gstreamerplayer.h"
24 25

#include "../config.h"
26

27 28 29 30 31 32
/*
 * The goal here is to contain all of the #if'ed ugliness in this file.
 */


Player *Player::createPlayer(int system)
33 34
{
    Player *p = 0;
35
#if HAVE_GSTREAMER
36 37
    switch(system) {
    case Arts:
38
	p = new ArtsPlayer();
39 40
	break;
    case GStreamer:
41
	p = new GStreamerPlayer();
42 43
	break;
    }
44
#else
45
    Q_UNUSED(system);
46
    p = new ArtsPlayer();
47 48 49
#endif

    return p;
50
}
51 52 53 54 55 56 57 58 59 60 61 62 63 64

KSelectAction *Player::playerSelectAction(QObject *parent)
{
    KSelectAction *action = 0;
#if HAVE_GSTREAMER
    action = new KSelectAction(i18n("Ouput To"), 0, parent, "outputSelect");
    QStringList l;
    l << "aRts" << "GStreamer";
    action->setItems(l);
#else
    Q_UNUSED(parent);
#endif
    return action;
}