• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
PlaybackSoundCueItem.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2014 Sanjiban Bairagya <sanjiban22393@gmail.com>
9 //
10 
11 #include "PlaybackSoundCueItem.h"
12 
13 namespace Marble
14 {
15 PlaybackSoundCueItem::PlaybackSoundCueItem( const GeoDataSoundCue* soundCue )
16 {
17  m_soundCue = soundCue;
18 #ifdef HAVE_PHONON
19  Phonon::MediaObject *mediaObject = new Phonon::MediaObject( );
20  Phonon::createPath( mediaObject, new Phonon::AudioOutput( Phonon::MusicCategory ) );
21  mediaObject->setCurrentSource( QUrl( soundCue->href() ) );
22  m_mediaObject = mediaObject;
23 #endif
24 }
25 
26 const GeoDataSoundCue* PlaybackSoundCueItem::soundCue() const
27 {
28  return m_soundCue;
29 }
30 
31 #ifdef HAVE_PHONON
32 Phonon::MediaObject* PlaybackSoundCueItem::mediaObject()
33 {
34  return m_mediaObject;
35 }
36 #endif
37 
38 double PlaybackSoundCueItem::duration() const
39 {
40 #ifdef HAVE_PHONON
41  return m_mediaObject->totalTime() * 1.0 / 1000;
42 #else
43  return 0;
44 #endif
45 }
46 
47 void PlaybackSoundCueItem::play()
48 {
49 #ifdef HAVE_PHONON
50  m_mediaObject->play();
51 #endif
52 }
53 
54 void PlaybackSoundCueItem::pause()
55 {
56 #ifdef HAVE_PHONON
57  m_mediaObject->pause();
58 #endif
59 }
60 
61 void PlaybackSoundCueItem::seek( double progress )
62 {
63 #ifdef HAVE_PHONON
64  m_mediaObject->seek( progress * 1000 );
65 #endif
66 }
67 
68 void PlaybackSoundCueItem::stop()
69 {
70 #ifdef HAVE_PHONON
71  m_mediaObject->stop();
72 #endif
73 }
74 
75 }
Marble::PlaybackSoundCueItem::PlaybackSoundCueItem
PlaybackSoundCueItem(const GeoDataSoundCue *soundCue)
Definition: PlaybackSoundCueItem.cpp:15
Marble::GeoDataSoundCue
Definition: GeoDataSoundCue.h:19
Phonon::MediaObject
Marble::PlaybackSoundCueItem::pause
void pause()
Definition: PlaybackSoundCueItem.cpp:54
Marble::PlaybackSoundCueItem::stop
void stop()
Definition: PlaybackSoundCueItem.cpp:68
Phonon::createPath
Path createPath(MediaNode *source, MediaNode *sink)
Marble::GeoDataSoundCue::href
QString href() const
Definition: GeoDataSoundCue.cpp:41
QUrl
Phonon::MediaObject::setCurrentSource
void setCurrentSource(const MediaSource &source)
Marble::PlaybackSoundCueItem::soundCue
const GeoDataSoundCue * soundCue() const
Definition: PlaybackSoundCueItem.cpp:26
Marble::PlaybackSoundCueItem::duration
double duration() const
Definition: PlaybackSoundCueItem.cpp:38
Phonon::AudioOutput
Marble::PlaybackSoundCueItem::play
void play()
Definition: PlaybackSoundCueItem.cpp:47
PlaybackSoundCueItem.h
Marble::PlaybackSoundCueItem::seek
void seek(double position)
Definition: PlaybackSoundCueItem.cpp:61
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal