Skip to content

Commit

Permalink
Merged in app_bundle (pull request #7)
Browse files Browse the repository at this point in the history
App bundle

Approved-by: Gustav Andersson
Approved-by: Ilias Bergstrom
  • Loading branch information
max-Elk committed Jun 27, 2023
2 parents 546cb28 + c01a186 commit a7bc6a5
Show file tree
Hide file tree
Showing 17 changed files with 1,927 additions and 1,217 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
venv/*
venv

.idea

sushi_gui/__pycache__/
sushi_gui/sushi_rpc_pb2*
sushi_gui/build/
sushi_gui/dist/
__pycache__/
sushi_rpc_pb2*

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "sushi-grpc-api"]
path = sushi-grpc-api
url = [email protected]:mindswteam/sushi-grpc-api.git
674 changes: 674 additions & 0 deletions LlCENSE

Large diffs are not rendered by default.

74 changes: 56 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,66 @@
# QT UI
Generic GUI for controlling Sushi over gRPC, built with python and QT. Can control both local instances and remote devices. Intended for testing and development.
# SUSHI GUI
A generic GUI for controlling Sushi over gRPC, built with Python and QT.
It can control both local instances and remote devices.
Intended for testing and development.

## Usage
## Installation
It is assumed you have Python 3 on your system. And Sushi, of course...

After cloning this repo, do not forget to run `git submodule update --init --recursive`!
### Dependencies
The preferred way to install deps is in a virtual environment. Here is how to do it with the builtin `venv` module. Using
`virtualenv` instead is also possible.
- `python3 -m venv venv` will create a virtual environment named *venv* with your installed Python
- `source venv/bin/activate` to activate that environment
- `pip install -r requirements.txt` to install all the dependencies in the environment

### Sushi .proto definitions
`sushi-grpc-api` is included in this repo as a submodule. It contains the proto definition file for Sushi.
In the Sushi repo, you will find the `.proto` definition file for Sushi. By default, this GUI will use that.

$ python3 ./qt_client.py
In case you need to use another proto file, you should set the environment variable SUSHI_GRPC_ELKPY_PROTO to that
path.

## Dependencies
* grpc-tools >= 1.29
* protobuf
* PySide2
Also, note that Sushi comes with its proto file when you check it out. Specifically in `sushi/rpc_interface/protos/sushi_rpc.proto`.
So setting environment variable like that:
```
$ export SUSHI_GRPC_ELKPY_PROTO=path_to_sushi/rpc_interface/protos/sushi_rpc.proto
```
will make the GUI use the proto file included with Sushi.

## Notes
* Make sure to set the path to _sushi_rpc.proto_ before launching.
* If controlling Sushi running on a remote device, change the ip from localhost to the *ip of the elk device*.
* It is assumed that you have copied the ElkPy package to the UI top directory, as advised in the ElkPy documentation.
If you want to use ElkPy from another place, do not forget to adapt the relevant `import` statements.
If you find yourself using this often and wanting to set the variable *once and for all*, you should add the command to your
`.bashrc` or `.zshrc`, depending on which shell you are using.

# TK UI (deprecated)
`client.py` is a generic GUI for controlling Sushi over gRPC, built with python and Tk. Can control both local instances and remote devices. Intended for testing and development and not for externa use. UI is very ugly and the code not up to standard for publishing.

Only works with Sushi version <= 0.9, use QT UI with more recent versions of Sushi
---


## Usage
Assuming that Sushi is running on your machine:

$ python3 ./sushi-gui.py

## Controlling Sushi when it is running on another machine
The GUI lets you specify an IP address and port number to connect to. Simple as that.

In case you need to hard-code a different default address than `localhost:51051`, feel free
to edit `sushi-gui.py:4`:
```
SUSHI_ADDRESS = 'localhost:51051'
```
with the new default address.

## Limitations
Although meant as a debugging/testing tools for Sushi developers, this GUI does **not** implement all of Sushi's features.
Most notably, some behavior one might expect after learning about the notification system is missing:

### Processor update notifications and ordering
Sushi allows for adding processor anywhere in the processor stack. But this GUI does not. When adding a plugin, it will
always add it at the bottom of the stack, i.e. in the last position in the audio flow. This limitation gets even more
annoying when the processor addition is done via other means which do allow for insertion in any position because this
GUI will **not** reflect the new ordering: the new plugin will always be shown at the bottom of the stack even though
it is actually somewhere else. Keep that in mind.

$ python3 ./client.py
---
Copyright 2023 Elk Audio AB, Stockholm, Sweden.

Make sure to set the path to _sushi_rpc.proto_ before launching. If controlling Sushi running on a remote device, change the ip from localhost to the ip of the elk device.
242 changes: 0 additions & 242 deletions client.py

This file was deleted.

21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build-system]
requires = ["setuptools>=59.5.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "sushi_gui"
version = "1.0.0"
authors = [
{ name="Maxime Gendebien", email="[email protected]" },
{ name="Gustav Andersson", email="[email protected]" },
]
description = "A simple GUI for Sushi, using PySide and gRPC."
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)"
]
dependencies = ['elkpy', 'grpcio', 'grpcio-tools', 'PySide>=6.4']
Loading

0 comments on commit a7bc6a5

Please sign in to comment.