qaudioengine.sip 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // qaudioengine.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtSpatialAudio 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_5_0 -)
  22. class QAudioEngine : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qaudioengine.h>
  26. %End
  27. %ConvertToSubClassCode
  28. static struct class_graph {
  29. const char *name;
  30. sipTypeDef **type;
  31. int yes, no;
  32. } graph[] = {
  33. {sipName_QAmbientSound, &sipType_QAmbientSound, -1, 1},
  34. {sipName_QAudioEngine, &sipType_QAudioEngine, -1, 2},
  35. {sipName_QAudioListener, &sipType_QAudioListener, -1, 3},
  36. {sipName_QAudioRoom, &sipType_QAudioRoom, -1, 4},
  37. {sipName_QSpatialSound, &sipType_QSpatialSound, -1, -1},
  38. };
  39. int i = 0;
  40. sipType = NULL;
  41. do
  42. {
  43. struct class_graph *cg = &graph[i];
  44. if (cg->name != NULL && sipCpp->inherits(cg->name))
  45. {
  46. sipType = *cg->type;
  47. i = cg->yes;
  48. }
  49. else
  50. i = cg->no;
  51. }
  52. while (i >= 0);
  53. %End
  54. public:
  55. enum OutputMode
  56. {
  57. Surround,
  58. Stereo,
  59. Headphone,
  60. };
  61. QAudioEngine();
  62. explicit QAudioEngine(QObject *parent /TransferThis/);
  63. QAudioEngine(int sampleRate, QObject *parent /TransferThis/ = 0);
  64. virtual ~QAudioEngine();
  65. void setOutputMode(QAudioEngine::OutputMode mode);
  66. QAudioEngine::OutputMode outputMode() const;
  67. int sampleRate() const;
  68. void setOutputDevice(const QAudioDevice &device);
  69. QAudioDevice outputDevice() const;
  70. void setMasterVolume(float volume);
  71. float masterVolume() const;
  72. void setPaused(bool paused);
  73. bool paused() const;
  74. void setRoomEffectsEnabled(bool enabled);
  75. bool roomEffectsEnabled() const;
  76. static const float DistanceScaleCentimeter;
  77. static const float DistanceScaleMeter;
  78. void setDistanceScale(float scale);
  79. float distanceScale() const;
  80. signals:
  81. void outputModeChanged();
  82. void outputDeviceChanged();
  83. void masterVolumeChanged();
  84. void pausedChanged();
  85. void distanceScaleChanged();
  86. public slots:
  87. void start();
  88. void stop();
  89. void pause();
  90. void resume();
  91. };
  92. %End