1
// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
2
/* This file is part of the KDE project
4
base code from kaudioplayer.h, kaudioplayer.cpp
5
Copyright (C) 2000 Stefan Westerfeld
8
and konq_sound.h konq_sound.cc
9
Copyright (c) 2001 Malte Starostik <malte@kde.org>
12
Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
14
This library is free software; you can redistribute it and/or
15
modify it under the terms of the GNU Library General Public
16
License as published by the Free Software Foundation; either
17
version 2 of the License, or (at your option) any later version.
19
This library is distributed in the hope that it will be useful,
20
but WITHOUT ANY WARRANTY; without even the implied warranty of
21
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
Library General Public License for more details.
24
You should have received a copy of the GNU Library General Public License
25
along with this library; see the file COPYING.LIB. If not, write to
26
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27
Boston, MA 02111-1307, USA.
33
#include <kartsdispatcher.h>
34
#include <kplayobjectfactory.h>
35
#include <soundserver.h>
40
#include "kpresenter_sound_player.h"
44
class KPresenterSoundPlayerPrivate {
48
KPresenterSoundPlayerPrivate( QString fileName ) : fileName( fileName ) {};
51
KArtsDispatcher m_dispatche;
52
Arts::SoundServerV2 m_soundServer;
53
KPlayObjectFactory *m_factory;
54
KPlayObject *m_player;
58
KPresenterSoundPlayer::KPresenterSoundPlayer( const QString &fileName, QObject *parent, const char *name )
59
: QObject( parent, name )
61
d = new KPresenterSoundPlayerPrivate( fileName );
64
d->m_soundServer = Arts::Reference( "global:Arts_SoundServerV2" );
65
d->m_factory = new KPlayObjectFactory( d->m_soundServer );
70
KPresenterSoundPlayer::~KPresenterSoundPlayer()
79
void KPresenterSoundPlayer::play( const QString &fileName )
81
KPresenterSoundPlayer sp( fileName );
85
void KPresenterSoundPlayer::stop()
93
void KPresenterSoundPlayer::play()
96
if ( d->m_soundServer.isNull() )
101
d->m_player = d->m_factory->createPlayObject( d->fileName, true );
103
if ( d->m_player->object().isNull() )
111
#include "kpresenter_sound_player.moc"