User Commands CDA(1) NAME cda - Compact disc digital audio player utility SYNOPSIS cda [-_d_e_v device] [-_b_a_t_c_h] [-_d_e_b_u_g] _c_o_m_m_a_n_d DESCRIPTION _C_d_a is a program that allows the use of the CD-ROM or CD-R drive as a full-featured stereo compact-disc player from the shell command line. It can be used interactively in line mode or visual (screen) mode, or as a script-driven utility. This is a companion utility to _x_m_c_d, a Motif-based CD audio player application for the X window system. _C_d_a uses the same configuration and support files as _x_m_c_d. Most of the features found on "real" CD players are available in _c_d_a, such as shuffle and repeat, and track programming functions. Multi-disc changers are also supported. A CD database feature allows the CD artist/title and track titles, and other associated general purpose text to be displayed as the program is started or when a CD is inserted. The CD database contents can be on your local system or queried from a remote CD database server host. No capability is provided to update the CD database via _c_d_a. You must use the X-based _x_m_c_d(_1) utility to add or modify CD database entries. On systems with more than one CD-ROM or CD-R drive, multiple invocations of _c_d_a can be used to operate each drive independently. _C_d_a is designed to be easy to use, with particular care taken to make all output easily parsable by other programs. The internal architecture of _c_d_a is designed to be easily portable to many UNIX operating system variants, and adaptable to the myriad of CD-ROM drives available. OPTIONS _C_d_a supports the following options: -_d_e_v _d_e_v_i_c_e Specifies the path name to the raw CD-ROM device. If this option is not used, the default device to be used is the first drive set up with the _x_m_c_d configuration program (See below). v2.4 Last change: 18 March 1998 1 User Commands CDA(1) -_b_a_t_c_h Signifies that _c_d_a should run in batch mode. This suppresses all interaction with the user (i.e., will not prompt the user to type anything). Batch mode is not meaningful in visual mode. -_d_e_b_u_g Causes verbose debugging diagnostics to be printed on _s_t_d_e_r_r. Note that if you are running in visual mode, the stderr output should be redirected to a file, or the debug information will corrupt the screen. COMMANDS _C_d_a supports the following commands: _o_n Start the _c_d_a daemon. _o_f_f Terminate the _c_d_a daemon. _d_i_s_c <_l_o_a_d | _e_j_e_c_t | _p_r_e_v | _n_e_x_t | _d_i_s_c#> Load or eject the CD, or change discs on a multi-disc changer. _l_o_c_k <_o_n | _o_f_f> Enable/disable the CD disc lock. When locked, the CD cannot be ejected using the CD-ROM front-panel eject button. _p_l_a_y [_t_r_a_c_k# [_m_m:_s_s]] Start playback. If the _t_r_a_c_k# is used, the playback starts from the specified track. The optional _m_m:_s_s argument specifies the minutes and seconds offset into the track from where to start playback. _p_a_u_s_e Pauses the playback. Use cda play to resume playback. _s_t_o_p Stop the plaback. _t_r_a_c_k <_p_r_e_v | _n_e_x_t> Proceed to the previous or the next track. This command is only valid when playback is already in progress. _i_n_d_e_x <_p_r_e_v | _n_e_x_t> Proceed to the previous or the next index. This command is only valid when playback is already in progress. _p_r_o_g_r_a_m [_c_l_e_a_r | _t_r_a_c_k# ...] If no argument is specified, this command displays the v2.4 Last change: 18 March 1998 2 User Commands CDA(1) current program play sequence, if any. The clear argument will cause the current program to be cleared. To define a new program, specify a list of track numbers separated by spaces. To start program play, use the play command. You cannot define a new program while shuffle mode is enabled. _s_h_u_f_f_l_e <_o_n | _o_f_f> Enable/disable shuffle play mode. When shuffle is enabled, _c_d_a will play the CD tracks in a random order. You can use this command only when audio playback is not in progress. Also, you must clear any program sequence before enabling shuffle. _r_e_p_e_a_t <_o_n | _o_f_f> Enable/disable the repeat mode. _v_o_l_u_m_e [_v_a_l_u_e#] If no argument is specified, this command displays the current audio volume setting. If a _v_a_l_u_e is used, then the audio volume level is set to the specified value. The valid range is 0 to 100. _b_a_l_a_n_c_e [_v_a_l_u_e#] If no argument is specified, this command displays the current balance control setting. If a _v_a_l_u_e is used, then the balance is set to the specified value. The valid range is 0 to 100, where 0 is full left, 50 is center and 100 is full right. _r_o_u_t_e [_v_a_l_u_e#] If no argument is specified, this command displays the current channel routing setting. If a _v_a_l_u_e is used, then the routing is set to the specified value. The valid range is 0 to 4, as specified below: 0 Normal stereo 1 Reverse stereo 2 Mono-L 3 Mono-R 4 Mono-L+R _s_t_a_t_u_s [_c_o_n_t [_s_e_c_s#]] Display the current disc status, disc number, track number, index number, time, modes, and repeat count. If the cont argument is specified, then the display will run continuously until the user types the interrupt character (typically _D_e_l_e_t_e or _C_t_r_l-_C). The optional secs sub-argument is the display update time interval. The default is 1 second. _t_o_c [_o_f_f_s_e_t_s] v2.4 Last change: 18 March 1998 3 User Commands CDA(1) Display the CD Table of Contents. The disc artist/title and track titles from the CD database associated with the current disc is also shown, if available. If an exact CD database match is not found, but the CD database server provides a list of inexact matches, then the user will be prompted to select from that list. If batch mode is active (i.e., the -batch option is used), then no such prompt will occur. If the offsets argument is used, then the track times are the absolute offsets from the start of the CD. Otherwise, the times shown are the track lengths. _e_x_t_i_n_f_o [_t_r_a_c_k#] Display the disc extended information text associated with the current CD, if available from the CD database. If the CD is currently playing, then the track extended information associated with the playing track is also displayed. If a track number is used in the argument, then the track extended information text of the specified track is shown instead. _d_e_v_i_c_e Displays the CD-ROM and device information. _v_e_r_s_i_o_n Displays the _c_d_a version and copyright information. _d_e_b_u_g [_o_n | _o_f_f] Show, set or unset the debug mode. If set, verbose debugging diagnostics will be printed on _s_t_d_e_r_r of the terminal that the _c_d_a _d_a_e_m_o_n is started from. If this is the same terminal that is running _c_d_a in visual mode, the debug information will corrupt the screen. _v_i_s_u_a_l Enter an interactive, screen-oriented visual mode. All other cda commands can also be invoked within this mode. DEVICE CONFIGURATION See _x_m_c_d(_1) for a description of the device configuration requirements. WARNING: If _c_d_a is not correctly configured, you may cause _c_d_a to deliver commands that are not supported by your CD- ROM drive. Under some environments this may lead to system hang or crash. v2.4 Last change: 18 March 1998 4 User Commands CDA(1) USING CDA Before using any function of the _c_d_a utility, you must first ensure that the XMCD_LIBDIR environment variable is properly set (see ENVIRONMENT below). This variable is optional in _x_m_c_d but is required for _c_d_a. Start the _c_d_a _d_a_e_m_o_n with the cda on command (or the F1 (o) function in visual mode). This reserves the CD-ROM device and initializes the program for further commands. All other _c_d_a functions will not work unless the _c_d_a _d_a_e_m_o_n is running. The other _c_d_a commands should be self explanatory. The off command (or the F1 (o) function in visual mode) can be used to terminate the _c_d_a _d_a_e_m_o_n and release the CD-ROM drive for use by other software. VISUAL MODE If the _c_d_a _v_i_s_u_a_l command is used, it enters a screen- oriented visual mode. In this mode, the status and other information available is continuously displayed and updated on the screen, and virtually all functions are available via a single key stroke. A minimum screen size of 80 columns by 24 rows is recommended for the visual mode. Visual mode uses the curses screen library to control the screen. It is essential that the TERM environment variable reflect the current terminal type, which ideally should have 8 (or more) function keys. Since function key definitions in terminfo descriptions are often unreliable, alphabetic key alternatives are also available. The screen is divided into two windows: an information window and a status window. According to context, the information window displays a help screen, device and version information, disc information and table of contents, or track extended information. This window is scrollable if it overflows its allotted screen area. The status window consists of the last few lines of the screen, enclosed in a box. The first line contains the program list, or track number and offset together with volume, balance and stereo/mono information. The remaining lines contain the function keys (with their alphabetic synonymns) and the functions they invoke. These functions are highlighted when they are on, making it easy to see the current state. Screen annotation and online help make operation self explanatory, but for reference, a list of commands follows. Alphabetic key alternatives to function keys are given in parenthesis. v2.4 Last change: 18 March 1998 5 User Commands CDA(1) ? Display help screen. Dismiss this screen by pressing the space bar. _F_1 (_o) On/Off. Start or stop the _c_d_a daemon. _F_2 (_j) Load or eject the CD. _F_3 (_p) Play, pause or unpause. _F_4 (_s) Stop. _F_5 (_k) Enable/disable the CD caddy lock. When locked, the CD cannot be ejected using the CD-ROM front-panel eject button. _F_6 (_u) Shuffle/Program. Pressing this key cycles through three states: normal, shuffle and program. In shuffle mode, the tracks of the CD will be played in random order. On entering program mode, _c_d_a will prompt for a space or comma separated list of track numbers, representing a desired playing order. The list should be terminated by carriage return. An empty list returns _c_d_a to normal mode. Shuffle and program mode cannot be engaged unless a CD is loaded but not playing or paused. _F_7 (_e) Enable/disable repeat mode. _F_8 (_q) Terminate the visual mode. If the _c_d_a daemon is running, a reminder of the fact is given and it is allowed to continue. The CD-ROM drive will continue operating in the same state. _C_d_a may be invoked again in either visual or line mode when required. _D/_d Change to the previous/next disc on multi-disc changes. _C_u_r_s_o_r _l_e_f_t/_r_i_g_h_t (_C/_c) Previous/next track. This is only valid if playback is already in progress. Proceed to the previous/next index mark. This is only valid if playback is already in progress. _C_u_r_s_o_r _u_p/_d_o_w_n (^/_v) v2.4 Last change: 18 March 1998 6 User Commands CDA(1) Scroll the information portion of the screen up or down. It may be scrolled up only until the last line is on the top line of the screen, and may not be scrolled down beyond the initial position. The initial scroll position is restored when different information is displayed, (e.g., when switching to or from the help information). +/- Increase or decrease volume by 5%. _l/_r Move balance 5% to left or right. _T_a_b Successive depressions of this key change the mode from stereo to mono, mono right, mono left, reverse stereo, and back to normal stereo. <_n> [_m_i_n_s _s_e_c_s] Proceed to track _n at _m_i_n_s minutes and _s_e_c_s seconds from the start. If _m_i_n_s _s_e_c_s is not given, start at the beginning of track _n. ^_l/^_r Control-l or control-r repaints the screen. This is useful if the screen has been corrupted (e.g., by operator messages sent by the _w_a_l_l(_1_M) command). CD DATABASE The CD Database feature of _x_m_c_d is supported by _c_d_a, which allows you to display the disc artists/title, track titles, and extended information about the CD or tracks via the toc or extinfo commands of _c_d_a. In visual mode, this information is displayed automatically if available. You cannot update the CD database via _c_d_a. _X_m_c_d must be used for that purpose. ENVIRONMENT Several environment variables are currently recognized by _c_d_a, and are described as follows: XMCD_LIBDIR This is a _r_e_q_u_i_r_e_d parameter which specifies the directory path under which _c_d_a'_s configuration files and CD database files are located. On most systems this is /_u_s_r/_l_i_b/_X_1_1/_x_m_c_d. XMCD_CDDBPATH This is used to override the _c_d_d_b_P_a_t_h common configuration parameter, which is a list of CD database category directories to be used under XMCDLIB/_c_d_d_b. See _x_m_c_d(_1) for details. v2.4 Last change: 18 March 1998 7 User Commands CDA(1) NOTES Not all CD-ROM drives support all features that appear on _c_d_a. For example, some drives do not support a software- driven volume control. On these drives the _c_d_a volume and balance commands may have no effect, or may simply change the volume between full mute and maximum. Similarly, the lock, disc, index, and route commands of _c_d_a may not have any effect on drives that do not support the appropriate functionality. FILES $HOME/.xmcdcfg/* XMCDLIB/cddb/* XMCDLIB/config/config.sh XMCDLIB/config/common.cfg XMCDLIB/config/device.cfg XMCDLIB/config/.tbl/* XMCDLIB/config/* XMCDLIB/help/* BINDIR/cda MANDIR/cda.1 /tmp/.cdaudio/* RELATED WEB SITES Xmcd/cda home page: _h_t_t_p://_s_u_n_s_i_t_e._u_n_c._e_d_u/_t_k_a_n/_x_m_c_d/ CD database server page: _h_t_t_p://_w_w_w._c_d_d_b._c_o_m/ Xmmix home page: _h_t_t_p://_s_u_n_s_i_t_e._u_n_c._e_d_u/_t_k_a_n/_x_m_m_i_x/ SEE ALSO xmcd(1), cddbcmd(1), wm2xmcd(1), X(1), Xmcd's README and INSTALL files Xmcd web site: http://sunsite.unc.edu/tkan/xmcd/ CDDB web site: http://www.cddb.com/ AUTHOR Ti Kan (_t_i@_a_m_b._o_r_g) AMB Research Laboratories, Sunnyvale, CA, U.S.A. _C_d_a also contains code contributed by several dedicated individuals. See the README file in the _c_d_a distribution for information. Comments, suggestions, and bug reports are always welcome. v2.4 Last change: 18 March 1998 8