Skip to content

Commit 3293b4e

Browse files
committed
Python update
1 parent 32a2fab commit 3293b4e

27 files changed

Lines changed: 1479 additions & 1408 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import _MatrixOS_Color
22

33
class Color(_MatrixOS_Color.Color):
4-
def Dim(self, factor: float = 0.2168) -> 'Color':
4+
def Dim(self, factor: float = 0.2168) -> Color:
55
return super().Dim(factor)
66

7-
def DimIfNot(self, not_dim: bool, factor: float = 0.2168) -> 'Color':
7+
def DimIfNot(self, not_dim: bool, factor: float = 0.2168) -> Color:
88
return super().DimIfNot(not_dim, factor)

Applications/Python/PikaPython/MatrixOS_KeyPad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from MatrixOS_KeyInfo import KeyInfo
44
from MatrixOS_Point import Point
55

6-
FunctionKey:int = 0
6+
FunctionKeyID:int = 0
77

88
def Get(timeout_ms: int = 0) -> KeyEvent:
99
return _MatrixOS_KeyPad.Get(timeout_ms)
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# KeyState enumeration for MatrixOS
2-
# Binding of OS/Framework/KeyEvent/KeyEvent.h
2+
# Binding of OS/Framework/KeyEvent/KeyInfo.h
33

44
class KeyState:
55
"""Key state enumeration values"""
6-
IDLE: int = 0
7-
ACTIVATED: int = 1
8-
PRESSED: int = 2
9-
RELEASED: int = 3
10-
HOLD: int = 4
11-
AFTERTOUCH: int = 5
6+
INVALID: int = 0
7+
IDLE: int = 1
8+
ACTIVATED: int = 2
9+
PRESSED: int = 3
10+
RELEASED: int = 4
11+
HOLD: int = 5
12+
AFTERTOUCH: int = 6
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _MatrixOS_Point
22

33
class Point(_MatrixOS_Point.Point):
4-
def Rotate(self, rotation: int, dimension: 'Point', reverse: bool = False) -> 'Point':
4+
def Rotate(self, rotation: int, dimension: Point, reverse: bool = False) -> Point:
55
return super().Rotate(rotation, dimension, reverse)

Applications/Python/PikaPython/_MatrixOS_Dimension.pyi

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ class Dimension:
2525
def Area(self) -> int: ...
2626

2727
# Operators
28-
def __add__(self, other: 'Dimension') -> 'Dimension': ...
29-
def __eq__(self, other: 'Dimension') -> bool: ...
30-
def __ne__(self, other: 'Dimension') -> bool: ...
31-
def __lt__(self, other: 'Dimension') -> bool: ...
32-
def __bool__(self) -> bool: ...
33-
def __int__(self) -> int: ...
28+
def __add__(self, other: Dimension) -> Dimension: ...
29+
def __eq__(self, other: Dimension) -> bool: ...
30+
def __bool__(self) -> bool: ...

Applications/Python/PikaPython/_MatrixOS_KeyEvent.pyi

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,15 @@ class KeyEvent:
1111

1212
# Getters
1313
def ID(self) -> int: ...
14-
def KeyInfo(self) -> any: ...
14+
def KeyInfo(self) -> any: ...
15+
16+
# Pass-through methods to KeyInfo
17+
def State(self) -> int: ...
18+
def Hold(self) -> bool: ...
19+
def HoldTime(self) -> int: ...
20+
def Active(self) -> bool: ...
21+
def Force(self) -> float: ...
22+
def Value(self, index: int = 0) -> float: ...
23+
24+
# Boolean conversion operator
25+
def __bool__(self) -> bool: ...

Applications/Python/PikaPython/_MatrixOS_KeyInfo.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ class KeyInfo:
99
# Constructor
1010
def __init__(self, *val): ...
1111

12-
# Getter
12+
# Getters
1313
def State(self) -> int: ... # Should return KeyState
14-
def Velocity(self) -> float: ...
14+
def Force(self) -> float: ...
15+
def Value(self, index: int = 0) -> float: ...
1516
def LastEventTime(self) -> int: ...
1617
def Hold(self) -> bool: ...
1718

Applications/Python/PikaPython/_MatrixOS_MidiPacket.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ class MidiPacket:
3535
def Value(self) -> int: ...
3636

3737
# Setters
38-
def SetStatus(self, status: MidiStatus) -> None: ...
39-
def SetChannel(self, channel: int) -> None: ...
40-
def SetNote(self, note: int) -> None: ...
41-
def SetController(self, controller: int) -> None: ...
42-
def SetVelocity(self, velocity: int) -> None: ...
43-
def SetValue(self, value: int) -> None: ...
38+
def SetStatus(self, status: MidiStatus) -> bool: ...
39+
def SetChannel(self, channel: int) -> bool: ...
40+
def SetNote(self, note: int) -> bool: ...
41+
def SetController(self, controller: int) -> bool: ...
42+
def SetVelocity(self, velocity: int) -> bool: ...
43+
def SetValue(self, value: int) -> bool: ...
4444

4545
# Helper
4646
def Length(self) -> int: ...

Applications/Python/PikaPython/_MatrixOS_Point.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Point:
1515
def __add__(self, other: Point) -> Point: ...
1616
def __sub__(self, other: Point) -> Point: ...
1717
def __mul__(self, val: int) -> Point: ...
18-
def __div__(self, val: int) -> Point: ...
1918
def __eq__(self, other: Point) -> bool: ...
2019
def __ne__(self, other: Point) -> bool: ...
2120
def Rotate(self, rotation: Direction, dimension: Point, reverse: bool) -> Point: ...

Applications/Python/PikaPython/pikascript-api/_MatrixOS_Dimension_Dimension.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ PikaObj* _MatrixOS_Dimension_Dimension___add__(PikaObj *self, PikaObj* other);
2727
pika_bool _MatrixOS_Dimension_Dimension___bool__(PikaObj *self);
2828
pika_bool _MatrixOS_Dimension_Dimension___eq__(PikaObj *self, PikaObj* other);
2929
void _MatrixOS_Dimension_Dimension___init__(PikaObj *self, PikaTuple* val);
30-
int _MatrixOS_Dimension_Dimension___int__(PikaObj *self);
31-
pika_bool _MatrixOS_Dimension_Dimension___lt__(PikaObj *self, PikaObj* other);
32-
pika_bool _MatrixOS_Dimension_Dimension___ne__(PikaObj *self, PikaObj* other);
3330

3431
#endif

0 commit comments

Comments
 (0)