Kodi Community Forum

Full Version: IPTV radio navigation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have MP as backend and I have added iptv radio stations to the radio group, so far so good. But when I play a radio channel I miss the opportunity to change the channels up or down. I also miss the ability to change the channels numbers through the numeric buttons. Is it possible to fix this, or could somebody point me in the right direction?

Reg.
Fred
Hi All there,

Where is the best place to upload the changed files? In the xbmc master branch or at margos branch?

Reg,
Fred
What changed files? If you have a patch for this then make a PR to the xbmc master branch.
(2012-10-20, 15:52)mikrohard Wrote: [ -> ]What changed files? If you have a patch for this then make a PR to the xbmc master branch.

There are multiple files which have to change

GUIWindowVisualision::OnAction
case REMOTE_0:
case REMOTE_1:
case REMOTE_2:
case REMOTE_3:
case REMOTE_4:
case REMOTE_5:
case REMOTE_6:
case REMOTE_7:
case REMOTE_8:
case REMOTE_9:
{
if (g_application.CurrentFileItem().IsLiveTV())
{
CPVRChannelPtr channel;
int iChannelNumber = -1;
g_PVRManager.GetCurrentChannel(channel);

if (action.GetID() == REMOTE_0)
{
iChannelNumber = g_PVRManager.GetPreviousChannel();
if (iChannelNumber > 0)
CLog::Log(LOGDEBUG, "switch to channel number %d", iChannelNumber);
else
CLog::Log(LOGDEBUG, "no previous channel number found");
}
else
{
int autoCloseTime = g_guiSettings.GetBool("pvrplayback.switchautoclose") ? 1500 : 0;
CStdString strChannel;
strChannel.Format("%i", action.GetID() - REMOTE_0);
if (CGUIDialogNumeric::ShowAndGetNumber(strChannel, g_localizeStrings.Get(19000), autoCloseTime) || autoCloseTime)
iChannelNumber = atoi(strChannel.c_str());
}

if (iChannelNumber > 0 && iChannelNumber != channel->ChannelNumber())
{
CPVRChannelGroupPtr selectedGroup = g_PVRManager.GetPlayingGroup(channel->IsRadio());
CFileItemPtr channel = selectedGroup->GetByChannelNumber(iChannelNumber);
if (!channel || !channel->HasPVRChannelInfoTag())
return false;

OnAction(CAction(ACTION_CHANNEL_SWITCH, (float)iChannelNumber));
}
}
return true;
}
break;

case ACTION_CHANNEL_SWITCH:
{
if (g_application.CurrentFileItem().IsLiveTV())
{
if (g_application.m_pPlayer != NULL && g_application.m_pPlayer->OnAction(action))
{
return true;
}
}
}
break;

Application:OnAction
// first check whether we're within 3 seconds of the start of the track
if (IsPlayingAudio() && m_pPlayer && m_pPlayer->OnAction(action))
{
return true;
}

// next : play next song from playlist
if (action.GetID() == ACTION_NEXT_ITEM)
{
if (IsPlayingAudio() && m_pPlayer && m_pPlayer->OnAction(action))
{
return true;
}

GUIDialogMusicOSD.cpp
bool CGUIDialogMusicOSD::OnAction(const CAction &action)
{
if (action.GetID() == ACTION_NEXT_ITEM || action.GetID() == ACTION_PREV_ITEM)
{
// these could indicate next chapter if video supports it
if (g_application.m_pPlayer != NULL && g_application.m_pPlayer->OnAction(action))
return true;
}

return CGUIDialog::OnAction(action);
}


Als the musicOSD.xml has some changes.