~ubuntu-branches/ubuntu/lucid/mplayerthumbs/lucid

« back to all changes in this revision

Viewing changes to src/servicesfactory.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-06-21 16:41:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090621164115-9w006t552m6juiun
Tags: 1.2-kde4.3.0-0ubuntu1
* New upstream release
* Transition to kde.mk from pkg-kde-tools:
  - Bump debhelper build-dep to 7
  - Bump compat version to 7
  - Include kde.mk and debhelper.mk in debian/rules
* Add shlib-depends to depends
* Bump Standards-Version to 3.8.2
* Remove unnecessary build-depend on cmake, bump kdelibs5-dev build-depend
  to 4.2.85 as its the first version to build-dep on cmake
* Drop conflict on libarts1-xine, package hasn't existed for a while
* Move homepage from the package description to its own field.
* Remove debian/patches. The only patch was a GCC fix that hasn't been
  applied in the last release, and mplayerthumbs seems to work with the 
  latest GCC
* Add debian/patches/kubuntu_01_out_of_source_build.diff so that we can
  build outside of kdemultimedia

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
   Copyright (C) 2006-2009
 
3
   by Marco Gulino <marco.gulino@gmail.com>
 
4
 
 
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.
 
8
 
 
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.
 
13
 
 
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.
 
18
*/
 
19
 
 
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"
 
27
 
 
28
 
 
29
#ifdef PHONON_API
 
30
        #include "phononbackend.h"
 
31
#endif
 
32
 
 
33
PreviewingFile* ServicesFactory::previewingFile(const QString& filePath, unsigned int scalingWidth, unsigned int scalingHeight, QObject* parent) {
 
34
  return new PreviewingFile(filePath, scalingWidth, scalingHeight, parent);
 
35
}
 
36
 
 
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);
 
43
          break;
 
44
#ifdef PHONON_API
 
45
    case VideoBackendIFace::Phonon:
 
46
      kDebug(DBG_AREA) << "videopreview: Selected phonon backend\n";
 
47
      return new PhononBackend(previewingFile, cfg);
 
48
          break;
 
49
#endif
 
50
  }
 
51
  // Well, we should never be here...
 
52
  return NULL;
 
53
}
 
54
 
 
55
MPlayerThumbsCfg* ServicesFactory::config() {
 
56
  return MPlayerThumbsCfg::self();
 
57
}
 
58
 
 
59
ServicesFactory::~ServicesFactory() {
 
60
 
 
61
}
 
62
 
 
63