smf/smfservermodule/smfcommon/smfmusicfingerprint.cpp
author cgandhi
Thu, 23 Sep 2010 17:43:31 +0530
changeset 25 a180113055cb
parent 18 013a02bf2bb0
permissions -rw-r--r--
Music Events are now normal Fetcher APIs added All APIs now return SmfError Canceling Request now supported Music Search now based on category Providerinfo added in DSM Added secondary ID, count, location to SMFAlbum Tags for Artist added Get tracks for album and artist added Added URL to subtitle DSM Bug fixes Detailed debugging logs filtered in server, pluginmgr, transportmgr playlistsOf() method changed in smfclient and plugin interfaces. RVCT B686 compilation issues resolved.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     1
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     2
 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     3
 * All rights reserved.
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     5
 * under the terms of the "Eclipse Public License v1.0" 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     6
 * which accompanies  this distribution, and is available
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html"
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     8
 *
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     9
 * Initial Contributors:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    10
 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    11
 *
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    12
 * Contributors:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    13
 * Manasij Roy, Nalina Hariharan
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    14
 * 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    15
 * Description:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    16
 * The SmfMusicFingerPrint class represents a music finger print used in searches
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    17
 *
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    18
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    19
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    20
#include <smfmusicfingerprint.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    21
#include <smfmusicfingerprint_p.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    22
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    23
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    24
 * Constructor with default argument
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    25
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    26
SmfMusicFingerPrint::SmfMusicFingerPrint( )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    27
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    28
	d = new SmfMusicFingerPrintPrivate;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    29
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    30
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    31
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    32
 * Constructor with default argument
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    33
 * @param aParent The parent object
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    34
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    35
SmfMusicFingerPrint::SmfMusicFingerPrint( const SmfMusicFingerPrint &aOther )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    36
	:d( aOther.d )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    37
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    38
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    39
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    40
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    41
 * Overloaded = operator
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    42
 * @param aOther The reference object
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    43
 * @return The target reference value
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    44
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    45
SmfMusicFingerPrint& SmfMusicFingerPrint::operator=( const SmfMusicFingerPrint &aOther )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    46
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    47
	d->m_fingerPrintData = aOther.d->m_fingerPrintData;
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    48
	d->m_id = aOther.d->m_id;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    49
	return *this;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    50
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    51
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    52
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    53
 * Destructor
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    54
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    55
SmfMusicFingerPrint::~SmfMusicFingerPrint( )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    56
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    57
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    58
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    59
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    60
 * GEt the music finger print data
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    61
 * @return The music finger print data
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    62
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    63
QByteArray SmfMusicFingerPrint::musicFingerPrint ( ) const
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    64
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    65
	return d->m_fingerPrintData;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    66
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    67
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    68
/**
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    69
 * Method to get the service specific id of this fingerprint data
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    70
 * @return The ID value 
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    71
 */
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    72
QString SmfMusicFingerPrint::id( ) const
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    73
	{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    74
	return d->m_id;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    75
	}	
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    76
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    77
/**
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    78
 * Method to set the music finger print data
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    79
 * @param aFp The music finger print data
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    80
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    81
void SmfMusicFingerPrint::setMusicFingerPrint ( const QByteArray &aFp)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    82
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    83
	d->m_fingerPrintData = aFp;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    84
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    85
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    86
/**
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    87
 * Method to set the service specific id of this fingerprint data
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    88
 * @param aId The ID value 
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    89
 */
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    90
void SmfMusicFingerPrint::setId( const QString &aId )
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    91
	{
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    92
	d->m_id = aId;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    93
	}
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    94
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    95
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    96
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    97
 * Method for Externalization. Writes the SmfMusicFingerPrint object to 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    98
 * the stream and returns a reference to the stream.
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    99
 * @param aDataStream Stream to be written
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   100
 * @param aMFP The SmfMusicFingerPrint object to be externalized
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   101
 * @return reference to the written stream
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   102
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   103
 QDataStream &operator<<( QDataStream &aDataStream, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   104
		const SmfMusicFingerPrint &aMFP )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   105
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   106
	// Serialize d->m_fingerPrintData
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   107
	aDataStream<<aMFP.d->m_fingerPrintData;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   108
	
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   109
	// Serialize d->m_id
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   110
	aDataStream<<aMFP.d->m_id;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   111
	
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   112
	return aDataStream;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   113
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   114
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   115
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   116
 * Method for Internalization. Reads a SmfMusicFingerPrint object from 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   117
 * the stream and returns a reference to the stream.
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   118
 * @param aDataStream Stream to be read
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   119
 * @param aMFP The SmfMusicFingerPrint object to be internalized
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   120
 * @return reference to the stream
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   121
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   122
 QDataStream &operator>>( QDataStream &aDataStream, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   123
		SmfMusicFingerPrint &aMFP)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   124
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   125
	// Deserialize d->m_fingerPrintData
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   126
	aDataStream>>aMFP.d->m_fingerPrintData;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   127
	
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   128
	// Deserialize d->m_id
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   129
	aDataStream>>aMFP.d->m_id;
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   130
	
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   131
	return aDataStream;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   132
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   133