ocarina/src/config.py

89 lines
4.3 KiB
Python
Raw Normal View History

################################################################################
################################################################################
## ##
## This configuration file applies to both ocarina-core and ocarina-extra. ##
## The ocarina-core section is to configure the variables used by ##
## ocarina-core. Most of the ocarina-core variables also apply to ##
## ocarina-extra. ##
## ##
################################################################################
################################################################################
# Import helpful modules
from ocarina import vars
from ct.path import *
from ct.call import *
# Helpful variables used by the application
# vars["$user"] is the users home directory
# vars["$ocarina"] is the directory ocarina uses to store all its files
# vars["$lockfile"] is the lockfile used by the application
# vars["$writeenable"] controls enables printing from ct.call.write()
################################################################################
################################################################################
## ##
## Section 1.1 ocarina-core variable configuration ##
## The goal of ocarina-core is to provide a simple, command line music ##
## player built on python and gstreamer. Many of the variables set in this ##
## section also apply to ocarina-extra ##
## ##
################################################################################
################################################################################
# Set this variable to force verbocity to always be at the same value.
# Calling ocarina with the -v option will have no effect. A higher value will
# print more output
#vars["$verbose"] = 0
# Setting this variable to change the prompt that is presented to the user
# by the built in command line. This variable is only used in ocarina-core
#vars["$prompt"] = ">>>"
# This variable controls if ocarina begins playback as soon as a song is loaded
# The default value is True
vars["$playonload"] = False
# This variable controls the gstreamer volume at startup. Values must be
# between 0.0 and 1.0, values less than 0.0 will be changed to 0.0 and values
# greater than 1.0 will be changed to 1.0
#vars["$volume"] = 1.0
# This variable controls how much the volume changes when calling
# volup() or voldown()
#vars["$volumeincr"] = 0.05
# This variable controls the port that ocarina listens on for requests. Other
# ocarina instances will connect to this port to forward a song to load.
# Setting this variable to 0 will cause ocarina to use a random port.
#vars["$port"] = 12345
################################################################################
################################################################################
## ##
## Section 1.2 ocarina-core additional configuration ##
## The rest of this section generall applies to features added to the ##
## ocarina-core command line. readline and rlcompleter, for example, are ##
## used to provide tab completion and a stored history. ##
## ##
################################################################################
################################################################################
# Enable readline tab completion
import readline
import rlcompleter
readline.parse_and_bind("tab:complete")
# Configure readline history.
# This file is written after every command entered, but you can comment out
# these lines to ignore the file
history = join(ocarina.vars["$ocarina"],"history")
if exists( history ):
readline.read_history_file(history)
# Set the max number of lines to store in the history file.
# A negative number means unlimited length
readline.set_history_length(50)