<commit_before>/*
    videodevicepool.h  -  Kopete Multiple Video Device handler Class

    Copyright (c) 2005-2006 by <NAME>   <<EMAIL>>
    Copyright (c) 2010      by <NAME>                 <<EMAIL>>

    Kopete    (c) 2002-2003      by the Kopete developers  <<EMAIL>>

    *************************************************************************
    *                                                                       *
    * This library is free software; you can redistribute it and/or         *
    * modify it under the terms of the GNU Lesser General Public            *
    * License as published by the Free Software Foundation; either          *
    * version 2 of the License, or (at your option) any later version.      *
    *                                                                       *
    *************************************************************************
*/

#ifndef VIDEODEVICEPOOL_H
#define VIDEODEVICEPOOL_H

#include <iostream>


#include "videoinput.h"
#include <qstring.h>
#include <qimage.h>
#include <kcombobox.h>
#include "videodevice.h"
#include "kopete_export.h"
#include <kconfig.h>
#include <kglobal.h>
#include <solid/device.h>


namespace Kopete {

namespace AV {

/**
This class allows kopete to check for the existence, open, configure, test, set parameters, grab frames from and close a given video capture card using the Video4Linux API.

@author <NAME>
*/

class KOPETE_EXPORT VideoDevicePool : public QObject
{
Q_OBJECT
public:
	static VideoDevicePool* self();
	int open(int device = -1);
	bool isOpen();
	int getFrame();
	int width();
	int minWidth();
	int maxWidth();
	int height();
	int minHeight();
	int maxHeight();
	int setSize( int newwidth, int newheight);
	int close();
	int startCapturing();
	int stopCapturing();
	int readFrame();
	int getImage(QImage *qimage);
	int selectInput(int newinput);
	int size();
	~VideoDevicePool();
	void fillDeviceKComboBox(KComboBox *combobox);
	void fillInputKComboBox(KComboBox *combobox);
	void fillStandardKComboBox(KComboBox *combobox);
	QString currentDeviceUdi();
	int currentDevice();
	int currentInput();
	int inputs();

	QList<NumericVideoControl> getSupportedNumericControls();
	QList<BooleanVideoControl> getSupportedBooleanControls();
	QList<MenuVideoControl> getSupportedMenuControls();
	QList<ActionVideoControl> getSupportedActionControls();

	int getControlValue(quint32 ctrl_id, qint32 * value);
	int setControlValue(quint32 ctrl_id, qint32 value);

	void saveCurrentDeviceConfig();

signals:
	/**
	 * Provisional signatures, probably more useful to indicate which device was registered
	 */
	void deviceRegistered( const QString & udi );
	void deviceUnregistered( const QString & udi );

protected slots:
	/**
	 * Slot called when a new device is added to the system
	 */
	void deviceAdded( const QString & udi );
	void deviceRemoved( const QString & udi );

protected:
	int xioctl(int request, void *arg);
	int errnoReturn(const char* s);
	bool registerDevice( Solid::Device & dev );
	int showDeviceCapabilities(int device = -1);
	int getSavedDevice();
	void loadDeviceConfig(); // Load configuration parameters;

	int m_current_device;
	QVector<VideoDevice*> m_videodevices;	/*!< Vector of pointers to the available video devices */
	struct imagebuffer m_buffer; // only used when no devices were found

private:
	VideoDevicePool();
	static VideoDevicePool* s_self;
	static __u64 m_clients; // Number of instances

};

}

}

#endif // VIDEODEVICEPOOL_H
<commit_msg>Remove obsolete function prototype<commit_after>/*
    videodevicepool.h  -  Kopete Multiple Video Device handler Class

    Copyright (c) 2005-2006 by <NAME>   <<EMAIL>>
    Copyright (c) 2010      by <NAME>                 <<EMAIL>>

    Kopete    (c) 2002-2003      by the Kopete developers  <<EMAIL>>

    *************************************************************************
    *                                                                       *
    * This library is free software; you can redistribute it and/or         *
    * modify it under the terms of the GNU Lesser General Public            *
    * License as published by the Free Software Foundation; either          *
    * version 2 of the License, or (at your option) any later version.      *
    *                                                                       *
    *************************************************************************
*/

#ifndef VIDEODEVICEPOOL_H
#define VIDEODEVICEPOOL_H

#include <iostream>


#include "videoinput.h"
#include <qstring.h>
#include <qimage.h>
#include <kcombobox.h>
#include "videodevice.h"
#include "kopete_export.h"
#include <kconfig.h>
#include <kglobal.h>
#include <solid/device.h>


namespace Kopete {

namespace AV {

/**
This class allows kopete to check for the existence, open, configure, test, set parameters, grab frames from and close a given video capture card using the Video4Linux API.

@author <NAME>
*/

class KOPETE_EXPORT VideoDevicePool : public QObject
{
Q_OBJECT
public:
	static VideoDevicePool* self();
	int open(int device = -1);
	bool isOpen();
	int getFrame();
	int width();
	int minWidth();
	int maxWidth();
	int height();
	int minHeight();
	int maxHeight();
	int setSize( int newwidth, int newheight);
	int close();
	int startCapturing();
	int stopCapturing();
	int getImage(QImage *qimage);
	int selectInput(int newinput);
	int size();
	~VideoDevicePool();
	void fillDeviceKComboBox(KComboBox *combobox);
	void fillInputKComboBox(KComboBox *combobox);
	void fillStandardKComboBox(KComboBox *combobox);
	QString currentDeviceUdi();
	int currentDevice();
	int currentInput();
	int inputs();

	QList<NumericVideoControl> getSupportedNumericControls();
	QList<BooleanVideoControl> getSupportedBooleanControls();
	QList<MenuVideoControl> getSupportedMenuControls();
	QList<ActionVideoControl> getSupportedActionControls();

	int getControlValue(quint32 ctrl_id, qint32 * value);
	int setControlValue(quint32 ctrl_id, qint32 value);

	void saveCurrentDeviceConfig();

signals:
	/**
	 * Provisional signatures, probably more useful to indicate which device was registered
	 */
	void deviceRegistered( const QString & udi );
	void deviceUnregistered( const QString & udi );

protected slots:
	/**
	 * Slot called when a new device is added to the system
	 */
	void deviceAdded( const QString & udi );
	void deviceRemoved( const QString & udi );

protected:
	int xioctl(int request, void *arg);
	int errnoReturn(const char* s);
	bool registerDevice( Solid::Device & dev );
	int showDeviceCapabilities(int device = -1);
	int getSavedDevice();
	void loadDeviceConfig(); // Load configuration parameters;

	int m_current_device;
	QVector<VideoDevice*> m_videodevices;	/*!< Vector of pointers to the available video devices */
	struct imagebuffer m_buffer; // only used when no devices were found

private:
	VideoDevicePool();
	static VideoDevicePool* s_self;
	static __u64 m_clients; // Number of instances

};

}

}

#endif // VIDEODEVICEPOOL_H

{'fraction_non_alphanumeric': 0.13385826771653545, 'fraction_numerical': 0.00973514674302076, 'mean_word_length': 3.6604402935290192, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4211500', 'n_tokens_mistral': 2099, 'n_tokens_neox': 1977, 'n_words': 647}