/src/3rdparty/phonon/phonon/factory_p.h

https://bitbucket.org/ultra_iter/qt-vtl · C Header · 203 lines · 55 code · 27 blank · 121 comment · 0 complexity · 9e1d3af7ee2a777acca771e2e62187ca MD5 · raw file

  1. /* This file is part of the KDE project
  2. Copyright (C) 2004-2007 Matthias Kretz <kretz@kde.org>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) version 3, or any
  7. later version accepted by the membership of KDE e.V. (or its
  8. successor approved by the membership of KDE e.V.), Nokia Corporation
  9. (or its successors, if any) and the KDE Free Qt Foundation, which shall
  10. act as a proxy defined in Section 6 of version 3 of the license.
  11. This library is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with this library. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef PHONON_FACTORY_P_H
  19. #define PHONON_FACTORY_P_H
  20. #include "phonon_export.h"
  21. #include <QtCore/QObject>
  22. #include <QtCore/QStringList>
  23. QT_BEGIN_HEADER
  24. QT_BEGIN_NAMESPACE
  25. class QUrl;
  26. class QIcon;
  27. namespace Phonon
  28. {
  29. class PlatformPlugin;
  30. class MediaNodePrivate;
  31. class AbstractMediaStream;
  32. /**
  33. * \internal
  34. * \brief Factory to access the preferred Backend.
  35. *
  36. * This class is used internally to get the backend's implementation.
  37. * It keeps track of the objects that were created. When a
  38. * request for a backend change comes, it asks all frontend objects to delete
  39. * their backend objects and then checks whether they were all deleted. Only
  40. * then the old backend is unloaded and the new backend is loaded.
  41. *
  42. * \author Matthias Kretz <kretz@kde.org>
  43. */
  44. namespace Factory
  45. {
  46. /**
  47. * Emits signals for Phonon::Factory.
  48. */
  49. class Sender : public QObject
  50. {
  51. Q_OBJECT
  52. Q_SIGNALS:
  53. /**
  54. * Emitted after the backend has successfully been changed.
  55. */
  56. void backendChanged();
  57. /**
  58. * \copydoc BackendCapabilities::Notifier::availableAudioOutputDevicesChanged
  59. */
  60. void availableAudioOutputDevicesChanged();
  61. /**
  62. * \copydoc BackendCapabilities::Notifier::availableAudioCaptureDevicesChanged
  63. */
  64. void availableAudioCaptureDevicesChanged();
  65. };
  66. /**
  67. * Returns a pointer to the object emitting the signals.
  68. *
  69. * \see Sender::backendChanged()
  70. */
  71. PHONON_EXPORT Sender *sender();
  72. /**
  73. * Create a new backend object for a MediaObject.
  74. *
  75. * \return a pointer to the MediaObject the backend provides.
  76. */
  77. QObject *createMediaObject(QObject *parent = 0);
  78. /**
  79. * Create a new backend object for a Effect.
  80. *
  81. * \return a pointer to the Effect the backend provides.
  82. */
  83. #ifndef QT_NO_PHONON_EFFECT
  84. QObject *createEffect(int effectId, QObject *parent = 0);
  85. #endif //QT_NO_PHONON_EFFECT
  86. /**
  87. * Create a new backend object for a VolumeFaderEffect.
  88. *
  89. * \return a pointer to the VolumeFaderEffect the backend provides.
  90. */
  91. #ifndef QT_NO_PHONON_VOLUMEFADEREFFECT
  92. QObject *createVolumeFaderEffect(QObject *parent = 0);
  93. #endif //QT_NO_PHONON_VOLUMEFADEREFFECT
  94. /**
  95. * Create a new backend object for a AudioOutput.
  96. *
  97. * \return a pointer to the AudioOutput the backend provides.
  98. */
  99. QObject *createAudioOutput(QObject *parent = 0);
  100. /**
  101. * Create a new backend object for a VideoWidget.
  102. *
  103. * \return a pointer to the VideoWidget the backend provides.
  104. */
  105. #ifndef QT_NO_PHONON_VIDEO
  106. QObject *createVideoWidget(QObject *parent = 0);
  107. #endif //QT_NO_PHONON_VIDEO
  108. /**
  109. * Create a new backend object for a AudioDataOutput.
  110. *
  111. * \return a pointer to the AudioDataOutput the backend provides.
  112. */
  113. PHONON_EXPORT QObject *createAudioDataOutput(QObject *parent = 0);
  114. /**
  115. * \return a pointer to the backend interface.
  116. */
  117. PHONON_EXPORT QObject *backend(bool createWhenNull = true);
  118. /**
  119. * Unique identifier for the Backend. Can be used in configuration files
  120. * for example.
  121. */
  122. QString identifier();
  123. /**
  124. * Get the name of the Backend. It's the name from the .desktop file.
  125. */
  126. PHONON_EXPORT QString backendName();
  127. /**
  128. * Get the comment of the Backend. It's the comment from the .desktop file.
  129. */
  130. QString backendComment();
  131. /**
  132. * Get the version of the Backend. It's the version from the .desktop file.
  133. *
  134. * The version is especially interesting if there are several versions
  135. * available for binary incompatible versions of the backend's media
  136. * framework.
  137. */
  138. QString backendVersion();
  139. /**
  140. * Get the icon (name) of the Backend. It's the icon from the .desktop file.
  141. */
  142. QString backendIcon();
  143. /**
  144. * Get the website of the Backend. It's the website from the .desktop file.
  145. */
  146. QString backendWebsite();
  147. /**
  148. * registers the backend object
  149. */
  150. PHONON_EXPORT QObject *registerQObject(QObject *o);
  151. bool isMimeTypeAvailable(const QString &mimeType);
  152. PHONON_EXPORT void registerFrontendObject(MediaNodePrivate *);
  153. PHONON_EXPORT void deregisterFrontendObject(MediaNodePrivate *);
  154. PHONON_EXPORT void setBackend(QObject *);
  155. //PHONON_EXPORT void createBackend(const QString &library, const QString &version = QString());
  156. PHONON_EXPORT PlatformPlugin *platformPlugin();
  157. //X It is probably better if we can get away with internal handling of
  158. //X freeing the soundcard device when it's not needed anymore and
  159. //X providing an IPC method to stop all MediaObjects -> free all
  160. //X devices
  161. //X /**
  162. //X * \internal
  163. //X * This is called when the application needs to free the soundcard
  164. //X * device(s).
  165. //X */
  166. //X void freeSoundcardDevices();
  167. } // namespace Factory
  168. } // namespace Phonon
  169. QT_END_NAMESPACE
  170. QT_END_HEADER
  171. #endif // PHONON_FACTORY_P_H
  172. // vim: sw=4 ts=4