Skip to content

Commit

Permalink
fix issue #150
Browse files Browse the repository at this point in the history
  • Loading branch information
Henio Tierra committed Oct 31, 2018
1 parent 14ff571 commit 433e364
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Install dependencies

Type this into the terminal to install TBOPlayer's dependencies:

# install pip, gobject, dbus, tk, gtk, requests, avconv, ffmpeg, tkdnd
# install pip, gobject, dbus, tk, gtk, requests, avconv, tkdnd
sudo apt-get install -y python-pip python-gobject-2 python-dbus python-tk python-gtk2 python-requests libav-tools tkdnd
# install pexpect, ptyprocess, magic
yes | pip install --user pexpect ptyprocess python-magic
Expand Down Expand Up @@ -96,7 +96,7 @@ Menus

* `Options` -

* Audio Output - play sound to hdmi, local, auto or ALSA device.
* Audio Output - play sound to hdmi, local, both or ALSA device.

* Mode - play the Single selected track, Repeat the single track, rotate around the Playlist starting from the selected track, randomly play a track from the Playlist.

Expand Down Expand Up @@ -183,7 +183,7 @@ Available options and respective accepted values are:

| Option | Allowed values/pattern |
|--------------------------|----------------------------------------------------|
| omx_audio_output | hdmi, local, auto, alsa |
| omx_audio_output | hdmi, local, both, alsa |
| mode | single, repeat, playlist, repeat playlist, shuffle |
| youtube_media_format | mp4, m4a |
| download_media_url_upon | add, play |
Expand Down
8 changes: 2 additions & 6 deletions options.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ def read(self,filename):
config=ConfigParser.ConfigParser()
config.read(filename)
try:
if config.get('config','audio',0) == 'auto':
self.omx_audio_output = ""
else:
self.omx_audio_output = "-o "+config.get('config','audio',0)

self.omx_audio_output = "-o " + config.get('config','audio',0)
self.mode = config.get('config','mode',0)
self.initial_track_dir = config.get('config','tracks',0)
self.last_track_dir = config.get('config','ltracks',0)
Expand Down Expand Up @@ -123,7 +119,7 @@ def create(self,filename):
def save_state(self):
config=ConfigParser.ConfigParser()
config.add_section('config')
config.set('config','audio',self.omx_audio_output.replace("-o ",''))
config.set('config','audio',self.omx_audio_output.replace("-o ",""))
config.set('config','subtitles',"on" if "on" in self.omx_subtitles else "off")
config.set('config','mode',self.mode)
config.set('config','playlists',self.initial_playlist_dir)
Expand Down
10 changes: 5 additions & 5 deletions tboplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ def set_option(self, option, value):
"omx_user_options": "str",
"omx_location": "str",
"ytdl_location": "str",
"omx_audio_output": ["hdmi","local","auto","alsa"],
"omx_audio_output": ["hdmi","local","both","alsa"],
"mode": ["single", "repeat","playlist","repeat playlist", "shuffle"],
"debug": ["on", "off"],
"youtube_media_format": ["mp4", "m4a"],
Expand Down Expand Up @@ -1776,10 +1776,10 @@ def body(self, master):
rb_hdmi.grid(row=1,column=0,sticky=W)
rb_local=Radiobutton(master, text=_("Local"), variable=self.audio_var,value="local")
rb_local.grid(row=2,column=0,sticky=W)
rb_auto=Radiobutton(master, text=_("Auto"), variable=self.audio_var,value="auto")
rb_auto=Radiobutton(master, text=_("Both"), variable=self.audio_var,value="both")
rb_auto.grid(row=3,column=0,sticky=W)
rb_auto=Radiobutton(master, text="ALSA", variable=self.audio_var,value="alsa")
rb_auto.grid(row=4,column=0,sticky=W)
rb_alsa=Radiobutton(master, text="ALSA", variable=self.audio_var,value="alsa")
rb_alsa.grid(row=4,column=0,sticky=W)

Label(master, text="").grid(row=9, sticky=W)
Label(master, text=_("Mode:")).grid(row=10, sticky=W)
Expand Down Expand Up @@ -2228,7 +2228,7 @@ def nope(self):
# ***************************************

if __name__ == "__main__":
datestring="11 Ago 2018"
datestring="30 Out 2018"

dbusif_tboplayer = None
try:
Expand Down

0 comments on commit 433e364

Please sign in to comment.