Fix setting output/device for Xine and VLC backend

- Fixed setting output and device on Xine and VLC backend
- Fixed track slider for Xine, VLC and Phonon
- Improved backend settings to better support multiple backends
- Added group by samplerate and bitdepth in collection
- Fixed crash on exit when existing instance of the application is already runnung caused by NVIDIA driver
- Changed Q_OS_MAC to Q_OS_MACOS
This commit is contained in:
Jonas Kvinge
2018-06-28 01:15:32 +02:00
parent 6978983dd3
commit 985b91e5f4
56 changed files with 2799 additions and 2589 deletions

View File

@@ -1,18 +1,22 @@
/* This file is part of Clementine.
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine 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. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Strawberry Music Player
* This file was part of Clementine
* Copyright 2017-2018, Jonas Kvinge <jonas@jkvinge.net>
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Strawberry 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef VLCENGINE_H
#define VLCENGINE_H
@@ -44,49 +48,44 @@ class VLCEngine : public Engine::Base {
~VLCEngine();
bool Init();
virtual qint64 position_nanosec() const;
virtual qint64 length_nanosec() const;
bool CanDecode( const QUrl &url );
Engine::State state() const { return state_; }
bool Load(const QUrl &url, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec);
bool Play(quint64 offset_nanosec);
void Stop(bool stop_after = false);
void Pause();
void Unpause();
Engine::State state() const { return state_; }
uint position() const;
uint length() const;
void Seek(quint64 offset_nanosec);
static void SetScopeData(float* data, int size);
const Engine::Scope& Scope();
protected:
void SetVolumeSW(uint percent);
public:
virtual qint64 position_nanosec() const;
virtual qint64 length_nanosec() const;
const Engine::Scope& Scope();
OutputDetailsList GetOutputsList() const;
QString DefaultOutput() { return ""; }
bool CustomDeviceSupport(const QString &name);
private:
libvlc_instance_t *instance_;
libvlc_media_player_t *player_;
Engine::State state_;
boost::circular_buffer<float> scope_data_;
static VLCEngine *sInstance;
QMutex scope_mutex_;
uint position() const;
uint length() const;
bool CanDecode(const QUrl &url);
static void SetScopeData(float* data, int size);
void HandleErrors() const;
void AttachCallback(libvlc_event_manager_t* em, libvlc_event_type_t type, libvlc_callback_t callback);
static void StateChangedCallback(const libvlc_event_t* e, void* data);
private:
// The callbacks need access to this
static VLCEngine *sInstance;
PluginDetailsList GetPluginList() const;
void GetDevicesList(QString output) const;
// VLC bits and pieces
//libvlc_exception_t exception_;
libvlc_instance_t *instance_;
libvlc_media_player_t *player_;
// Our clementine_scope VLC plugin puts data in here
QMutex scope_mutex_;
boost::circular_buffer<float> scope_data_;
Engine::State state_;
};
#endif // VLCENGINE_H