|
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; |
|
48 return *this; |
|
49 } |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 SmfMusicFingerPrint::~SmfMusicFingerPrint( ) |
|
55 { |
|
56 } |
|
57 |
|
58 /** |
|
59 * GEt the music finger print data |
|
60 * @return The music finger print data |
|
61 */ |
|
62 QByteArray SmfMusicFingerPrint::musicFingerPrint ( ) const |
|
63 { |
|
64 return d->m_fingerPrintData; |
|
65 } |
|
66 |
|
67 /** |
|
68 * Method to set the music finger print data |
|
69 * @param aFp The music finger print data |
|
70 */ |
|
71 void SmfMusicFingerPrint::setMusicFingerPrint ( const QByteArray &aFp) |
|
72 { |
|
73 d->m_fingerPrintData = aFp; |
|
74 } |
|
75 |
|
76 |
|
77 /** |
|
78 * Method for Externalization. Writes the SmfMusicFingerPrint object to |
|
79 * the stream and returns a reference to the stream. |
|
80 * @param aDataStream Stream to be written |
|
81 * @param aMFP The SmfMusicFingerPrint object to be externalized |
|
82 * @return reference to the written stream |
|
83 */ |
|
84 QDataStream &operator<<( QDataStream &aDataStream, |
|
85 const SmfMusicFingerPrint &aMFP ) |
|
86 { |
|
87 // Serialize d->m_fingerPrintData |
|
88 aDataStream<<aMFP.d->m_fingerPrintData; |
|
89 |
|
90 return aDataStream; |
|
91 } |
|
92 |
|
93 /** |
|
94 * Method for Internalization. Reads a SmfMusicFingerPrint object from |
|
95 * the stream and returns a reference to the stream. |
|
96 * @param aDataStream Stream to be read |
|
97 * @param aMFP The SmfMusicFingerPrint object to be internalized |
|
98 * @return reference to the stream |
|
99 */ |
|
100 QDataStream &operator>>( QDataStream &aDataStream, |
|
101 SmfMusicFingerPrint &aMFP) |
|
102 { |
|
103 // Deserialize d->m_fingerPrintData |
|
104 aDataStream>>aMFP.d->m_fingerPrintData; |
|
105 |
|
106 return aDataStream; |
|
107 } |
|
108 |