[AE] Add comparison operator to AEAudioFormat
authorTrent Nelson <trent.a.b.nelson@gmail.com>
Wed, 18 Dec 2013 17:26:38 +0000 (12:26 -0500)
committerTrent Nelson <trent.a.b.nelson@gmail.com>
Thu, 19 Dec 2013 18:14:37 +0000 (13:14 -0500)
xbmc/cores/AudioEngine/Utils/AEAudioFormat.h
xbmc/cores/AudioEngine/Utils/AEChannelInfo.cpp
xbmc/cores/AudioEngine/Utils/AEChannelInfo.h

index 88abac7..9ac5c79 100644 (file)
@@ -125,6 +125,17 @@ typedef struct AEAudioFormat{
     m_frameSamples = 0;
     m_frameSize = 0;
   }
+
+  bool operator==(const AEAudioFormat& fmt) const
+  {
+    return  m_dataFormat    ==  fmt.m_dataFormat    &&
+            m_sampleRate    ==  fmt.m_sampleRate    &&
+            m_encodedRate   ==  fmt.m_encodedRate   &&
+            m_channelLayout ==  fmt.m_channelLayout &&
+            m_frames        ==  fmt.m_frames        &&
+            m_frameSamples  ==  fmt.m_frameSamples  &&
+            m_frameSize     ==  fmt.m_frameSize;
+  }
  
 } AEAudioFormat;
 
index 5d48571..cf129ba 100644 (file)
@@ -192,7 +192,7 @@ CAEChannelInfo& CAEChannelInfo::operator=(const enum AEStdChLayout rhs)
   return *this;
 }
 
-bool CAEChannelInfo::operator==(const CAEChannelInfo& rhs)
+bool CAEChannelInfo::operator==(const CAEChannelInfo& rhs) const
 {
   /* if the channel count doesnt match, no need to check further */
   if (m_channelCount != rhs.m_channelCount)
index ab114ea..2f1bca6 100644 (file)
@@ -78,7 +78,7 @@ public:
   CAEChannelInfo& operator=(const CAEChannelInfo& rhs);
   CAEChannelInfo& operator=(const enum AEChannel* rhs);
   CAEChannelInfo& operator=(const enum AEStdChLayout rhs);
-  bool operator==(const CAEChannelInfo& rhs);
+  bool operator==(const CAEChannelInfo& rhs) const;
   bool operator!=(const CAEChannelInfo& rhs);
   CAEChannelInfo& operator+=(const enum AEChannel& rhs);
   CAEChannelInfo& operator-=(const enum AEChannel& rhs);