36
36
#include " utils/log.h"
37
37
#include " video/PlayerController.h"
38
38
#include " video/VideoUtils.h"
39
- #include " video/windows/GUIWindowVideoBase .h"
39
+ #include " video/guilib/VideoSelectActionProcessor .h"
40
40
41
41
#include < math.h>
42
42
@@ -502,14 +502,33 @@ int PlayOrQueueMedia(const std::vector<std::string>& params, bool forcePlay)
502
502
if (!item.m_bIsFolder && item.IsPlugin ())
503
503
item.SetProperty (" IsPlayable" , true );
504
504
505
- if (askToResume == true )
505
+ if (askToResume)
506
506
{
507
- if (CGUIWindowVideoBase::ShowResumeMenu (item) == false )
507
+ const VIDEO::GUILIB::SelectAction action =
508
+ VIDEO::GUILIB::CVideoSelectActionProcessorBase::ChoosePlayOrResume (item);
509
+ if (action == VIDEO::GUILIB::SELECT_ACTION_RESUME)
510
+ {
511
+ item.SetStartOffset (STARTOFFSET_RESUME);
512
+ }
513
+ else if (action != VIDEO::GUILIB::SELECT_ACTION_PLAY)
514
+ {
515
+ // The Resume dialog was closed without any choice
508
516
return false ;
517
+ }
509
518
item.SetProperty (" check_resume" , false );
510
519
}
511
520
512
- if (item.m_bIsFolder || item.IsPlayList ())
521
+ if (item.IsStack ())
522
+ {
523
+ const VIDEO_UTILS::ResumeInformation resumeInfo =
524
+ VIDEO_UTILS::GetStackPartResumeInformation (item, playOffset + 1 );
525
+
526
+ if (item.GetStartOffset () == STARTOFFSET_RESUME)
527
+ item.SetStartOffset (resumeInfo.startOffset );
528
+
529
+ item.m_lStartPartNumber = resumeInfo.partNumber ;
530
+ }
531
+ else if (!forcePlay /* queue */ || item.m_bIsFolder || item.IsPlayList ())
513
532
{
514
533
CFileItemList items;
515
534
GetItemsForPlayList (std::make_shared<CFileItem>(item), items);
@@ -774,17 +793,17 @@ static int SubtitleShiftDown(const std::vector<std::string>& params)
774
793
// / \table_row2_l{
775
794
// / <b>`PlayMedia(media[\,isdir][\,1]\,[playoffset=xx])`</b>
776
795
// / ,
777
- // / Plays the media. This can be a playlist\, music\, or video file\, directory\,
778
- // / plugin or an Url . The optional parameter "\ ,isdir" can be used for playing
779
- // / a directory. "\,1" will start the media without switching to fullscreen.
780
- // / If media is a playlist\, you can use playoffset=xx where xx is
781
- // / the position to start playback from.
796
+ // / Plays the given media. This can be a playlist\, music\, or video file\, directory\,
797
+ // / plugin\, disc image stack\, video file stack or an URL . The optional parameter ` ,isdir` can
798
+ // / be used for playing a directory. `,1` will start the media without switching to fullscreen.
799
+ // / If media is a playlist or a disc image stack or a video file stack \, you can use
800
+ // / playoffset=xx where xx is the position to start playback from.
782
801
// / @param[in] media URL to media to play (optional).
783
- // / @param[in] isdir Set " isdir" if media is a directory (optional).
784
- // / @param[in] windowed Set "1" to start playback without switching to fullscreen (optional).
785
- // / @param[in] resume Set " resume" to force resuming (optional).
786
- // / @param[in] noresume Set " noresume" to force not resuming (optional).
787
- // / @param[in] playeroffset Set " playoffset=<offset>" to start playback from a given position in a playlist (optional).
802
+ // / @param[in] isdir Set ` isdir` if media is a directory (optional).
803
+ // / @param[in] windowed Set `1` to start playback without switching to fullscreen (optional).
804
+ // / @param[in] resume Set ` resume` to force resuming (optional).
805
+ // / @param[in] noresume Set ` noresume` to force not resuming (optional).
806
+ // / @param[in] playoffset Set ` playoffset=<offset>` to start playback from a given position in a playlist or stack (optional).
788
807
// / }
789
808
// / \table_row2_l{
790
809
// / <b>`PlayWith(core)`</b>
@@ -803,17 +822,18 @@ static int SubtitleShiftDown(const std::vector<std::string>& params)
803
822
// / <b>`QueueMedia(media[\,isdir][\,1][\,playnext]\,[playoffset=xx])`</b>
804
823
// / \anchor Builtin_QueueMedia,
805
824
// / Queues the given media. This can be a playlist\, music\, or video file\, directory\,
806
- // / plugin or an Url. The optional parameter "\,isdir" can be used for playing
807
- // / a directory. "\,1" will start the media without switching to fullscreen.
808
- // / If media is a playlist\, you can use playoffset=xx where xx is
809
- // / the position to start playback from.
825
+ // / plugin\, disc image stack\, video file stack or an URL. The optional parameter `,isdir` can
826
+ // / be used for playing a directory. `,1` will start the media without switching to fullscreen.
827
+ // / If media is a playlist or a disc image stack or a video file stack\, you can use
828
+ // / playoffset=xx where xx is the position to start playback from.
829
+ // / where xx is the position to start playback from.
810
830
// / @param[in] media URL of media to queue.
811
- // / @param[in] isdir Set " isdir" if media is a directory (optional).
812
- // / @param[in] 1 Set "1" to start playback without switching to fullscreen (optional).
813
- // / @param[in] resume Set " resume" to force resuming (optional).
814
- // / @param[in] noresume Set " noresume" to force not resuming (optional).
815
- // / @param[in] playeroffset Set " playoffset=<offset>" to start playback from a given position in a playlist (optional).
816
- // / @param[in] playnext Set " playnext" to play the media right after the currently playing item, if player is currently
831
+ // / @param[in] isdir Set ` isdir` if media is a directory (optional).
832
+ // / @param[in] 1 Set `1` to start playback without switching to fullscreen (optional).
833
+ // / @param[in] resume Set ` resume` to force resuming (optional).
834
+ // / @param[in] noresume Set ` noresume` to force not resuming (optional).
835
+ // / @param[in] playoffset Set ` playoffset=<offset>` to start playback from a given position in a playlist or stack (optional).
836
+ // / @param[in] playnext Set ` playnext` to play the media right after the currently playing item, if player is currently
817
837
// / playing. If player is not playing, append media to current playlist (optional).
818
838
// / <p><hr>
819
839
// / @skinning_v20 **[New builtin]** \link Builtin_QueueMedia `QueueMedia(media[\,isdir][\,1][\,playnext]\,[playoffset=xx])`\endlink
0 commit comments