mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-04 01:42:44 +00:00
Add user-configurable playback settings
* PlaybackManager has been updated to workaround limitiations in QtMultimedia * PlaybackManager now sends the DeviceProfile to the server when determining the playback url. This makes the Jellyfin server send information back about transcoding. * The DeviceProfile type has been changed from an QJsonObject into the DTO generated by the OpenAPI descripton. * A settings page has been added on SailfishOS that allows the user to configure the PlaybackManager to their whishes. * The DebugInfo page on SailfishOS now persists its settings (closes #8)
This commit is contained in:
parent
64ad37707c
commit
6bfe783bec
13 changed files with 388 additions and 196 deletions
|
@ -96,7 +96,7 @@ public:
|
|||
Q_PROPERTY(QString baseUrl READ baseUrl WRITE setBaseUrl NOTIFY baseUrlChanged)
|
||||
Q_PROPERTY(bool authenticated READ authenticated WRITE setAuthenticated NOTIFY authenticatedChanged)
|
||||
Q_PROPERTY(QString userId READ userId NOTIFY userIdChanged)
|
||||
Q_PROPERTY(QJsonObject deviceProfile READ deviceProfile NOTIFY deviceProfileChanged)
|
||||
Q_PROPERTY(QJsonObject deviceProfile READ deviceProfileJson NOTIFY deviceProfileChanged)
|
||||
Q_PROPERTY(QString version READ version)
|
||||
Q_PROPERTY(EventBus *eventbus READ eventbus FINAL)
|
||||
Q_PROPERTY(Jellyfin::WebSocket *websocket READ websocket FINAL)
|
||||
|
@ -139,8 +139,9 @@ public:
|
|||
*/
|
||||
QVariantList supportedCommands() const ;
|
||||
void setSupportedCommands(QVariantList newSupportedCommands);
|
||||
const QJsonObject &deviceProfile() const;
|
||||
const QJsonObject &playbackDeviceProfile() const;
|
||||
const QJsonObject deviceProfileJson() const;
|
||||
QSharedPointer<DTO::DeviceProfile> deviceProfile() const;
|
||||
const QJsonObject clientCapabilities() const;
|
||||
/**
|
||||
* @brief Retrieves the authentication token. Null QString if not authenticated.
|
||||
* @note This is not the full authentication header, just the token.
|
||||
|
|
|
@ -30,10 +30,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#include <QtMultimedia/QMediaPlayer>
|
||||
|
||||
#include "../dto/deviceprofile.h"
|
||||
|
||||
namespace Jellyfin {
|
||||
namespace Model {
|
||||
namespace DeviceProfile {
|
||||
QJsonObject generateProfile();
|
||||
DTO::DeviceProfile generateProfile();
|
||||
// Transport
|
||||
bool supportsHls();
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace ViewModel {
|
|||
class Settings : public QObjectSettingsWrapper {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool allowTranscoding READ allowTranscoding WRITE setAllowTranscoding NOTIFY allowTranscodingChanged)
|
||||
Q_PROPERTY(int maxBitRate READ maxBitRate WRITE setMaxBitRate NOTIFY maxBitRateChanged)
|
||||
Q_PROPERTY(int maxStreamingBitRate READ maxStreamingBitRate WRITE setMaxStreamingBitRate NOTIFY maxStreamingBitRateChanged)
|
||||
public:
|
||||
explicit Settings(ApiClient *apiClient);
|
||||
virtual ~Settings();
|
||||
|
@ -42,14 +42,14 @@ public:
|
|||
bool allowTranscoding() const;
|
||||
void setAllowTranscoding(bool allowTranscoding);
|
||||
|
||||
int maxBitRate() const;
|
||||
void setMaxBitRate(int newMaxBitRate);
|
||||
int maxStreamingBitRate() const;
|
||||
void setMaxStreamingBitRate(int newMaxBitRate);
|
||||
signals:
|
||||
void allowTranscodingChanged(bool newAllowTranscoding);
|
||||
void maxBitRateChanged(int newMaxBitRate);
|
||||
void maxStreamingBitRateChanged(int newMaxBitRate);
|
||||
private:
|
||||
bool m_allowTranscoding = true;
|
||||
int m_maxBitRate = 5000000;
|
||||
int m_maxStreamingBitRate = 5000000;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue