Jump to content

How to Create a new plugin?


mohammad izadpanah

Recommended Posts

mohammad izadpanah

Hi dears

Can anyone explain how to create new plugin for dvbdream or DVBViewer in multi steps like this?

step 1: user must use which language( like C or C# or visual c#)?

step 2: user writes codes in which software?

step 3: How the user learn and use functions of dvb softwares? (like which function get user freq info).

step 4: How the user create a dll for using in dvb softwares?

thanks a lot

Link to post

You should first know what kind of plugin you want to create. If you need a low level you should download the sdk from the members section. The OSD Plugin System uses the COM Interface. You can easily get the required information by importing the DVBViewer COM Object. 

It does not matter if you use C++/C# for the last one. C would be complicated if you want to use COM. 

A good start for it is to have a look in the developer section of this forum.

 

Christian

  • Thanks 1
Link to post
mohammad izadpanah
Quote

 

You should first know what kind of plugin you want to create

 

 

 

 I want to learn to write  plugin for dvb player. my first plugin shows some info of current channel like pids, bitrate, frequency, polarization, sat position and ....

 

step 1: user must use which language( like C or C# or visual c#)? 

It does not matter if you use C++/C# for the last one. C would be complicated if you want to use COM. 

is it possible to use VB.NET?


step 2: user writes codes in which software?

Any Software! Any recommendation?

step 3: How the user learn and use functions of dvb softwares? (like which function get user freq info).

You can easily get the required information by importing the DVBViewer COM Object.

step 4: How the user create a dll for using in dvb softwares?

like general methods to create dll.

Edited by mohammad izadpanah
Link to post
mohammad izadpanah
On 11/8/2019 at 7:12 PM, hackbart said:

You should first know what kind of plugin you want to create. If you need a low level you should download the sdk from the members section.

 

On 11/10/2019 at 8:44 AM, mohammad izadpanah said:

is it possible to share source of a simple plugin? is it exist in forum?

 

I found several source of plugins in developer section but i didn't find sdk. Please send download link. Also please give me  members section link

Link to post
  • 4 months later...
mohammad izadpanah
Posted (edited)

Hi friends

 

how can i get channel info according to attached file. I write a plugin in delphi 7 that show all channel info. Please write some codes.

unit main;

interface

uses
  Windows, Messages, SysUtils,StrUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, TeEngine, Series, ExtCtrls, TeeProcs, Chart, Grids,about, ModuleAPI;

type

  Tfmain = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label2: TLabel;

.
.
.


procedure Tfmain.FormShow(Sender: TObject);
var
  tpinfo: TTuner; 

begin

        Label11.Caption := inttostr(tpinfo.OrbitalPos);/////////// it is very important for me////////////////

        Label12.Caption := inttostr(tpinfo.Frequency);

        Label13.Caption := inttostr(tpinfo.SymbolRate);

end;

 

these codes doesn't work correct.why?

 

thanks

 

 

APIModule.zip

Edited by mohammad izadpanah
Link to post
Griga

Use the following up-to-date TTuner declaration:
 

Spoiler



  TTuner = record
    TunerType: TTunerType;
    Group: TChannelGroup;
    Unused1: Byte;
    Flags: Byte;
    Frequency: DWord;
    SymbolRate: DWord; //or URL Hash 0..31
    LOF: Word; //LNB LOF, or TS Stream URL Hash 32..47
    PMT: Word;
    Volume: Byte;
    DiSEqCValueExt: Byte;
    SatModulation: Byte;
    AVFormat: Byte;
    FEC: Byte;
    AudioChannel: Byte;
    Unused3: Word; //SubtitlePID: Word; //TransEdit internal
    Polarity: Byte; //or Modulation or BandWidth
    Unused4: Byte; //Favourite: Byte; //DVBViewer GE internal
    OrbitalPos: Word;
    Tone: Byte; //22 khz off/on, or TS Stream stream type (only during runntime, not in channels.dat)
    EPGFlag: Byte;
    DiSEqCValue: Word; // OrbitPos, or other value: Positoner, GotoAngular, Command String, or TS Stream URL Hash 48..63
    DiSEqC: Byte; //None,SimpleA, SimpleB, PosA/OptA, PosB/OptA, PosA/OptB, PosB/OptB
    Language: TTunerLanguage;
    AudioPID: Word;
    Substream: Word; //changed for MPLP, replaces former NetworkNr: Byte; Favourite: Byte;
    VideoPID: Word;
    TransportStreamID: Word;
    TelePID: Word;
    NetworkID: Word;
    SID: Word;
    PCRPID: Word;
  end;


 

 

  • Thanks 1
Link to post
mohammad izadpanah
Posted (edited)

thanks for new update but plugin shows zero for these variables. (OrbitalPos, frequency and SymbolRate).  

 

Please read my codes again. is it correct?

 

procedure Tfmain.FormShow(Sender: TObject);
var
  tpinfo: TTuner; 

begin

        Label11.Caption := inttostr(tpinfo.OrbitalPos);

        Label12.Caption := inttostr(tpinfo.Frequency);

        Label13.Caption := inttostr(tpinfo.SymbolRate);

end;

1- what is this ? is it necessary to use EventMsg  ?  how to use ?  Please write some codes.

EventMsg (evRemoveChannel, @Tuner) ;// with evRemoveChannel = 998: Is sent if a station is already being played and passes a pointer to its tuner data record

 

2- Like  TTuner declaration, what's declaration for channel info like name, provider, ecm, emm , ...?

 

 

Edited by mohammad izadpanah
Link to post
mohammad izadpanah
Posted (edited)

According to this post by @Lars_MQ and up-to-date TTuner declaration by @Griga , Please help me to get transponder info (OrbitalPos, frequency and SymbolRate).

 

I am guessing that it's needed to  use  DVBViewer Plugin API Commands by SendMessage Functions. 

 

1- is there any API COMMAND LIKE following COMMANDs to get TTuner records?

const
  WM_DVBVIEWER         = $B2C2;
  MSG_STARTPIDCALLBACK = $45104;
  MSG_STOPPIDCALLBACK  = $45105;

 

2- I found this in "DVBViewer SDK.chm" file. How can I use this to get Transponder info?

res:=SendMessage(dvbHandle,$B2C2,$1031,0); // returns the ServiceID<<16+Transponder
 

Edited by mohammad izadpanah
Link to post
Griga
20 hours ago, mohammad izadpanah said:

Like  TTuner declaration, what's declaration for channel info like name, provider, ecm, emm , ...?

 

ecm and emm are not processed and stored in DVBViewer. Plugins must retrieve them from the DVB streams.

 

You can get the number and name of the currently played channel in the follwoing way:

type
  TSetChannel = packed record
    Channel: Integer; //channel number
    ChannelName: PAnsiChar;
  end;  
  PSetChannel = ^TSetChannel;

var
  SC: TSetChannel

SendMessage(dvbHandle,WM_DVBVIEWER,MSG_GETCHANNEL,LPARAM(@SC));

but AFAIK there is no way to get the provider name.

 

Attached the source code of a little plugin that I wrote for correcting wrong bits in video/audio/teletext PES headers, in order to make a channel playable in DVBViewer. The function EventMsg shows how to get the tuner record.

 

PatchMarkerBits_Source.zip

  • Thanks 1
Link to post
mohammad izadpanah

thanks a lot.

 

Please add a Simple Form to project to show freq info in Labels.(CurrentTuner.Frequency , CurrentTuner.SymbolRate , CurrentTuner.OrbitalPos)

Label1.Caption := 'Frequency = ' + IntToStr(CurrentTuner.Frequency) ;

Label2.Caption := 'SymbolRate = ' +IntToStr(CurrentTuner.SymbolRate ) ;

Label3.Caption :='OrbitalPos= ' + IntToStr(CurrentTuner.OrbitalPos) ;

 

Also add following procedure to project to show plugin in menu.

 

procedure SetMenuHandle(Menu: HMenu); stdcall;
begin
	//Please Write a some codes for me to learn
end;

procedure MenuItemClick(MenuID: integer); stdcall;
begin
  //Please Write a  some codes for me to learn
end;

 

I'm ashamed to take your time! 😔
 

 

 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...