18
|
1 |
/**
|
|
2 |
* Copyright (c) 2010 Sasken Communication Technologies Ltd.
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html"
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
* Manasij Roy, Nalina Hariharan
|
|
14 |
*
|
|
15 |
* Description:
|
|
16 |
* The SmfMusicFingerPrint class represents a music finger print used in searches
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
#include <smfmusicfingerprint.h>
|
|
21 |
#include <smfmusicfingerprint_p.h>
|
|
22 |
|
|
23 |
/**
|
|
24 |
* Constructor with default argument
|
|
25 |
*/
|
|
26 |
SmfMusicFingerPrint::SmfMusicFingerPrint( )
|
|
27 |
{
|
|
28 |
d = new SmfMusicFingerPrintPrivate;
|
|
29 |
}
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Constructor with default argument
|
|
33 |
* @param aParent The parent object
|
|
34 |
*/
|
|
35 |
SmfMusicFingerPrint::SmfMusicFingerPrint( const SmfMusicFingerPrint &aOther )
|
|
36 |
:d( aOther.d )
|
|
37 |
{
|
|
38 |
}
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Overloaded = operator
|
|
42 |
* @param aOther The reference object
|
|
43 |
* @return The target reference value
|
|
44 |
*/
|
|
45 |
SmfMusicFingerPrint& SmfMusicFingerPrint::operator=( const SmfMusicFingerPrint &aOther )
|
|
46 |
{
|
|
47 |
d->m_fingerPrintData = aOther.d->m_fingerPrintData;
|
25
|
48 |
d->m_id = aOther.d->m_id;
|
18
|
49 |
return *this;
|
|
50 |
}
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Destructor
|
|
54 |
*/
|
|
55 |
SmfMusicFingerPrint::~SmfMusicFingerPrint( )
|
|
56 |
{
|
|
57 |
}
|
|
58 |
|
|
59 |
/**
|
|
60 |
* GEt the music finger print data
|
|
61 |
* @return The music finger print data
|
|
62 |
*/
|
|
63 |
QByteArray SmfMusicFingerPrint::musicFingerPrint ( ) const
|
|
64 |
{
|
|
65 |
return d->m_fingerPrintData;
|
|
66 |
}
|
|
67 |
|
|
68 |
/**
|
25
|
69 |
* Method to get the service specific id of this fingerprint data
|
|
70 |
* @return The ID value
|
|
71 |
*/
|
|
72 |
QString SmfMusicFingerPrint::id( ) const
|
|
73 |
{
|
|
74 |
return d->m_id;
|
|
75 |
}
|
|
76 |
|
|
77 |
/**
|
18
|
78 |
* Method to set the music finger print data
|
|
79 |
* @param aFp The music finger print data
|
|
80 |
*/
|
|
81 |
void SmfMusicFingerPrint::setMusicFingerPrint ( const QByteArray &aFp)
|
|
82 |
{
|
|
83 |
d->m_fingerPrintData = aFp;
|
|
84 |
}
|
|
85 |
|
25
|
86 |
/**
|
|
87 |
* Method to set the service specific id of this fingerprint data
|
|
88 |
* @param aId The ID value
|
|
89 |
*/
|
|
90 |
void SmfMusicFingerPrint::setId( const QString &aId )
|
|
91 |
{
|
|
92 |
d->m_id = aId;
|
|
93 |
}
|
|
94 |
|
18
|
95 |
|
|
96 |
/**
|
|
97 |
* Method for Externalization. Writes the SmfMusicFingerPrint object to
|
|
98 |
* the stream and returns a reference to the stream.
|
|
99 |
* @param aDataStream Stream to be written
|
|
100 |
* @param aMFP The SmfMusicFingerPrint object to be externalized
|
|
101 |
* @return reference to the written stream
|
|
102 |
*/
|
|
103 |
QDataStream &operator<<( QDataStream &aDataStream,
|
|
104 |
const SmfMusicFingerPrint &aMFP )
|
|
105 |
{
|
|
106 |
// Serialize d->m_fingerPrintData
|
|
107 |
aDataStream<<aMFP.d->m_fingerPrintData;
|
|
108 |
|
25
|
109 |
// Serialize d->m_id
|
|
110 |
aDataStream<<aMFP.d->m_id;
|
|
111 |
|
18
|
112 |
return aDataStream;
|
|
113 |
}
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Method for Internalization. Reads a SmfMusicFingerPrint object from
|
|
117 |
* the stream and returns a reference to the stream.
|
|
118 |
* @param aDataStream Stream to be read
|
|
119 |
* @param aMFP The SmfMusicFingerPrint object to be internalized
|
|
120 |
* @return reference to the stream
|
|
121 |
*/
|
|
122 |
QDataStream &operator>>( QDataStream &aDataStream,
|
|
123 |
SmfMusicFingerPrint &aMFP)
|
|
124 |
{
|
|
125 |
// Deserialize d->m_fingerPrintData
|
|
126 |
aDataStream>>aMFP.d->m_fingerPrintData;
|
|
127 |
|
25
|
128 |
// Deserialize d->m_id
|
|
129 |
aDataStream>>aMFP.d->m_id;
|
|
130 |
|
18
|
131 |
return aDataStream;
|
|
132 |
}
|
|
133 |
|