forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added connections to lambda expressions in player manager, file liste…
…ner now opens and closes the file
- Loading branch information
Showing
13 changed files
with
144 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
#include <QDateTime> | ||
#include <QJsonArray> | ||
#include <QJsonDocument> | ||
#include <QJsonObject> | ||
|
||
#include "listenbrainzjsonfactory.h" | ||
|
||
|
||
QByteArray ListenBrainzJSONFactory::getJSONFromTrack(TrackPointer pTrack, JsonType type) { | ||
QJsonObject jsonObject; | ||
QString stringType; | ||
if (type == NowListening) { | ||
stringType = "playing_now"; | ||
} | ||
else { | ||
stringType = "single"; | ||
} | ||
|
||
QJsonArray payloadArray; | ||
QJsonObject payloadObject; | ||
QJsonObject metadataObject; | ||
QString title = pTrack->getTitle(); | ||
QString artist = pTrack->getArtist(); | ||
metadataObject.insert("artist_name",artist); | ||
metadataObject.insert("track_name",title); | ||
payloadObject.insert("track_metadata",metadataObject); | ||
qint64 timeStamp = QDateTime::currentSecsSinceEpoch(); | ||
|
||
if (type == Single) { | ||
payloadObject.insert("listened_at",timeStamp); | ||
} | ||
payloadArray.append(payloadObject); | ||
jsonObject.insert("listen_type",stringType); | ||
jsonObject.insert("payload",payloadArray); | ||
QJsonDocument doc(jsonObject); | ||
return doc.toJson(QJsonDocument::Compact); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
#include <QByteArray> | ||
|
||
#include "track/track.h" | ||
|
||
namespace ListenBrainzJSONFactory { | ||
enum JsonType {NowListening, Single}; | ||
QByteArray getJSONFromTrack(TrackPointer pTrack, JsonType type); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
#include "broadcast/listenbrainzservice.h" | ||
|
||
void ListenBrainzService::slotBroadcastCurrentTrack(TrackPointer pTrack) { | ||
|
||
} | ||
|
||
void ListenBrainzService::slotScrobbleTrack(TrackPointer pTrack) { | ||
|
||
} | ||
|
||
void ListenBrainzService::slotAllTracksPaused() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include "broadcast/scrobblingservice.h" | ||
|
||
class ListenBrainzService : public ScrobblingService { | ||
Q_OBJECT | ||
public: | ||
void slotBroadcastCurrentTrack(TrackPointer pTrack) override; | ||
void slotScrobbleTrack(TrackPointer pTrack) override; | ||
void slotAllTracksPaused() override; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters