\section{KDE::Play\-Object\-Factory Class Reference}
\label{classKDE_1_1PlayObjectFactory}\index{KDE::PlayObjectFactory@{KDE::PlayObjectFactory}}
This class implements a factory to create KDE::Play\-Objects for a given URL and mimetype.  


{\tt \#include $<$kplayobjectfactory.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Play\-Object\-Factory} (Arts::Sound\-Server\-V2 server)
\item 
{\bf Play\-Object\-Factory} ({\bf KArts\-Server} $\ast$server)
\item 
void {\bf set\-Audio\-Manager\-Play} ({\bf KAudio\-Manager\-Play} $\ast$amanplay)
\item 
{\bf KDE::Play\-Object} $\ast$ {\bf create\-Play\-Object} (const {\bf KURL} \&url, bool create\-BUS)
\item 
{\bf KDE::Play\-Object} $\ast$ {\bf create\-Play\-Object} (const {\bf KURL} \&url, const {\bf QString} \&mimetype, bool create\-BUS)
\item 
void {\bf set\-Allow\-Streaming} (bool s)
\item 
bool {\bf allow\-Streaming} ()
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf QString\-List} {\bf mime\-Types} (void)
\end{CompactItemize}


\subsection{Detailed Description}
This class implements a factory to create KDE::Play\-Objects for a given URL and mimetype. 

A detailed description about how to use the {\bf KDE} multimedia framework can be found in the documentation for {\bf KDE::Play\-Object}{\rm (p.\,\pageref{classKDE_1_1PlayObject})}.



Definition at line 79 of file kplayobjectfactory.h.

\subsection{Constructor \& Destructor Documentation}
\index{KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}!PlayObjectFactory@{PlayObjectFactory}}
\index{PlayObjectFactory@{PlayObjectFactory}!KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDE::Play\-Object\-Factory::Play\-Object\-Factory (Arts::Sound\-Server\-V2 {\em server})}\label{classKDE_1_1PlayObjectFactory_a0}


Creates a KDE::Play\-Object\-Factory. 

{\tt server} is an Arts::Sound\-Server\-V2

Definition at line 88 of file kplayobjectfactory.cc.\index{KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}!PlayObjectFactory@{PlayObjectFactory}}
\index{PlayObjectFactory@{PlayObjectFactory}!KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDE::Play\-Object\-Factory::Play\-Object\-Factory ({\bf KArts\-Server} $\ast$ {\em server})}\label{classKDE_1_1PlayObjectFactory_a1}


Convenience constructor to pass a {\bf KArts\-Server}{\rm (p.\,\pageref{classKArtsServer})} instead of an Arts::Sound\-Server\-V2. 

This equivalent to calling KDE::Play\-Object\-Factory( server.server() ).

\begin{Desc}
\item[Since:]3.2\end{Desc}


Definition at line 98 of file kplayobjectfactory.cc.

\subsection{Member Function Documentation}
\index{KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}!setAudioManagerPlay@{setAudioManagerPlay}}
\index{setAudioManagerPlay@{setAudioManagerPlay}!KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDE::Play\-Object\-Factory::set\-Audio\-Manager\-Play ({\bf KAudio\-Manager\-Play} $\ast$ {\em amanplay})}\label{classKDE_1_1PlayObjectFactory_a3}


If this is set the {\bf Play\-Object}{\rm (p.\,\pageref{classKDE_1_1PlayObject})} doesn't create a Synth\_\-BUS\_\-UPLINK at all but always uses the Synth\_\-AMAN\_\-PLAY that you passed. 



Definition at line 114 of file kplayobjectfactory.cc.\index{KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}!createPlayObject@{createPlayObject}}
\index{createPlayObject@{createPlayObject}!KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KDE::Play\-Object} $\ast$ KDE::Play\-Object\-Factory::create\-Play\-Object (const {\bf KURL} \& {\em url}, bool {\em create\-BUS})}\label{classKDE_1_1PlayObjectFactory_a4}


Creates a {\bf KDE::Play\-Object}{\rm (p.\,\pageref{classKDE_1_1PlayObject})} to play back the file or stream {\tt url} points to. 

Set {\tt create\-BUS} to \char`\"{}true\char`\"{}, if you want the {\bf Play\-Object}{\rm (p.\,\pageref{classKDE_1_1PlayObject})} to be connected to a SYNTH\_\-BUS\_\-UPLINK on creation. This is usually the case. You only need to set this to \char`\"{}false\char`\"{} if you want to attach your own sound effects to the {\bf Play\-Object}{\rm (p.\,\pageref{classKDE_1_1PlayObject})}.

You don't need to know the mimetype of the file or stream, it will be detected automatically.

Definition at line 121 of file kplayobjectfactory.cc.

References KMime\-Type::find\-By\-URL().\index{KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}!createPlayObject@{createPlayObject}}
\index{createPlayObject@{createPlayObject}!KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KDE::Play\-Object} $\ast$ KDE::Play\-Object\-Factory::create\-Play\-Object (const {\bf KURL} \& {\em url}, const {\bf QString} \& {\em mimetype}, bool {\em create\-BUS})}\label{classKDE_1_1PlayObjectFactory_a5}


This method also creates a {\bf KDE::Play\-Object}{\rm (p.\,\pageref{classKDE_1_1PlayObject})}, but does no automatic mimetype detection. 

Use this method with care.

Definition at line 127 of file kplayobjectfactory.cc.

References QObject::connect(), endl(), kd\-Warning(), and mime\-Types().\index{KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}!setAllowStreaming@{setAllowStreaming}}
\index{setAllowStreaming@{setAllowStreaming}!KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDE::Play\-Object\-Factory::set\-Allow\-Streaming (bool {\em s})\hspace{0.3cm}{\tt  [inline]}}\label{classKDE_1_1PlayObjectFactory_a6}


set\-Allow\-Streaming( true ) allows the factory to create a streaming {\bf Play\-Object}{\rm (p.\,\pageref{classKDE_1_1PlayObject})} for a non-local URL. 

This is also the default. Usually, you should not need to set this to false.

Definition at line 126 of file kplayobjectfactory.h.\index{KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}!allowStreaming@{allowStreaming}}
\index{allowStreaming@{allowStreaming}!KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDE::Play\-Object\-Factory::allow\-Streaming ()\hspace{0.3cm}{\tt  [inline]}}\label{classKDE_1_1PlayObjectFactory_a7}


returns \char`\"{}true\char`\"{} if the factory is allowed to create streaming Play\-Objects. 



Definition at line 132 of file kplayobjectfactory.h.\index{KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}!mimeTypes@{mimeTypes}}
\index{mimeTypes@{mimeTypes}!KDE::PlayObjectFactory@{KDE::Play\-Object\-Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KDE::Play\-Object\-Factory::mime\-Types (void)\hspace{0.3cm}{\tt  [static]}}\label{classKDE_1_1PlayObjectFactory_e0}


Return the mimetypes that are playable. 



Definition at line 174 of file kplayobjectfactory.cc.

References QString::from\-Local8Bit(), KMime\-Type::mime\-Type(), QString\-List::sort(), and QString::strip\-White\-Space().

Referenced by create\-Play\-Object().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kplayobjectfactory.h\item 
kplayobjectfactory.cc\end{CompactItemize}
