internetradio2.0/songhistorysrc/irsonghistoryinfo.cpp
changeset 14 896e9dbc5f19
parent 12 608f67c22514
child 15 065198191975
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  class for the songhistory information.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "irsonghistoryinfo.h"
       
    19 
       
    20 // ---------------------------------------------------------------------------
       
    21 // Function : NewL
       
    22 // Function returns an instance of CIRSongHistoryInfo
       
    23 // Two phase constructor
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 	EXPORT_C CIRSongHistoryInfo * CIRSongHistoryInfo::NewL()
       
    27 		{
       
    28 			CIRSongHistoryInfo* self =  CIRSongHistoryInfo :: NewLC();
       
    29 			CleanupStack::Pop( self );
       
    30 			return self;
       
    31 		}
       
    32 
       
    33 // ---------------------------------------------------------------------------
       
    34 //CIRLastPlayedSongs::NewLC()
       
    35 //Static function
       
    36 //standard two phased constructor
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 	EXPORT_C CIRSongHistoryInfo * CIRSongHistoryInfo::NewLC()
       
    40 		{
       
    41 			CIRSongHistoryInfo* self = new( ELeave ) CIRSongHistoryInfo();
       
    42 			CleanupStack::PushL( self );
       
    43 			return self;
       
    44 		}
       
    45 // ---------------------------------------------------------------------------
       
    46 //CIRSongHistoryInfo::~CIRSongHistoryInfo()
       
    47 //standard C++ destructor
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 EXPORT_C CIRSongHistoryInfo::~CIRSongHistoryInfo()
       
    51 	{
       
    52 		iArtistInfo.Close();
       
    53 
       
    54 		iSongInfo.Close();
       
    55 
       
    56 		iStreamUrlInfo.Close();
       
    57 
       
    58 		iChannelInfo.Close();
       
    59 		
       
    60 		iChannelDescription.Close();
       
    61 
       
    62         iImageUrl.Close();
       
    63         iGenreName.Close();
       
    64         iCountryName.Close();
       
    65         iLanguageName.Close();
       
    66 		
       
    67 		iMusicStoreStatus.Close();
       
    68 		
       
    69 	}
       
    70 
       
    71 // ---------------------------------------------------------------------------
       
    72 //CIRSongHistoryInfo::~CIRSongHistoryInfo()
       
    73 //standard C++ constructor
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 CIRSongHistoryInfo::CIRSongHistoryInfo()
       
    77 	 {
       
    78 		
       
    79 	 }
       
    80 
       
    81 
       
    82 // ---------------------------------------------------------------------------
       
    83 // CIRSongHistoryInfo::SetArtist
       
    84 // Sets Artist name
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87  void CIRSongHistoryInfo::SetArtist(RBuf& aArtist)
       
    88  {
       
    89  	iArtistInfo.Create(aArtist);
       
    90  }
       
    91  
       
    92   // ---------------------------------------------------------------------------
       
    93 // CIRSongHistoryInfo::SetSongName
       
    94 // Sets Song name
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97  void CIRSongHistoryInfo::SetSongName (RBuf& aSongName)
       
    98  {
       
    99  	iSongInfo.Create(aSongName);
       
   100  }
       
   101  
       
   102   // ---------------------------------------------------------------------------
       
   103 // CIRSongHistoryInfo::SetStreamUrl
       
   104 // Sets Stream url name
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107  void CIRSongHistoryInfo::SetStreamUrl(RBuf& aStreamUrl)
       
   108  {
       
   109  	iStreamUrlInfo.Create(aStreamUrl);
       
   110  }
       
   111  
       
   112   // ---------------------------------------------------------------------------
       
   113 // CIRSongHistoryInfo::SetChannelName
       
   114 // Sets Channel name
       
   115 // ---------------------------------------------------------------------------
       
   116 //
       
   117  void CIRSongHistoryInfo::SetChannelName(RBuf& aChannelName)
       
   118  {
       
   119  	iChannelInfo.Create(aChannelName);
       
   120  }
       
   121  // ---------------------------------------------------------------------------
       
   122 // CIRSongHistoryInfo::SetChannelDesc
       
   123 // Sets Channel name
       
   124 // ---------------------------------------------------------------------------
       
   125 //
       
   126  void CIRSongHistoryInfo::SetChannelDesc(RBuf& aChannelDesc)
       
   127  {
       
   128  	iChannelDescription.Create(aChannelDesc);
       
   129  }
       
   130 // ---------------------------------------------------------------------------
       
   131 // CIRSongHistoryInfo::SetImageUrl
       
   132 // Sets Channel image Url
       
   133 // ---------------------------------------------------------------------------
       
   134 //
       
   135  void CIRSongHistoryInfo::SetImageUrl(RBuf& aImageUrl)
       
   136  {
       
   137     iImageUrl.Create(aImageUrl);
       
   138  }
       
   139  
       
   140  // ---------------------------------------------------------------------------
       
   141  // CIRSongHistoryInfo::SetGenreName
       
   142  // Set channel genre name
       
   143  // ---------------------------------------------------------------------------
       
   144  //
       
   145 void CIRSongHistoryInfo::SetGenreName(const RBuf& aGenreName)
       
   146 {
       
   147     iGenreName.Create(aGenreName);
       
   148 }
       
   149 
       
   150 // ---------------------------------------------------------------------------
       
   151 // CIRSongHistoryInfo::SetCountryName
       
   152 // Set channel country name
       
   153 // ---------------------------------------------------------------------------
       
   154 //
       
   155 void CIRSongHistoryInfo::SetCountryName(const RBuf& aCountryName)
       
   156 {
       
   157     iCountryName.Create(aCountryName);
       
   158 }
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // CIRSongHistoryInfo::SetLanguageName
       
   162 // Set channel language name
       
   163 // ---------------------------------------------------------------------------
       
   164 //
       
   165 void CIRSongHistoryInfo::SetLanguageName(const RBuf& aLanguageName)
       
   166 {
       
   167     iLanguageName.Create(aLanguageName);
       
   168 }
       
   169  // ---------------------------------------------------------------------------
       
   170 // CIRSongHistoryInfo::SetChannelMusicStatus
       
   171 // Sets Channel's MusicStoreStatus
       
   172 // ---------------------------------------------------------------------------
       
   173 //
       
   174  void CIRSongHistoryInfo::SetChannelMusicStatus(RBuf& aChannelMusicStatus)
       
   175  {
       
   176  	iMusicStoreStatus.Create(aChannelMusicStatus);
       
   177  }
       
   178 // ---------------------------------------------------------------------------
       
   179 // CIRSongHistoryInfo::SetChannelType
       
   180 // Sets Channel TYpe
       
   181 // ---------------------------------------------------------------------------
       
   182 //
       
   183  void CIRSongHistoryInfo::SetChannelType(TInt aChannelType)
       
   184  {
       
   185  	iChannelType=aChannelType;
       
   186  }
       
   187 // ---------------------------------------------------------------------------
       
   188 // CIRSongHistoryInfo::SetChannelId
       
   189 // Sets Channel Id
       
   190 // ---------------------------------------------------------------------------
       
   191 //
       
   192  void CIRSongHistoryInfo::SetChannelId(TInt aChannelId)
       
   193  {
       
   194  	iChannelId=aChannelId;
       
   195  }
       
   196 
       
   197 // ---------------------------------------------------------------------------
       
   198 // CIRSongHistoryInfo::SetBitrate
       
   199 // Sets bitrate
       
   200 // ---------------------------------------------------------------------------
       
   201 //
       
   202  void CIRSongHistoryInfo::SetBitrate(TInt aBitrate)
       
   203  {
       
   204     iBitrate=aBitrate;
       
   205  }
       
   206   // ---------------------------------------------------------------------------
       
   207 // CIRSongHistoryInfo::SetHistoryInfo
       
   208 // Sets Song History Information.
       
   209 // ---------------------------------------------------------------------------
       
   210 //
       
   211 
       
   212  EXPORT_C void CIRSongHistoryInfo::SetHistoryInfo(RBuf& aSongName,
       
   213 												  RBuf& aArtist, 
       
   214 												  RBuf& aStreamUrl, 
       
   215 												  RBuf& aChannelName ,
       
   216 												  TInt aChannelType, 
       
   217 												  TInt aChannelId,
       
   218 												  TInt aBitrate,
       
   219 												  RBuf& aChannelDesc,
       
   220                                                   RBuf& aImageUrl,
       
   221                                                   RBuf& aGenreName,
       
   222                                                   RBuf& aCountryName,
       
   223                                                   RBuf& aLanguageName,
       
   224 												  RBuf& aMusicStoreStatus
       
   225 												   )
       
   226  {
       
   227  	SetSongName(aSongName);
       
   228  	SetArtist(aArtist);
       
   229  	SetStreamUrl(aStreamUrl);
       
   230  	SetChannelName(aChannelName);
       
   231     SetChannelType(aChannelType);
       
   232     SetChannelId(aChannelId);
       
   233     SetBitrate(aBitrate);
       
   234     SetChannelDesc(aChannelDesc);
       
   235     SetImageUrl(aImageUrl);
       
   236     SetGenreName(aGenreName);
       
   237     SetCountryName(aCountryName);
       
   238     SetLanguageName(aLanguageName);
       
   239     SetChannelMusicStatus(aMusicStoreStatus);
       
   240 	
       
   241  }
       
   242  
       
   243   // ---------------------------------------------------------------------------
       
   244 // CIRSongHistoryInfo::GetSongInfo
       
   245 // Gets the song information
       
   246 // ---------------------------------------------------------------------------
       
   247 //
       
   248  EXPORT_C const RBuf& CIRSongHistoryInfo::GetSongInfo() const
       
   249  {
       
   250  	return iSongInfo;
       
   251  }
       
   252  
       
   253   // ---------------------------------------------------------------------------
       
   254 // CIRSongHistoryInfo::GetArtistInfo
       
   255 // Gets Artist name
       
   256 // ---------------------------------------------------------------------------
       
   257 //
       
   258  EXPORT_C const RBuf& CIRSongHistoryInfo::GetArtistInfo() const
       
   259  {
       
   260  	return iArtistInfo;
       
   261  }
       
   262  
       
   263 // ---------------------------------------------------------------------------
       
   264 // CIRSongHistoryInfo::GetStreamUrl
       
   265 // Gets StreamUrl name
       
   266 // ---------------------------------------------------------------------------
       
   267 //
       
   268  EXPORT_C const RBuf& CIRSongHistoryInfo::GetStreamUrl() const
       
   269  {
       
   270  	return iStreamUrlInfo;
       
   271  }
       
   272  
       
   273  // ---------------------------------------------------------------------------
       
   274 // CIRSongHistoryInfo::GetChannelName
       
   275 // Gets Channel name
       
   276 // ---------------------------------------------------------------------------
       
   277 //
       
   278  EXPORT_C const RBuf& CIRSongHistoryInfo::GetChannelName() const
       
   279  {
       
   280  	return iChannelInfo;
       
   281  }
       
   282   // ---------------------------------------------------------------------------
       
   283 // CIRSongHistoryInfo::GetChannelDesc
       
   284 // Gets Channel name
       
   285 // ---------------------------------------------------------------------------
       
   286 //
       
   287  EXPORT_C const RBuf& CIRSongHistoryInfo::GetChannelDesc() const 
       
   288  {
       
   289  	return iChannelDescription;
       
   290  }
       
   291 
       
   292 // ---------------------------------------------------------------------------
       
   293 // CIRSongHistoryInfo::GetImageUrl
       
   294 // Gets Channel image Url
       
   295 // ---------------------------------------------------------------------------
       
   296 //
       
   297  EXPORT_C const RBuf& CIRSongHistoryInfo::GetImageUrl() const 
       
   298  {
       
   299     return iImageUrl;
       
   300  }
       
   301  // ---------------------------------------------------------------------------
       
   302  // CIRSongHistoryInfo::GetGenreName
       
   303  // Get channel genre name
       
   304  // ---------------------------------------------------------------------------
       
   305  //
       
   306  
       
   307 const RBuf& CIRSongHistoryInfo::GetGenreName() const 
       
   308  {
       
   309     return iGenreName;
       
   310  }
       
   311  
       
   312 // ---------------------------------------------------------------------------
       
   313 // CIRSongHistoryInfo::GetCountryName
       
   314 // Get channel country name
       
   315 // ---------------------------------------------------------------------------
       
   316 //
       
   317 const RBuf& CIRSongHistoryInfo::GetCountryName() const 
       
   318  {
       
   319     return iCountryName;
       
   320  }
       
   321  
       
   322 // ---------------------------------------------------------------------------
       
   323 // CIRSongHistoryInfo::GetLanguageName
       
   324 // Get channel language name
       
   325 // ---------------------------------------------------------------------------
       
   326 //
       
   327 const RBuf& CIRSongHistoryInfo::GetLanguageName() const 
       
   328  {
       
   329     return iLanguageName;
       
   330  }
       
   331 
       
   332   // ---------------------------------------------------------------------------
       
   333 // CIRSongHistoryInfo::GetChannelType
       
   334 // Gets Channel Type
       
   335 // ---------------------------------------------------------------------------
       
   336 //
       
   337  EXPORT_C TInt CIRSongHistoryInfo::GetChannelType() const
       
   338  {
       
   339  	return iChannelType;
       
   340  }
       
   341   // ---------------------------------------------------------------------------
       
   342 // CIRSongHistoryInfo::GetChannelId
       
   343 // Gets Channel Id
       
   344 // ---------------------------------------------------------------------------
       
   345 //
       
   346  EXPORT_C TInt CIRSongHistoryInfo::GetChannelId() const
       
   347  {
       
   348  	return iChannelId;
       
   349  }
       
   350  // ---------------------------------------------------------------------------
       
   351 // CIRSongHistoryInfo::GetBitrate
       
   352 // Gets bitrate
       
   353 // ---------------------------------------------------------------------------
       
   354 //
       
   355 EXPORT_C TInt CIRSongHistoryInfo::GetBitrate() const
       
   356 {
       
   357    return iBitrate;
       
   358 }
       
   359   // ---------------------------------------------------------------------------
       
   360 // CIRSongHistoryInfo::GetChannelMusicStatus
       
   361 // Gets Channel MusicStoreStatus
       
   362 // ---------------------------------------------------------------------------
       
   363 //
       
   364  EXPORT_C const RBuf& CIRSongHistoryInfo::GetChannelMusicStatus() const 
       
   365  {
       
   366  	return iMusicStoreStatus;
       
   367  }