NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 5 6 7 8 9 … 93 Next »
Noobie Here!

 
  • 0 Vote(s) - 0 Average
Noobie Here!
jrockow
Offline

Senior Member

Posts: 713
Threads: 110
Joined: Nov 2005
#1
2014-03-06, 02:51 AM
I am interested in developing my own custom user interfaces (screens) to use with NPVR.

I have already created a new interface for "pending recordings" which I am happy with.
However, this is basically a snapshot of the DB at a particular time, with no real interaction with NPVR.

The next UI that I want to develope would be for "ready recordings".
This would obviously be more difficult as I would need to access the play/delete aspects of NPVR.
I assume this would entail DLLs or APIs or whatever. I have no experience with those.

I've looked at the developers "where do we start" thread, but I guess the sample files are no longer available?

I'm not sure I understand the concept of coding an exe which relies on an XML file?
I thought I would just code the entire project without using an external XML file?

As you can tell, I'm just a noobie, but would like to give it a shot.
Maybe it's over my head?

Any help is appreciated. Thanx.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,661
Threads: 767
Joined: Nov 2003
#2
2014-03-06, 03:15 AM
NextPVR plugins are .dlls. I assume your question about XML files relates to the skin files? These files exist to help make things easier for you. They're used by the skin frame to help you draw the things on your screen, defining stuff like fonts/locations/colors/etc. You'd have to write a hell of a lot of code to reproduce the same sorts of screens without the skinhelper and associated xml files etc.

I've attached the most relevant sample plugin, test3. It shows how to create a simple screen in the style of the built in screens.

The older test1 and test2 plugins used the look and feel of GBPVR, so no longer relevant.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,661
Threads: 767
Joined: Nov 2003
#3
2014-03-06, 03:16 AM
Myself and a few others here will be able to help you through it if you decide to go ahead creating a plugin. It's not as hard as it looks, and you'll quickly get the hang of it.
jrockow
Offline

Senior Member

Posts: 713
Threads: 110
Joined: Nov 2005
#4
2014-03-06, 06:00 PM
sub,

As always, thanx for your quick reply.
I am trying to work with the Test3 sample, but getting an error while trying to build.
*****************************************************************************************************
The command "copy "C:\Dev\NextPVR\Sample Plugins\Test3\bin\Debug\Test3.dll" C:\Users\Public\NPVR\Plugins\Test3
copy "C:\Dev\NextPVR\Sample Plugins\Test3\bin\Debug\Test3.pdb" C:\Users\Public\NPVR\Plugins\Test3" exited with code 1.
*****************************************************************************************************
I've tried to recreate the directories in the error message, but I don't seem to have a "Test3.pdb" anywhere.

Question about the XML skin files; must they be manually created?
There's quite a bit of info there.

To add to my problem, I've never coded in C before, so that makes it even a little more difficult for me.
(not to mention I'll be 70 years old on my next birthday, so hang in there with me Smile
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,661
Threads: 767
Joined: Nov 2003
#5
2014-03-06, 06:18 PM
From memory, that project had a post-build event to copy the plugin test3.dll (and it's a associated debug symbols file test3.pdb), into the NextPVR plugin directory (C:\Users\Public\NPVR\Plugins\Test3). It does this so that when you run NextPVR, it'll load the most recently build version of the plugin.

You'll probably need to update that build event to correct the paths for wherever you've got your project. ie, right click on the project, click properties, then select the 'Build Events' tab. In there you should see the Post-Build event, and can edit the command to have the correct path.

The skin files are created manually. That zip file included the example skin file required for that sample plugin. You'd typically start with an xml file like that, and only make small edits as your add additional items you want to display.
jrockow
Offline

Senior Member

Posts: 713
Threads: 110
Joined: Nov 2005
#6
2014-03-07, 02:46 PM
I'm not sure I get the idea of the skin files yet...
Seems to me it would take quite a lot of trial and error setting up a form when you're just dealing with numbers.
(as compared to for example the visual studio design window)
I'm sure I must be missing something.

Can you give me any examples of code for playing/deleting a file.
I don't think there are any in the Test3 example.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,661
Threads: 767
Joined: Nov 2003
#7
2014-03-07, 04:52 PM
Quote:Seems to me it would take quite a lot of trial and error setting up a form when you're just dealing with numbers.
(as compared to for example the visual studio design window)
Yes, but we don't have any visual design tool, so we're stuck with trial and error. It wouldn't have been possible to create these types of screen with the visual studio design window. The screen are effectively a picture, and the xml files help us draw that picture.

Quote:Can you give me any examples of code for playing/deleting a file.
I don't think there are any in the Test3 example.
Playing a recording would have code like this:
Code:
List<ScheduledRecording> recordings = ScheduledRecording.LoadAll();
ScheduledRecording recording = recordings[0]; // first recording in list
PluginHelperFactory.GetPluginHelper().PlayVideoFile(recording.Filename);

Deleting a recording would have code like this:
Code:
ScheduleHelperFactory.GetScheduleHelper().DeleteRecording(recording);
jrockow
Offline

Senior Member

Posts: 713
Threads: 110
Joined: Nov 2005
#8
2014-03-07, 08:33 PM
Is there anywhere I can read up on the other GetPluginHelper commands I'm interested in; I hate to keep bugging you like this.
(i.e. I need to know how to STOP, PAUSE and RESUME the file)

Also, I tried to create a stripped down .EXE file just to test the commands but it doesn't appear to load Nutility.DLL.
I'm guessing that can't be done? I do have a reference to the DLL in the EXE.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,661
Threads: 767
Joined: Nov 2003
#9
2014-03-07, 08:39 PM
jrockow Wrote:Is there anywhere I can read up on the other GetPluginHelper commands I'm interested in; I hate to keep bugging you like this.
(i.e. I need to know how to STOP, PAUSE and RESUME the file)
There is no documentation on it, but most of the functions have self-explanatory names:

Code:
bool PlayLiveTV();
        bool PlayLiveTV(Channel channel);
        bool PlayLiveTVPIP(Channel channel);
        bool PlayVideoFile(string filename);
        bool PlayVideoFile(string filename, Hashtable metadata);
        bool PlayVideoFiles(List<string> files);
        bool PlayDVD(string path);
        bool PlayDVD();
        bool PlayMusicFile(string file);
        bool PlayMusicFiles(List<string> files);
        bool PlayChannelAudio(Channel channel);
        bool PlayNetRadioStream(string url);
        void SetAudioDescription(string description);

To pause/stop etc you can call PluginHelperFactory.GetPluginHelper().GetPlaybackProxy() after playing a file, and use the IPlaybackProxy interface it returns to call these methods:
Code:
interface IPlaybackProxy
    {
        ProxyType GetProxyType();

        //void SetDefaultMetaData(Hashtable metaData);

        // playback control
        void Pause();
        void Play();
        void Stop();
        bool IsPaused();

        // navigation
        double GetDuration();
        double GetPosition();
        double GetStart();
        void SetPosition(double position);

        // volume
        void IncreaseVolume();
        void DecreaseVolume();
        void Mute();
        void Unmute();
        bool IsMuted();
        double GetVolume();
        void SetVolume(double volume);        

        // OSD      
        Color GetTransparentColor();
        void SetOSD(List<UiElement> renderer);
        void HideOSD();

        // audio stream
        List<string> GetAudioStreamList();
        void SetAudioStream(string streamXML);

        // subtitles
        List<string> GetSubtitleStreamList();
        void SetSubtitleStream(string streamXML);

        // aspect ratio modes
        List<string> GetAspectRatioModes();
        void SetAspectRatioMode(string mode);
        string GetAspectRatioMode();

        
    }

Quote:Also, I tried to create a stripped down .EXE file just to test the commands but it doesn't appear to load Nutility.DLL.
I'm guessing that can't be done? I do have a reference to the DLL in the EXE.
As I mentioned, NextPVR plugins are .DLL files. You can't create a stand alone executable - the plugin helper functions only work from within NextPVR.exe.
jrockow
Offline

Senior Member

Posts: 713
Threads: 110
Joined: Nov 2005
#10
2014-03-10, 03:30 AM
It's going pretty good so far.
Think I'm starting to get the hang of it.

However, I have more questions:
My biggest problem at the moment is not knowing what's available for me to use.
It looks like I figured out how to get the NAME, FILENAME, STATUS, STARTTIME and EVENTOID from the DB.

I don't know how to get the DESCRIPTION or SUBTITLE.
I also don't know how to sort the columns.

With the other plugin I created I made my own call to the DB so I had no problem getting those values.

If you could help me with that I would appreciate it.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (17): 1 2 3 4 5 … 17 Next »
Jump to page 


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

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

Linear Mode
Threaded Mode