/* Copyright (C) 2000 Andy Sherwood (enigmax@home.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Song.cpp : Implementation of CSong #include "stdafx.h" #include "Rio500Remix.h" #include "Song.h" ///////////////////////////////////////////////////////////////////////////// // CSong //********************************************************************************************* // Description: Constructor for CSong // // Returns: Nothing // //********************************************************************************************* CSong::CSong() : m_lNumber(-1), m_wBitmapBlocks(-1), m_lFolder(-1) { } //********************************************************************************************* // Description: Get song name // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::get_Name( BSTR *pVal) // [o] Song name { *pVal = m_bsName.copy(); return S_OK; } //********************************************************************************************* // Description: Put song name // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::put_Name( BSTR newVal) // [i] Song name { m_bsName = newVal; return S_OK; } //********************************************************************************************* // Description: Get song number // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::get_Number( long *pVal) // [o] Song number { *pVal = m_lNumber; return S_OK; } //********************************************************************************************* // Description: Put song number // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::put_Number( long newVal) // [i] Song number { m_lNumber = newVal; return S_OK; } //********************************************************************************************* // Description: Get bitmap as variant. Variant contains a SAFEARRAY of 1536 VT_UI1 elements // which constitute a 786x16x1bpp bitmap // // Returns: Same as VariantCopy // //********************************************************************************************* STDMETHODIMP CSong::get_Bitmap( VARIANT *pVal) // [o] A variant containing a 1536 VT_UI1 element SAFEARRAY { return VariantCopy(pVal, &m_vBitmap); } //********************************************************************************************* // Description: Put bitmap as variant. See description above. // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::put_Bitmap( VARIANT newVal) // [i] A variant containing a 1536 VT_UI1 element SAFEARRAY { m_vBitmap = newVal; return S_OK; } //********************************************************************************************* // Description: Get number of bitmap blocks. A block is an 8x16 rectangle of pixels in the // bitmap. The Rio will scroll only the portion of the song/folder name // represented by these blocks, not the entire 768 pixel name // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::get_BitmapBlocks( WORD *pVal) // [o] Number of bitmap blocks { *pVal = m_wBitmapBlocks; return S_OK; } //********************************************************************************************* // Description: Put number of bitmap blocks. See description above. // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::put_BitmapBlocks( WORD newVal) // [i] Number of bitmap blocks { m_wBitmapBlocks = newVal; return S_OK; } //********************************************************************************************* // Description: Get folder number for this song // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::get_Folder( long *pVal) // [o] Folder number { *pVal = m_lFolder; return S_OK; } //********************************************************************************************* // Description: Put folder number for this song // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::put_Folder( long newVal) // [i] Folder number { m_lFolder = newVal; return S_OK; } //********************************************************************************************* // Description: Get file name (.MP3) for this song // // Returns: // //********************************************************************************************* STDMETHODIMP CSong::get_SongFileName( BSTR *pVal) // [o] Song file name { *pVal = m_bsSongFileName.copy(); return S_OK; } //********************************************************************************************* // Description: Put file name (.MP3) for this song // // Returns: // //********************************************************************************************* STDMETHODIMP CSong::put_SongFileName( BSTR newVal) // [i] Song file name { m_bsSongFileName = newVal; return S_OK; } //********************************************************************************************* // Description: Get size of this song // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::get_Size( long *pVal) // [o] Size on Rio { *pVal = m_lSize; return S_OK; } //********************************************************************************************* // Description: Set size of this song // // Returns: S_OK // //********************************************************************************************* STDMETHODIMP CSong::put_Size( long newVal) // [o] Size on Rio { m_lSize = newVal; return S_OK; }