From 392422114a66f937feaf96473cbf9e4b3404b309 Mon Sep 17 00:00:00 2001 From: chriszero Date: Sun, 27 Sep 2015 19:21:00 +0200 Subject: Corrections to MpvService --- plex.cpp | 11 +++++++---- services.h | 16 +++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/plex.cpp b/plex.cpp index cf09120..f0042f3 100644 --- a/plex.cpp +++ b/plex.cpp @@ -172,12 +172,15 @@ void cMyPlugin::PlayFile(plexclient::Video Vid) cPlugin* mpvPlugin = cPluginManager::GetPlugin("mpv"); if(Config::GetInstance().UseMpv && mpvPlugin) { - Mpv_StartPlayService_v1_0_t req; + Mpv_PlayFile req; + Mpv_SetTitle reqTitle; char* file = (char*)(Vid.m_pServer->GetUri() + Vid.m_Media.m_sPartKey).c_str(); + req.Filename = file; - req.Title = (char*)Vid.GetTitle().c_str(); - //req.Title = &Vid.GetTitle().c_str(); - mpvPlugin->Service(MPV_START_PLAY_SERVICE, &req); + mpvPlugin->Service(MPV_PLAY_FILE, &req); + + reqTitle.Title = (char*)Vid.GetTitle().c_str(); + mpvPlugin->Service(MPV_SET_TITLE, &reqTitle); return; } else if (Config::GetInstance().UseMpv) { diff --git a/services.h b/services.h index 14099e3..eea4641 100644 --- a/services.h +++ b/services.h @@ -1,14 +1,16 @@ #pragma once -#define MPV_START_PLAY_SERVICE "Mpv-StartPlayService_v1_0" -#define MPV_SET_TITLE_SERVICE "Mpv-SetTitleService_v1_0" +#define MPV_PLAY_FILE "Mpv_PlayFile" +#define MPV_SET_TITLE "Mpv_SetTitle" +// play the given Filename, this can be a media file or a playlist typedef struct { - char* Filename; - char* Title; -} Mpv_StartPlayService_v1_0_t; + char *Filename; +} Mpv_PlayFile; + +// Overrides the displayed title in replay info typedef struct { - char* Title; -} Mpv_SetTitleService_v1_0_t; \ No newline at end of file + char *Title; +} Mpv_SetTitle; -- cgit v1.2.3