Skip to content

Commit

Permalink
Display color in hex, change previous/fastForward actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawolanin committed Oct 3, 2021
1 parent 6c15dc9 commit 0f0f6ee
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 3 deletions.
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,87 @@ async def main(host="localhost", port="8080", username="", password=""):
print("Status:", status)
print("Number of tracks:", response["number_of_tracks"])
print("Time signature:", response["time_signature"])
print("Play state:", response["play_state"])
print("Repeat:", response["repeat"])
print("Metronome:", response["metronome"])


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```

### getStatus response

```json
{
"tracks": [
{
"index": 0,
"name": "MASTER",
"flags": [],
"volume": "1.000000",
"pan": "0.000000",
"last_meter_peak": "-1500",
"last_meter_pos": "-1500",
"width_pan2": "1.000000",
"panmode": "0",
"sendcnt": "0",
"recvcnt": "0",
"hwoutcnt": "1",
"color": "#000000"
},
{
"index": 1,
"name": "Track 1",
"flags": [],
"volume": "1.000000",
"pan": "0.000000",
"last_meter_peak": "-1500",
"last_meter_pos": "-1500",
"width_pan2": "1.000000",
"panmode": "3",
"sendcnt": "0",
"recvcnt": "0",
"hwoutcnt": "0",
"color": "#764e78"
},
{
"index": 2,
"name": "Track 2",
"flags": ["selected"],
"volume": "1.000000",
"pan": "0.000000",
"last_meter_peak": "-1500",
"last_meter_pos": "-1500",
"width_pan2": "1.000000",
"panmode": "3",
"sendcnt": "0",
"recvcnt": "0",
"hwoutcnt": "0",
"color": "#d9c25b"
}
],
"repeat": true,
"metronome": false,
"time_signature": "4/4",
"beatpos": {
"position_seconds": "0.000000000000000",
"full_beat_position": "0.000000000000000",
"measure_cnt": "0",
"beats_in_measure": "0.000000000010000"
},
"play_state": "stopped",
"transport": {
"playstate": "stopped",
"position_seconds": "0.000000",
"repeat": true,
"position_string": "1.1.00",
"position_string_beats": "1.1.00"
},
"number_of_tracks": 2
}
```

[releases]: https://github.com/kubawolanin/python-reaperdaw/releases
[releases-shield]: https://img.shields.io/github/release/kubawolanin/python-reaperdaw.svg?style=popout
[pypi-releases]: https://pypi.org/project/python-reaperdaw/
Expand Down
2 changes: 1 addition & 1 deletion reaperdaw/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def processLine(line: str):
"sendcnt": token[10],
"recvcnt": token[11],
"hwoutcnt": token[12],
"color": token[13],
"color": "#000000" if int(token[13]) == 0 else f"#{hex(int(token[13]))[3:]}",
})
return False

Expand Down
4 changes: 2 additions & 2 deletions reaperdaw/reaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def status(self):
return self._status

async def rewind(self):
await self.sendCommand("40084")
await self.sendCommand("40172")

async def stop(self):
await self.sendCommand("1016")
Expand All @@ -48,7 +48,7 @@ async def pause(self):
await self.sendCommand("1008")

async def fastForward(self):
await self.sendCommand("40085")
await self.sendCommand("40173")

async def record(self):
await self.sendCommand("1013")
Expand Down

0 comments on commit 0f0f6ee

Please sign in to comment.