[mythtv] Beginner's code question

Carl Reynolds mythtv-dev at hyperbole-software.com
Thu Jan 29 14:02:25 UTC 2009



Jelle De Loecker wrote:
> Hi everyone,
>
> I'm trying to get LiveTV to work for people with Multirec (like me) but
> I'm quite lost in the sourcecode (and there aren't that many comments,
> really)
>
> Below is an excerpt from the TvRec::StartRecording function, I'm curious
> about a few things:
>
> * If the other recorder is busy, but the input is not in a shared input
> group, why do we label it as "not busy"? What if someone else is
> watching it? (I wonder what we do with this list afterwards)
>
> * Is StartRecording called every time you change the channel?
>
> * Where do we "push_[it]_back" to?
>
> BEGIN CODE:
>
> // Stop remote recordings if needed
> for (uint i = 0; i < cardids.size(); i++)
> {
> 	TunedInputInfo busy_input;
> 	bool is_busy = RemoteIsBusy(cardids[i], busy_input);
>
> 	// if the other recorder is busy, but the input is
> 	// not in a shared input group, then as far as we're
> 	// concerned here it isn't busy.
> 	if (is_busy)
> 	{
> 	is_busy = (bool) igrp.GetSharedInputGroup(
> 		busy_input.inputid, rcinfo->inputid);
> 	}
>
> 	if (is_busy && !sourceid)
> 	{
> 	mplexid  = (*it).info->GetMplexID();
> 	sourceid = (*it).info->sourceid;
> 	}
>
> 	if (is_busy &&
> 	((sourceid != busy_input.sourceid) ||
> 		(mplexid  != busy_input.mplexid)))
> 	{
> 	states.push_back((TVState) RemoteGetState(cardids[i]));
> 	cardids2.push_back(cardids[i]);
> 	}
> }
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
>   

1. I think you'll find there is a check in the code before this part 
gets called to see if the other recorders are ready to be shut down. 
This section would only be called when we are ready to shut down all 
recorders.

2. I don't know

3  states.push_back( ... ) is pushing the state of the remote device to 
the back of the 'states' list. The method name means we're putting the 
state on the back of the queue as opposed to putting it on at the front. 
Look at the documentation for the Qt modules to find out more on these 
methods. (http://doc.trolltech.com/4.0/classes.html)






More information about the mythtv-dev mailing list