Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Play the next video automatically' option #1069

Merged
1 commit merged into from Oct 7, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion language/English/strings.po
Expand Up @@ -4816,7 +4816,15 @@ msgctxt "#13432"
msgid "Allow hardware acceleration (VideoToolbox)"
msgstr ""

#empty strings from id 13433 to 13499
msgctxt "#13433"
msgid "Play the next video automatically"
msgstr ""

msgctxt "#13434"
msgid "Play only this"
msgstr ""

#empty strings from id 13435 to 13499

msgctxt "#13500"
msgid "A/V sync method"
Expand Down
1 change: 1 addition & 0 deletions xbmc/dialogs/GUIDialogContextMenu.h
Expand Up @@ -122,6 +122,7 @@ enum CONTEXT_BUTTON { CONTEXT_BUTTON_CANCELLED = 0,
CONTEXT_BUTTON_SORTBY_DATE,
CONTEXT_BUTTON_MENU_HOOKS,
CONTEXT_BUTTON_PLAY_AND_QUEUE,
CONTEXT_BUTTON_PLAY_ONLY_THIS,
CONTEXT_BUTTON_UPDATE_EPG,
CONTEXT_BUTTON_RECORD_ITEM,
CONTEXT_BUTTON_TAGS_ADD_ITEMS,
Expand Down
3 changes: 3 additions & 0 deletions xbmc/settings/GUISettings.cpp
Expand Up @@ -662,6 +662,9 @@ void CGUISettings::Initialize()

CSettingsCategory* vp = AddCategory(SETTINGS_VIDEOS, "videoplayer", 14086);

AddBool(vp, "videoplayer.autoplaynextitem", 13433, false);
AddSeparator(vp, "videoplayer.sep1");

map<int, int> renderers;
renderers.insert(make_pair(13416, RENDER_METHOD_AUTO));

Expand Down
2 changes: 1 addition & 1 deletion xbmc/video/GUIViewStateVideo.cpp
Expand Up @@ -454,7 +454,7 @@ bool CGUIViewStateWindowVideoNav::AutoPlayNextItem()
if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS || params.GetContentType() == 6) // recently added musicvideos
return g_guiSettings.GetBool("musicplayer.autoplaynextitem");

return false;
return g_guiSettings.GetBool("videoplayer.autoplaynextitem");
}

CGUIViewStateWindowVideoPlaylist::CGUIViewStateWindowVideoPlaylist(const CFileItemList& items) : CGUIViewStateWindowVideo(items)
Expand Down
10 changes: 8 additions & 2 deletions xbmc/video/windows/GUIWindowVideoBase.cpp
Expand Up @@ -1222,10 +1222,14 @@ void CGUIWindowVideoBase::GetContextButtons(int itemNumber, CContextButtons &but
buttons.Add(CONTEXT_BUTTON_RESUME_ITEM, GetResumeString(*(item.get()))); // Resume Video
}
//if the item isn't a folder, is a member of a list rather than a single item
//and we're not on the last element of the list, then add the 'play from here' option
//and we're not on the last element of the list,
//then add add either 'play from here' or 'play only this' depending on default behaviour
if (!item->m_bIsFolder && m_vecItems->Size() > 1 && itemNumber < m_vecItems->Size()-1)
{
buttons.Add(CONTEXT_BUTTON_PLAY_AND_QUEUE, 13412);
if (!g_guiSettings.GetBool("videoplayer.autoplaynextitem"))
buttons.Add(CONTEXT_BUTTON_PLAY_AND_QUEUE, 13412);
else
buttons.Add(CONTEXT_BUTTON_PLAY_ONLY_THIS, 13434);
}
if (item->IsSmartPlayList() || m_vecItems->IsSmartPlayList())
buttons.Add(CONTEXT_BUTTON_EDIT_SMART_PLAYLIST, 586);
Expand Down Expand Up @@ -1431,6 +1435,8 @@ bool CGUIWindowVideoBase::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
return true;
case CONTEXT_BUTTON_PLAY_AND_QUEUE:
return OnPlayAndQueueMedia(item);
case CONTEXT_BUTTON_PLAY_ONLY_THIS:
return OnPlayMedia(itemNumber);
default:
break;
}
Expand Down