-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
…ray ISO/BDMV.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,8 @@ class CFileItem : | |
const std::string &GetDynPath() const; | ||
void SetDynPath(const std::string &path); | ||
|
||
std::string GetBlurayPath() const; | ||
This comment has been minimized.
Sorry, something went wrong.
ksooo
Member
|
||
|
||
/*! \brief reset class to it's default values as per construction. | ||
Free's all allocated memory. | ||
\sa Initialize | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,7 +266,9 @@ bool CPlayListPlayer::PlayItemIdx(int itemIdx) | |
return Play(); | ||
} | ||
|
||
bool CPlayListPlayer::Play(const CFileItemPtr& pItem, const std::string& player) | ||
bool CPlayListPlayer::Play(const CFileItemPtr& pItem, | ||
const std::string& player, | ||
bool forceSelection /* = false */) | ||
{ | ||
Id playlistId; | ||
bool isVideo{IsVideo(*pItem)}; | ||
|
@@ -304,13 +306,14 @@ bool CPlayListPlayer::Play(const CFileItemPtr& pItem, const std::string& player) | |
SetCurrentPlaylist(playlistId); | ||
Add(playlistId, pItem); | ||
|
||
return Play(0, player); | ||
return Play(0, player, false, false, forceSelection); | ||
This comment has been minimized.
Sorry, something went wrong.
ksooo
Member
|
||
} | ||
|
||
bool CPlayListPlayer::Play(int iSong, | ||
const std::string& player, | ||
bool bAutoPlay /* = false */, | ||
bool bPlayPrevious /* = false */) | ||
bool bPlayPrevious /* = false */, | ||
bool forceSelection /* = false */) | ||
{ | ||
if (m_iCurrentPlayList == TYPE_NONE) | ||
return false; | ||
|
@@ -342,7 +345,7 @@ bool CPlayListPlayer::Play(int iSong, | |
m_bPlaybackStarted = false; | ||
|
||
const auto playAttempt = std::chrono::steady_clock::now(); | ||
bool ret = g_application.PlayFile(*item, player, bAutoPlay); | ||
bool ret = g_application.PlayFile(*item, player, bAutoPlay, forceSelection); | ||
if (!ret) | ||
{ | ||
CLog::Log(LOGERROR, "Playlist Player: skipping unplayable item: {}, path [{}]", m_iCurrentSong, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,19 +55,22 @@ class CPlayListPlayer : public IMsgTargetCallback, | |
* \brief Creates a new playlist for an item and starts playing it | ||
* \param pItem The item to play. | ||
* \param player The player name. | ||
* \param forceSelection for Blurays, force simple menu to change playlist (default to false) | ||
* \return True if has success, otherwise false. | ||
*/ | ||
bool Play(const CFileItemPtr& pItem, const std::string& player); | ||
bool Play(const CFileItemPtr& pItem, const std::string& player, bool forceSelection = false); | ||
This comment has been minimized.
Sorry, something went wrong.
ksooo
Member
|
||
|
||
/*! \brief Start playing a particular entry in the current playlist | ||
\param index the index of the item to play. This value is modified to ensure it lies within the current playlist. | ||
\param replace whether this item should replace the currently playing item. See CApplication::PlayFile (defaults to false). | ||
\param playPreviousOnFail whether to go back to the previous item if playback fails (default to false) | ||
\param forceSelection for Blurays, force simple menu to change playlist (default to false) | ||
*/ | ||
bool Play(int index, | ||
const std::string& player, | ||
bool replace = false, | ||
bool playPreviousOnFail = false); | ||
bool playPreviousOnFail = false, | ||
bool forceSelection = false); | ||
|
||
/*! \brief Returns the index of the current item in active playlist. | ||
\return Current item in the active playlist. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2286,7 +2286,10 @@ bool CApplication::PlayStack(CFileItem& item, bool bRestart) | |
return PlayFile(selectedStackPart, "", true); | ||
} | ||
|
||
bool CApplication::PlayFile(CFileItem item, const std::string& player, bool bRestart) | ||
bool CApplication::PlayFile(CFileItem item, | ||
const std::string& player, | ||
bool bRestart /* = false */, | ||
bool forceSelection /* = false */) | ||
{ | ||
// Ensure the MIME type has been retrieved for http:// and shout:// streams | ||
if (item.GetMimeType().empty()) | ||
|
@@ -2426,7 +2429,7 @@ bool CApplication::PlayFile(CFileItem item, const std::string& player, bool bRes | |
|
||
// a disc image might be Blu-Ray disc | ||
if (!(options.startpercent > 0.0 || options.starttime > 0.0) && | ||
(IsBDFile(item) || item.IsDiscImage())) | ||
(IsBDFile(item) || item.IsDiscImage() || (IsBlurayPlaylist(item) && forceSelection))) | ||
This comment has been minimized.
Sorry, something went wrong.
ksooo
Member
|
||
{ | ||
// No video selection when using external or remote players (they handle it if supported) | ||
const bool isSimpleMenuAllowed = [&]() | ||
|
@@ -2444,7 +2447,7 @@ bool CApplication::PlayFile(CFileItem item, const std::string& player, bool bRes | |
if (isSimpleMenuAllowed) | ||
{ | ||
// Check if we must show the simplified bd menu. | ||
if (!CGUIDialogSimpleMenu::ShowPlaySelection(item)) | ||
if (!CGUIDialogSimpleMenu::ShowPlaySelection(item, forceSelection)) | ||
return true; | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ | |
#include "video/VideoFileItemClassify.h" | ||
#include "video/VideoInfoTag.h" | ||
|
||
std::string m_savePath; | ||
This comment has been minimized.
Sorry, something went wrong.
ksooo
Member
|
||
|
||
using namespace KODI; | ||
|
||
namespace | ||
|
@@ -52,12 +54,18 @@ class CGetDirectoryItems : public IRunnable | |
}; | ||
} | ||
|
||
|
||
bool CGUIDialogSimpleMenu::ShowPlaySelection(CFileItem& item) | ||
bool CGUIDialogSimpleMenu::ShowPlaySelection(CFileItem& item, bool forceSelection /* = false */) | ||
{ | ||
if (CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_DISC_PLAYBACK) != BD_PLAYBACK_SIMPLE_MENU) | ||
return true; | ||
|
||
m_savePath = ""; | ||
if (VIDEO::IsBlurayPlaylist(item) && forceSelection) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
{ | ||
m_savePath = item.GetDynPath(); // save for screen refresh later | ||
item.SetDynPath(item.GetBlurayPath()); | ||
} | ||
|
||
if (VIDEO::IsBDFile(item)) | ||
{ | ||
std::string root = URIUtils::GetParentPath(item.GetDynPath()); | ||
|
@@ -127,10 +135,11 @@ bool CGUIDialogSimpleMenu::ShowPlaySelection(CFileItem& item, const std::string& | |
|
||
if (item_new->m_bIsFolder == false) | ||
{ | ||
std::string original_path = item.GetDynPath(); | ||
if (m_savePath.empty()) // If not set above (choose playlist selected) | ||
m_savePath = item.GetDynPath(); | ||
item.SetDynPath(item_new->GetDynPath()); | ||
item.SetProperty("get_stream_details_from_player", true); | ||
item.SetProperty("original_listitem_url", original_path); | ||
item.SetProperty("original_listitem_url", m_savePath); | ||
return true; | ||
} | ||
|
||
|
@78andyp I know I'm late to the party, but next time, to help our translators, whenever you add a new string, add the files where the string is used and a short verbal description for what the string is used. Look how it is done for other strings in this file and you will see what I mean.