NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 25 26 27 28 29 … 93 Next »
INI, Text File Reader...

 
  • 0 Vote(s) - 0 Average
INI, Text File Reader...
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#1
2009-01-30, 10:14 PM
Just so I'm not reinventing the wheel...

I'm getting in deep into VB.net ( I have Visual Studio, and I'm learning to read C# too, but that's just so I can finally understand the code examples...)

I'd like to be able to read and write INI files and other text files used by other 3rd part programs like Comskip.

I'd like to be able to write something like

x = INIQuery ([comskip.ini filepath], "live_tv")

And get x = 1 or 0...

Here's a chunk of that ini
Code:
sage_framenumber_bug=0
sage_minute_bug=0
live_tv=1                                          ; set to 1 if you use parallelprocessing and need the output while recording
live_tv_retries=4            ; change to 16 when using live_tv in BTV, used for mpeg PS and TS
dvrms_live_tv_retries=300            ; only used for dvr_ms

I had to write something quite ugly for VB6 but had to work around dealing with crlf spaces and tabs existing.

Does someone have a sample of how they create/read/write values for file like this?

---

BTW, I have no idea why it took me so long to get into .net. Everything seems to be sooooo much easier... Just playing with XML right now....
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#2
2009-01-31, 01:11 AM
zehd Wrote:BTW, I have no idea why it took me so long to get into .net. Everything seems to be sooooo much easier... Just playing with XML right now....

Wow, That was so easy... Good to go
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#3
2009-01-31, 05:46 AM
zehd Wrote:I'm getting in deep into VB.net ( I have Visual Studio, and I'm learning to read C# too

:eek:

I must be needing glasses.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,920
Threads: 956
Joined: May 2006
#4
2009-01-31, 06:07 AM
whurlston Wrote::eek:

I must be needing glasses.

Zehd wrote C# not "See Sharp"

Martin
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#5
2009-01-31, 06:11 AM
Big Grin

That's what I thought he wrote. I was beginning to wonder if I'd ever see that post from him. I've been trying to get hime to move to .Net for ages. Frank, see any improvements in XMLTv processing speeds? Wink
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#6
2009-01-31, 08:37 AM
whurlston Wrote:Big Grin

That's what I thought he wrote. I was beginning to wonder if I'd ever see that post from him. I've been trying to get hime to move to .Net for ages. Frank, see any improvements in XMLTv processing speeds? Wink

I'm just getting into reading and writing xml snippets (Ex Em El). I was certainly going to see how far I get with your serializer, and would probably be pleading for help, then...

But for now, I have enough getting comfortable with sqlite3, the registry, INIs, Metadata, inet access.

There are still a lot of concepts I need to learn, things I've never really paid attention to. But I know already .net is the way to go, and I'm sure the New Ultra is gonna be quick...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#7
2009-01-31, 08:40 AM
mvallevand Wrote:Zehd wrote C# not "See Sharp"

Martin

That's funny guys, I bet you waited a long time for that joke. Needing glasses - See Sharp...

The musician in me never really thought outside of that joke until it was 'pointed' out to me...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#8
2009-02-03, 01:46 AM
whurlston Wrote:Big Grin

That's what I thought he wrote. I was beginning to wonder if I'd ever see that post from him. I've been trying to get hime to move to .Net for ages. Frank, see any improvements in XMLTv processing speeds? Wink

Well I would if I could just get past a few concepts. Having trouble finding the basic information so that I can get a running start, searching for snippets..

I'm trying to strike a balance in reinventing the wheel in so far as I learn how the wheel turns, and don't kill myself knowing others have already done a lot of work...

I'm having a hard time understanding StrongType and Serialization.

My feeling is that it is faster for an app to EXPECT a structure from the XML it is reading, then to 'try and figure out' what the format is.

So, A strong typed class would have all the blanks ready to be filled in when reading a Programme record. Then I could reference the tags almost directly.

Next with serialization, I suspect it is a matter of:
load the programme records in one at a time into an input object
adjust the data
output one at a time (perhaps into a object)
writing..

(BTW, I'm totally keeping everything Variable driven -- some poor practises from VB6 made my apps REQUIRE the GB-PVR Recording Service to Interact with Desktop)

Of course I want to understand this in regards to xmltv enhancing, but I want to be able to use any type of XML
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#9
2009-02-03, 02:07 AM (This post was last modified: 2009-02-03, 05:52 PM by whurlston.)
Ok, being self taught, I may not have all the terminology correct but here goes:

StrongTyping just means having a class with a defined structure for data. This is what I created with the xmltv class.

(De)Serialization is just a method reading and writing data from a text/xml file and populating that strongtyped class.

In my xmltv class (I think that's what I called it, I'd have to look again), there is a ReadFrom(string FileName) which would read the file and populate all the data.

Code:
XmlTv.Tv xmltv = new XmlTv.Tv();
            xmltv.ReadFrom(@"C:\xmltv\DigitalCable.xml");
            foreach (XmlTv.Programme p in xmltv.Programmes)
            {
                // the AddDays value would be the number of day before consider old * -1.
                // This is used since the isNew value is not always correct.
                if (p.isNew || p.OriginalAirDate > p.Start.AddDays(-7))
                {
                    p.Title[0].Text += " *";
                }
            }
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#10
2009-02-03, 02:48 AM
whurlston Wrote:Ok, being self taught, I may not have all the terminology correct but here goes:

StrongTyping just means having a class with a defined structure for data. This is what I created with the xmltv class.

(De)Serialization is just a method reading and writing data from a text/xml file and populating that strongtyped class.

In my xmltv class (I think that's what I called it, I'd have to look again), there is a ReadFrom(string FileName) which would read the file and populate all the data.

Code:
XmlTv myXmltv = new XmlTv();
bool b = myXmltv.ReadFrom(myFile.xml);
if (b)
{
// myXmltv should now contain all the data from the xmltv file
foreach (XmlTv.Programme p in myXmltv.Programmes)
{
if (p.isNew) p.Title += " *";
}
}

This is all from memory so it may be slightly different. I'll provide you a real sample later tonight.

That would be great... Smile
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  How Does "Use S01E01 File naming format if possible" work puck64 7 5,321 2015-08-25, 10:21 AM
Last Post: puck64
  NEWA - using buffer file produced by /public/VLCService?Channel= bgowland 5 2,805 2014-01-02, 06:36 AM
Last Post: bgowland
  Is the input file for pvrx2.exe -import unique to NextPVR? spinnaker 1 1,770 2013-10-08, 02:25 AM
Last Post: sub
  Accessing music file metadata in C# bgowland 6 3,297 2013-01-26, 05:14 AM
Last Post: bgowland
  RSS Reader tmrt 51 18,211 2011-02-21, 07:22 AM
Last Post: tmrt
  File browsing - a big ask imilne 3 1,994 2010-11-04, 09:03 PM
Last Post: imilne
  Run Multiple File Conversions On Your 4 Core -Burn Your Processor luttrell1962 12 4,576 2010-03-25, 07:33 AM
Last Post: luttrell1962
  Determining text size and available space Ommina 2 1,661 2010-03-15, 05:34 AM
Last Post: sub
  Using Windows file system shortcuts ACTCMS 0 1,807 2010-01-26, 11:45 PM
Last Post: ACTCMS
  Not looking in correct location for skin file scb147 4 2,213 2009-07-29, 06:26 PM
Last Post: scb147

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

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

Linear Mode
Threaded Mode