• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • arts
 

arts

  • arts
  • kde
kaudiomanagerplay.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2003 Matthias Kretz <kretz@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 
18 */
19 
20 #include "kaudiomanagerplay.h"
21 #include "kartsserver.h"
22 
23 #include <soundserver.h>
24 #include <string>
25 
26 KAudioManagerPlay::KAudioManagerPlay( KArtsServer * server, const TQString & title )
27 {
28  d = new PrivateData;
29  d->amanPlay = Arts::DynamicCast( server->server().createObject( "Arts::Synth_AMAN_PLAY" ) );
30  d->started = false;
31  setTitle( title );
32 }
33 
34 KAudioManagerPlay::~KAudioManagerPlay()
35 {
36  stop();
37  delete d;
38 }
39 
40 Arts::Synth_AMAN_PLAY KAudioManagerPlay::amanPlay()
41 {
42  return d->amanPlay;
43 }
44 
45 bool KAudioManagerPlay::isNull() const
46 {
47  if( !this )
48  return true;
49  return d->amanPlay.isNull();
50 }
51 
52 void KAudioManagerPlay::setTitle( const TQString & title )
53 {
54  d->amanPlay.title( std::string( title.local8Bit() ) );
55 }
56 
57 TQString KAudioManagerPlay::title()
58 {
59  return TQString::fromLocal8Bit( d->amanPlay.title().c_str() );
60 }
61 
62 void KAudioManagerPlay::setAutoRestoreID( const TQString & autoRestoreID )
63 {
64  d->amanPlay.autoRestoreID( std::string( autoRestoreID.local8Bit() ) );
65 }
66 
67 TQString KAudioManagerPlay::autoRestoreID()
68 {
69  return TQString::fromLocal8Bit( d->amanPlay.autoRestoreID().c_str() );
70 }
71 
72 void KAudioManagerPlay::start()
73 {
74  if( d->started )
75  return;
76 
77  d->started = true;
78  d->amanPlay.start();
79 }
80 
81 void KAudioManagerPlay::stop()
82 {
83  if( !d->started )
84  return;
85 
86  d->started = false;
87  d->amanPlay.stop();
88 }
KArtsServer
KArtsServer is a wrapper to conveniently get a reference to a SoundServer, and restart artsd when nec...
Definition: kartsserver.h:38
KArtsServer::server
Arts::SoundServerV2 server(void)
Get a verified reference to the SoundServerV2, (re)starting artsd using the kcontrol-specified settin...
Definition: kartsserver.cpp:47
KAudioManagerPlay::title
TQString title()
returns the name of the output as it appears in the AudioManager
Definition: kaudiomanagerplay.cpp:57
KAudioManagerPlay::setTitle
void setTitle(const TQString &title)
Set the name of the output in the AudioManager.
Definition: kaudiomanagerplay.cpp:52
KAudioManagerPlay::isNull
bool isNull() const
return true if this == 0 or amanPlay().isNull()
Definition: kaudiomanagerplay.cpp:45
KAudioManagerPlay::amanPlay
Arts::Synth_AMAN_PLAY amanPlay()
Returns the internal Arts::Synth_AMAN_PLAY.
Definition: kaudiomanagerplay.cpp:40

arts

Skip menu "arts"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

arts

Skip menu "arts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for arts by doxygen 1.9.1
This website is maintained by Timothy Pearson.