aboutsummaryrefslogtreecommitdiff
path: root/pydora/audio_backend.py
diff options
context:
space:
mode:
Diffstat (limited to 'pydora/audio_backend.py')
-rw-r--r--pydora/audio_backend.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pydora/audio_backend.py b/pydora/audio_backend.py
index f92998a..1adf0a3 100644
--- a/pydora/audio_backend.py
+++ b/pydora/audio_backend.py
@@ -3,11 +3,15 @@ import time
3import fcntl 3import fcntl
4import select 4import select
5import socket 5import socket
6import logging
6 7
7from pandora.py2compat import which 8from pandora.py2compat import which
8from .utils import iterate_forever, SilentPopen 9from .utils import iterate_forever, SilentPopen
9 10
10 11
12log = logging.getLogger("pydora.audio_backend")
13
14
11class PlayerException(Exception): 15class PlayerException(Exception):
12 """Base class for all player exceptions 16 """Base class for all player exceptions
13 """ 17 """
@@ -139,6 +143,7 @@ class BasePlayer(object):
139 if not getattr(self, "_cmd"): 143 if not getattr(self, "_cmd"):
140 raise RuntimeError("Player command is not configured") 144 raise RuntimeError("Player command is not configured")
141 145
146 log.debug("Starting playback command: %r", self._cmd)
142 self._process = SilentPopen(self._cmd) 147 self._process = SilentPopen(self._cmd)
143 self._post_start() 148 self._post_start()
144 149
@@ -211,6 +216,7 @@ class MPG123Player(BasePlayer):
211 if not loc: 216 if not loc:
212 raise PlayerUnusable("Unable to find mpg123") 217 raise PlayerUnusable("Unable to find mpg123")
213 218
219 log.info("Using mpg123 at path %s", loc)
214 return loc 220 return loc
215 221
216 def _load_track(self, song): 222 def _load_track(self, song):
@@ -246,6 +252,7 @@ class VLCPlayer(BasePlayer):
246 if not loc: 252 if not loc:
247 raise PlayerUnusable("Unable to find VLC") 253 raise PlayerUnusable("Unable to find VLC")
248 254
255 log.info("Using vlc at location %s", loc)
249 return loc 256 return loc
250 257
251 def raise_volume(self): 258 def raise_volume(self):
@@ -300,6 +307,7 @@ class RemoteVLC(VLCPlayer):
300 307
301 def _ensure_started(self): 308 def _ensure_started(self):
302 if not self._control_sock: 309 if not self._control_sock:
310 log.debug("Connecting to remote VLC at %r", self._connect_to)
303 self._control_sock = socket.create_connection(self._connect_to) 311 self._control_sock = socket.create_connection(self._connect_to)
304 self._control_sock.setblocking(False) 312 self._control_sock.setblocking(False)
305 313