- Do not offer streams to download clients.
- Move Google Play logo and qr code to the middle of the settings screen.
This commit is contained in:
parent
b1c488ffea
commit
0785214949
@ -48,6 +48,7 @@ enum MsgType {
|
|||||||
FIRST_DATA_SENT_COMPLETE = 48;
|
FIRST_DATA_SENT_COMPLETE = 48;
|
||||||
LYRICS = 49;
|
LYRICS = 49;
|
||||||
SONG_FILE_CHUNK = 50;
|
SONG_FILE_CHUNK = 50;
|
||||||
|
DOWNLOAD_QUEUE_EMPTY = 51;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valid Engine states
|
// Valid Engine states
|
||||||
|
@ -577,13 +577,15 @@ void OutgoingDataCreator::OfferNextSong(RemoteClient *client) {
|
|||||||
if (!download_queue_.contains(client))
|
if (!download_queue_.contains(client))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (download_queue_.value(client).isEmpty())
|
pb::remote::Message msg;
|
||||||
return;
|
|
||||||
|
|
||||||
|
if (download_queue_.value(client).isEmpty()) {
|
||||||
|
// We sent all songs, tell the client the queue is empty
|
||||||
|
msg.set_type(pb::remote::DOWNLOAD_QUEUE_EMPTY);
|
||||||
|
} else {
|
||||||
// Get the item and send the single song
|
// Get the item and send the single song
|
||||||
DownloadItem item = download_queue_[client].head();
|
DownloadItem item = download_queue_[client].head();
|
||||||
|
|
||||||
pb::remote::Message msg;
|
|
||||||
msg.set_type(pb::remote::SONG_FILE_CHUNK);
|
msg.set_type(pb::remote::SONG_FILE_CHUNK);
|
||||||
pb::remote::ResponseSongFileChunk* chunk = msg.mutable_response_song_file_chunk();
|
pb::remote::ResponseSongFileChunk* chunk = msg.mutable_response_song_file_chunk();
|
||||||
|
|
||||||
@ -595,6 +597,7 @@ void OutgoingDataCreator::OfferNextSong(RemoteClient *client) {
|
|||||||
|
|
||||||
CreateSong(item.song_, item.song_.image(), -1,
|
CreateSong(item.song_, item.song_.image(), -1,
|
||||||
chunk->mutable_song_metadata());
|
chunk->mutable_song_metadata());
|
||||||
|
}
|
||||||
|
|
||||||
msg.set_version(msg.default_instance().version());
|
msg.set_version(msg.default_instance().version());
|
||||||
client->SendData(&msg);
|
client->SendData(&msg);
|
||||||
@ -671,6 +674,10 @@ void OutgoingDataCreator::SendSingleSong(RemoteClient* client, const Song &song,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OutgoingDataCreator::SendAlbum(RemoteClient *client, const Song &song) {
|
void OutgoingDataCreator::SendAlbum(RemoteClient *client, const Song &song) {
|
||||||
|
// No streams!
|
||||||
|
if (song.url().scheme() != "file")
|
||||||
|
return;
|
||||||
|
|
||||||
SongList album = app_->library_backend()->GetSongsByAlbum(song.album());
|
SongList album = app_->library_backend()->GetSongsByAlbum(song.album());
|
||||||
|
|
||||||
foreach (Song s, album) {
|
foreach (Song s, album) {
|
||||||
@ -687,8 +694,19 @@ void OutgoingDataCreator::SendPlaylist(RemoteClient *client, int playlist_id) {
|
|||||||
}
|
}
|
||||||
SongList song_list = playlist->GetAllSongs();
|
SongList song_list = playlist->GetAllSongs();
|
||||||
|
|
||||||
|
// Count the local songs
|
||||||
|
int count = 0;
|
||||||
foreach (Song s, song_list) {
|
foreach (Song s, song_list) {
|
||||||
DownloadItem item(s, song_list.indexOf(s)+1, song_list.size());
|
if (s.url().scheme() == "file") {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (Song s, song_list) {
|
||||||
|
// Only local files!
|
||||||
|
if (s.url().scheme() == "file") {
|
||||||
|
DownloadItem item(s, song_list.indexOf(s)+1, count);
|
||||||
download_queue_[client].append(item);
|
download_queue_[client].append(item);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>884</width>
|
<width>385</width>
|
||||||
<height>587</height>
|
<height>528</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -134,11 +134,54 @@
|
|||||||
<string>Download the Android app</string>
|
<string>Download the Android app</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="play_store">
|
<widget class="QLabel" name="play_store">
|
||||||
<property name="cursor">
|
<property name="cursor">
|
||||||
<cursorShape>PointingHandCursor</cursorShape>
|
<cursorShape>PointingHandCursor</cursorShape>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>or scan the QR code!</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -146,6 +189,9 @@
|
|||||||
<property name="pixmap">
|
<property name="pixmap">
|
||||||
<pixmap resource="../../data/data.qrc">:/clementine_remote_qr.png</pixmap>
|
<pixmap resource="../../data/data.qrc">:/clementine_remote_qr.png</pixmap>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user