Go to the documentation of this file.
23 .replace(
"\"",
"\\\"")
25 .replace(
"\\$",
"\\$");
39 QString
tmp = command;
40 if (
tmp.contains(
"%d"))
42 QString default_handler =
44 if (
tmp.contains(
"%s") && default_handler.contains(
"%s"))
45 default_handler = default_handler.replace(
"%s",
"");
46 tmp.replace(
"%d", default_handler);
51 if (
tmp.contains(
"%s"))
52 return tmp.replace(
"%s", arg);
54 return QString(
"%1 %2").arg(
tmp, arg);
71 virtual bool Play()
const = 0;
84 QString plot, QString title, QString subtitle,
85 QString director,
int season,
int episode, QString inetref,
86 std::chrono::minutes length, QString year, QString
id) :
99 const QString &mrl,
const QString &plot,
const QString &title,
100 const QString &subtitle,
const QString &director,
101 int season,
int episode,
const QString &inetref,
102 std::chrono::minutes length,
const QString &year,
const QString &
id)
105 director, season, episode, inetref, length, year,
id);
146 QString play_command) :
190 auto playerclone = [](
auto *player) {
return player->Clone(); };
206 QString play_command =
220 if (!play_command.isEmpty())
227 QString::number(item->
GetID()));
253 if (!play_command.isEmpty())
260 QString::number(item->
GetID()));
271 QString extension =
filename.section(
".", -1, -1);
272 QDir dir_test(QString(
"%1/VIDEO_TS").arg(
filename));
273 if (dir_test.exists())
274 extension =
"VIDEO_TS";
275 QDir bd_dir_test(QString(
"%1/BDMV").arg(
filename));
276 if (bd_dir_test.exists())
283 auto sameext = [extension](
const auto & fa)
284 {
return fa.extension.toLower() == extension.toLower() &&
286 auto fa = std::find_if(fa_list.cbegin(), fa_list.cend(), sameext);
287 if (fa != fa_list.cend())
288 play_command = fa->playcommand;
290 if (play_command.trimmed().isEmpty())
291 play_command =
"Internal";
300 std::chrono::minutes length = 0min;
306 plot = extraData->GetPlot();
307 title = extraData->GetTitle();
308 subtitle = extraData->GetSubtitle();
309 director = extraData->GetDirector();
310 season = extraData->GetSeason();
311 episode = extraData->GetEpisode();
312 inetref = extraData->GetInetRef();
313 length = extraData->GetLength();
314 year = QString::number(extraData->GetYear());
315 id = QString::number(extraData->GetID());
319 season, episode, inetref, length, year,
id);
333 [](
auto *player){
return player->Play(); } );
345 const QString &plot,
const QString &title,
const QString &subtitle,
346 const QString &director,
int season,
int episode,
const QString &inetref,
347 std::chrono::minutes length,
const QString &year,
const QString &
id)
350 plot, title, subtitle, director, season, episode, inetref,
QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
VideoPlayProc & operator=(const VideoPlayProc &)
void emitTVPlaybackStopped(void)
virtual QString GetCommandDisplayName() const =0
virtual VideoPlayProc * Clone() const =0
const association_list & getList() const
bool Play() const override
~VideoPlayerCommandPrivate()
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
void AltPlayerFor(const VideoMetadata *item)
virtual ~VideoPlayProc()=default
bool HandleMedia(const QString &Handler, const QString &Mrl, const QString &Plot="", const QString &Title="", const QString &Subtitle="", const QString &Director="", int Season=0, int Episode=0, const QString &Inetref="", std::chrono::minutes LenMins=2h, const QString &Year="1895", const QString &Id="", bool UseBookmarks=false)
VideoPlayerCommandPrivate(const VideoPlayerCommandPrivate &other)
void PlayerFor(const QString &filename, const VideoMetadata *extraData=nullptr)
class VideoPlayerCommandPrivate * m_d
QString ExpandPlayCommand(const QString &command, const QString &filename)
std::vector< file_association > association_list
VideoPlayerCommandPrivate()=default
QString GetCommandDisplayName() const
player_list m_playerProcs
static VideoPlayMythSystem * Create(const QString &command, const QString &filename)
VideoPlayMythSystem * Clone() const override
virtual bool Play() const =0
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
VideoPlayerCommandPrivate & operator=(const VideoPlayerCommandPrivate &rhs)=delete
void PlayerFor(const VideoMetadata *item)
QString GetCommandDisplayName() const
Returns the player command suitable for display to the user.
void AddPlayer(const QString &player, const QString &filename, const QString &plot, const QString &title, const QString &subtitle, const QString &director, int season, int episode, const QString &inetref, std::chrono::minutes length, const QString &year, const QString &id)
std::vector< VideoPlayProc * > player_list
static FileAssociations & getFileAssociation()
static VideoPlayerCommand AltPlayerFor(const VideoMetadata *item)
VideoPlayMythSystem(QString disp_command, QString play_command)
QString GetCommandDisplayName() const override
QString ShellEscape(const QString &src)
MythMainWindow * GetMythMainWindow(void)
void WantingPlayback(QObject *sender)
All the objects that have registered using MythCoreContext::RegisterForPlayback but sender will be ca...
static VideoPlayerCommand PlayerFor(const VideoMetadata *item)
void setFunctionLEDs(enum LCDFunctionSet func, bool on)
VideoPlayerCommand & operator=(const VideoPlayerCommand &rhs)
void PauseIdleTimer(bool Pause)
Pause the idle timeout timer.
QString GetSetting(const QString &key, const QString &defaultval="")