2017-12-10, 12:58 AM
It also gives rise to a situation that's not straightforward to recover as something is corrupted and you can no longer get back to that form to correct the information.
Also, once in this state, several UI operations encountered similar exceptions, though I didn't keep all those stack traces.
I did eventually find that I could re-edit the channel via Devices to recover the situation.
Here's the exception stack trace:
************** Exception Text **************
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at NUtility.ChannelMapping.ParseInt(String val)
at NUtility.ChannelMapping.ExtractTuningCache()
at NUtility.ChannelMapping.get_Locator()
at NextPVR.Settings.ChannelDetailsForm.ChannelDetailsForm_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I'd encountered this by typing a hex ONID value because my TV shows the channel SID, TSID, & ONID as hex values, and at the time I hadn't recognised that NPVR was using the decimal value, so I typed the hex ONID (233a) that my TV showed and got into a mess.
Looking at the call stack, I'd recommend using TryParse() rather than Parse(), and handling the error appropriately.
Background - several SD channels (such as ITV) show fine on the TV (the TV diagnostic shows no errors and a good signal strength) but break up terribly and are unwatchable in NPVR (& Media Centre), and seeing the different hex/decimal numbers I thought the PC tuner was tuning to the wrong signal for those channels - though I now realise I was mistaken in that assumption.
Additionally, can I suggest that all the UI form's behaviour with the OK (Enter) and Cancel (Esc) keyboard handling be sorted out please. It should be an easy matter of setting the correct properties of the forms & OK/Cancel button controls, no code changes needed.
I'm using NPVR 4.0.5 (171208)
Other than these small points - great work!
Also, once in this state, several UI operations encountered similar exceptions, though I didn't keep all those stack traces.
I did eventually find that I could re-edit the channel via Devices to recover the situation.
Here's the exception stack trace:
************** Exception Text **************
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at NUtility.ChannelMapping.ParseInt(String val)
at NUtility.ChannelMapping.ExtractTuningCache()
at NUtility.ChannelMapping.get_Locator()
at NextPVR.Settings.ChannelDetailsForm.ChannelDetailsForm_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I'd encountered this by typing a hex ONID value because my TV shows the channel SID, TSID, & ONID as hex values, and at the time I hadn't recognised that NPVR was using the decimal value, so I typed the hex ONID (233a) that my TV showed and got into a mess.
Looking at the call stack, I'd recommend using TryParse() rather than Parse(), and handling the error appropriately.
Background - several SD channels (such as ITV) show fine on the TV (the TV diagnostic shows no errors and a good signal strength) but break up terribly and are unwatchable in NPVR (& Media Centre), and seeing the different hex/decimal numbers I thought the PC tuner was tuning to the wrong signal for those channels - though I now realise I was mistaken in that assumption.
Additionally, can I suggest that all the UI form's behaviour with the OK (Enter) and Cancel (Esc) keyboard handling be sorted out please. It should be an easy matter of setting the correct properties of the forms & OK/Cancel button controls, no code changes needed.
I'm using NPVR 4.0.5 (171208)
Other than these small points - great work!