NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 82 83 84 85 86 … 93 Next »
Caller ID Plugin and C++

 
  • 0 Vote(s) - 0 Average
Caller ID Plugin and C++
Lucas_24
Offline

Member

Posts: 242
Threads: 15
Joined: Jul 2004
#11
2004-10-26, 06:58 PM
just got a neat idea. I know I'm getting ahead of you guys, but once implemented, we could add friend's pictures in a directory with filenames relating to the phone number, then have photo caller ID if the picture is available.
WIN 7
1 X PVR 250
1 X PVR 500
1 X HD-PVR
2 X MVP
2 X PCH A100
CodeMonkey
Offline

Senior Member

Posts: 389
Threads: 86
Joined: Apr 2004
#12
2004-10-26, 11:47 PM
Right now we can only display text, not pictures. But even if we could, I think it best to discreetly display text instead of obscuring the show you are watching with a overlayed picture. However since the source will be released you could always add that as an option.
-CodeMonkey
CodeMonkey
Offline

Senior Member

Posts: 389
Threads: 86
Joined: Apr 2004
#13
2004-12-06, 07:11 PM
Back on track I hope.  Got slammed at work recently so no progress made.  Things are quieting down a little because of the holidays, so I should get time to implement this.

Sub, regarding how this would work with GBPVR.  Your comment previously was to implement the IEventNotification interface because there was no need for a menu button, which makes sense.  So if I implement this interface I assume I would not respond to any of the events received because I do not care about any of these events:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">public enum EventTypes
{
CurrentAudioTrack,
CurrentVideoTrack,
CurrentTrackDuration,
CurrentChannelNumber,
CurrentChannelName,
};[/QUOTE]

Then I would just call ShowMessage() asynchronously when I received a caller ID notification from the callerid server.  Am I understanding correctly?

For example, this is what I'm talking about ...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">namespace CallerIDPlugin
{
/// <summary>
/// CallerIDTask implements IEventNotification
/// </summary>
public class CallerIDTask : IEventNotification
{
public CallerIDTask()
       {
// Setup the socket to listen for incoming call id notifications

try
{
//create the listening socket...
m_socListener = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
IPEndPoint ipLocal = new IPEndPoint (IPAddress.Any ,10629);  // YAC socket
//bind to local IP Address...
m_socListener.Bind(ipLocal);
//start listening...
m_socListener.Listen (4);
// create the call back for any client connections...
m_socListener.BeginAccept(new AsyncCallback (OnClientConnect),null);
}
catch(SocketException se)
{
System.Diagnostics.Debug.WriteLine(se.Message);
}

       }

public void OnClientConnect(IAsyncResult asyn)
{
PluginHelperFactory.getPluginHelper().ShowMessage("Caller ID Data From Server");
}

public void Notify(EventTypes eventType, string eventText)
{
// Do nothing, we don't care about these events
}[/QUOTE]

This approach is OK, or do I need to do something in response to any or all of the events?
-CodeMonkey
CodeMonkey
Offline

Senior Member

Posts: 389
Threads: 86
Joined: Apr 2004
#14
2004-12-07, 02:35 AM
Ok, looks like the code above works.  However, I was testing with gbpvr being on the main menu.  The ShowMessage() shows the string fine.  However it does not erase by itself.  Looks like there is a timer involved, but after it expires the text stays on the menu until you do something like down arrow or change to a submenu item and return.  The text does not seem to display at all when playing a video.  And last but certainly not least, it seems to hang gbpvr when gbpvr is on live tv when the message comes in.  Note that I am running strictly on the PC, no display on a TV.  And, no cable or anything connected to gbpvr, so no video signal.

Minor bugs [Image: smile.gif]

I might have a alpha version of this plugin available tonight or tomorrow for anyone interested [Image: smile.gif]

Oh, and a question for a C# expert.  Whats the proper way to erase a System.String?  There doesn't seem to be a Erase method and I left my C# book at work [Image: smile.gif]  I ended up with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">szCallData = szCallData.Remove(0, szCallData.Length);[/QUOTE]
But there must be a better way Wink

For those interested, here is a screenshot.  I did try one with a real phone call, but it showed my cell phone number so I used the YAC test call instead Wink

CallerID Screen Shot
-CodeMonkey
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#15
2004-12-07, 03:17 AM
just set the string to null
szCallDate = null;
or empty szCallDate = string.EmptyString() (i think its EmptyString(), i always just use &quot;&quot; instead, i think it does the same thing, if your using an ide it should display the available methods look for one that looks like emptystring or empty or something along those lines).

with null you just have to make sure to tests for null exceptions.

i wish i could try this plugin, its a really good idea and i like how your making it, a popup, thats handy. i got no caller id [Image: sad.gif]
CodeMonkey
Offline

Senior Member

Posts: 389
Threads: 86
Joined: Apr 2004
#16
2004-12-07, 03:31 AM
The IDE showed no empty or emptystring or clear or anything.  The remove is no more ugly than setting to null, so for now I will leave it [Image: smile.gif]

It pretty much works. I still need to add a config dialog to set a port number for those who don't want to use the default. I won't release a alpha tonight because I want to hear what sub has to say about the bugs (in case it's my problem!Wink [Image: smile.gif].

Stay tuned.
-CodeMonkey
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,823
Threads: 769
Joined: Nov 2003
#17
2004-12-07, 04:42 AM
No, they're my bugs. The show message plugin API just hasn't been very well tested yet. I'm aware the message wasn't showing on the video, and have this on my list of things to look at. I wasn't aware the message wasn't going away after x seconds. I must have broken this in the last release.

Anyway, I'll look at these again in the next release.
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#18
2004-12-07, 04:48 AM
you mustnt be using visual studio, the empty string is
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">string str = string.Empty[/QUOTE]
i havent used any other ide so i dont know how they work
CodeMonkey
Offline

Senior Member

Posts: 389
Threads: 86
Joined: Apr 2004
#19
2004-12-07, 01:59 PM
I will try that tonight reven, thanks.

Thanks sub.

And sub, ideally I would like to be able to temporarily disable this plugin from the remote. The scenerio is you have the plugin enabled, you are watching a movie and the phone rings. You see the text on the screen. But you don't want the movie interrupted again so you push a button on the remote to toggle it off. Hitting the button again or restarting gbpvr would reenable it. My thought was to enhance the IEventNotification interface to give a disable event. But I'm not sure how to accomplish this unless one button is dedicated to callerid disable (which seems silly). Any thoughts?
-CodeMonkey
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#20
2004-12-07, 02:43 PM
I believe all String.Empty does is map to null. I could be wrong though.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (3): « Previous 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 3,212 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,810 2020-11-14, 08:01 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,782 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 3,105 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,975 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,585 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 2,104 2013-03-12, 06:48 AM
Last Post: psycik
  Plugin problems with started from the command line mvallevand 11 5,496 2012-08-12, 07:56 PM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,438 2012-02-11, 05:42 PM
Last Post: mvallevand
  Weather Plugin imilne 0 1,561 2012-01-15, 08:33 PM
Last Post: imilne

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode