aboutsummaryrefslogtreecommitdiffstats
path: root/src/VLCInput.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-07-30 19:39:05 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-07-30 19:39:05 +0200
commit9b6fe48ffc63832125b519e7f839650a16d79804 (patch)
tree752092ec1273276789626f157abca75952d66c56 /src/VLCInput.h
parent19caa87a466e02e53e91a97f1084d860b02de9eb (diff)
parent5f2817a40d509e9dc172a161ac1a3efb66b8e7b8 (diff)
downloadODR-AudioEnc-9b6fe48ffc63832125b519e7f839650a16d79804.tar.gz
ODR-AudioEnc-9b6fe48ffc63832125b519e7f839650a16d79804.tar.bz2
ODR-AudioEnc-9b6fe48ffc63832125b519e7f839650a16d79804.zip
Merge 'gh/next' into next
Diffstat (limited to 'src/VLCInput.h')
-rw-r--r--src/VLCInput.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/VLCInput.h b/src/VLCInput.h
index 761492b..da4b7ae 100644
--- a/src/VLCInput.h
+++ b/src/VLCInput.h
@@ -49,6 +49,34 @@ extern "C" {
/*! Common functionality for the direct libvlc input and the
* threaded libvlc input
*/
+
+struct ICY_TEXT_T {
+ std::string artist;
+ std::string title;
+ std::string now_playing;
+
+ bool operator==(const ICY_TEXT_T& other) const {
+ return
+ artist == other.artist &&
+ title == other.title &&
+ now_playing == other.now_playing;
+ }
+ bool operator!=(const ICY_TEXT_T& other) const {
+ return !(*this == other);
+ }
+ void useArtistTitle(std::string artist, std::string title) {
+ this->artist = artist;
+ this->title = title;
+ now_playing = "";
+ }
+ void useNowPlaying(std::string now_playing) {
+ artist = "";
+ title = "";
+ this->now_playing = now_playing;
+ }
+};
+
+
class VLCInput
{
public:
@@ -119,6 +147,9 @@ class VLCInput
bool fault_detected() { return m_fault; };
+ /*! Separator string used when artist/title are written
+ */
+ static const std::string ICY_TEXT_SEPARATOR;
private:
/*! Stop the player and release resources
*/
@@ -160,8 +191,8 @@ class VLCInput
*/
std::future<bool> icy_text_written;
std::mutex m_nowplaying_mutex;
- std::string m_nowplaying;
- std::string m_nowplaying_previous;
+ ICY_TEXT_T m_nowplaying;
+ ICY_TEXT_T m_nowplaying_previous;
// VLC pointers
libvlc_instance_t *m_vlc;