From ad5e96ea6b7e8b75972babe870338ceda00349fc Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 16 May 2012 14:07:39 +0200 Subject: Allow to use 320kbps quality for streaming and syncing. --- libQtSpotify/qspotifysession.cpp | 2 +- libQtSpotify/qspotifysession.h | 3 ++- qml/SettingsPage.qml | 16 ++++++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/libQtSpotify/qspotifysession.cpp b/libQtSpotify/qspotifysession.cpp index a6b73be..ad1338b 100644 --- a/libQtSpotify/qspotifysession.cpp +++ b/libQtSpotify/qspotifysession.cpp @@ -701,7 +701,7 @@ void QSpotifySession::setSyncQuality(StreamingQuality q) m_syncQuality = q; QSettings s; s.setValue("syncQuality", int(q)); - sp_session_preferred_offline_bitrate(m_sp_session, sp_bitrate(q), false); + sp_session_preferred_offline_bitrate(m_sp_session, sp_bitrate(q), true); emit syncQualityChanged(); } diff --git a/libQtSpotify/qspotifysession.h b/libQtSpotify/qspotifysession.h index 9ba25d5..8bfa887 100644 --- a/libQtSpotify/qspotifysession.h +++ b/libQtSpotify/qspotifysession.h @@ -114,7 +114,8 @@ public: enum StreamingQuality { Unknown = -1, LowQuality = SP_BITRATE_96k, - HighQuality = SP_BITRATE_160k + HighQuality = SP_BITRATE_160k, + UltraQuality = SP_BITRATE_320k }; enum ConnectionRule { diff --git a/qml/SettingsPage.qml b/qml/SettingsPage.qml index 03dd94b..ad21fb9 100644 --- a/qml/SettingsPage.qml +++ b/qml/SettingsPage.qml @@ -123,20 +123,24 @@ Page { Selector { title: "Stream" model: ListModel { - ListElement { name: "Low bandwidth"; value: SpotifySession.LowQuality } - ListElement { name: "High bandwidth"; value: SpotifySession.HighQuality } + ListElement { name: "Low quality (96kbps)"; value: SpotifySession.LowQuality } + ListElement { name: "Normal quality (160kbps)"; value: SpotifySession.HighQuality } + ListElement { name: "High quality (320kbps)"; value: SpotifySession.UltraQuality } } - selectedIndex: spotifySession.streamingQuality == SpotifySession.LowQuality ? 0 : 1 + selectedIndex: spotifySession.streamingQuality == SpotifySession.LowQuality ? 0 + : spotifySession.streamingQuality == SpotifySession.HighQuality ? 1 : 2 onSelectedIndexChanged: spotifySession.streamingQuality = model.get(selectedIndex).value } Selector { title: "Offline Sync" model: ListModel { - ListElement { name: "Low Quality"; value: SpotifySession.LowQuality } - ListElement { name: "High Quality"; value: SpotifySession.HighQuality } + ListElement { name: "Low quality (96kbps)"; value: SpotifySession.LowQuality } + ListElement { name: "Normal quality (160kbps)"; value: SpotifySession.HighQuality } + ListElement { name: "High quality (320kbps)"; value: SpotifySession.UltraQuality } } - selectedIndex: spotifySession.syncQuality == SpotifySession.LowQuality ? 0 : 1 + selectedIndex: spotifySession.syncQuality == SpotifySession.LowQuality ? 0 + : spotifySession.syncQuality == SpotifySession.HighQuality ? 1 : 2 onSelectedIndexChanged: spotifySession.syncQuality = model.get(selectedIndex).value } -- cgit v1.2.3