qmediaplayer.sip 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. // qmediaplayer.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtMultimedia Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. %If (Qt_6_2_0 -)
  22. class QMediaPlayer : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qmediaplayer.h>
  26. %End
  27. public:
  28. enum PlaybackState
  29. {
  30. StoppedState,
  31. PlayingState,
  32. PausedState,
  33. };
  34. enum MediaStatus
  35. {
  36. NoMedia,
  37. LoadingMedia,
  38. LoadedMedia,
  39. StalledMedia,
  40. BufferingMedia,
  41. BufferedMedia,
  42. EndOfMedia,
  43. InvalidMedia,
  44. };
  45. enum Error
  46. {
  47. NoError,
  48. ResourceError,
  49. FormatError,
  50. NetworkError,
  51. AccessDeniedError,
  52. };
  53. explicit QMediaPlayer(QObject *parent /TransferThis/ = 0);
  54. virtual ~QMediaPlayer();
  55. QList<QMediaMetaData> audioTracks() const;
  56. QList<QMediaMetaData> videoTracks() const;
  57. QList<QMediaMetaData> subtitleTracks() const;
  58. int activeAudioTrack() const;
  59. int activeVideoTrack() const;
  60. int activeSubtitleTrack() const;
  61. void setActiveAudioTrack(int index);
  62. void setActiveVideoTrack(int index);
  63. void setActiveSubtitleTrack(int index);
  64. void setAudioOutput(QAudioOutput *output);
  65. QAudioOutput *audioOutput() const;
  66. void setVideoOutput(QObject *);
  67. QObject *videoOutput() const;
  68. void setVideoSink(QVideoSink *sink);
  69. QVideoSink *videoSink() const;
  70. QUrl source() const;
  71. const QIODevice *sourceDevice() const;
  72. QMediaPlayer::PlaybackState playbackState() const;
  73. QMediaPlayer::MediaStatus mediaStatus() const;
  74. qint64 duration() const;
  75. qint64 position() const;
  76. bool hasAudio() const;
  77. bool hasVideo() const;
  78. float bufferProgress() const;
  79. QMediaTimeRange bufferedTimeRange() const;
  80. bool isSeekable() const;
  81. qreal playbackRate() const;
  82. QMediaPlayer::Error error() const;
  83. QString errorString() const;
  84. bool isAvailable() const;
  85. QMediaMetaData metaData() const;
  86. public slots:
  87. void play();
  88. void pause();
  89. void stop();
  90. void setPosition(qint64 position);
  91. void setPlaybackRate(qreal rate);
  92. void setSource(const QUrl &source) /ReleaseGIL/;
  93. void setSourceDevice(QIODevice *device, const QUrl &sourceUrl = QUrl()) /ReleaseGIL/;
  94. signals:
  95. void sourceChanged(const QUrl &media);
  96. void playbackStateChanged(QMediaPlayer::PlaybackState newState);
  97. void mediaStatusChanged(QMediaPlayer::MediaStatus status);
  98. void durationChanged(qint64 duration);
  99. void positionChanged(qint64 position);
  100. void hasAudioChanged(bool available);
  101. void hasVideoChanged(bool videoAvailable);
  102. void bufferProgressChanged(float progress);
  103. void seekableChanged(bool seekable);
  104. void playbackRateChanged(qreal rate);
  105. void metaDataChanged();
  106. void videoOutputChanged();
  107. void audioOutputChanged();
  108. void tracksChanged();
  109. void activeTracksChanged();
  110. void errorChanged();
  111. void errorOccurred(QMediaPlayer::Error error, const QString &errorString);
  112. public:
  113. enum Loops /BaseType=IntEnum/
  114. {
  115. Infinite,
  116. Once,
  117. };
  118. int loops() const;
  119. void setLoops(int loops);
  120. signals:
  121. void loopsChanged();
  122. public:
  123. %If (Qt_6_5_0 -)
  124. bool isPlaying() const;
  125. %End
  126. signals:
  127. %If (Qt_6_5_0 -)
  128. void playingChanged(bool playing);
  129. %End
  130. public:
  131. %If (Qt_6_8_0 -)
  132. void setAudioBufferOutput(QAudioBufferOutput *output);
  133. %End
  134. %If (Qt_6_8_0 -)
  135. QAudioBufferOutput *audioBufferOutput() const;
  136. %End
  137. signals:
  138. %If (Qt_6_8_0 -)
  139. void audioBufferOutputChanged();
  140. %End
  141. public:
  142. %If (Qt_6_10_0 -)
  143. enum class PitchCompensationAvailability
  144. {
  145. AlwaysOn,
  146. Available,
  147. Unavailable,
  148. };
  149. %End
  150. %If (Qt_6_10_0 -)
  151. QMediaPlayer::PitchCompensationAvailability pitchCompensationAvailability() const;
  152. %End
  153. %If (Qt_6_10_0 -)
  154. bool pitchCompensation() const;
  155. %End
  156. %If (Qt_6_10_0 -)
  157. QPlaybackOptions playbackOptions() const;
  158. %End
  159. public slots:
  160. %If (Qt_6_10_0 -)
  161. void setPitchCompensation(bool) const;
  162. %End
  163. %If (Qt_6_10_0 -)
  164. void setPlaybackOptions(const QPlaybackOptions &options);
  165. %End
  166. %If (Qt_6_10_0 -)
  167. void resetPlaybackOptions();
  168. %End
  169. signals:
  170. %If (Qt_6_10_0 -)
  171. void pitchCompensationChanged(bool);
  172. %End
  173. %If (Qt_6_10_0 -)
  174. void playbackOptionsChanged();
  175. %End
  176. };
  177. %End