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.

287 lines
10KB

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