Skip to content

retsyx/slapstick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building and using Slap
=======================

On all systems Slap needs Python 2.5 (or better) and a C compiler to build and run. 
Once Slap is built (see below):
1. Place all media files under the 'media' directory in the Slap directory
2. Execute slap.py

Slap is built with a Python script called build.py. It is written such that errors are Python exceptions. If you encounter an exception when running build.py, then the build failed and it's probably not a bug in the script.

The build script will attempt to locate an existing mpg123 binary in your search path (under the assumption that it is more likely to work on your system). If it finds the binary it will copy it instead of compiling a new one.

Running Slap on multiple operating systems
==========================================

As noted, Slap requires Python on the host system. It also requires an mpg123 binary on the USB stick. Slap is designed so that multiple binaries for different OSs can exist on the USB stick at once. Currently, build.py will place the binary generated for the OS it was run on. To support more systems, build Slap on the system you want support for and copy the generated mpg123 binary (placed in the 'player' directory) to the 'player' directory on your USB stick. 

Building Slap on *nix
=====================

Gcc is required to build mpg123. In the Slap directory execute build.py. If all goes well, the 'build' directory should now contain a fully formed Slap setup that you can run and copy to your USB stick.

Building Slap on Windows
========================

Building Slap on Windows requires:

1. Microsoft Visual C++ Express or better (http://msdn.microsoft.com/vstudio/express/visualc/)
2. Microsoft Platform SDK (http://www.microsoft.com)

Once the above are installed, you need to set a few environment variables:

1. PYTHON_INCLUDE (e.g. c:\python25\Include)
2. PYTHON_LIB (e.g. c:\python25\libs\python25.lib)

You also need to have a properly setup Visual Studio environment. The easiest way to do this is to use the Visual Studio command prompt (e.g. Start menu->All Programs->Visual C++ Studio Express Edition->Visual Studio Tools->Visual Studio 2005 Command Prompt). In the command prompt cd to the Slap directory and execute build.py.

If all goes well, the build 'directory' should now contain a fully formed Slap setup that you can run and copy to your USB stick.

Windows build notes
===================

mpg123 will compile with ~720 warnings on Windows - that's a lot of warnings. Fixing all these warnings would probably require extensive changes in the mpg123 code itself. I've tried to keep changes here to a minimum. 

Building mpg123 on your stick
=============================

Slap is designed so that you can have multiple mpg123 binaries on your USB stick for different operating systems. Slap will select the correct binary at runtime. However, you only run on one OS at a time and it can be tedious to manually shuffle the Slap source code to build mpg123 on each system and place the player in the correct location on your USB stick.
The Slap build allows you to compile mpg123 on any *nix machine (with a C tool chain, etc.) directly on your USB stick. First, when performing the initial build (either on Windows or *nix) specify the --with-source option. Build.py will copy the mpg123 source code and itself to the 'build' directory, which you then copy to your USB stick.
To build mpg123 directly on your USB stick and have it ready for use, execute build.py with the --mpg123-only flag.

Windows compilation is not supported because of the required dependencies (if you can resolve the dependencies, it's a small step to obtain the original Slap code again).

Miscellaneous
=============

Slap is built out of various bits and pieces:

mpg123 (http://mpg123.de) - to play mp3 (version 0.66)
mutagen (http://www.sacredchao.net/quodlibet) - to parse media meta-information
Python (http://www.python.org) - some Python curses script used in the Windows curses emulation (wcurses)

About

Automatically exported from code.google.com/p/slapstick

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published