This client-server repository of music reproduction was developed for the discipline of Computer Networks of the Federal University of São João del Rei.
Read this in other languages: Portuguese
You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Our address is:
Universidade Federal de São João del-Rei – UFSJ
Campus Tancredo de Almeida Neves – CTAN
Prédio do Curso de Ciência da Computação, 3° andar/Sala nº 3.01A
Av. Visconde do Rio Preto, s/nº, Colônia do Bengo,
São João del-Rei, MG, CEP 36301-360
- Python (tested with v2.7)
- Pillow (tested with pillow >= 5.0.0)*
- Tkinter (tested with 8.6)*
- py-game (v3.6.1)*
* required only when running the server
When cloning a repository the .git
can be left off the end.
$ git clone --depth 1 https://github.com/thiagomides/cs_binary.git
- Install python 2.7.
- Download pip then compile and install.
- Install package Pygame
py -m pip install -U pygame --user
- Tutorial for install python-tk tutorial
- Install package Pillow
pip install Pillow
- Install packages:
sudo apt-get install python2.7 python-pygame python-tk python-pip
- Install package Pillow
pip install Pillow
sudo chmod +X setup.sh && ./setup.sh
Distribution | Python 3 package | Python 2 package |
---|---|---|
Debian/Ubuntu | python3-pygame | python-pygame |
Fedora/Ubuntu | python3-pygame | pygame |
There are three ways to use this script:
- Drag your
.*
file(s) ontoclient.py
. - Drag your directory onto
client.py
. - Using the command line which also offers more advanced options.
usage: client.py [-h] [--port PORT] [--address IP] [--command CMD] [--directory DIR]
[--file DOF] [--no-keep-alive]
arguments:
-h, --help show this help message and exit.
-p PORT, --port PORT port number to listen up (default: 3030)
-a IP, --address IP address number to listen up (default: 127.0.0.1)
-f DOF, --file DOF directory to binary file(s) or binary file
-c STR, --command CMD customize chapter command (see README)
-e EXT, --extension EXT define files extension (default: /*.mp3)
--no-keep-alive connections are considered persistent unless a --no-keep-alive is included
You can customize the chapter command with --command CMD
where CMD
is a valid python format string.
command arguments:
list return playlist now
next begin a new sound playback
play begin sound playback
stop temporarily stop playback of all sound channels
noow return the music name
rewind restart music
play_music play music by identificator
Play file (you can also drag one .* files onto client.py
):
python client.py -f Led_Zeppelin-Stairway_To_Heaven.mp3
Play folder file(s) no persistent connections:
python client.py -f ~/Music/Beatles/The_White_Album/ --no-keep-alive
Get attually server playlist:
python client.py -c list
Force server port and submit multiple file(s):
python client.py -d ~/Music/Beatles/The_White_Album/ -p 3035
There is a way to use this script:
- Using the command line which also offers a port options.
usage: server.py [-h] [--port PORT] [--directory DIR]
optional arguments:
-h, --help show this help message and exit.
-p PORT, --port PORT port number to listen up
-d DIR, --directory DIR binary(s) storage folder (default: ../arquivos/)
Default:
python server.py
Server socket change, modify storage folder:
python server -p 3030 -d ../arquivos/