Showing OSD when changing channels in MyTV (1 Viewer)

SePPiE

Portal Pro
December 6, 2004
66
0
The Netherlands
keans said:
hi,

this would really be awesome to have something like Maschine' suggestion ;-)

I was wondering if it would not make more sense to show the current show in bigger font and the following in a smaller font - furthermore the information should be about the current show as well not about the following...

just my 2 cents
keans

yes indeed, that's bothering me also.. I even thought it was my fault at first and was looking at the problem in the xmltv file and my time settings, but then saw in the source that it was meant like that... :)

You can fix this by editing the tvosd.xml in your preferred skin ... :) just swap the values at On TV Now and On TV Next...
 

SePPiE

Portal Pro
December 6, 2004
66
0
The Netherlands
well, i've been tinkering around a bit and have something already... I'm reusing the OSD as is, but hiding all the uneccesary controls when channel switching :) So you don't see the play, rewind etc in the botten.. Also the NEXT SHOW is not displayed etc..
Still got some issues to work out tho... It's interfering with the real OSD right now and I have to try and find a sollution for that... Also I need to still show it too after a channel switch by numberpad ....

I also enlarged the thumbnail photo a bit, centered it more and (not visible on this picture) increased the font of the channel name.. On my tv it's hardly readable...
infoOSD.jpg



[UPDATE]
I fixed the interferance with the REAL osd, so to speak and it works perfect now :)
Only thing left to do is to make the keypad channel switching work.. Not really a very neccessary thing, but sometimes annoying when you want to go to a channel quickly.....
 

SePPiE

Portal Pro
December 6, 2004
66
0
The Netherlands
Better working code...

(You can also download a zip file I made with the modified files below and a compiled Debug DLL plus modified skin here....



In GUITV\GUITVHome.cs:

static public void OnNextChannel()
{
// get list of all channels
string strChannel=Recorder.TVChannelName;
if (currentGroup!=null)
{
// get current channel name
for (int i=0; i < currentGroup.tvChannels.Count;++i)
{
TVChannel chan=(TVChannel)currentGroup.tvChannels;
if (String.Compare(chan.Name,strChannel,true)==0 )
{
//select next channel
int iNext=i+1;
if (iNext>currentGroup.tvChannels.Count-1) iNext=0;
chan=(TVChannel)currentGroup.tvChannels[iNext];

//and view that
int card=GUITVHome.GetCurrentCard();
Recorder.StartViewing(card, chan.Name, Recorder.IsCardViewing(card), Recorder.IsCardTimeShifting(card)) ;

if (GUIGraphicsContext.IsFullScreenVideo)
{
GUIFullScreenTV TVWindow = (GUIFullScreenTV) GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TVFULLSCREEN);
if (TVWindow != null) TVWindow.ShowInfoOSD();
}
return;
}
}
return;
}
ArrayList m_channels=new ArrayList();
TVDatabase.GetChannels(ref m_channels);

// get current channel name
for (int i=0; i < m_channels.Count;++i)
{
TVChannel chan=(TVChannel)m_channels;
if (String.Compare(chan.Name,strChannel,true)==0 )
{
//select next channel
int iNext=i+1;
if (iNext>m_channels.Count-1) iNext=0;
chan=(TVChannel)m_channels[iNext];

//and view that
int card=GUITVHome.GetCurrentCard();
Recorder.StartViewing(card, chan.Name, Recorder.IsCardViewing(card), Recorder.IsCardTimeShifting(card)) ;

if (GUIGraphicsContext.IsFullScreenVideo)
{
GUIFullScreenTV TVWindow = (GUIFullScreenTV) GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TVFULLSCREEN);
if (TVWindow != null) TVWindow.ShowInfoOSD();
}
return;
}
}
}

static public void OnPreviousChannel()
{
string strChannel=Recorder.TVChannelName;
if (currentGroup!=null)
{
for (int i=0; i < currentGroup.tvChannels.Count;++i)
{
TVChannel chan=(TVChannel)currentGroup.tvChannels;
if (String.Compare(chan.Name,strChannel,true)==0 )
{
int iPrev=i-1;
if (iPrev<0) iPrev=currentGroup.tvChannels.Count-1;
chan=(TVChannel)currentGroup.tvChannels[iPrev];

int card=GUITVHome.GetCurrentCard();
Recorder.StartViewing(card, chan.Name, Recorder.IsCardViewing(card), Recorder.IsCardTimeShifting(card)) ;


if (GUIGraphicsContext.IsFullScreenVideo)
{
GUIFullScreenTV TVWindow = (GUIFullScreenTV) GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TVFULLSCREEN);
if (TVWindow != null) TVWindow.ShowInfoOSD();
}
return;
}
}
}

ArrayList m_channels=new ArrayList();
TVDatabase.GetChannels(ref m_channels);
for (int i=0; i < m_channels.Count;++i)
{
TVChannel chan=(TVChannel)m_channels;
if (String.Compare(chan.Name,strChannel,true)==0 )
{
int iPrev=i-1;
if (iPrev<0) iPrev=m_channels.Count-1;
chan=(TVChannel)m_channels[iPrev];

int card=GUITVHome.GetCurrentCard();
Recorder.StartViewing(card, chan.Name, Recorder.IsCardViewing(card), Recorder.IsCardTimeShifting(card)) ;

if (GUIGraphicsContext.IsFullScreenVideo)
{
GUIFullScreenTV TVWindow = (GUIFullScreenTV) GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TVFULLSCREEN);
if (TVWindow != null) TVWindow.ShowInfoOSD();
}
return;
}
}
}

Then in GUITV\GUIFULLSCREENTV.cs insert this new subroutine
public void ShowInfoOSD()
{
if (m_bOSDVisible)
{
m_osdWindow.ShowingInfo();
m_osdWindow.UpdateChannelInfo();
m_dwOSDTimeOut=DateTime.Now;
m_bUpdate = true;

}
else
{
m_osdWindow.ShowingInfo();
m_osdWindow.UpdateChannelInfo();
Log.Write("INFO OSD:ON");
m_dwOSDTimeOut=DateTime.Now;
GUIMessage msg= new GUIMessage (GUIMessage.MessageType.GUI_MSG_WINDOW_INIT,m_osdWindow.GetID,0,0,0,0,null);
m_osdWindow.OnMessage(msg); // Send an init msg to the OSD
m_bOSDVisible=true;
m_bUpdate=true;
}
}

Also change the OnAction.ACTION_SHOW_OSD to reflect the following
case Action.ActionType.ACTION_SHOW_OSD: // Show the OSD
{
Log.Write("OSD:ON");
m_dwOSDTimeOut=DateTime.Now;
GUIMessage msg= new GUIMessage (GUIMessage.MessageType.GUI_MSG_WINDOW_INIT,m_osdWindow.GetID,0,0,0,0,null);
m_osdWindow.NoMoreInfo();
m_osdWindow.OnMessage(msg); // Send an init msg to the OSD
m_bOSDVisible=true;
m_bUpdate=true;

}

Then in GUITV\GUITVOSD.cs declare:
bool m_bShowingInfo = false;

then add the following subroutines somewhere
public void ShowingInfo()
{
m_bShowingInfo = true;
}
public void NoMoreInfo()
{
if (m_bShowingInfo==true)
{
ShowControl(GetID,(int)Controls.OSD_MUTE);
ShowControl(GetID,(int)Controls.OSD_SUBTITLES);
ShowControl(GetID,(int)Controls.OSD_BOOKMARKS);
ShowControl(GetID,(int)Controls.OSD_VIDEO);
ShowControl(GetID,(int)Controls.OSD_AUDIO);

ShowControl(GetID,(int)Controls.OSD_REWIND); // pop all the relevant
ShowControl(GetID,(int)Controls.OSD_FFWD); // buttons back to
ShowControl(GetID,(int)Controls.OSD_PLAY); // their up state
ShowControl(GetID,(int)Controls.OSD_SKIPBWD); // pop all the relevant
ShowControl(GetID,(int)Controls.OSD_STOP); // buttons back to
ShowControl(GetID,(int)Controls.OSD_SKIPFWD); // their up state
ShowControl(GetID,(int)Controls.OSD_MUTE); // their up state
ShowControl(GetID,(int)Controls.LABEL_ONTV_NEXT);
ShowControl(GetID,(int)Controls.BTN_CHANNEL_UP);
ShowControl(GetID,(int)Controls.BTN_CHANNEL_DOWN);
ShowControl(GetID,(int)Controls.BTN_PROGRAM_LEFT);
ShowControl(GetID,(int)Controls.BTN_PROGRAM_RIGHT);

ToggleButton((int)Controls.OSD_MUTE, false);
ToggleButton((int)Controls.OSD_SUBTITLES, false);
ToggleButton((int)Controls.OSD_BOOKMARKS, false);
ToggleButton((int)Controls.OSD_VIDEO, false);
ToggleButton((int)Controls.OSD_AUDIO, false);

ToggleButton((int)Controls.OSD_REWIND, false); // pop all the relevant
ToggleButton((int)Controls.OSD_FFWD, false); // buttons back to
ToggleButton((int)Controls.OSD_PLAY, false); // their up state

ToggleButton((int)Controls.OSD_SKIPBWD, false); // pop all the relevant
ToggleButton((int)Controls.OSD_STOP, false); // buttons back to
ToggleButton((int)Controls.OSD_SKIPFWD, false); // their up state
ToggleButton((int)Controls.OSD_MUTE, false); // their up state
m_bShowingInfo = false;
}
}

void HideAllButInfo()
{
// Set all sub menu controls to hidden

HideControl(GetID, (int)Controls.OSD_SUBMENU_BG_AUDIO);
HideControl(GetID, (int)Controls.OSD_SUBMENU_BG_VIDEO);
HideControl(GetID, (int)Controls.OSD_SUBMENU_BG_BOOKMARKS);
HideControl(GetID, (int)Controls.OSD_SUBMENU_BG_SUBTITLES);
HideControl(GetID, (int)Controls.OSD_SUBMENU_BG_VOL);


HideControl(GetID, (int)Controls.OSD_VOLUMESLIDER);
HideControl(GetID, (int)Controls.OSD_VIDEOPOS);
HideControl(GetID, (int)Controls.OSD_VIDEOPOS_LABEL);
HideControl(GetID, (int)Controls.OSD_AUDIOSTREAM_LIST);
HideControl(GetID, (int)Controls.OSD_AVDELAY);
HideControl(GetID, (int)Controls.OSD_SATURATIONLABEL);
HideControl(GetID, (int)Controls.OSD_SATURATION);
HideControl(GetID, (int)Controls.OSD_SHARPNESSLABEL);
HideControl(GetID, (int)Controls.OSD_SHARPNESS);
HideControl(GetID, (int)Controls.OSD_AVDELAY_LABEL);

HideControl(GetID, (int)Controls.OSD_BRIGHTNESS);
HideControl(GetID, (int)Controls.OSD_BRIGHTNESSLABEL);

HideControl(GetID, (int)Controls.OSD_GAMMA);
HideControl(GetID, (int)Controls.OSD_GAMMALABEL);

HideControl(GetID, (int)Controls.OSD_CONTRAST);
HideControl(GetID, (int)Controls.OSD_CONTRASTLABEL);

HideControl(GetID, (int)Controls.OSD_CREATEBOOKMARK);
HideControl(GetID, (int)Controls.OSD_BOOKMARKS_LIST);
HideControl(GetID, (int)Controls.OSD_BOOKMARKS_LIST_LABEL);
HideControl(GetID, (int)Controls.OSD_CLEARBOOKMARKS);
HideControl(GetID, (int)Controls.OSD_SUBTITLE_DELAY);
HideControl(GetID, (int)Controls.OSD_SUBTITLE_DELAY_LABEL);
HideControl(GetID, (int)Controls.OSD_SUBTITLE_ONOFF);
HideControl(GetID, (int)Controls.OSD_SUBTITLE_LIST);

HideControl(GetID,(int)Controls.OSD_MUTE);
HideControl(GetID,(int)Controls.OSD_SUBTITLES);
HideControl(GetID,(int)Controls.OSD_BOOKMARKS);
HideControl(GetID,(int)Controls.OSD_VIDEO);
HideControl(GetID,(int)Controls.OSD_AUDIO);

HideControl(GetID,(int)Controls.OSD_REWIND); // pop all the relevant
HideControl(GetID,(int)Controls.OSD_FFWD); // buttons back to
HideControl(GetID,(int)Controls.OSD_PLAY); // their up state

HideControl(GetID,(int)Controls.OSD_SKIPBWD); // pop all the relevant
HideControl(GetID,(int)Controls.OSD_STOP); // buttons back to
HideControl(GetID,(int)Controls.OSD_SKIPFWD); // their up state
HideControl(GetID,(int)Controls.OSD_MUTE); // their up state
HideControl(GetID,(int)Controls.LABEL_ONTV_NEXT);
HideControl(GetID,(int)Controls.BTN_CHANNEL_UP);
HideControl(GetID,(int)Controls.BTN_CHANNEL_DOWN);
HideControl(GetID,(int)Controls.BTN_PROGRAM_LEFT);
HideControl(GetID,(int)Controls.BTN_PROGRAM_RIGHT);
}

And then in the UpdateProgressBar() sub alter it like this:
void UpdateProgressBar()
{
double fPercent;
if (g_Player.Playing==false)
{
if (m_util==null)
{
m_util=new TVUtil();
}
TVProgram prog=m_util.GetCurrentProgram(GetChannelName());
if (prog==null) return;
string strTime=String.Format("{0}-{1}",
prog.StartTime.ToString("t",CultureInfo.CurrentCulture.DateTimeFormat),
prog.EndTime.ToString("t",CultureInfo.CurrentCulture.DateTimeFormat));

TimeSpan ts=prog.EndTime-prog.StartTime;
double iTotalSecs=ts.TotalSeconds;
ts=DateTime.Now-prog.StartTime;
double iCurSecs=ts.TotalSeconds;
fPercent = ((double)iCurSecs) / ((double)iTotalSecs);
}
fPercent=g_Player.CurrentPosition / g_Player.Duration;
fPercent *=100.0d;
GUIProgressControl cntl=GetControl( (int)Controls.PROGRESS_BAR) as GUIProgressControl;
if (cntl!=null)
{
cntl.Percentage=(int)fPercent;
}
if (m_bShowingInfo==true)
{
HideAllButInfo();
}

}



I know for sure above code could be more efficient, but hey, I'm more used to VB.Net myself and think I did quite well :) I'm also doing this in the boss his time, so sometimes my attention goes to other stuff, but ah well, here it is :)

Only thing left to do is numberpad channel switching.. But don't really know how to tackle that problem yet... So for the anxious people, at least here's the info OSD :) ....


Oh yeah, if you would also like the tv logo's a bit bigger and more centered,here's my modified mce xml skin elements:

[UPDATE] Come to think of it, you NEED to alter the ON TV NEXT and ON TV NOW like below, cause else you'll see the NEXT show in the top and not the CURRENT show[/UPDATE]

TVOSD.XML:

<control>
<description>TV Logo</description>
<type>image</type>
<id>10</id>
<posX>20</posX>
<posY>435</posY>
<width>100</width>
<height>100</height>
<texture>#TV.View.thumb</texture>
<visible>yes</visible>
</control>
<control>
<description>On tv NOW</description>
<id>36</id>
<type>textbox</type>
<width>500</width>
<height>60</height>
<posX>205</posX>
<posY>420</posY>
<align>left</align>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
</control>
<control>
<description>On tv NEXT</description>
<id>37</id>
<type>textbox</type>
<width>500</width>
<height>60</height>
<posX>205</posX>
<posY>443</posY>
<align>left</align>
<font>font10</font>
<textcolor>FFB2D4F5</textcolor>
</control>
<control>
<description>Current channel</description>
<type>label</type>
<id>35</id>
<posX>35</posX>
<posY>540</posY>
<label>-</label>
<align>left</align>
<font>font10</font>
<textcolor>FFFFFFFF</textcolor>
</control>[/url]
 
A

Anonymous

Guest
hi,

this looks rather great 8)

As i wrote before - I really like to see the current show, but to remove the following complete was not my intention - what about putting the following show at the bottom of OSD ?
Another thing is, that you should perhaps talk to one of the core developers if this could be implementet as default - because only posting some code here is more a dirty hack and not all people can participate in this great feature ...

don't get me wrong you're doing a great job ;-)

keans
 

SePPiE

Portal Pro
December 6, 2004
66
0
The Netherlands
hehehe yeah i know... I'm gonna PM frodo and/or mario if they can take a look and see if they could implement it in the final core... I really missed this a lot and know a lot of other people did too...
They probly can also implement this in a more "efficient" way...
 

Maschine

Retired Team Member
  • Premium Supporter
  • June 15, 2004
    768
    86
    Germany
    Home Country
    Germany Germany
    Seppie,

    this is getting nicer the longer I look at it ;-)

    But still one suggestion: please get rid of the progressbar. I think it's not needed and the space it takes right now we could use better. I would like to see the title of the following show and it's starting time.

    This is also just one line and weg get the same info as from the progressbar, because we have the starting time of the current show next to it's title and the ending time is the starting time of the next show which is also displayed. :shock: oops, this is getting a bit complicated now, but I'm sure you'll understand the basic message ;-)

    Have a nice weekend and keep up the great work!

    Maschine
     
    A

    Anonymous

    Guest
    hm, seeing the following show with start time (in one line) would be great - but I like the progressbar - what about shrinking the progressbar? half of the height would do for me and you would gain some free space as well...
    For me it just more comfortable to see in the progressbar how long the current show takes than calculating with times ;-)

    keans
     

    SePPiE

    Portal Pro
    December 6, 2004
    66
    0
    The Netherlands
    actually, I think the progressbar does need to be gone or at least moved. cause now it takes up half the screen, which is irritating as well..
    Unfortunatly I haven't figured out how to get rid of the progressbar yet, and I also have seen that to get rid of the progress bar I also need to make a new background bitmap ... Cause the lighter blue where the progressbar is drawn is part of the OSD skin background.

    I think it would be easier to get rid of the entire progressbar, lighterblue area and just make a next show and next show time text somewhere, so you still have a quick view of how long the show will take...

    I'll think about it some more this weekend and twinker around some more..
    I also PM'ed Frodo about this, and I hope with his expertise and my humble hack (my first code addition to MP) we can make this standard, slick looking and supported by all MP skins..
     

    MrMario64

    Retired Team Member
  • Premium Supporter
  • April 22, 2004
    822
    1
    50
    Home Country
    Netherlands Netherlands
    it was planned allready to make a new zap-dialog.
    We will check whats better, use your "hack" or make the new dialog ourselves.

    Thanx!

    jcee.
    You can allready show a full list of channels in TV
    Press F9 to show the context menu and then select channel list.
     
    A

    Anonymous

    Guest
    As far as i can see the OSD is showing up when switching in 0.1.0.6. I hate it and can't find a switch to disable it. :-(
     

    Users who are viewing this thread

    Top Bottom