Source: qtvision.h


Annotated List
Files
Globals
Hierarchy
Index
/*
 *
 * Copyright (C) 2002 George Staikos 
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */



#ifndef __QTVISION_H
#define __QTVISION_H

#include 
#include 
#include 


#include "srcselect.h"
#include "setupmain.h"
#include "setuptune.h"
#include "setupch.h"
#include "cfgdata.h"
#include "channelstore.h"
#include "channel.h"


class V4LDev;
class QTimer;

/**
 * A reusable TV object.
 *
 * @version $Id: qtvision.h,v 1.6 2002/03/18 19:42:25 rich Exp $
 */
class QtVision : public QObject
{
Q_OBJECT
public:
	QtVision(QObject *parent = 0, const char* name = 0);
	~QtVision();

	void setScreen( QWidget *view ) { this->view = view; }

	// void paintEvent(QPaintEvent *event);

	// Stop the current device and dispose of it
	void stopDevice();

	/**
	 * Try to start using the previous device. Returns true iff it succeeds.
	 */
	bool tryAutoStart();

	bool hasDevice() const { return _v4l ? true : false; }
	V4LDev *device() const { return _v4l; }

	ChannelStore *channels() { return &_cs; }

	/**
	 * Factory method for creating the screen the picture will be displayed
	 * on. This widget returned will depend on the facilities supported by
	 * the TV card and X server (eg. there will be special screen widgets
	 * for Xv support).
	 */
	virtual QWidget *createScreen( QWidget *parent=0, const char *name=0 );

public slots:
	void start();

	/**
	 * Launches the channel wizard and returns the dialog return value.
	 */
	int launchWizard();

	/**
	 *  Ask the user to select a device.
	 */
	void selectDevice();

	void startCapture();

	void grabImage();

	void channelDown();
	void channelUp();
	void snapshot();
	void settings();

	void sliderChanged(int);
	void changeFrameRate(int x);
	void ssdlgChangeSources(const QString& dev);

	void volumeMute();
	void volumeUp();
	void volumeDown();

	void setTunerMode( int mode );

signals:
	void channelChanged( int num );
	void deviceChanged( V4LDev *dev );

protected:
	void setChannel( Channel *channel );
	SourceSelection *createSourceDialog();

	typedef QMap DeviceMap;
	typedef QMap SourceMap;
private:
	V4LDev *_v4l;
	QTimer *_timer;
	DeviceMap _devs;
	SourceMap _srcs;
	SourceSelection *_ssdlg;
	SetupMain *_setupMain;
	SetupTune *_setupTune;
	SetupChannels *_setupCh;
	ConfigData *_cfg;
	ChannelStore _cs;
	Channel *_chan;
	QWidget *view;
};

#endif


Generated by: rich on pegasus on Wed Mar 20 03:16:53 2002, using kdoc 2.0a53.