Manually or autoscanning DVB-T Channels using DirectshowLib-2005?

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2008
Posts: 17
Reputation: Soundgarden is an unknown quantity at this point 
Solved Threads: 0
Soundgarden Soundgarden is offline Offline
Newbie Poster

Manually or autoscanning DVB-T Channels using DirectshowLib-2005?

 
0
  #1
Oct 15th, 2008
Now I have been using the Directshowlib-2005 Libs. And the SDK BDA sample called DTVViewer.

Now I am not the type of person to ask for help and annoy the living *&^*& out of some poor person..

...But....

I just need some simple help to convert the code into something that I can use as a Media Centre All in one..I have already designed a Touch Screen Media Player and UI and works fine but now I would just like to add the Digital TV Module....

OK using the DTVViewer sample code I finally got some source code to work with 2 different brands of DVB-T Tuner Cards (DVICO/Fusion and Compro E700). Now I have not modified the sample code MUCH at all it just worked! Just by entering the Frequency and Hitting Build Graph..

What I would like to do is mod the code so that I can Either use a combo box with Pre-Entered Frequency’s (i.e..Channel ??/Freq 191500).

Now the help I need as I have just started to programming in c# again(after a few years). And I can’t seem to figure out how this works completely...

So basically what I need is to somehow call the DVBTTuning() class with predefined Values(Frequencies) from a Combo box(or Whatever).

This is the section of code that I think! I need to change.

  1. namespace DirectShowLib.Sample
  2.  
  3. {
  4.  
  5. /// <summary>
  6. /// Description résumée de DVBTTuning.
  7. /// </summary>
  8. public class DVBTTuning : Form, ITuningSelector
  9. {
  10.  
  11. private System.Windows.Forms.Label label1;
  12. private System.Windows.Forms.Label label2;
  13. private System.Windows.Forms.Label label3;
  14. private System.Windows.Forms.Label label4;
  15. private System.Windows.Forms.Label label5;
  16. private System.Windows.Forms.Button button1;
  17. private System.Windows.Forms.TextBox textCarrierFreq;
  18. private System.Windows.Forms.TextBox textONID;
  19. private System.Windows.Forms.TextBox textTSID;
  20. private System.Windows.Forms.TextBox textSID;
  21.  
  22.  
  23. /// <summary>
  24. /// Variable nécessaire au concepteur.
  25. /// </summary>
  26.  
  27. private System.ComponentModel.Container components = null;
  28.  
  29.  
  30.  
  31. private IDVBTuningSpace tuningSpace = null;
  32. private IDVBTuneRequest tuneRequest = null;
  33.  
  34. public DVBTTuning()
  35. {
  36. InitializeComponent();
  37.  
  38. int hr = 0;
  39.  
  40. this.tuningSpace = (IDVBTuningSpace) new DVBTuningSpace();
  41. hr = this.tuningSpace.put_UniqueName("DVBT TuningSpace");
  42. hr = this.tuningSpace.put_FriendlyName("DVBT TuningSpace");
  43. hr = this.tuningSpace.put__NetworkType(typeof(DVBTNetworkProvider).GUID);
  44. hr = this.tuningSpace.put_SystemType(DVBSystemType.Terrestrial);
  45.  
  46. MessageBox.Show(this.tuningSpace.ToString());
  47.  
  48. ITuneRequest tr = null;
  49.  
  50. hr = this.tuningSpace.CreateTuneRequest(out tr);
  51.  
  52. DsError.ThrowExceptionForHR(hr);
  53.  
  54. this.tuneRequest = (IDVBTuneRequest) tr;
  55.  
  56. hr = this.tuneRequest.put_ONID(-1);
  57. hr = this.tuneRequest.put_TSID(-1);
  58. hr = this.tuneRequest.put_SID(-1);
  59.  
  60. IDVBTLocator locator = (IDVBTLocator) new DVBTLocator();
  61.  
  62.  
  63. hr = locator.put_CarrierFrequency(191500); <- I have enter the vaule manually(191500)
  64.  
  65.  
  66. hr = tr.put_Locator(locator as ILocator);
  67.  
  68. }

*****I have not sent the whole sample...But the Link is http://sourceforge.net/project/showf...kage_id=188409

This Class calls a form with the tuning Freq(s) and SID and such...I just would like to be able to pass a value within a call say User clicks button Channel Up and it Calls Change Channel(FreqComboBox).
(In other words remove the need to manually enter each Frequencies when Hitting retune)

OK my basic question is how would I rewrite this sample for only DVB-T(not DVBS) and add Predefined Channels(Frequencies) later in the build I would like to attempt Auto Scan Feature...But would like to just get the basic working....



and one other thing what the hell is the ' hr ' varible doing? were is it's value being sent...I KNOW THAT'S A VAGUE Question.

Any Help Would be greatly appreciated..
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Manually or autoscanning DVB-T Channels using DirectshowLib-2005?

 
0
  #2
Oct 15th, 2008
First question: You can get the selected item from a combo box and use that to send to your procedure.. (which is I think what you asked)

Second..

hr Its just a return variable, it probably should be checked that the value is as expected.. but.. I havent read up on the SDK..
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 17
Reputation: Soundgarden is an unknown quantity at this point 
Solved Threads: 0
Soundgarden Soundgarden is offline Offline
Newbie Poster

Re: Manually or autoscanning DVB-T Channels using DirectshowLib-2005?

 
0
  #3
Oct 16th, 2008
Thanks Liz, For your response,

and thats the problem. I'm a little confused on how to send the Frequencys to the procedure. I have tried but iam not really sure how. I would usually send somehting like DVBTTuning(Combobox.Selectedtext).

But i can't work out how to send from mainform to DVBTTuning() class(Method)..

do i use ChannelTuneRequest Blah = new ChannelTuneRequest(); or somehting similar or try and mod this...But still can't seem to send Combobox.text to this method...This is the code I think I'm having trouble with:-

public bool TuneSelect()
    {
      int hr = 0;
      ILocator locator;
      int freq;
      int onid, tsid, sid;


      hr = this.tuneRequest.get_Locator(out locator);
 
     //How can i set the value for freq from the combobox located on the mainform???
  
      hr = locator.get_CarrierFrequency(out freq);

      hr = this.tuneRequest.get_ONID(out onid);
      hr = this.tuneRequest.get_TSID(out tsid);
      hr = this.tuneRequest.get_SID(out sid);

      textCarrierFreq.Text = freq.ToString();
      textONID.Text = onid.ToString();
      textTSID.Text = tsid.ToString();
      textSID.Text = sid.ToString();

      this.ShowDialog();

      if (this.DialogResult == DialogResult.OK)
      {
        hr = locator.put_CarrierFrequency(Convert.ToInt32(textCarrierFreq.Text));
        hr = this.tuneRequest.put_Locator(locator);
        Marshal.ReleaseComObject(locator);

        hr = this.tuneRequest.put_ONID(Convert.ToInt32(textONID.Text));
        hr = this.tuneRequest.put_TSID(Convert.ToInt32(textTSID.Text));
        hr = this.tuneRequest.put_SID(Convert.ToInt32(textSID.Text));
        return true;
      }
      else
      {
        Marshal.ReleaseComObject(locator);
        return false;
      }
    }
Any help would be great.. I know that there is a simple way to do this...I just can't seem to wrap my head around the Procedure(I think I have convinced myself it's harder than it would appear)
    #endregion
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Manually or autoscanning DVB-T Channels using DirectshowLib-2005?

 
0
  #4
Oct 16th, 2008
If the methods you have dont allow you to send values to them, then you arguably cant.

In your code above, thats hopefully where your combo box data would go in, so you know how to retrieve it, try it, whats the worst that can happen.. it doesnt work
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC