2
Copyright (C) 2006-2009
3
by Marco Gulino <marco.gulino@gmail.com>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License version 2.1 as published by the Free Software Foundation.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
20
#include "constants.h"
21
#include "servicesfactory.h"
22
#include "previewingfile.h"
23
#include "videobackendiface.h"
24
#include "mplayervideobackend.h"
25
#include "mplayerthumbs.h"
26
#include "mplayerthumbs-config.h"
30
#include "phononbackend.h"
33
PreviewingFile* ServicesFactory::previewingFile(const QString& filePath, unsigned int scalingWidth, unsigned int scalingHeight, QObject* parent) {
34
return new PreviewingFile(filePath, scalingWidth, scalingHeight, parent);
37
VideoBackendIFace *ServicesFactory::videoBackend(PreviewingFile* previewingFile, MPlayerThumbsCfg* cfg) {
38
kDebug(DBG_AREA) << "videopreview: backend: " << cfg->backend() << endl;
39
switch(cfg->backend() ) {
40
case VideoBackendIFace::MPlayer:
41
kDebug(DBG_AREA) << "videopreview: Selected mplayer backend\n";
42
return new MPlayerVideoBackend(previewingFile, cfg);
45
case VideoBackendIFace::Phonon:
46
kDebug(DBG_AREA) << "videopreview: Selected phonon backend\n";
47
return new PhononBackend(previewingFile, cfg);
51
// Well, we should never be here...
55
MPlayerThumbsCfg* ServicesFactory::config() {
56
return MPlayerThumbsCfg::self();
59
ServicesFactory::~ServicesFactory() {