blautils.py: catch unhandled exception

The `serialize_to_file' routine uses shutil to back up old files. If the
destination for these backup files exists on the filesytem an exception is
raised which we now deal with properly. Additionally, we now remove backup
files when the actual file is successfully opened in the `deserialize_from_file'
routine.

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
blaplaylist.py: add DND support for the tabstrip

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
playlists: set proper playlist after page removal

Fix bug where the current page was always set as new active playlist
after a page was removed even if the active playlist reference wasn't
None.

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
BlaQueue: catch unhandled exception

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
formats: handle None-type tags when parsing tags

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
Update window title after editing tags

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
Lay out rough roadmap

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
blafm.py: fill out empty error message

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
blaplayer.py: print debug buffering messages

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
spectrum: protect adapter modifications by lock

Incoming buffers are written and read/flushed from different methods,
executed in different threads. Since the underlying storage type of
buffers in the spectrum visualizer (a GstAdapter) is not thread-safe
modifications to the adapter need to be protected by a lock. This is
likely to fix occasional segfaults that have to do with unreferencing
GstMiniObjects whose reference count already dropped to 0.

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
blafm.py: catch another unhandled exception

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
blatoolbar.py: fix incorrect scroll behaviour

We previously changed BlaPlayer's `get_position' method to return 0 instead
of -1 when querying the bin for the current position fails. This changed was
not applied to the PositionSlider class in blatoolbar.py which still checked
for -1 as error value. On excessive scrolling, causing many seek operations on
the bin, the get_position sometimes returns 0 which the slider class lets pass
as valid value, thus incorrectly resetting the slider position.

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
Simplify singleton check

We only want to allow one instance per user, thus we create a pid file in
the user's blaplay directory on startup. So far, when blaplay was invoked
we checked the directory for a pid file, read the pid and checked the contents
of /proc/$PID which required parsing the cmdline to decide whether to leave
the interpreter or continue. We now create a pidfile in the user directory and
lock it using fcntl, removing the necessity to even read the proc table at all.

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
Enhance command-line interface

Implement adding songs to blaplay from the CLI, either to an already
running instance via D-Bus or on startup.

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
blafm.py: catch unhandled timeout exception

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
Store multiple tag values as list

Previously multiple tag values were stored as string, joined by a
newline character. In order to display lyrics tags properly in the
tag editor we need to store the tags differently because the lyrics
itself are likely to contain newline characters. We now change multiple
values in lists.

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
blaradio.py: catch unhandled exception on start-up

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
blaplaylist.py: catch unhandled exception

Catch KeyError exception when trying to jump to current track when __current is
not None, but the respective key does not exist in the BlaPlaylist.uris dict
anymore.

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
bladb.py: fix bug with EVENT_MOVED events

Files residing in a monitored directory which are not in the library
(e.g. m3u, png, etc.) would so far raise a KeyError exception in the `move()'
method as it assumed that the method would only be invoked on tracks already in
the library. Consequently, files being renamed to something we might want to
consider parsing based on it's (possibly) new extension were thus ignored. An
example for a situation would be downloading a song through Chrome to a monitored
directory because Chrome appends `crdownload' to downloads that are in progress and
renames the files on completion.

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
BlaQueue: add missing keyevents for cut/copy/paste

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>