| 
									
										
										
										
											2014-11-03 17:13:32 +00:00
										 |  |  | #include <QtPlugin>
 | 
					
						
							|  |  |  | #include <QAction>
 | 
					
						
							|  |  |  | #include "plugin/pluginapi.h"
 | 
					
						
							|  |  |  | #include "util/simpleserializer.h"
 | 
					
						
							|  |  |  | #include "v4lplugin.h"
 | 
					
						
							|  |  |  | #include "v4lgui.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const PluginDescriptor V4LPlugin::m_pluginDescriptor = { | 
					
						
							| 
									
										
										
										
											2015-05-21 18:09:12 +00:00
										 |  |  | 	QString("V4L SDRplay Input"), | 
					
						
							| 
									
										
										
										
											2015-05-18 15:18:00 +01:00
										 |  |  | 	QString("4.0"), | 
					
						
							| 
									
										
										
										
											2015-05-21 18:09:12 +00:00
										 |  |  | 	QString("(c) 2015 John Greb"), | 
					
						
							| 
									
										
										
										
											2014-12-03 18:41:38 +00:00
										 |  |  | 	QString("http://palosaari.fi/linux/"), | 
					
						
							| 
									
										
										
										
											2014-11-03 17:13:32 +00:00
										 |  |  | 	true, | 
					
						
							| 
									
										
										
										
											2014-12-03 18:41:38 +00:00
										 |  |  | 	QString("github.com/hexameron/rtl-sdrangelove") | 
					
						
							| 
									
										
										
										
											2014-11-03 17:13:32 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | V4LPlugin::V4LPlugin(QObject* parent) : | 
					
						
							|  |  |  | 	QObject(parent) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const PluginDescriptor& V4LPlugin::getPluginDescriptor() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return m_pluginDescriptor; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void V4LPlugin::initPlugin(PluginAPI* pluginAPI) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	m_pluginAPI = pluginAPI; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	m_pluginAPI->registerSampleSource("org.osmocom.sdr.samplesource.v4l", this); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PluginInterface::SampleSourceDevices V4LPlugin::enumSampleSources() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	SampleSourceDevices result; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-18 15:18:00 +01:00
										 |  |  | 	QString displayedName(QString("Linux V4L (SDRplay)")); | 
					
						
							| 
									
										
										
										
											2014-11-21 19:44:19 +00:00
										 |  |  | 	SimpleSerializer s(1); | 
					
						
							|  |  |  | 	s.writeS32(1, 0); | 
					
						
							|  |  |  | 	result.append(SampleSourceDevice(displayedName, "org.osmocom.sdr.samplesource.v4l", s.final())); | 
					
						
							| 
									
										
										
										
											2014-11-03 17:13:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	return result; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-18 02:47:14 +02:00
										 |  |  | PluginGUI* V4LPlugin::createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address) | 
					
						
							| 
									
										
										
										
											2014-11-03 17:13:32 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	if(sourceName == "org.osmocom.sdr.samplesource.v4l") { | 
					
						
							|  |  |  | 		V4LGui* gui = new V4LGui(m_pluginAPI); | 
					
						
							|  |  |  | 		m_pluginAPI->setInputGUI(gui); | 
					
						
							|  |  |  | 		return gui; | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		return NULL; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } |