Separate "watched" flag for TV and Movies
#16
Woahoo... my code was working afterall. The problem was I'd set the breakpoint before running XBMC and it was being triggered by the rendering engine as soon as I went into a video nav window before the items had been loaded. If I just let it run, then it all works fine and it is working as it should.

I just need to update CXbmcHttp::xbmcSTSetting to do the same thing, with the only problem being I don't know how to trigger it to test my changes.

kraqh3d Wrote:But while typing this out, I thought of something... why not use position 0 in the vector to store the current content type as an integer which references the correct index to use, with -1 as not valid. Then you can easily do something like this:

I'm not sure this would simplify things would it? I mean - yes it would simplify the code to look up the content type, but I would then need code in the enter / exit video nav window code to update position 0 to reflect the correct content type.

I do need to find some tidier way to determine the correct vector index to use, at the moment I have all these ugly code blocks something like

Code:
if (content == "movies")
   iWatchModeIndex = 0;
else if (content == "tvshows")
   iWatchModeIndex = 1;
else if (content == "seasons")
   iWatchModeIndex = 2;
else if (content == "episodes")
   iWatchModeIndex = 3;
else if (content == "musicvideos")
   iWatchModeIndex = 4;

bReturn = g_settings.m_WatchMode[iWatchModeIndex] == VIDEO_SHOW_UNWATCHED;
Reply
#17
kids these days and their forgetting lookup tables Wink

map<string,bool> g_settings.m_watchMode;
Reply
#18
I didn't think updating pos 0 in the Nav window would be troublesome since you're updating the vector in Nav window anyway. Using a map like spiff suggests makes it much easier, but it needs to be an int since its three values (ALL,WATCHED,UNWATCHED):

map<CStdString,int> g_settings.m_watchMode;

Then you use find to locate the record based off the content string. The nice thing is it will naturally handle all the content types by default, setting them to ALL. (though at the expense of some extra memory.)

Code:
map<CStdString,int>::iterator it;
it = g_settings.m_WatchMode.find(strContent);
bReturn = it->second == VIDEO_SHOW_UNWATCHED;
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#19
Yeah, yeah, I was just in the process of changing my vector to a map when I saw these posts. Thanks, it saves me looking up the code.

Wouldn't a "kid" be more likely to use a map? When I was programming we didn't have the luxury of a map class unless you rolled your own Smile
Reply
#20
heh, true, please don't take any offense, just a silly way of wording it.
Reply
#21
No offense taken at all Smile
Reply
#22
Again, I would appreciate some help with a very basic issue here. I'm not at all familiar with working on such a very large collaborative development project, so:

1. What is the recommended method for generating the "diff" given I am developing in Visual C++ Express 2008 and using TortoiseSVN. Do either of these tools have all I need built in?

2. What's the easiest method to ensure that my diff has been applied on the head of the tree. Given I checked out the code 4 days ago, there's a good chance one or more of the files I have modified are already out of date. Is it just a manual process of comparing the diff from this file with the head to ensure there are no other changes I need, or will TortoiseSVN help me out here?

Thanks for your help. I'm within sight of my first patch now, and very excited to get it submitted Smile
Reply
#23
1) right click the folder, tortoise svn -> create patch.
2) right click -> svn update before doing 1)
Reply
#24
Thanks spiff.

Patch attached to trac. Comments or feedback welcome.
Reply
#25
ticket # ?
Reply
#26
In the first post. #9103 - link below

AaronD Wrote:#9103.
Reply
#27
Added version 2 of patch to address jmarshall's observations, to trac on ticket # 9103.

Thanks
Reply

Logout Mark Read Team Forum Stats Members Help
Separate "watched" flag for TV and Movies0