qaudioformat.sip 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // qaudioformat.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 QAudioFormat
  23. {
  24. %TypeHeaderCode
  25. #include <qaudioformat.h>
  26. %End
  27. public:
  28. enum AudioChannelPosition
  29. {
  30. UnknownPosition,
  31. FrontLeft,
  32. FrontRight,
  33. FrontCenter,
  34. LFE,
  35. BackLeft,
  36. BackRight,
  37. FrontLeftOfCenter,
  38. FrontRightOfCenter,
  39. BackCenter,
  40. LFE2,
  41. SideLeft,
  42. SideRight,
  43. TopFrontLeft,
  44. TopFrontRight,
  45. TopFrontCenter,
  46. TopCenter,
  47. TopBackLeft,
  48. TopBackRight,
  49. TopSideLeft,
  50. TopSideRight,
  51. TopBackCenter,
  52. BottomFrontCenter,
  53. BottomFrontLeft,
  54. BottomFrontRight,
  55. };
  56. enum ChannelConfig : quint32
  57. {
  58. ChannelConfigUnknown,
  59. ChannelConfigMono,
  60. ChannelConfigStereo,
  61. ChannelConfig2Dot1,
  62. %If (Qt_6_4_0 -)
  63. ChannelConfig3Dot0,
  64. %End
  65. %If (Qt_6_4_0 -)
  66. ChannelConfig3Dot1,
  67. %End
  68. ChannelConfigSurround5Dot0,
  69. ChannelConfigSurround5Dot1,
  70. ChannelConfigSurround7Dot0,
  71. ChannelConfigSurround7Dot1,
  72. };
  73. enum SampleFormat : quint16
  74. {
  75. Unknown,
  76. UInt8,
  77. Int16,
  78. Int32,
  79. Float,
  80. };
  81. bool isValid() const;
  82. void setSampleRate(int sampleRate);
  83. int sampleRate() const;
  84. void setChannelCount(int channelCount);
  85. int channelCount() const;
  86. qint32 bytesForDuration(qint64 duration) const;
  87. qint64 durationForBytes(qint32 byteCount) const;
  88. qint32 bytesForFrames(qint32 frameCount) const;
  89. qint32 framesForBytes(qint32 byteCount) const;
  90. qint32 framesForDuration(qint64 duration) const;
  91. qint64 durationForFrames(qint32 frameCount) const;
  92. int bytesPerFrame() const;
  93. void setChannelConfig(QAudioFormat::ChannelConfig config);
  94. QAudioFormat::ChannelConfig channelConfig() const;
  95. int channelOffset(QAudioFormat::AudioChannelPosition channel) const;
  96. void setSampleFormat(QAudioFormat::SampleFormat f);
  97. QAudioFormat::SampleFormat sampleFormat() const;
  98. int bytesPerSample() const;
  99. float normalizedSampleValue(const void *sample) const;
  100. %If (Qt_6_4_0 -)
  101. static QAudioFormat::ChannelConfig defaultChannelConfigForChannelCount(int channelCount);
  102. %End
  103. };
  104. %End
  105. %If (Qt_6_2_0 -)
  106. bool operator==(const QAudioFormat &a, const QAudioFormat &b);
  107. %End
  108. %If (Qt_6_2_0 -)
  109. bool operator!=(const QAudioFormat &a, const QAudioFormat &b);
  110. %End