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.

262 lines
9.4KB

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