Wiki

Clone wiki

Main / For Developer

Common

Using the Python source

Running Beam from source requires the installation of Python3 plus some packages.

Download the beam sources :

https://bitbucket.org/beam-project/main/downloads/
beam-src-v0.5.zip

and unzip the folder "beam" in it to somewhere. Move into that folder and start beam with a command like:

python beam.py

Using the PyCharm IDE

File->New project->Create from existing sources

~\beam-project\beam
VCS->Enable version control system->Git Pull

Using PyCharm has the advantage, that tracebacks can get doubleclicked to jump to the error position in the code. And version control support is included to push/pull the commits.

Run beam (Shift-F10)

Debug beam (Shift-F9)

Step Over (F8)

Step Into (F7)

Set a new Beam version number

In the file

resources/json/strings.json

there is a property like

  "version": "0.5.0.0",

that has to get adjusted to get displayed in the main window title.

PyCharm -> Git -> Commit -> Comment: "V0.5.0.0" -> Commit and Push

Merge a Branch

Bitbucket -> Branches -> Merge

Add a new Media Player

1) Create module source file for the operatig system

bin/modules/lin/strawberrymodule.py

def run(MaxTandaLength):
[...]
    return playlist, playbackStatus

2) Import the module in nowplayingdata.py

if platform.system() == 'Linux':
    from bin.modules.lin import audaciousmodule, rhythmboxmodule, clementinemodule, bansheemodule, spotifymodule, mixxxmodule, strawberrymodule

3)Include the function in NowPlayingData.readData(self, currentSettings):

        if platform.system() == 'Linux':
            [...]
            if currentSettings._moduleSelected == 'Strawberry':
                self.currentPlaylist, self.PlaybackStatus = strawberrymodule.run(currentSettings._maxTandaLength)

4) Add new module to resources/json/beamsettings.json

   {
      "Modules": [
        "Audacious",
        "Banshee",
        "Clementine",
        "Rhythmbox",
        "Spotify",
        "Mixxx",
        "Icecast",
        "Strawberry"
      ],
      "System": "Linux"
    },

Windows

Install Python3

Download & Install Python 3.9.9 from:

https://www.python.org/downloads/

Execute

python-3.9.9-amd64.exe

Python path configuration:

User Environment Path: + C:\Users\<username>\AppData\Local\Programs\Python\Python39

python -m ensurepip

User Environment Path: + C:\Users\<username>\AppData\Local\Programs\Python\Python39\Scripts

pip3 install wxpython
pip3 install mutagen
pip3 install pypiwin32
pip3 install traktor_nowplaying
pip3 install pyinstaller

Start Beam

python beam.py

or maybe

python3 beam.py

Build an executable

pyinstaller --noconfirm --noconsole --clean --onefile --add-data="resources;resources" --add-data="docs;docs" --name="beam-win.exe" beam.py 

Run it:

.\dist\beam-win.exe

Start Beam sources from the command line

cd C:\Users\<username>\beam-projec\beam
python beam.py

Start Beam sources by a desktop shortcut

Desktop->New->Shortcut Location of the item:

C:\Users\<username>\AppData\Local\Programs\Python\Python39\python.exe C:\Users\<username>\beam-projec\beam\beam.py
Name:
Beam
Shortcut Context Menu->Properties->Start in:
C:\Users\<username>\beam-project\beam

Apple macOS

Announced Jan 2022: Apple will not be including Python2 with its macOS 12.3 "Monterey" So you will have to install Python3 separately, Python2 does not get supported since 2020.

Install Python3

If you have successfully done it and you would write it down, please let us know. Some possible hints:

https://www.geeksforgeeks.org/how-to-install-wxpython-on-macos/

pip3 install wxpython
pip3 install mutagen
pip3 install pypiwin32
pip3 install traktor_nowplaying
pip3 install ola
pip3 install pyinstaller

Start Beam

If you have successfully done it and you would write it down, please let us know.

Build an executable

If you have successfully done it and you would write it down, please let us know.

Linux

Distributions where the executable gets tested:

  • Ubuntu 20.04 LTS
  • Mint 20 Chinnamon

Install Python3

These are instructions for a global installation.

A virtual environment installation might have advantages if you use Python also for other applications.

sudo apt-get -y install python3
sudo apt-get -y install python3-pip
sudo apt-get -y install python3-wxgtk4.0
sudo apt-get -y install python3-mutagen
sudo apt-get -y install python3-setuptools
sudo apt-get -y install python3-dev
sudo apt-get -y install python3-dbus

sudo pip3 install traktor_nowplaying
sudo pip3 install ola
sudo pip3 install pyinstaller

Now you can run Beam from your source directory:

python beam.py

or maybe

python3 beam.py

Build an executable

cd ~/beam-project/beam
pyinstaller --noconfirm --noconsole --clean --onefile --add-data="resources:resources" --add-data="docs:docs" --name="beam-lin" beam.py

Run it:

$ chmod u+x ./dist/beam-lin
$ ./dist/beam-lin

Updated