Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

V4LChannel Class Reference

#include <v4l.h>

Inheritance diagram for V4LChannel:

Inheritance graph
[legend]
Collaboration diagram for V4LChannel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 V4LChannel (V4LDevice *device, int index)
virtual ~V4LChannel ()
void * getStruct ()
char * getName ()
bool setTuner (unsigned int index)
unsigned int getNumberOfTuners ()
V4LTunergetTuner (unsigned int index)
int getSignal ()
void report ()

Private Attributes

V4LDevicedevice
video_channel channel
vector< V4LTuner * > tuners
V4LTunercurrent

Constructor & Destructor Documentation

V4LChannel::V4LChannel V4LDevice device,
int  index
 

Definition at line 252 of file v4l.cc.

References channel, getNumberOfTuners(), V4LDevice::request(), and tuners.

00253 {
00254     memset( &channel, 0, sizeof( struct video_channel ) );
00255     this->device = device;
00256     this->channel.channel = index;
00257     device->request( VIDIOCGCHAN, this );
00258     device->request( VIDIOCSCHAN, this );
00259     for ( unsigned int i = 0; i < getNumberOfTuners(); i ++ )
00260     {
00261         V4LTuner *tuner = new V4LTuner( this->device, i );
00262         tuners.insert( tuners.end(), tuner );
00263     }
00264 }

V4LChannel::~V4LChannel  )  [virtual]
 

Definition at line 266 of file v4l.cc.

00267 {
00268     cout << "Channel destroyed" << endl;
00269 }


Member Function Documentation

char * V4LChannel::getName  ) 
 

Definition at line 276 of file v4l.cc.

References channel.

Referenced by report().

00277 {
00278     return channel.name;
00279 }

unsigned int V4LChannel::getNumberOfTuners  ) 
 

Definition at line 297 of file v4l.cc.

References channel.

Referenced by V4L::getNumberOfTuners(), report(), and V4LChannel().

00298 {
00299     return channel.tuners;
00300 }

int V4LChannel::getSignal  ) 
 

Definition at line 314 of file v4l.cc.

References current, device, V4LTuner::getSignal(), and V4LDevice::request().

Referenced by V4L::getSignal().

00315 {
00316     device->request( VIDIOCGTUNER, current );
00317     return current->getSignal();
00318 }

void * V4LChannel::getStruct  )  [virtual]
 

Implements V4LStruct.

Definition at line 271 of file v4l.cc.

References channel.

00272 {
00273     return & channel;
00274 }

V4LTuner * V4LChannel::getTuner unsigned int  index  ) 
 

Definition at line 302 of file v4l.cc.

References tuners.

Referenced by V4L::getTuner().

00303 {
00304     if ( index >= 0 && index < tuners.size() )
00305     {
00306         return tuners[ index ];
00307     }
00308     else
00309     {
00310         return NULL;
00311     }
00312 }

void V4LChannel::report  ) 
 

Definition at line 320 of file v4l.cc.

References channel, getName(), and getNumberOfTuners().

00321 {
00322     cout << ">>>> Channel # " << channel.channel << endl;
00323     cout << ">>>> Name    : " << this->getName() << endl;
00324     cout << ">>>> Tuners  : " << this->getNumberOfTuners() << endl;
00325     cout << ">>>> Flags   : " << endl;
00326     if ( channel.flags & VIDEO_VC_TUNER )
00327         cout << "     Channel has tuners" << endl;
00328     if ( channel.flags & VIDEO_VC_AUDIO )
00329         cout << "     Channel has audio" << endl;
00330     cout << ">>>> Type    : " << endl;
00331     if ( channel.type & VIDEO_TYPE_TV )
00332         cout << "     TV" << endl;
00333     if ( channel.type & VIDEO_TYPE_CAMERA )
00334         cout << "     Camera" << endl;
00335 }

bool V4LChannel::setTuner unsigned int  index  ) 
 

Definition at line 281 of file v4l.cc.

References current, device, V4LDevice::request(), V4LTuner::setRangeHigh(), V4LTuner::setRangeLow(), and tuners.

Referenced by V4L::setTuner().

00282 {
00283     if ( index >= 0 && index < tuners.size() )
00284     {
00285         current = tuners[ index ];
00286         // FIXME: Hardcoded tuner settings
00287         current->setRangeLow( 0 );
00288         current->setRangeHigh( 0xffff );
00289         return device->request( VIDIOCSTUNER, current );
00290     }
00291     else
00292     {
00293         return false;
00294     }
00295 }


Member Data Documentation

struct video_channel V4LChannel::channel [private]
 

Definition at line 124 of file v4l.h.

Referenced by getName(), getNumberOfTuners(), getStruct(), report(), and V4LChannel().

V4LTuner* V4LChannel::current [private]
 

Definition at line 126 of file v4l.h.

Referenced by getSignal(), and setTuner().

V4LDevice* V4LChannel::device [private]
 

Definition at line 123 of file v4l.h.

Referenced by getSignal(), and setTuner().

vector<V4LTuner *> V4LChannel::tuners [private]
 

Definition at line 125 of file v4l.h.

Referenced by getTuner(), setTuner(), and V4LChannel().


The documentation for this class was generated from the following files:
Generated on Sun Mar 11 22:13:27 2007 for Kino by  doxygen 1.4.2