lastbash-cvs Mailing List for Last.fm console player (Page 5)
Status: Beta
Brought to you by:
cstroie
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(27) |
Dec
(77) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(14) |
Feb
(8) |
Mar
(41) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
|
From: Costin S. <cs...@us...> - 2006-12-12 12:03:36
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1252 Modified Files: lastbash Log Message: Use distro config file. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- lastbash 11 Dec 2006 22:57:18 -0000 1.99 +++ lastbash 12 Dec 2006 12:03:31 -0000 1.100 @@ -51,6 +51,7 @@ # Files and directories HOME_DIR="${HOME}/.lastbash" +DIST_CONF_FILE="/etc/lastbash.config" CONF_FILE="${HOME_DIR}/config" AUTH_FILE="${HOME_DIR}/auth" PLAYER_PIPE="${HOME_DIR}/player_fifo" @@ -88,7 +89,8 @@ #----------------------------------------------------------------------------- # Create the home directory if missing [ ! -d "${HOME_DIR}" ] && mkdir -p "${HOME_DIR}" -# Load the user settings if they exist +# Load the settings if they exist +[ -f "${DIST_CONF_FILE}" ] && source "${DIST_CONF_FILE}" [ -f "${CONF_FILE}" ] && source "${CONF_FILE}" # Load the authentication settings if they exist [ -f "${AUTH_FILE}" ] && source "${AUTH_FILE}" |
|
From: Costin S. <cs...@us...> - 2006-12-11 22:59:28
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21713 Modified Files: TODO Log Message: One more TODO. Index: TODO =================================================================== RCS file: /cvsroot/lastbash/lastbash/TODO,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- TODO 5 Dec 2006 23:05:55 -0000 1.15 +++ TODO 11 Dec 2006 22:59:24 -0000 1.16 @@ -2,6 +2,7 @@ # $Id$ TODO +- more panels switchable by F-keys (Main, History, Artist...) - use getopts - use arrow keys to browse the history - add more led monitored stuff |
|
From: Costin S. <cs...@us...> - 2006-12-11 22:57:26
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20889 Modified Files: lastbash Log Message: Display changing station errors. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- lastbash 9 Dec 2006 12:26:37 -0000 1.98 +++ lastbash 11 Dec 2006 22:57:18 -0000 1.99 @@ -689,7 +689,7 @@ local URL=$(url_encode "$2") local WS_RESPONSE WS_ERROR local LASTFM_URL LASTFM_STATIONNAME - local RET ERRMSG + local RET # Do the http get if http_get "${LASTFM_BASEURL}" "${LASTFM_PORT}" "${LASTFM_BASEPATH}/adjust.php?session=$1&url=${URL}" @@ -710,24 +710,20 @@ # Check the returned data if [ "${WS_RESPONSE}" != "OK" ] then - # FIXME Are these the error codes? - case "${WS_ERROR}" in - "1") RET="2"; ERRMSG="Not enough content to play this station" ;; - "2") RET="3"; ERRMSG="Not enough members for radio" ;; - "3") RET="4"; ERRMSG="Not enough fans for radio" ;; - "4") RET="5"; ERRMSG="Not available for streaming" ;; - "5") RET="6"; ERRMSG="Feature only available to subscribers" ;; - "6") RET="7"; ERRMSG="Not enough neighbours for this radio" ;; - "7") RET="8"; ERRMSG="Streaming system is offline for maintenance" ;; - *) RET="255"; ERRMSG="Changing station failed for unknown error" ;; - esac - debug "${FUNCNAME}: Error ${WS_ERROR}. ${ERRMSG}" + if [[ "${WS_ERROR}" == ${NUMBER_REGEXP} ]] + then + debug "${FUNCNAME}: Error ${WS_ERROR}. Changing station failed" + RET="${WS_ERROR}" + else + debug "${FUNCNAME}: Changing station failed for unknown error" + RET="255" + fi else RET="0" debug "${FUNCNAME}: Station changed" fi else - RET="1" + RET="255" debug "${FUNCNAME}: Changing station failed" fi @@ -1310,32 +1306,35 @@ #----------------------------------------------------------------------------- function tui_lastfm_connect() { - local ERRCODE RET + local RET # Set the status line tui_sbar "Connecting to Last.fm..." # Try connecting lastfm_connect "${LASTFM_USER}" "${LASTFM_PASS}" - ERRCODE="$?" + RET="$?" # Check the error code - if [ "${ERRCODE}" == "0" ] + if [ "${RET}" == "0" ] then # TODO Display the LASTFM_INFO_MESSAGE - RET="0" - # Update the status line - tui_sbar "Connected" - sleep 1 # Change the station, if required - [ "${LASTFM_STATION}" ] && tui_lastfm_station "${LASTFM_STATION}" - elif [ "${ERRCODE}" == "2" ] + if [ "${LASTFM_STATION}" ] + then + tui_lastfm_station "${LASTFM_STATION}" + else + # Update the status line + tui_sbar "Connected" + sleep 1 + # Get the initial metadata + tui_metadata + fi + elif [ "${RET}" == "2" ] then - RET="2" tui_sbar "Last.fm session failed, check credentials" - elif [ "${ERRCODE}" == "3" ] + elif [ "${RET}" == "3" ] then - RET="3" tui_sbar "Player banned, contact the author" else RET="1" @@ -1352,30 +1351,39 @@ { # $1 - station - local ERRCODE RET + local RET ERRMSG # Set the status line tui_sbar "Setting new Last.fm station..." # Try changing the station lastfm_station "${LASTFM_SESSION}" "$1" - ERRCODE="$?" + RET="$?" # Check the error code - if [ "${ERRCODE}" == "0" ] + if [ "${RET}" == "0" ] then - RET="0" # Update the status line tui_sbar "Station changed" else - # TODO Display the detailed error messages - RET="1" - tui_sbar "Changing station failed" + case "${RET}" in + "1") ERRMSG="Not enough content to play this station" ;; + "2") ERRMSG="The group has not enough members for radio" ;; + "3") ERRMSG="The artist has not enough fans for radio" ;; + "4") ERRMSG="The item is not available for streaming" ;; + "5") ERRMSG="Feature available only to subscribers" ;; + "6") ERRMSG="Not enough neighbours for this radio" ;; + "7") ERRMSG="Streaming system is offline for maintenance" ;; + *) ERRMSG="Changing station failed for unknown error" ;; + esac + + # Display the detailed error messages + tui_sbar "${ERRMSG}" fi - # Sleep one moment and refresh the metadata + # Sleep one moment sleep 1 - tui_metadata + #[ "${RET}" == "0" ] && tui_metadata # Return the status code return "${RET}" @@ -2069,8 +2077,6 @@ then # Start the player player_start - # Get the initial metadata - tui_metadata # Enter the readkey loop read_key_loop else |
|
From: Costin S. <cs...@us...> - 2006-12-09 12:27:55
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25976 Modified Files: lastbash.config Log Message: Added support for now_playing. Index: lastbash.config =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash.config,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- lastbash.config 6 Dec 2006 17:52:12 -0000 1.1 +++ lastbash.config 9 Dec 2006 12:27:50 -0000 1.2 @@ -25,3 +25,6 @@ # HTTP client to use. Possible values: 'wget', 'curl', 'builtin', 'auto' HTTP_CLIENT="auto" +# Save the metadata (artist-track) of the current playing track to a file. +SAVE_NOWPLAYING="y" + |
|
From: Costin S. <cs...@us...> - 2006-12-09 12:26:40
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25600 Modified Files: lastbash Log Message: Minor paramter renaming. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- lastbash 9 Dec 2006 12:24:17 -0000 1.97 +++ lastbash 9 Dec 2006 12:26:37 -0000 1.98 @@ -31,7 +31,7 @@ USE_PLAYER="y" AUTO_PLAY="y" HTTP_CLIENT="auto" # $HTTP_CLIENTS, builtin, auto -SAVE_NOW_PLAYING="y" +SAVE_NOWPLAYING="y" # Program identification PROG_NAME="lastbash" @@ -60,7 +60,7 @@ PID_FILE="${HOME_DIR}/pid" COMMAND_FILE="${HOME_DIR}/command" COMMAND_FILE_LOCK="${HOME_DIR}/command.lock" -NOW_PLAYING_FILE="${HOME_DIR}/now_playing" +NOWPLAYING_FILE="${HOME_DIR}/now_playing" # Internal stuff PLAYERS="mplayer" @@ -128,9 +128,9 @@ # Function: Save the now_playing file {{{1 #----------------------------------------------------------------------------- -function save_now_playing() +function save_nowplaying() { - [ "${SAVE_NOW_PLAYING}" == "y" ] && echo -n "$1" > "${NOW_PLAYING_FILE}" + [ "${SAVE_NOWPLAYING}" == "y" ] && echo -n "$1" > "${NOWPLAYING_FILE}" } # Function: Print usage summary {{{1 @@ -1041,10 +1041,10 @@ if [ "${META_STREAMING}" == "true" ] then set_xterm "${META_ARTIST} - ${META_TRACK}" - save_now_playing "${META_ARTIST} - ${META_TRACK}" + save_nowplaying "${META_ARTIST} - ${META_TRACK}" else set_xterm "${PROG_TITLE}: Not streaming" - save_now_playing + save_nowplaying fi } |
|
From: Costin S. <cs...@us...> - 2006-12-09 12:24:54
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24823 Modified Files: lastbash Log Message: Save the current playing meta info to a file. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- lastbash 8 Dec 2006 18:12:49 -0000 1.96 +++ lastbash 9 Dec 2006 12:24:17 -0000 1.97 @@ -31,6 +31,7 @@ USE_PLAYER="y" AUTO_PLAY="y" HTTP_CLIENT="auto" # $HTTP_CLIENTS, builtin, auto +SAVE_NOW_PLAYING="y" # Program identification PROG_NAME="lastbash" @@ -59,6 +60,7 @@ PID_FILE="${HOME_DIR}/pid" COMMAND_FILE="${HOME_DIR}/command" COMMAND_FILE_LOCK="${HOME_DIR}/command.lock" +NOW_PLAYING_FILE="${HOME_DIR}/now_playing" # Internal stuff PLAYERS="mplayer" @@ -124,6 +126,13 @@ [[ "${TERM}" =~ "^xterm" ]] && echo -ne "\e]0;$1\a" } +# Function: Save the now_playing file {{{1 +#----------------------------------------------------------------------------- +function save_now_playing() +{ + [ "${SAVE_NOW_PLAYING}" == "y" ] && echo -n "$1" > "${NOW_PLAYING_FILE}" +} + # Function: Print usage summary {{{1 #----------------------------------------------------------------------------- function url_encode() @@ -1028,12 +1037,14 @@ tput cup 6 2 echo -ne "${LINE}${T_EL}" - # Set the xterm title + # Set the xterm title and save the now_playing file if [ "${META_STREAMING}" == "true" ] then set_xterm "${META_ARTIST} - ${META_TRACK}" + save_now_playing "${META_ARTIST} - ${META_TRACK}" else set_xterm "${PROG_TITLE}: Not streaming" + save_now_playing fi } |
|
From: Costin S. <cs...@us...> - 2006-12-08 18:12:54
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6182 Modified Files: lastbash Log Message: Use the correct PID for the lock file. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- lastbash 8 Dec 2006 15:00:35 -0000 1.95 +++ lastbash 8 Dec 2006 18:12:49 -0000 1.96 @@ -1758,8 +1758,10 @@ { # $@ - the commands + local PID="$$" + # Check and create the lock - if ( set -o noclobber; echo "$$" > "${COMMAND_FILE_LOCK}" ) 2>/dev/null + if ( set -o noclobber; echo "${PID}" > "${COMMAND_FILE_LOCK}" ) 2>/dev/null then # Create the lock echo "$$" > "${COMMAND_FILE_LOCK}" @@ -1803,10 +1805,10 @@ #----------------------------------------------------------------------------- function sigusr1() { - local CMD ARGS + local CMD ARGS PID="$$" # Check and create the lock - if ( set -o noclobber; echo "$$" > "${COMMAND_FILE_LOCK}" ) 2>/dev/null + if ( set -o noclobber; echo "${PID}" > "${COMMAND_FILE_LOCK}" ) 2>/dev/null then # Check the command file exists if [ -f "${COMMAND_FILE}" ] |
|
From: Costin S. <cs...@us...> - 2006-12-08 17:53:11
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30038 Added Files: lastbash.bash_completion Log Message: Initial support for bash completion. --- NEW FILE: lastbash.bash_completion --- # LastBASH bash_completion file # Copyright (C) 2006 Costin Stroie <cs...@us...> # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # $Id: lastbash.bash_completion,v 1.1 2006/12/08 17:53:08 cstroie Exp $ function _lastbash() { local current prev list COMPREPLY=() current=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} cmd="${COMP_WORDS[0]}" #echo "CURRENT: $current" >> /tmp/comp if [ "$prev" == -g ] then list="$($cmd -g help)" elif [ "$prev" == -p ] then list="$($cmd -p help)" elif [ "$prev" == -c ] then list="SKIP BAN LOVE REFRESH RTP DISCOVERY DEBUG WINCH QUIT" elif [ "$prev" == -r ] then list="" else if [[ "$current" == -* ]] then list="-a -A -d -g -p -r -u -c -v -h" elif [[ "$current" =~ ^lastfm:// ]] then _lastbash_url return 0 else list="lastfm://" fi fi if [ "$list" ] then COMPREPLY=( $(compgen -W "$list" -- $current) ) else COMPREPLY=() fi return 0 } function _lastbash_url() { local C L S declare -a U if [ "$current" == "lastfm://" ] then C="" else C="${current%/}" C="${C##*/}" fi #echo "C: ${C}" >> /tmp/comp S="${current##lastfm://}" U=(${S//\// }) #echo "U: ${U}" >> /tmp/comp #echo "U#: ${#U[@]}" >> /tmp/comp if [ "${U[0]}" ] then case "${U[0]}" in "globaltags") if [ "${U[1]}" ] then L="" else L="rock metal progressive" fi ;; "group") if [ "${U[1]}" ] then L="" else L="LastBASH Linux Amarok" fi ;; "user") if [ "${U[1]}" ] then if [ "${U[2]}" ] then L="" else L="recommended neighbours personal loved" fi else L="cstroie mscarlat dbordeanu" fi ;; "usertags") if [ "${U[1]}" ] then if [ "${U[2]}" ] then L="" else L="rock metal guitar" fi else L="RJ" fi ;; "artist") if [ "${U[1]}" ] then if [ "${U[2]}" ] then L="" else L="similarartists fans" fi else L="Rammstein Pink%20Floyd Yes" fi ;; "play") if [ "${U[1]}" ] then L="" else L="tracks" fi ;; *) L="globaltags group user usertags artist play" ;; esac else L="globaltags group user usertags artist play" fi #echo "L: ${L}" >> /tmp/comp COMPREPLY=( $(compgen -W "$L" -- $C) ) #echo "COMPLETION: ${COMPREPLY[@]}" >> /tmp/comp #COMPREPLY=() } complete -F _lastbash lastbash |
|
From: Costin S. <cs...@us...> - 2006-12-08 15:00:42
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25292 Modified Files: lastbash Log Message: More remote commands added. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- lastbash 8 Dec 2006 14:23:23 -0000 1.94 +++ lastbash 8 Dec 2006 15:00:35 -0000 1.95 @@ -1782,12 +1782,15 @@ # $2 - arguments (optional) case "$1" in - "REFRESH") tui_metadata ;; - "STATION") tui_lastfm_station "$2" ;; - "SKIP") tui_lastfm_command_skip ;; - "BAN") tui_lastfm_command_ban ;; - "LOVE") tui_lastfm_command_love ;; - "RTP") tui_lastfm_rtp ;; + "REFRESH") tui_metadata ;; + "STATION") tui_lastfm_station "$2" ;; + "SKIP") tui_lastfm_command_skip ;; + "BAN") tui_lastfm_command_ban ;; + "LOVE") tui_lastfm_command_love ;; + "RTP") tui_lastfm_rtp ;; + "DISCOVERY") tui_lastfm_discovery ;; + "WINCH") sigwinch ;; + "DEBUG") tui_debug_toggle ;; # Quit # FIXME Terminal left in wrong status "QUIT") quit 0 ;; |
|
From: Costin S. <cs...@us...> - 2006-12-08 14:23:27
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11076 Modified Files: lastbash Log Message: Added quick helps for HTTP client and player. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- lastbash 8 Dec 2006 13:49:10 -0000 1.93 +++ lastbash 8 Dec 2006 14:23:23 -0000 1.94 @@ -1968,6 +1968,17 @@ esac done +# Some quick helps +if [ "${HTTP_CLIENT}" == "help" ] +then + echo "${HTTP_CLIENTS} builtin auto" + exit 0 +elif [ "${PLAYER}" == "help" ] +then + echo "${PLAYERS} auto" + exit 0 +fi + # Write the debug header debug_header |
|
From: Costin S. <cs...@us...> - 2006-12-08 13:50:08
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30345 Modified Files: lastbash.1 Log Message: Added the debug mode toggle key. Index: lastbash.1 =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash.1,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- lastbash.1 7 Dec 2006 22:43:58 -0000 1.3 +++ lastbash.1 8 Dec 2006 13:50:05 -0000 1.4 @@ -131,6 +131,9 @@ .B ^L Redraw the interface .TP +.B ^D +Toggle debug mode +.TP .B q Quit (and stop the backend player too) .SH "REMOTE CONTROL" |
|
From: Costin S. <cs...@us...> - 2006-12-08 13:49:15
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30145 Modified Files: lastbash Log Message: Debugging function improved. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- lastbash 8 Dec 2006 12:48:54 -0000 1.92 +++ lastbash 8 Dec 2006 13:49:10 -0000 1.93 @@ -68,6 +68,7 @@ declare -a HISTORY_ARTIST HISTORY_ALBUM HISTORY_TRACK HISTORY_DURATION HISTORY_MIN_SEC HISTORY_ACTION CR=$'\x0d' LF=$'\x0a' +CTRL_D=$'\x04' CTRL_L=$'\x0c' NUMBER_REGEXP="+([0-9])" @@ -102,18 +103,18 @@ #----------------------------------------------------------------------------- function debug_header() { - debug "------------------------------------------------" + debug "--------------------------------------------------------" debug " Debug session started on `date`" - debug "------------------------------------------------" + debug "--------------------------------------------------------" } # Function: Write the debug footer {{{1 #----------------------------------------------------------------------------- function debug_footer() { - debug "------------------------------------------------" + debug "--------------------------------------------------------" debug " Debug session ended on `date`" - debug "------------------------------------------------" + debug "--------------------------------------------------------" } # Function: Set the xterm title {{{1 @@ -163,7 +164,7 @@ fi # Check some required programs - debug "Checking for missing programs..." + debug "${FUNCNAME}: Checking for missing programs..." for P in ${REQ_PROGRAMS} do type -t "${P}" >/dev/null 2>&1 || MP="${MP}${P} " @@ -171,11 +172,11 @@ if [ "${MP}" ] then - debug "Missing: ${MP}" + debug "${FUNCNAME}: Missing programs: ${MP}" echo "The following required programs are missing: ${MP}" exit 1 else - debug "No missing programs." + debug "${FUNCNAME}: No missing programs" fi # Check a minimum terminal size @@ -184,7 +185,7 @@ if [ "${T_LINES}" -lt 15 ] || [ "${T_COLUMNS}" -lt 40 ] then echo "Minimum terminal size is 40x15, your is ${T_COLUMNS}x${T_LINES}" - debug "Terminal size insufficient: ${T_COLUMNS}x${T_LINES}" + debug "${FUNCNAME}: Terminal size insufficient: ${T_COLUMNS}x${T_LINES}" exit 1 fi @@ -200,11 +201,11 @@ then if [ "${REFRESH_INTERVAL}" -lt "30" ] then - debug "Refresh interval too short: ${REFRESH_INTERVAL}" + debug "${FUNCNAME}: Refresh interval too short: ${REFRESH_INTERVAL}" REFRESH_INTERVAL="30" fi else - debug "Refresh interval not numerical: ${REFRESH_INTERVAL}" + debug "${FUNCNAME}: Refresh interval not numerical: ${REFRESH_INTERVAL}" REFRESH_INTERVAL="30" fi @@ -212,27 +213,27 @@ if [ "${PLAYER}" == "auto" ] then PLAYER="" - debug "Searching for available and supported players..." + debug "${FUNCNAME}: Searching for available and supported players..." # Search for the first supported player for P in ${PLAYERS} do - debug "Trying ${P}..." + debug "${FUNCNAME}: Trying ${P}..." if type -t "${P}" >/dev/null 2>&1 then - debug "Player found: ${P}" + debug "${FUNCNAME}: Player found: ${P}" PLAYER="${P}" break fi done # No player is present - [ ! "${PLAYER}" ] && debug "No supported player found." + [ ! "${PLAYER}" ] && debug "${FUNCNAME}: no supported player found" else if type -t "${PLAYER}" >/dev/null 2>&1 then - debug "Player found: ${PLAYER}" + debug "${FUNCNAME}: Player found: ${PLAYER}" else # The player is not present, switching to none - debug "Player ${PLAYER} not found." + debug "${FUNCNAME}: Player ${PLAYER} not found" PLAYER="" fi fi @@ -240,18 +241,18 @@ # Check for http client if [ "${HTTP_CLIENT}" == "builtin" ] then - debug "Using the builtin HTTP client." + debug "${FUNCNAME}: Using the builtin HTTP client" elif [ "${HTTP_CLIENT}" == "auto" ] then HTTP_CLIENT="" - debug "Searching for available and supported HTTP clients..." + debug "${FUNCNAME}: Searching for available and supported HTTP clients..." # Search for the first supported http client for P in ${HTTP_CLIENTS} do - debug "Trying ${P}..." + debug "${FUNCNAME}: Trying ${P}..." if type -t "${P}" >/dev/null 2>&1 then - debug "HTTP client found: ${P}" + debug "${FUNCNAME}: HTTP client found: ${P}" HTTP_CLIENT="${P}" break fi @@ -259,16 +260,16 @@ # No HTTP client is present if [ ! "${HTTP_CLIENT}" ] then - debug "No supported HTTP client found, using the builtin one." + debug "${FUNCNAME}: No supported HTTP client found, using the builtin one" HTTP_CLIENT="builtin" fi else if type -t "${HTTP_CLIENT}" >/dev/null 2>&1 then - debug "HTTP client found: ${HTTP_CLIENT}" + debug "${FUNCNAME}: HTTP client found: ${HTTP_CLIENT}" else # The HTTP client is not present, switching to builtin - debug "HTTP client ${HTTP_CLIENT} not found." + debug "${FUNCNAME}: HTTP client ${HTTP_CLIENT} not found" HTTP_CLIENT="builtin" fi fi @@ -286,7 +287,7 @@ tui_sbar "Quitting. Good bye." # Stop the player, if running - player_stop + player_quit # Restore the terminal term_exit @@ -655,14 +656,14 @@ if [ "${WS_RESPONSE}" != "OK" ] then RET="2" - debug "${FUNCNAME}: Command failed, unknown error" + debug "${FUNCNAME}: Command \"$2\" failed, unknown error" else RET="0" - debug "${FUNCNAME}: Command sent" + debug "${FUNCNAME}: Command \"$2\" sent successfully" fi else RET="1" - debug "${FUNCNAME}: Command failed" + debug "${FUNCNAME}: Command \"$2\" failed" fi # Return the status code @@ -711,7 +712,7 @@ "7") RET="8"; ERRMSG="Streaming system is offline for maintenance" ;; *) RET="255"; ERRMSG="Changing station failed for unknown error" ;; esac - debug "${FUNCNAME}: ${WS_ERROR}. ${ERRMSG}" + debug "${FUNCNAME}: Error ${WS_ERROR}. ${ERRMSG}" else RET="0" debug "${FUNCNAME}: Station changed" @@ -962,10 +963,11 @@ # - R: the player is running # - P: record to profile is on # - D: Discovery mode is on + # - B: Debug mode is on L1="-" [ "${META_RTP}" == "1" ] && L2="P" || L2="-" [ "${META_DISCOVERY}" == "1" ] && L3="D" || L3="-" - L4="-" + [ "${DEBUG}" == "y" ] && L4="B" || L4="-" # Compute the main field size S=$(( T_COLUMNS - 27 )) @@ -1567,12 +1569,12 @@ if [ "${DEBUG}" == "y" ] then tui_sbar "Debug mode disabled" - DEBUG="n" debug_footer + DEBUG="n" else tui_sbar "Debug mode enabled" - DEBUG="y" debug_header + DEBUG="y" fi # Sleep one moment and restore the status bar @@ -1591,6 +1593,7 @@ if [ -p "${PLAYER_PIPE}" ] then echo "$1" > "${PLAYER_PIPE}" + debug "${FUNCNAME} (${PLAYER}): $1" fi } @@ -1599,14 +1602,14 @@ function player_start() { # Return if no player is to be used - [ "${USE_PLAYER}" != "y" ] || return + [ "${USE_PLAYER}" != "y" ] && return if ! type -t mkfifo >/dev/null 2>&1 then tui_sbar "No way to control the player, mkfifo is absent" "2" - debug "No way to control the player, mkfifo is absent" + debug "${FUNCNAME}: mkfifo is absent" USE_PLAYER="n" - return + return 1 fi # Set the status line @@ -1618,15 +1621,26 @@ rm -f "${PLAYER_PIPE}" fi mkfifo -m 600 "${PLAYER_PIPE}" + if [ -p "${PLAYER_PIPE}" ] + then + debug "${FUNCNAME}: Pipe created" + else + debug "${FUNCNAME}: Pipe not created" + tui_sbar "Unable to create the player controlling pipe" "1" + return 1 + fi # Start the player in background if [ "${PLAYER}" == "mplayer" ] then mplayer -cache 512 -idle -slave -quiet -input file="${PLAYER_PIPE}" >/dev/null 2>&1 & + debug "${FUNCNAME}: Player ${PLAYER} started" elif [ "${PLAYER}" == "mpg123" ] then mpg123 --remote --remote-err --quiet <"${PLAYER_PIPE}" >/dev/null 2>&1 & + debug "${FUNCNAME}: Player ${PLAYER} started" else + debug "${FUNCNAME}: No player started" tui_sbar "No supported player found" fi @@ -1634,7 +1648,7 @@ sleep 1 # Update the status line - tui_sbar "Player started" + tui_sbar "Player started (${PLAYER})" [ "${AUTO_PLAY}" == "y" ] && player_load } @@ -1644,13 +1658,12 @@ function player_load() { # Return if no player is to be used - [ "${USE_PLAYER}" != "y" ] || return + [ "${USE_PLAYER}" != "y" ] && return # Set the status line tui_sbar "Loading the stream..." # Load the stream and start playing - tui_sbar "Playing..." if [ "${PLAYER}" == "mplayer" ] then player_command "loadfile ${LASTFM_STREAM}" @@ -1658,6 +1671,7 @@ then player_command "load ${LASTFM_STREAM}" else + debug "${FUNCNAME}: No player running" tui_sbar "No supported player is running" fi @@ -1672,13 +1686,12 @@ #----------------------------------------------------------------------------- function player_stop() { - [ "${USE_PLAYER}" != "y" ] || return + [ "${USE_PLAYER}" != "y" ] && return # Set the status line - tui_sbar "Stop playing..." + tui_sbar "Stop playing the stream..." player_command "stop" - rm -f "${PLAYER_PIPE}" # Restore the status bar sleep 1 @@ -1689,7 +1702,7 @@ #----------------------------------------------------------------------------- function player_quit() { - [ "${USE_PLAYER}" != "y" ] || return + [ "${USE_PLAYER}" != "y" ] && return # Set the status line tui_sbar "Closing the player..." @@ -1702,13 +1715,17 @@ killall mpg123 else tui_sbar "No supported player is running" + debug "${FUNCNAME}: No player running" fi + # Wait a second + sleep 1 + # Remove the FIFO rm -f "${PLAYER_PIPE}" # Set the status line - tui_sbar "Player closed" "1" + tui_sbar "Player closed" } # Function: Check if another instance is running {{{1 @@ -1869,10 +1886,11 @@ "k") tui_lastfm_command_skip ;; "p") tui_lastfm_rtp ;; "d") tui_lastfm_discovery ;; - "D") tui_debug_toggle ;; "s") tui_scroll_toggle ;; # Redisplay the TUI "${CTRL_L}") sigwinch ;; + # Toggle debug mode + "${CTRL_D}") tui_debug_toggle ;; # Player commands "x") player_load ;; "X") player_start ;; |
|
From: Costin S. <cs...@us...> - 2006-12-08 12:48:57
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5313 Modified Files: lastbash Log Message: Fixed the player activation. Added debug toggling support. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- lastbash 8 Dec 2006 12:14:38 -0000 1.91 +++ lastbash 8 Dec 2006 12:48:54 -0000 1.92 @@ -98,6 +98,24 @@ [ "${DEBUG}" == "y" ] && echo "$1" >> "${DEBUG_FILE}" } +# Function: Write the debug header {{{1 +#----------------------------------------------------------------------------- +function debug_header() +{ + debug "------------------------------------------------" + debug " Debug session started on `date`" + debug "------------------------------------------------" +} + +# Function: Write the debug footer {{{1 +#----------------------------------------------------------------------------- +function debug_footer() +{ + debug "------------------------------------------------" + debug " Debug session ended on `date`" + debug "------------------------------------------------" +} + # Function: Set the xterm title {{{1 #----------------------------------------------------------------------------- function set_xterm() @@ -275,6 +293,9 @@ # Eventually, save the settings #save_settings + + # Write the debug footer + debug_footer fi exit $1 } @@ -1539,6 +1560,26 @@ tui_sbar } +# Function: TUI for toggling debug mode {{{1 +#----------------------------------------------------------------------------- +function tui_debug_toggle() +{ + if [ "${DEBUG}" == "y" ] + then + tui_sbar "Debug mode disabled" + DEBUG="n" + debug_footer + else + tui_sbar "Debug mode enabled" + DEBUG="y" + debug_header + fi + + # Sleep one moment and restore the status bar + sleep 1 + tui_sbar +} + # Function: Send commands to the player {{{1 #----------------------------------------------------------------------------- function player_command() @@ -1558,10 +1599,11 @@ function player_start() { # Return if no player is to be used - [ "${USE_PLAYER}" == "y" ] || return + [ "${USE_PLAYER}" != "y" ] || return if ! type -t mkfifo >/dev/null 2>&1 then + tui_sbar "No way to control the player, mkfifo is absent" "2" debug "No way to control the player, mkfifo is absent" USE_PLAYER="n" return @@ -1602,7 +1644,7 @@ function player_load() { # Return if no player is to be used - [ "${USE_PLAYER}" == "y" ] || return + [ "${USE_PLAYER}" != "y" ] || return # Set the status line tui_sbar "Loading the stream..." @@ -1630,7 +1672,7 @@ #----------------------------------------------------------------------------- function player_stop() { - [ "${USE_PLAYER}" == "y" ] || return + [ "${USE_PLAYER}" != "y" ] || return # Set the status line tui_sbar "Stop playing..." @@ -1647,7 +1689,7 @@ #----------------------------------------------------------------------------- function player_quit() { - [ "${USE_PLAYER}" == "y" ] || return + [ "${USE_PLAYER}" != "y" ] || return # Set the status line tui_sbar "Closing the player..." @@ -1827,6 +1869,7 @@ "k") tui_lastfm_command_skip ;; "p") tui_lastfm_rtp ;; "d") tui_lastfm_discovery ;; + "D") tui_debug_toggle ;; "s") tui_scroll_toggle ;; # Redisplay the TUI "${CTRL_L}") sigwinch ;; @@ -1908,9 +1951,7 @@ done # Write the debug header -debug "------------------------------------------------" -debug " Debug started on `date`" -debug "------------------------------------------------" +debug_header # Set a parameter, if this is the first instance first_instance && FIRST_INSTANCE="y" |
|
From: Costin S. <cs...@us...> - 2006-12-08 12:14:43
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24099 Modified Files: lastbash Log Message: Fixed the mkfifo detection. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- lastbash 7 Dec 2006 22:47:24 -0000 1.90 +++ lastbash 8 Dec 2006 12:14:38 -0000 1.91 @@ -1560,9 +1560,10 @@ # Return if no player is to be used [ "${USE_PLAYER}" == "y" ] || return - if type -t mkfifo >/dev/null 2>&1 + if ! type -t mkfifo >/dev/null 2>&1 then debug "No way to control the player, mkfifo is absent" + USE_PLAYER="n" return fi |
|
From: Costin S. <cs...@us...> - 2006-12-07 22:47:27
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29680 Modified Files: lastbash Log Message: Minimum terminal width reduced to 40. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- lastbash 7 Dec 2006 22:41:11 -0000 1.89 +++ lastbash 7 Dec 2006 22:47:24 -0000 1.90 @@ -163,9 +163,9 @@ # Check a minimum terminal size T_LINES=$(tput lines) T_COLUMNS=$(tput cols) - if [ "${T_LINES}" -lt 15 ] || [ "${T_COLUMNS}" -lt 60 ] + if [ "${T_LINES}" -lt 15 ] || [ "${T_COLUMNS}" -lt 40 ] then - echo "Minimum terminal size is 60x15, your is ${T_COLUMNS}x${T_LINES}" + echo "Minimum terminal size is 40x15, your is ${T_COLUMNS}x${T_LINES}" debug "Terminal size insufficient: ${T_COLUMNS}x${T_LINES}" exit 1 fi |
|
From: Costin S. <cs...@us...> - 2006-12-07 22:44:02
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28090 Modified Files: lastbash.1 Log Message: Added the 'g' command line option. Index: lastbash.1 =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash.1,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lastbash.1 6 Dec 2006 15:30:52 -0000 1.2 +++ lastbash.1 7 Dec 2006 22:43:58 -0000 1.3 @@ -9,7 +9,7 @@ .SH "NAME" lastbash \- Console player for Last.fm .SH "SYNOPSIS" -\fBlastbash\fR [-aAdvh] [-p \fIplayer\fR] [-r \fIrefresh_interval\fR] [-u \fIusername\fR] [-c \fIcommand\fR] [\fIstation\fR] +\fBlastbash\fR [-aAdvh] [-g \fIHTTP_client\fR] [-p \fIplayer\fR] [-r \fIrefresh_interval\fR] [-u \fIusername\fR] [-c \fIcommand\fR] [\fIstation\fR] .SH "DESCRIPTION" LastBASH is a console/terminal based Last.fm player. Although the default Last.fm player is a great one, it also is a graphical one and it could be somewhat inadequate for the die-hard terminal users, like some people I know. @@ -28,17 +28,15 @@ .B -d Enable debug mode (will create a log file at \fI~/.lastbash/lastbash.debug\fR). .TP -.B -v -Show program name and version. -.TP -.B -h -Show a quick help. +.B -g \fIHTTP_client\fR +Set the HTTP client to use for the webservice. .TP .B -p \fIplayer\fR Set the backend player to use. .TP .B -r \fIrefresh_interval\fR Set the refresh interval, in seconds. +Minimum value allowed is \fI30\fR. .TP .B -u \fIusername\fR Set Last.fm username and re-request the password. @@ -47,6 +45,12 @@ Send \fIcommand\fR to the first instance. See \fBRemote control\fR below. .TP +.B -v +Show program name and version. +.TP +.B -h +Show a quick help. +.TP .I station Specify the Last.fm station to connect to when starting or to send to the first instance. See \fBRemote control\fR below. |
|
From: Costin S. <cs...@us...> - 2006-12-07 22:41:15
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27300 Modified Files: lastbash Log Message: Use getopts and show a better help. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- lastbash 7 Dec 2006 22:08:23 -0000 1.88 +++ lastbash 7 Dec 2006 22:41:11 -0000 1.89 @@ -107,13 +107,6 @@ # Function: Print usage summary {{{1 #----------------------------------------------------------------------------- -function usage() -{ - echo "Usage: ${0##*/} [-aAdvh] [-p player] [-r refresh] [-u username] [-c command] [station]" -} - -# Function: Print usage summary {{{1 -#----------------------------------------------------------------------------- function url_encode() { # $1 - string to encode @@ -131,6 +124,12 @@ read -n 1 -s -t "$1" SLEEP_KEY } +# Function: Print program name and version {{{1 +#----------------------------------------------------------------------------- +function prog_ver() +{ + echo "${PROG_NAME} v${PROG_VER}" +} # Function: Initialization {{{1 #----------------------------------------------------------------------------- @@ -1855,26 +1854,56 @@ unset KEY done } + +# Function: Print usage summary {{{1 +#----------------------------------------------------------------------------- +function usage() +{ + prog_ver + echo + echo "Usage: ${0##*/} [options] [station]" + echo + echo "Options:" + echo " -a,-A Enable/Disable the autoplay feature" + echo " -d Enable the debug mode" + echo " -g HTTP_client Set the HTTP client to use for the webservice" + echo " -p player Set the backend player" + echo " -r refresh Set the metadata refresh interval" + echo " -u username Set new username to login with and clear the password" + echo " -c command Set the command to send to the running instance" + echo " -v Show program name and version" + echo " -h Show this quick help" + echo + echo "HTTP clients: ${HTTP_CLIENTS} builtin auto" + echo "Players: ${PLAYERS} auto" + echo + echo "Station: any valid Last.fm station, such as the following:" + echo " lastfm://globaltags/rock" + echo " lastfm://user/cstroie/neighbours" + echo " lastfm://group/LastBASH" +} # }}}1 # The main part #----------------------------------------------------------------------------- # Check commandline options -while [ "${1:0:1}" = "-" ] +while getopts ":c:g:p:r:u:aAdvh" OPTION do - case "$1" in - "-a") AUTO_PLAY="y" ;; - "-A") AUTO_PLAY="n" ;; - "-c") LASTFM_COMMAND="$2"; shift 1 ;; - "-d") DEBUG="y" ;; - "-p") PLAYER="$2"; shift 1 ;; - "-r") REFRESH_INTERVAL="$2"; shift 1 ;; - "-u") LASTFM_USER="$2"; LASTFM_PASS=""; shift 1 ;; - "-v") echo "${PROG_NAME} v${PROG_VER}" && exit 0 ;; - "-h") usage && exit 0 ;; + case "${OPTION}" in + "a") AUTO_PLAY="y" ;; + "A") AUTO_PLAY="n" ;; + "c") LASTFM_COMMAND="${OPTARG}" ;; + "d") DEBUG="y" ;; + "g") HTTP_CLIENT="${OPTARG}" ;; + "p") PLAYER="${OPTARG}" ;; + "r") REFRESH_INTERVAL="${OPTARG}" ;; + "u") LASTFM_USER="${OPTARG}"; LASTFM_PASS="" ;; + "v") prog_ver && exit 0 ;; + "h") usage && exit 0 ;; + "?") echo "Unexpected argument: \"${OPTARG}\""; exit 1 ;; + ":") echo "Required argument not found for \"${OPTARG}\""; exit 1 ;; esac - shift 1 done # Write the debug header @@ -1886,19 +1915,19 @@ first_instance && FIRST_INSTANCE="y" # This should be the Last.fm station -if [[ "$1" =~ "^lastfm://" ]] +if [[ "${!OPTIND}" =~ "^lastfm://" ]] then # This is the new station to tune into if [ "${FIRST_INSTANCE}" ] then # Store the station to load after the init - LASTFM_STATION="$1" + LASTFM_STATION="${!OPTIND}" else # Another instance is already running - remote_call "STATION $1" + remote_call "STATION ${!OPTIND}" exit 0 fi -elif [ "$1" ] +elif [ "${!OPTIND}" ] then # The string is unexpected usage |
|
From: Costin S. <cs...@us...> - 2006-12-07 22:08:28
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14158 Modified Files: lastbash Log Message: Fixed the refresh interval erroneous setting. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- lastbash 6 Dec 2006 23:05:39 -0000 1.87 +++ lastbash 7 Dec 2006 22:08:23 -0000 1.88 @@ -69,6 +69,7 @@ CR=$'\x0d' LF=$'\x0a' CTRL_L=$'\x0c' +NUMBER_REGEXP="+([0-9])" # Set some shell options shopt -s nocasematch @@ -108,7 +109,7 @@ #----------------------------------------------------------------------------- function usage() { - echo "Usage: ${0##*/} [-aAdrvh] [-p player] [-r refresh] [-u username] [-c command] [station]" + echo "Usage: ${0##*/} [-aAdvh] [-p player] [-r refresh] [-u username] [-c command] [station]" } # Function: Print usage summary {{{1 @@ -178,7 +179,17 @@ fi # Check and fix the refresh interval - [ "${REFRESH_INTERVAL}" -lt "30" ] && REFRESH_INTERVAL="30" + if [[ "${REFRESH_INTERVAL}" == ${NUMBER_REGEXP} ]] + then + if [ "${REFRESH_INTERVAL}" -lt "30" ] + then + debug "Refresh interval too short: ${REFRESH_INTERVAL}" + REFRESH_INTERVAL="30" + fi + else + debug "Refresh interval not numerical: ${REFRESH_INTERVAL}" + REFRESH_INTERVAL="30" + fi # Check for player if [ "${PLAYER}" == "auto" ] |
|
From: Costin S. <cs...@us...> - 2006-12-06 23:06:10
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21404 Modified Files: lastbash Log Message: Added a experimental way of displaying history line, to fix the unicode truncation. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- lastbash 6 Dec 2006 17:35:56 -0000 1.86 +++ lastbash 6 Dec 2006 23:05:39 -0000 1.87 @@ -1092,6 +1092,62 @@ tput csr 0 ${T_LINES} } +# Function: Display the line in history area, using column positioning {{{1 +#----------------------------------------------------------------------------- +function tui_history_line_col() +{ + # $1 - index in HISTORY array + + local FIELD LINE S C + + # Clear the line + LINE="${T_EL}" + + # Move to column + C="1" + LINE="${LINE}$(tput hpa $C)" + + # Start with the love/ban indicator + if [ "${HISTORY_ACTION[$1]}" ] + then + LINE="${LINE}${HISTORY_ACTION[$1]:0:1}" + else + LINE="${LINE} " + fi + + # Add the artist, if the field units are not null + if [ "${HISTORY_FIELD_UNITS[0]}" != "0" ] + then + C=$(( C + 3 )) + S="${HISTORY_FIELD_SIZE[0]}" + printf -v FIELD "%-${S}s" "${HISTORY_ARTIST[$1]:0:$S}" + LINE="${LINE}$(tput hpa $C)${FIELD}" + fi + + # Add the album, if the field units are not null + if [ "${HISTORY_FIELD_UNITS[1]}" != "0" ] + then + C=$(( C + S + 2 )) + S="${HISTORY_FIELD_SIZE[1]}" + printf -v FIELD "%-${S}s" "${HISTORY_ALBUM[$1]:0:$S}" + LINE="${LINE}$(tput hpa $C)${FIELD}" + fi + + # Add the track title + C=$(( C + S + 2 )) + S="${HISTORY_FIELD_SIZE[2]}" + printf -v FIELD "%-${S}s" "${HISTORY_TRACK[$1]:0:$S}" + LINE="${LINE}$(tput hpa $C)${FIELD}" + + # Add the track duration + C=$(( C + S + 2 )) + printf -v FIELD "%6s " "${HISTORY_MIN_SEC[$1]}" + LINE="${LINE}$(tput hpa $C)${FIELD}" + + # Output the line + echo -n "${LINE}" +} + # Function: Display the line in history area {{{1 #----------------------------------------------------------------------------- function tui_history_line() |
|
From: Costin S. <cs...@us...> - 2006-12-06 18:10:10
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26765 Modified Files: Makefile Log Message: Better files distribution. Index: Makefile =================================================================== RCS file: /cvsroot/lastbash/lastbash/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 6 Dec 2006 15:31:16 -0000 1.3 +++ Makefile 6 Dec 2006 18:10:00 -0000 1.4 @@ -2,19 +2,24 @@ # Costin Stroie <cs...@us...> # $Id$ -# Project name +# Project name and version name = lastbash +version = 0.3.1 # Targets proglist = lastbash +conflist = lastbash.config man1list = lastbash.1 doclist = AUTHORS COPYING README INSTALL TODO VERSION ChangeLog +datalist = # Directories prefix = /usr/local bindir = $(DESTDIR)$(prefix)/bin -mandir = $(DESTDIR)$(prefix)/man +confdir = $(DESTDIR)/etc +mandir = $(DESTDIR)$(prefix)/share/man man1dir = $(mandir)/man1 +docdir = $(DESTDIR)$(prefix)/share/doc/$(name)-$(version) datadir = $(DESTDIR)$(prefix)/share/$(name) srcdir = . @@ -44,29 +49,36 @@ groff -man -Thtml $< > $@ # Install section -install: install_dirs install_prog install_man install_data +install: install_dirs install_prog install_conf install_man install_doc install_dirs: - $(MK_DIR) $(bindir) $(man1dir) $(datadir) + $(MK_DIR) $(bindir) $(confdir) $(man1dir) $(docdir) $(datadir) install_prog: $(INSTALL_PROG) $(proglist) $(bindir) +install_conf: + $(INSTALL_DATA) $(conflist) $(confdir) + install_man: install_man1 install_man1: $(INSTALL_DATA) $(man1list) $(man1dir) +install_doc: + $(INSTALL_DATA) $(doclist) $(docdir) + install_data: - $(INSTALL_DATA) $(doclist) $(datadir) + $(INSTALL_DATA) $(datalist) $(datadir) uninstall: - $(RM) -rf $(datadir) + $(RM) -rf $(datadir) $(docdir) for i in $(proglist); do $(RM) -f $(bindir)/$$i; done + for i in $(conflist); do $(RM) -f $(confdir)/$$i; done for i in $(man1list); do $(RM) -f $(man1dir)/$$i; done # Packaging pack: - VERSION=`cat VERSION` && cd .. && tar zcvf /tmp/$(name)-$$VERSION.tar.gz $(name)-$$VERSION + cd .. && tar zcvf /tmp/$(name)-$(version).tar.gz $(name)-$(version) # vim: set ft=make nowrap nu: |
|
From: Costin S. <cs...@us...> - 2006-12-06 17:52:18
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19112 Added Files: lastbash.config Log Message: Added the lastbash configuration file. --- NEW FILE: lastbash.config --- # LastBASH Configuration file # This file should be placed in '/etc/lastbash.config' or '~/.lastbash/config' # Enable debug mode. Possible values: 'y' or 'n' DEBUG="n" # History scrolling direction: up or down. Possible values: 'y' or 'n' HISTORY_SCROLL_DOWN="y" # Relative proportions of the history field units: artist, album and title. HISTORY_FIELD_UNITS=(2 2 3) # Metadata refresh interval, in seconds. REFRESH_INTERVAL="30" # Use the backend player. Possible values: 'y' or 'n' USE_PLAYER="y" # Backend player to use. Possible values: 'mplayer', 'auto' PLAYER="auto" # Automatically start playing. Possible values: 'y' or 'n' AUTO_PLAY="y" # HTTP client to use. Possible values: 'wget', 'curl', 'builtin', 'auto' HTTP_CLIENT="auto" |
|
From: Costin S. <cs...@us...> - 2006-12-06 17:36:02
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12080 Modified Files: lastbash Log Message: Fixed the bug which caused the action not to be displayed in history. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- lastbash 6 Dec 2006 16:14:27 -0000 1.85 +++ lastbash 6 Dec 2006 17:35:56 -0000 1.86 @@ -1187,7 +1187,7 @@ HISTORY_TRACK[$HINDEX]="${PREV_TRACK}" HISTORY_DURATION[$HINDEX]="${PREV_DURATION}" HISTORY_MIN_SEC[$HINDEX]="${PREV_MIN_SEC}" - HISTORY_ACTION[$HINDEX]="${META_ACTION}" + HISTORY_ACTION[$HINDEX]="${PREV_ACTION}" tui_history "${HINDEX}" fi |
|
From: Costin S. <cs...@us...> - 2006-12-06 16:14:33
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12061 Modified Files: INSTALL lastbash VERSION Log Message: Version up: 0.3.1. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- lastbash 6 Dec 2006 13:57:34 -0000 1.84 +++ lastbash 6 Dec 2006 16:14:27 -0000 1.85 @@ -36,7 +36,7 @@ PROG_NAME="lastbash" PROG_TITLE="LastBASH" PROG_DESC="Console player for Last.fm" -PROG_VER="0.3.0" +PROG_VER="0.3.1" AUTHOR="Costin Stroie" AUTHOR_EMAIL="cs...@us..." Index: VERSION =================================================================== RCS file: /cvsroot/lastbash/lastbash/VERSION,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- VERSION 6 Dec 2006 16:12:26 -0000 1.7 +++ VERSION 6 Dec 2006 16:14:27 -0000 1.8 @@ -1 +1 @@ -0.3.0 +0.3.1 Index: INSTALL =================================================================== RCS file: /cvsroot/lastbash/lastbash/INSTALL,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- INSTALL 6 Dec 2006 13:56:06 -0000 1.6 +++ INSTALL 6 Dec 2006 16:14:27 -0000 1.7 @@ -10,8 +10,8 @@ First, unpack the archive (replace the version number with the correct one) and enter the directory -$ tar xzf lastbash-0.3.0.tar.gz -$ cd lastbash-0.3.0 +$ tar xzf lastbash-0.3.1.tar.gz +$ cd lastbash-0.3.1 Then run the program (assuming bash is your shell) |
|
From: Costin S. <cs...@us...> - 2006-12-06 16:12:29
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11257 Modified Files: VERSION Log Message: Version 0.3.0. Index: VERSION =================================================================== RCS file: /cvsroot/lastbash/lastbash/VERSION,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- VERSION 28 Nov 2006 18:21:58 -0000 1.6 +++ VERSION 6 Dec 2006 16:12:26 -0000 1.7 @@ -1 +1 @@ -0.2.4 +0.3.0 |
|
From: Costin S. <cs...@us...> - 2006-12-06 15:31:20
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27359 Modified Files: Makefile Log Message: Added manpage processing rules. Index: Makefile =================================================================== RCS file: /cvsroot/lastbash/lastbash/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 22 Nov 2006 20:56:32 -0000 1.2 +++ Makefile 6 Dec 2006 15:31:16 -0000 1.3 @@ -32,6 +32,18 @@ all: @echo "Nothing to make, use 'make install' to perform an installation." +# Convert the man page +ps: $(addsuffix .ps, $(man1list)) + +%.ps: % + groff -man -ma4 -Tps $< > $@ + +html: $(addsuffix .html, $(man1list)) + +%.html: % + groff -man -Thtml $< > $@ + +# Install section install: install_dirs install_prog install_man install_data install_dirs: @@ -53,6 +65,7 @@ for i in $(proglist); do $(RM) -f $(bindir)/$$i; done for i in $(man1list); do $(RM) -f $(man1dir)/$$i; done +# Packaging pack: VERSION=`cat VERSION` && cd .. && tar zcvf /tmp/$(name)-$$VERSION.tar.gz $(name)-$$VERSION |