Selector -- README.txt
-- Owen Smith <orpheus@be.com>, 28-Apr-1999

Selector is a demonstration of a simple node that routes one of several inputs to one output. The user can choose which input to route to the output.



		Selector Contents

In addition to the newsletter articles associated with this sample code, and the readme you're now looking at, Selector contains the following:

common/		Contains source that is generally useful for both the add-on and the test app
Selector_addon/	Contains source and build files for the Selector media add-on
Selector_test/	Contains source and build files for a test application
makefile		This builds the add-on, installs it in ~/config/add-ons/media, and builds the test app.
article1.txt		The first newsletter article that discusses the add-on and UI
article2.txt		The second newsletter article that delves into the timing issues of SelectorNode
README.txt	This file. Go figure.



		Building Selector

The makefile in the root directory is the easiest way to build Selector, since it builds both the add-on and the test app, and moves the add-on into the proper place for you. If you use the project files, make sure to move the add-on to ~/config/add-ons/media before you start the test app! Also, make sure the add-on has its attributes set correctly (using mimeset), or the controls won't work.

IMPORTANT: Once you have built the Selector add-on for the first time, and dropped it into the proper place, you must currently RESTART THE MEDIA SERVER to have that add-on be recognized by the system. You can do this without rebooting by going into the Media preferences panel, selecting Audio Settings, and clicking on the "Restart Media Server" button at the bottom right corner of the window.



		Running Selector

The Selector_test application will test the application for you by using audio files, and is meant to be run from the command line. Try Selector_test --help for a list of options.

As an interesting aside, the add-on can be run as an application as well (and this is used to good effect in the code, see article1.txt...). If you happen to know the node ID (i.e. media_node::node) of a currently running node, you can actually launch the Selector add-on to run a simple UI for the node in question! For example, if you discover (using BMediaRoster::GetAudioMixer()) that the system mixer's ID is 4, try running the following from the command line for yuks:

~/config/add-ons/media/Selector.media_addon node=4



		Building Selector under genki/4

The code is targeted towards the upcoming genki/5 release, but you can build and run it under genki/4 by doing the following:

1. Grab Stephen's MotherNode from:
ftp://ftp.be.com/pub/samples/media_kit/MotherNode.zip

2. Extract MotherNode.cpp and MotherNode.h from this archive, and put them in the Selector_addon directory.

3. In both Selector_addon/makefile and Selector_test/makefile, set GENKI_4 = true at the top of the file. 

4. Build the entire project using the uber-makefile in the parent directory.
