Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

271 lines
9.7KB

  1. #!/usr/bin/env python3
  2. # SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
  3. # SPDX-License-Identifier: GPL-2.0-or-later
  4. from qt_config import qt as qt_config
  5. if qt_config == 5:
  6. from PyQt5.QtCore import Qt
  7. Qt.CheckState = int
  8. Qt.MiddleButton = Qt.MidButton
  9. elif qt_config == 6:
  10. from PyQt6.QtCore import Qt, QEvent, QEventLoop
  11. from PyQt6.QtGui import QFont, QPainter, QPalette
  12. from PyQt6.QtWidgets import (
  13. QAbstractItemView,
  14. QAbstractSpinBox,
  15. QApplication,
  16. QColorDialog,
  17. QDialog,
  18. QDialogButtonBox,
  19. QFileDialog,
  20. QGraphicsItem,
  21. QGraphicsScene,
  22. QGraphicsView,
  23. QHeaderView,
  24. QLineEdit,
  25. QListWidgetItem,
  26. QMenu,
  27. QMessageBox,
  28. QStyle,
  29. )
  30. Qt.AlignCenter = Qt.AlignmentFlag.AlignCenter
  31. Qt.AlignLeft = Qt.AlignmentFlag.AlignLeft
  32. Qt.AA_DontShowIconsInMenus = Qt.ApplicationAttribute.AA_DontShowIconsInMenus
  33. Qt.IgnoreAspectRatio = Qt.AspectRatioMode.IgnoreAspectRatio
  34. Qt.KeepAspectRatio = Qt.AspectRatioMode.KeepAspectRatio
  35. Qt.NoBrush = Qt.BrushStyle.NoBrush
  36. Qt.Checked = Qt.CheckState.Checked
  37. Qt.Unchecked = Qt.CheckState.Unchecked
  38. Qt.CustomContextMenu = Qt.ContextMenuPolicy.CustomContextMenu
  39. Qt.NoContextMenu = Qt.ContextMenuPolicy.NoContextMenu
  40. Qt.ArrowCursor = Qt.CursorShape.ArrowCursor
  41. Qt.ClosedHandCursor = Qt.CursorShape.ClosedHandCursor
  42. Qt.CrossCursor = Qt.CursorShape.CrossCursor
  43. Qt.OpenHandCursor = Qt.CursorShape.OpenHandCursor
  44. Qt.PointingHandCursor = Qt.CursorShape.PointingHandCursor
  45. Qt.SizeAllCursor = Qt.CursorShape.SizeAllCursor
  46. Qt.SizeHorCursor = Qt.CursorShape.SizeHorCursor
  47. Qt.black = Qt.GlobalColor.black
  48. Qt.blue = Qt.GlobalColor.blue
  49. Qt.cyan = Qt.GlobalColor.cyan
  50. Qt.darkGray = Qt.GlobalColor.darkGray
  51. Qt.red = Qt.GlobalColor.red
  52. Qt.transparent = Qt.GlobalColor.transparent
  53. Qt.white = Qt.GlobalColor.white
  54. Qt.yellow = Qt.GlobalColor.yellow
  55. Qt.Key_0 = Qt.Key.Key_0
  56. Qt.Key_1 = Qt.Key.Key_1
  57. Qt.Key_2 = Qt.Key.Key_2
  58. Qt.Key_3 = Qt.Key.Key_3
  59. Qt.Key_5 = Qt.Key.Key_5
  60. Qt.Key_6 = Qt.Key.Key_6
  61. Qt.Key_7 = Qt.Key.Key_7
  62. Qt.Key_9 = Qt.Key.Key_9
  63. Qt.Key_A = Qt.Key.Key_A
  64. Qt.Key_Agrave = Qt.Key.Key_Agrave
  65. Qt.Key_B = Qt.Key.Key_B
  66. Qt.Key_C = Qt.Key.Key_C
  67. Qt.Key_Ccedilla = Qt.Key.Key_Ccedilla
  68. Qt.Key_Comma = Qt.Key.Key_Comma
  69. Qt.Key_D = Qt.Key.Key_D
  70. Qt.Key_Delete = Qt.Key.Key_Delete
  71. Qt.Key_E = Qt.Key.Key_E
  72. Qt.Key_Eacute = Qt.Key.Key_Eacute
  73. Qt.Key_Egrave = Qt.Key.Key_Egrave
  74. Qt.Key_Escape = Qt.Key.Key_Escape
  75. Qt.Key_F = Qt.Key.Key_F
  76. Qt.Key_G = Qt.Key.Key_G
  77. Qt.Key_H = Qt.Key.Key_H
  78. Qt.Key_Home = Qt.Key.Key_Home
  79. Qt.Key_I = Qt.Key.Key_I
  80. Qt.Key_J = Qt.Key.Key_J
  81. Qt.Key_M = Qt.Key.Key_M
  82. Qt.Key_Minus = Qt.Key.Key_Minus
  83. Qt.Key_N = Qt.Key.Key_N
  84. Qt.Key_O = Qt.Key.Key_O
  85. Qt.Key_P = Qt.Key.Key_P
  86. Qt.Key_ParenLeft = Qt.Key.Key_ParenLeft
  87. Qt.Key_Plus = Qt.Key.Key_Plus
  88. Qt.Key_Q = Qt.Key.Key_Q
  89. Qt.Key_QuoteDbl = Qt.Key.Key_QuoteDbl
  90. Qt.Key_R = Qt.Key.Key_R
  91. Qt.Key_S = Qt.Key.Key_S
  92. Qt.Key_T = Qt.Key.Key_T
  93. Qt.Key_U = Qt.Key.Key_U
  94. Qt.Key_V = Qt.Key.Key_V
  95. Qt.Key_W = Qt.Key.Key_W
  96. Qt.Key_X = Qt.Key.Key_X
  97. Qt.Key_Y = Qt.Key.Key_Y
  98. Qt.Key_Z = Qt.Key.Key_Z
  99. Qt.AltModifier = Qt.KeyboardModifier.AltModifier
  100. Qt.ControlModifier = Qt.KeyboardModifier.ControlModifier
  101. Qt.MetaModifier = Qt.KeyboardModifier.MetaModifier
  102. Qt.NoModifier = Qt.KeyboardModifier.NoModifier
  103. Qt.ShiftModifier = Qt.KeyboardModifier.ShiftModifier
  104. Qt.UserRole = Qt.ItemDataRole.UserRole
  105. Qt.ItemIsDragEnabled = Qt.ItemFlag.ItemIsDragEnabled
  106. Qt.ItemIsEnabled = Qt.ItemFlag.ItemIsEnabled
  107. Qt.ItemIsSelectable = Qt.ItemFlag.ItemIsSelectable
  108. Qt.ContainsItemShape = Qt.ItemSelectionMode.ContainsItemShape
  109. Qt.LeftButton = Qt.MouseButton.LeftButton
  110. Qt.MiddleButton = Qt.MouseButton.MiddleButton
  111. Qt.RightButton = Qt.MouseButton.RightButton
  112. Qt.MouseEventSynthesizedByApplication = Qt.MouseEventSource.MouseEventSynthesizedByApplication
  113. Qt.Horizontal = Qt.Orientation.Horizontal
  114. Qt.FlatCap = Qt.PenCapStyle.FlatCap
  115. Qt.MiterJoin = Qt.PenJoinStyle.MiterJoin
  116. Qt.DashLine = Qt.PenStyle.DashLine
  117. Qt.NoPen = Qt.PenStyle.NoPen
  118. Qt.SolidLine = Qt.PenStyle.SolidLine
  119. Qt.ScrollBarAlwaysOn = Qt.ScrollBarPolicy.ScrollBarAlwaysOn
  120. Qt.ScrollBarAlwaysOff = Qt.ScrollBarPolicy.ScrollBarAlwaysOff
  121. Qt.AscendingOrder = Qt.SortOrder.AscendingOrder
  122. Qt.SmoothTransformation = Qt.TransformationMode.SmoothTransformation
  123. Qt.WA_OpaquePaintEvent = Qt.WidgetAttribute.WA_OpaquePaintEvent
  124. Qt.WindowModal = Qt.WindowModality.WindowModal
  125. Qt.WindowActive = Qt.WindowState.WindowActive
  126. Qt.WindowMinimized = Qt.WindowState.WindowMinimized
  127. Qt.MSWindowsFixedSizeDialogHint = Qt.WindowType.MSWindowsFixedSizeDialogHint
  128. Qt.WindowContextHelpButtonHint = Qt.WindowType.WindowContextHelpButtonHint
  129. QAbstractItemView.DropOnly = QAbstractItemView.DragDropMode.DropOnly
  130. QAbstractItemView.SingleSelection = QAbstractItemView.SelectionMode.SingleSelection
  131. QAbstractSpinBox.NoButtons = QAbstractSpinBox.ButtonSymbols.NoButtons
  132. QAbstractSpinBox.UpDownArrows = QAbstractSpinBox.ButtonSymbols.UpDownArrows
  133. QAbstractSpinBox.StepNone = QAbstractSpinBox.StepEnabledFlag.StepNone
  134. QAbstractSpinBox.StepDownEnabled = QAbstractSpinBox.StepEnabledFlag.StepDownEnabled
  135. QAbstractSpinBox.StepUpEnabled = QAbstractSpinBox.StepEnabledFlag.StepUpEnabled
  136. QApplication.exec_ = lambda a: a.exec()
  137. QColorDialog.DontUseNativeDialog = QColorDialog.ColorDialogOption.DontUseNativeDialog
  138. QDialog.exec_ = lambda d: d.exec()
  139. QDialogButtonBox.Reset = QDialogButtonBox.StandardButton.Reset
  140. QEvent.EnabledChange = QEvent.Type.EnabledChange
  141. QEvent.MouseButtonPress = QEvent.Type.MouseButtonPress
  142. QEvent.PaletteChange = QEvent.Type.PaletteChange
  143. QEvent.StyleChange = QEvent.Type.StyleChange
  144. QEvent.User = QEvent.Type.User
  145. QEventLoop.ExcludeUserInputEvents = QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents
  146. QFileDialog.AcceptSave = QFileDialog.AcceptMode.AcceptSave
  147. QFileDialog.AnyFile = QFileDialog.FileMode.AnyFile
  148. QFileDialog.DontUseCustomDirectoryIcons = QFileDialog.Option.DontUseCustomDirectoryIcons
  149. QFileDialog.ShowDirsOnly = QFileDialog.Option.ShowDirsOnly
  150. QFont.AllUppercase = QFont.Capitalization.AllUppercase
  151. QFont.Bold = QFont.Weight.Bold
  152. QFont.Normal = QFont.Weight.Normal
  153. QGraphicsItem.ItemSelectedHasChanged = QGraphicsItem.GraphicsItemChange.ItemSelectedHasChanged
  154. QGraphicsItem.ItemIsFocusable = QGraphicsItem.GraphicsItemFlag.ItemIsFocusable
  155. QGraphicsItem.ItemIsMovable = QGraphicsItem.GraphicsItemFlag.ItemIsMovable
  156. QGraphicsItem.ItemIsSelectable = QGraphicsItem.GraphicsItemFlag.ItemIsSelectable
  157. QGraphicsItem.ItemSendsGeometryChanges = QGraphicsItem.GraphicsItemFlag.ItemSendsGeometryChanges
  158. QGraphicsScene.NoIndex = QGraphicsScene.ItemIndexMethod.NoIndex
  159. QGraphicsView.NoDrag = QGraphicsView.DragMode.NoDrag
  160. QGraphicsView.ScrollHandDrag = QGraphicsView.DragMode.ScrollHandDrag
  161. QGraphicsView.FullViewportUpdate = QGraphicsView.ViewportUpdateMode.FullViewportUpdate
  162. QGraphicsView.MinimalViewportUpdate = QGraphicsView.ViewportUpdateMode.MinimalViewportUpdate
  163. QHeaderView.Fixed = QHeaderView.ResizeMode.Fixed
  164. QLineEdit.Normal = QLineEdit.EchoMode.Normal
  165. QListWidgetItem.UserType = QListWidgetItem.ItemType.UserType
  166. QMenu.exec_ = lambda m, p: m.exec(p)
  167. QMessageBox.exec_ = lambda mb: mb.exec()
  168. QMessageBox.Cancel = QMessageBox.StandardButton.Cancel
  169. QMessageBox.No = QMessageBox.StandardButton.No
  170. QMessageBox.Ok = QMessageBox.StandardButton.Ok
  171. QMessageBox.Yes = QMessageBox.StandardButton.Yes
  172. QMessageBox.Critical = QMessageBox.Icon.Critical
  173. QMessageBox.Information = QMessageBox.Icon.Information
  174. QMessageBox.Warning = QMessageBox.Icon.Warning
  175. QPainter.CompositionMode_Difference = QPainter.CompositionMode.CompositionMode_Difference
  176. QPainter.CompositionMode_Multiply = QPainter.CompositionMode.CompositionMode_Multiply
  177. QPainter.CompositionMode_Plus = QPainter.CompositionMode.CompositionMode_Plus
  178. QPainter.CompositionMode_SourceOver = QPainter.CompositionMode.CompositionMode_SourceOver
  179. QPainter.HighQualityAntialiasing = None
  180. QPainter.Antialiasing = QPainter.RenderHint.Antialiasing
  181. QPainter.SmoothPixmapTransform = QPainter.RenderHint.SmoothPixmapTransform
  182. QPainter.TextAntialiasing = QPainter.RenderHint.TextAntialiasing
  183. QPalette.Active = QPalette.ColorGroup.Active
  184. QPalette.Disabled = QPalette.ColorGroup.Disabled
  185. QPalette.Inactive = QPalette.ColorGroup.Inactive
  186. QPalette.AlternateBase = QPalette.ColorRole.AlternateBase
  187. QPalette.Base = QPalette.ColorRole.Base
  188. QPalette.BrightText = QPalette.ColorRole.BrightText
  189. QPalette.Button = QPalette.ColorRole.Button
  190. QPalette.ButtonText = QPalette.ColorRole.ButtonText
  191. QPalette.Dark = QPalette.ColorRole.Dark
  192. QPalette.Highlight = QPalette.ColorRole.Highlight
  193. QPalette.HighlightedText = QPalette.ColorRole.HighlightedText
  194. QPalette.Light = QPalette.ColorRole.Light
  195. QPalette.Link = QPalette.ColorRole.Link
  196. QPalette.LinkVisited = QPalette.ColorRole.LinkVisited
  197. QPalette.Mid = QPalette.ColorRole.Mid
  198. QPalette.Midlight = QPalette.ColorRole.Midlight
  199. QPalette.Shadow = QPalette.ColorRole.Shadow
  200. QPalette.Text = QPalette.ColorRole.Text
  201. QPalette.ToolTipBase = QPalette.ColorRole.ToolTipBase
  202. QPalette.ToolTipText = QPalette.ColorRole.ToolTipText
  203. QPalette.Window = QPalette.ColorRole.Window
  204. QPalette.WindowText = QPalette.ColorRole.WindowText
  205. QPalette.Background = QPalette.Window
  206. QStyle.State_Selected = QStyle.StateFlag.State_Selected