[peripherals] pass the full PeripheralScanResult to CPeripheral constructors (cleanup)
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 26 Feb 2013 14:19:35 +0000 (15:19 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 28 Feb 2013 19:30:42 +0000 (20:30 +0100)
22 files changed:
xbmc/peripherals/PeripheralTypes.h
xbmc/peripherals/Peripherals.cpp
xbmc/peripherals/bus/PeripheralBus.cpp
xbmc/peripherals/bus/PeripheralBus.h
xbmc/peripherals/devices/Peripheral.cpp
xbmc/peripherals/devices/Peripheral.h
xbmc/peripherals/devices/PeripheralBluetooth.cpp
xbmc/peripherals/devices/PeripheralBluetooth.h
xbmc/peripherals/devices/PeripheralCecAdapter.cpp
xbmc/peripherals/devices/PeripheralCecAdapter.h
xbmc/peripherals/devices/PeripheralDisk.cpp
xbmc/peripherals/devices/PeripheralDisk.h
xbmc/peripherals/devices/PeripheralHID.cpp
xbmc/peripherals/devices/PeripheralHID.h
xbmc/peripherals/devices/PeripheralImon.cpp
xbmc/peripherals/devices/PeripheralImon.h
xbmc/peripherals/devices/PeripheralNIC.cpp
xbmc/peripherals/devices/PeripheralNIC.h
xbmc/peripherals/devices/PeripheralNyxboard.cpp
xbmc/peripherals/devices/PeripheralNyxboard.h
xbmc/peripherals/devices/PeripheralTuner.cpp
xbmc/peripherals/devices/PeripheralTuner.h

index 5fb1a45..cc95579 100644 (file)
@@ -185,4 +185,67 @@ namespace PERIPHERALS
       strHexString.Format("%04X", iVal);
     };
   };
+
+  class PeripheralScanResult
+  {
+  public:
+    PeripheralScanResult(const PeripheralBusType busType) :
+      m_type(PERIPHERAL_UNKNOWN),
+      m_iVendorId(0),
+      m_iProductId(0),
+      m_mappedType(PERIPHERAL_UNKNOWN),
+      m_busType(busType) {}
+
+    PeripheralScanResult(void) :
+      m_type(PERIPHERAL_UNKNOWN),
+      m_iVendorId(0),
+      m_iProductId(0),
+      m_mappedType(PERIPHERAL_UNKNOWN),
+      m_busType(PERIPHERAL_BUS_UNKNOWN) {}
+
+    bool operator ==(const PeripheralScanResult& right) const
+    {
+      return m_iVendorId  == right.m_iVendorId &&
+             m_iProductId == right.m_iProductId &&
+             m_type       == right.m_type &&
+             m_busType    == right.m_busType &&
+             m_strLocation.Equals(right.m_strLocation);
+    }
+
+    bool operator !=(const PeripheralScanResult& right) const
+    {
+      return !(*this == right);
+    }
+
+    PeripheralType    m_type;
+    CStdString        m_strLocation;
+    int               m_iVendorId;
+    int               m_iProductId;
+    PeripheralType    m_mappedType;
+    CStdString        m_strDeviceName;
+    PeripheralBusType m_busType;
+  };
+
+  struct PeripheralScanResults
+  {
+    bool GetDeviceOnLocation(const CStdString& strLocation, PeripheralScanResult* result) const
+    {
+      for (std::vector<PeripheralScanResult>::const_iterator it = m_results.begin(); it != m_results.end(); it++)
+      {
+        if ((*it).m_strLocation == strLocation)
+        {
+          *result = *it;
+          return true;
+        }
+      }
+      return false;
+    }
+
+    bool ContainsResult(const PeripheralScanResult& result) const
+    {
+      return std::find(m_results.begin(), m_results.end(), result) != m_results.end();
+    }
+
+    std::vector<PeripheralScanResult> m_results;
+  };
 }
index 1c7e971..f770b6c 100644 (file)
@@ -246,33 +246,33 @@ CPeripheral *CPeripherals::CreatePeripheral(CPeripheralBus &bus, const Periphera
   switch(mappedResult.m_mappedType)
   {
   case PERIPHERAL_HID:
-    peripheral = new CPeripheralHID(mappedResult.m_mappedType, mappedResult.m_busType, mappedResult.m_strLocation, mappedResult.m_strDeviceName, mappedResult.m_iVendorId, mappedResult.m_iProductId);
+    peripheral = new CPeripheralHID(mappedResult);
     break;
 
   case PERIPHERAL_NIC:
-    peripheral = new CPeripheralNIC(mappedResult.m_mappedType, mappedResult.m_busType, mappedResult.m_strLocation, mappedResult.m_strDeviceName, mappedResult.m_iVendorId, mappedResult.m_iProductId);
+    peripheral = new CPeripheralNIC(mappedResult);
     break;
 
   case PERIPHERAL_DISK:
-    peripheral = new CPeripheralDisk(mappedResult.m_mappedType, mappedResult.m_busType, mappedResult.m_strLocation, mappedResult.m_strDeviceName, mappedResult.m_iVendorId, mappedResult.m_iProductId);
+    peripheral = new CPeripheralDisk(mappedResult);
     break;
 
   case PERIPHERAL_NYXBOARD:
-    peripheral = new CPeripheralNyxboard(mappedResult.m_mappedType, mappedResult.m_busType, mappedResult.m_strLocation, mappedResult.m_strDeviceName, mappedResult.m_iVendorId, mappedResult.m_iProductId);
+    peripheral = new CPeripheralNyxboard(mappedResult);
     break;
 
   case PERIPHERAL_TUNER:
-    peripheral = new CPeripheralTuner(mappedResult.m_mappedType, mappedResult.m_busType, mappedResult.m_strLocation, mappedResult.m_strDeviceName, mappedResult.m_iVendorId, mappedResult.m_iProductId);
+    peripheral = new CPeripheralTuner(mappedResult);
     break;
 
   case PERIPHERAL_BLUETOOTH:
-    peripheral = new CPeripheralBluetooth(mappedResult.m_mappedType, mappedResult.m_busType, mappedResult.m_strLocation, mappedResult.m_strDeviceName, mappedResult.m_iVendorId, mappedResult.m_iProductId);
+    peripheral = new CPeripheralBluetooth(mappedResult);
     break;
 
   case PERIPHERAL_CEC:
 #if defined(HAVE_LIBCEC)
     if (bus.Type() == PERIPHERAL_BUS_CEC)
-      peripheral = new CPeripheralCecAdapter(mappedResult.m_mappedType, mappedResult.m_busType, mappedResult.m_strLocation, mappedResult.m_strDeviceName, mappedResult.m_iVendorId, mappedResult.m_iProductId);
+      peripheral = new CPeripheralCecAdapter(mappedResult);
 #else
     if (!m_bMissingLibCecWarningDisplayed)
     {
@@ -284,7 +284,7 @@ CPeripheral *CPeripherals::CreatePeripheral(CPeripheralBus &bus, const Periphera
     break;
 
   case PERIPHERAL_IMON:
-    peripheral = new CPeripheralImon(mappedResult.m_mappedType, mappedResult.m_busType, mappedResult.m_strLocation, mappedResult.m_strDeviceName, mappedResult.m_iVendorId, mappedResult.m_iProductId);
+    peripheral = new CPeripheralImon(mappedResult);
     break;
 
   default:
index c4eb230..89c706d 100644 (file)
@@ -29,85 +29,6 @@ using namespace PERIPHERALS;
 
 #define PERIPHERAL_DEFAULT_RESCAN_INTERVAL 1000
 
-PeripheralScanResult::PeripheralScanResult(const PeripheralBusType busType)
-{
-  m_iVendorId  = 0;
-  m_iProductId = 0;
-  m_type       = PERIPHERAL_UNKNOWN;
-  m_mappedType = PERIPHERAL_UNKNOWN;
-  m_busType    = busType;
-}
-
-PeripheralScanResult::PeripheralScanResult(void)
-{
-  m_iVendorId  = 0;
-  m_iProductId = 0;
-  m_type       = PERIPHERAL_UNKNOWN;
-  m_mappedType = PERIPHERAL_UNKNOWN;
-  m_busType    = PERIPHERAL_BUS_UNKNOWN;
-}
-
-bool PeripheralScanResult::operator ==(const PeripheralScanResult &right) const
-{
-  return m_iVendorId == right.m_iVendorId &&
-      m_iProductId == right.m_iProductId &&
-      m_type == right.m_type &&
-      m_strLocation.Equals(right.m_strLocation) &&
-      m_busType == right.m_busType;
-}
-
-bool PeripheralScanResult::operator !=(const PeripheralScanResult &right) const
-{
-  return !(*this == right);
-}
-
-bool PeripheralScanResult::operator ==(const CPeripheral &right) const
-{
-  return m_iVendorId == right.VendorId() &&
-      m_iProductId == right.ProductId() &&
-      m_type == right.Type() &&
-      m_strLocation.Equals(right.Location()) &&
-      m_busType == right.GetBusType();
-}
-
-bool PeripheralScanResult::operator !=(const CPeripheral &right) const
-{
-  return !(*this == right);
-}
-
-bool PeripheralScanResults::GetDeviceOnLocation(const CStdString &strLocation, PeripheralScanResult *result) const
-{
-  bool bReturn(false);
-
-  for (unsigned int iDevicePtr = 0; iDevicePtr < m_results.size(); iDevicePtr++)
-  {
-    if (m_results.at(iDevicePtr).m_strLocation == strLocation)
-    {
-      *result = m_results.at(iDevicePtr);
-      bReturn = true;
-      break;
-    }
-  }
-
-  return bReturn;
-}
-
-bool PeripheralScanResults::ContainsResult(const PeripheralScanResult &result) const
-{
-  bool bReturn(false);
-
-  for (unsigned int iDevicePtr = 0; iDevicePtr < m_results.size(); iDevicePtr++)
-  {
-    if (m_results.at(iDevicePtr) == result)
-    {
-      bReturn = true;
-      break;
-    }
-  }
-
-  return bReturn;
-}
-
 CPeripheralBus::CPeripheralBus(CPeripherals *manager, PeripheralBusType type) :
     CThread("XBMC Peripherals"),
     m_iRescanTime(PERIPHERAL_DEFAULT_RESCAN_INTERVAL),
@@ -159,7 +80,7 @@ void CPeripheralBus::UnregisterRemovedDevices(const PeripheralScanResults &resul
     CPeripheral *peripheral = m_peripherals.at(iDevicePtr);
     PeripheralScanResult updatedDevice(m_type);
     if (!results.GetDeviceOnLocation(peripheral->Location(), &updatedDevice) ||
-        updatedDevice != *peripheral)
+        *peripheral != updatedDevice)
     {
       /* device removed */
       removedPeripherals.push_back(peripheral);
index 8900e11..a719106 100644 (file)
@@ -31,33 +31,6 @@ namespace PERIPHERALS
 {
   class CPeripherals;
 
-  struct PeripheralScanResult
-  {
-    PeripheralScanResult(const PeripheralBusType busType);
-    PeripheralScanResult(void);
-    bool operator ==(const PeripheralScanResult &right) const;
-    bool operator !=(const PeripheralScanResult &right) const;
-
-    bool operator ==(const CPeripheral &right) const;
-    bool operator !=(const CPeripheral &right) const;
-
-    PeripheralType    m_type;
-    CStdString        m_strLocation;
-    int               m_iVendorId;
-    int               m_iProductId;
-    PeripheralType    m_mappedType;
-    CStdString        m_strDeviceName;
-    PeripheralBusType m_busType;
-  };
-
-  struct PeripheralScanResults
-  {
-    bool GetDeviceOnLocation(const CStdString &strLocation, PeripheralScanResult *result) const;
-    bool ContainsResult(const PeripheralScanResult &result) const;
-
-    std::vector<PeripheralScanResult> m_results;
-  };
-
   /*!
    * @class CPeripheralBus
    * This represents a bus on the system. By default, this bus instance will scan for changes every second.
index 2aa0e7a..5cd51a9 100644 (file)
@@ -38,22 +38,22 @@ struct SortBySettingsOrder
   }
 };
 
-CPeripheral::CPeripheral(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId) :
-  m_type(type),
-  m_busType(busType),
-  m_strLocation(strLocation),
-  m_strDeviceName(strDeviceName),
+CPeripheral::CPeripheral(const PeripheralScanResult& scanResult) :
+  m_type(scanResult.m_mappedType),
+  m_busType(scanResult.m_busType),
+  m_strLocation(scanResult.m_strLocation),
+  m_strDeviceName(scanResult.m_strDeviceName),
   m_strFileLocation(StringUtils::EmptyString),
-  m_iVendorId(iVendorId),
-  m_iProductId(iProductId),
+  m_iVendorId(scanResult.m_iVendorId),
+  m_iProductId(scanResult.m_iProductId),
   m_strVersionInfo(g_localizeStrings.Get(13205)), // "unknown"
   m_bInitialised(false),
   m_bHidden(false),
   m_bError(false)
 {
-  PeripheralTypeTranslator::FormatHexString(iVendorId, m_strVendorId);
-  PeripheralTypeTranslator::FormatHexString(iProductId, m_strProductId);
-  m_strFileLocation.Format("peripherals://%s/%s.dev", PeripheralTypeTranslator::BusTypeToString(busType), strLocation.c_str());
+  PeripheralTypeTranslator::FormatHexString(scanResult.m_iVendorId, m_strVendorId);
+  PeripheralTypeTranslator::FormatHexString(scanResult.m_iProductId, m_strProductId);
+  m_strFileLocation.Format("peripherals://%s/%s.dev", PeripheralTypeTranslator::BusTypeToString(scanResult.m_busType), scanResult.m_strLocation.c_str());
 }
 
 CPeripheral::~CPeripheral(void)
@@ -518,3 +518,17 @@ void CPeripheral::ClearSettings(void)
   }
   m_settings.clear();
 }
+
+bool CPeripheral::operator ==(const PeripheralScanResult& right) const
+{
+  return m_iVendorId  == right.m_iVendorId &&
+         m_iProductId == right.m_iProductId &&
+         m_type       == right.m_type &&
+         m_busType    == right.m_busType &&
+         m_strLocation.Equals(right.m_strLocation);
+}
+
+bool CPeripheral::operator !=(const PeripheralScanResult& right) const
+{
+  return !(*this == right);
+}
index 080677d..47f1771 100644 (file)
@@ -34,11 +34,13 @@ namespace PERIPHERALS
     friend class CGUIDialogPeripheralSettings;
 
   public:
-    CPeripheral(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
+    CPeripheral(const PeripheralScanResult& scanResult);
     virtual ~CPeripheral(void);
 
     bool operator ==(const CPeripheral &right) const;
     bool operator !=(const CPeripheral &right) const;
+    bool operator ==(const PeripheralScanResult& right) const;
+    bool operator !=(const PeripheralScanResult& right) const;
 
     const CStdString &FileLocation(void) const     { return m_strFileLocation; }
     const CStdString &Location(void) const         { return m_strLocation; }
index 342f482..c48aa91 100644 (file)
@@ -23,8 +23,8 @@
 
 using namespace PERIPHERALS;
 
-CPeripheralBluetooth::CPeripheralBluetooth(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId) :
-  CPeripheral(type, busType, strLocation, strDeviceName, iVendorId, iProductId)
+CPeripheralBluetooth::CPeripheralBluetooth(const PeripheralScanResult& scanResult) :
+  CPeripheral(scanResult)
 {
   m_features.push_back(FEATURE_BLUETOOTH);
 }
index d4831ff..292df34 100644 (file)
@@ -26,7 +26,7 @@ namespace PERIPHERALS
   class CPeripheralBluetooth : public CPeripheral
   {
   public:
-    CPeripheralBluetooth(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
+    CPeripheralBluetooth(const PeripheralScanResult& scanResult);
     virtual ~CPeripheralBluetooth(void) {};
   };
 }
index 03c9e18..bf2717d 100644 (file)
@@ -80,8 +80,8 @@ class DllLibCEC : public DllDynamic, DllLibCECInterface
   END_METHOD_RESOLVE()
 };
 
-CPeripheralCecAdapter::CPeripheralCecAdapter(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId) :
-  CPeripheralHID(type, busType, strLocation, strDeviceName, iVendorId, iProductId),
+CPeripheralCecAdapter::CPeripheralCecAdapter(const PeripheralScanResult& scanResult) :
+  CPeripheralHID(scanResult),
   CThread("CEC Adapter"),
   m_dll(NULL),
   m_cecAdapter(NULL)
index 7654300..33a6e49 100644 (file)
@@ -86,7 +86,7 @@ namespace PERIPHERALS
     friend class CPeripheralCecAdapterUpdateThread;
 
   public:
-    CPeripheralCecAdapter(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
+    CPeripheralCecAdapter(const PeripheralScanResult& scanResult);
     virtual ~CPeripheralCecAdapter(void);
 
     void Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data);
index 5183fdd..6587f88 100644 (file)
@@ -23,8 +23,9 @@
 
 using namespace PERIPHERALS;
 
-CPeripheralDisk::CPeripheralDisk(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId) :
-  CPeripheral(type, busType, strLocation, strDeviceName.IsEmpty() ? g_localizeStrings.Get(35003) : strDeviceName, iVendorId, iProductId)
+CPeripheralDisk::CPeripheralDisk(const PeripheralScanResult& scanResult) :
+  CPeripheral(scanResult)
 {
+  m_strDeviceName = scanResult.m_strDeviceName.IsEmpty() ? g_localizeStrings.Get(35003) : scanResult.m_strDeviceName;
   m_features.push_back(FEATURE_DISK);
 }
index 712fe62..432b7f7 100644 (file)
@@ -26,7 +26,7 @@ namespace PERIPHERALS
   class CPeripheralDisk : public CPeripheral
   {
   public:
-    CPeripheralDisk(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
+    CPeripheralDisk(const PeripheralScanResult& scanResult);
     virtual ~CPeripheralDisk(void) {};
   };
 }
index a6295b4..11f6254 100644 (file)
 using namespace PERIPHERALS;
 using namespace std;
 
-CPeripheralHID::CPeripheralHID(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId) :
-  CPeripheral(type, busType, strLocation, strDeviceName.IsEmpty() ? g_localizeStrings.Get(35001) : strDeviceName, iVendorId, iProductId),
+CPeripheralHID::CPeripheralHID(const PeripheralScanResult& scanResult) :
+  CPeripheral(scanResult),
   m_bInitialised(false)
 {
+  m_strDeviceName = scanResult.m_strDeviceName.IsEmpty() ? g_localizeStrings.Get(35001) : scanResult.m_strDeviceName;
   m_features.push_back(FEATURE_HID);
 }
 
index 8095ab9..41c1a24 100644 (file)
@@ -27,7 +27,7 @@ namespace PERIPHERALS
   class CPeripheralHID : public CPeripheral
   {
   public:
-    CPeripheralHID(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
+    CPeripheralHID(const PeripheralScanResult& scanResult);
     virtual ~CPeripheralHID(void);
     virtual bool InitialiseFeature(const PeripheralFeature feature);
     virtual bool LookupSymAndUnicode(XBMC_keysym &keysym, uint8_t *key, char *unicode) { return false; }
index 0609835..1f2b034 100644 (file)
@@ -37,8 +37,8 @@ using namespace std;
 volatile long CPeripheralImon::m_lCountOfImonsConflictWithDInput = 0;
 
 
-CPeripheralImon::CPeripheralImon(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId) :
-  CPeripheralHID(type, busType, strLocation, strDeviceName.IsEmpty() ? g_localizeStrings.Get(35001) : strDeviceName, iVendorId, iProductId)
+CPeripheralImon::CPeripheralImon(const PeripheralScanResult& scanResult) :
+  CPeripheralHID(scanResult)
 {
   m_features.push_back(FEATURE_IMON);
   m_bImonConflictsWithDInput = false;
index 1891270..f8e40ff 100644 (file)
@@ -26,7 +26,7 @@ namespace PERIPHERALS
   class CPeripheralImon : public CPeripheralHID
   {
   public:
-    CPeripheralImon(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
+    CPeripheralImon(const PeripheralScanResult& scanResult);
     virtual ~CPeripheralImon(void) {}
     virtual bool InitialiseFeature(const PeripheralFeature feature);
     virtual void OnSettingChanged(const CStdString &strChangedSetting);
index 97f891f..4e8ca2e 100644 (file)
@@ -25,8 +25,9 @@
 using namespace PERIPHERALS;
 using namespace std;
 
-CPeripheralNIC::CPeripheralNIC(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId) :
-  CPeripheral(type, busType, strLocation, strDeviceName.IsEmpty() ? g_localizeStrings.Get(35002) : strDeviceName, iVendorId, iProductId)
+CPeripheralNIC::CPeripheralNIC(const PeripheralScanResult& scanResult) :
+  CPeripheral(scanResult)
 {
+  m_strDeviceName = scanResult.m_strDeviceName.IsEmpty() ? g_localizeStrings.Get(35002) : scanResult.m_strDeviceName;
   m_features.push_back(FEATURE_NIC);
 }
index bce9c58..e31e7f1 100644 (file)
@@ -26,7 +26,7 @@ namespace PERIPHERALS
   class CPeripheralNIC : public CPeripheral
   {
   public:
-    CPeripheralNIC(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
+    CPeripheralNIC(const PeripheralScanResult& scanResult);
     virtual ~CPeripheralNIC(void) {};
   };
 }
index 8a8b3d6..dd64dea 100644 (file)
@@ -27,8 +27,8 @@
 using namespace PERIPHERALS;
 using namespace std;
 
-CPeripheralNyxboard::CPeripheralNyxboard(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId) :
-  CPeripheralHID(type, busType, strLocation, strDeviceName, iVendorId, iProductId)
+CPeripheralNyxboard::CPeripheralNyxboard(const PeripheralScanResult& scanResult) :
+  CPeripheralHID(scanResult)
 {
   m_features.push_back(FEATURE_NYXBOARD);
 }
index e82bf00..6648e42 100644 (file)
@@ -26,7 +26,7 @@ namespace PERIPHERALS
   class CPeripheralNyxboard : public CPeripheralHID
   {
   public:
-    CPeripheralNyxboard(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
+    CPeripheralNyxboard(const PeripheralScanResult& scanResult);
     virtual ~CPeripheralNyxboard(void) {};
     virtual bool LookupSymAndUnicode(XBMC_keysym &keysym, uint8_t *key, char *unicode);
   };
index e372ff1..65504b0 100644 (file)
@@ -23,8 +23,8 @@
 
 using namespace PERIPHERALS;
 
-CPeripheralTuner::CPeripheralTuner(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId) :
-  CPeripheral(type, busType, strLocation, strDeviceName, iVendorId, iProductId)
+CPeripheralTuner::CPeripheralTuner(const PeripheralScanResult& scanResult) :
+  CPeripheral(scanResult)
 {
   m_features.push_back(FEATURE_TUNER);
 }
index dd804a7..8749378 100644 (file)
@@ -26,7 +26,7 @@ namespace PERIPHERALS
   class CPeripheralTuner : public CPeripheral
   {
   public:
-    CPeripheralTuner(const PeripheralType type, const PeripheralBusType busType, const CStdString &strLocation, const CStdString &strDeviceName, int iVendorId, int iProductId);
+    CPeripheralTuner(const PeripheralScanResult& scanResult);
     virtual ~CPeripheralTuner(void) {};
   };
 }