⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mp3playerstationsprovider.cpp

📁 music player developemntm usic player developemntm usic player developemntmusic player developemnt
💻 CPP
字号:
/*	------------------------------------------------------------------------	Copyright (C) 2000 COMNEON GmbH & Co. OHG. All rights reserved.	------------------------------------------------------------------------	This document contains proprietary information belonging to COMNEON.	Passing on and copying of this document, use and communication of its	contents is not permitted without prior written authorisation.	------------------------------------------------------------------------ */#include "MP3PlayerApplicationPreComp.hpp"#include <Afs/Rfs/RootFileSystem.hpp>#include "MP3PlayerSongsProvider.hpp"/*------------------------------------------------------------------					Provider column description ------------------------------------------------------------------*/static ColumnInfo c_mp3player_stations_provider_colinfo[] = {	{ c_mp3player_songlength,	NumberType },	{ c_mp3player_songtitle,	WStringType },	{ c_invalid_colid,	UndefinedType } // mandatory last entry};/*	------------------------------------------------------------------------	MP3PlayerSongsProvider	------------------------------------------------------------------------ */MP3PlayerSongsProvider::MP3PlayerSongsProvider(){}	// MP3PlayerSongsProvider/*	------------------------------------------------------------------------	~MP3PlayerSongsProvider	------------------------------------------------------------------------ */MP3PlayerSongsProvider::~MP3PlayerSongsProvider(){}	// ~MP3PlayerSongsProvider/*	------------------------------------------------------------------------	Init	------------------------------------------------------------------------ */void MP3PlayerSongsProvider::Init(){	SetColumnInfoTable(c_mp3player_stations_provider_colinfo);	/*FilePtr file = RootFileSystem::GetFile(		Pathname(c_mp3player_stations_file_name), L"ffs");	// The file is considered a radio configuration file and has to exist.	ASSERT_DEBUG(file.Get() != 0);	m_handler.Init(file, &m_commit_record, c_max_mp3player_stations_records);	if (m_handler.GetRowCount() != c_max_mp3player_stations_records) {		MP3PlayerStationsRecord rec;		m_handler.AddRecord(&rec);	}*/}	// Init/*	------------------------------------------------------------------------	GetProviderId	------------------------------------------------------------------------ */INT MP3PlayerSongsProvider::GetProviderId() const { 	return c_mp3player_stations_provider_id; }	// GetProviderId/*	------------------------------------------------------------------------	MaxRowCount	------------------------------------------------------------------------ */INT MP3PlayerSongsProvider::MaxRowCount()  { 	return 255; }	// MaxRowCount/*	------------------------------------------------------------------------	GetDataItem	------------------------------------------------------------------------ */BOOLEAN MP3PlayerSongsProvider::GetDataItem(INT columnid, INT row, DataItem & item){	BOOLEAN rc = ((row >= 0) && (row < m_handler.GetRowCount()));	if(rc){		switch(columnid){			case c_mp3player_songlength:				item.SetNumber(275); // 4m 35s				break;			case c_mp3player_songtitle: {				WString text;				text.Format(L"MP3 song %d", row + 1);				item.SetWString(text);				break;			}			default:				rc = FALSE;		}	}	return rc;}	// GetDataItem/*	------------------------------------------------------------------------	SetDataItem	------------------------------------------------------------------------ */BOOLEAN MP3PlayerSongsProvider::SetDataItem(const DataItem & item, INT columnid){	/*BOOLEAN rc = TRUE;	switch(columnid) {		case c_radio_freq:			m_commit_record.SetRadioFreq((UINT32) item.GetNumber());			break;		default:			rc = FALSE;	}	return rc;*/	return FALSE;}	// SetDataItem/*	------------------------------------------------------------------------	SelectRow	------------------------------------------------------------------------ */BOOLEAN MP3PlayerSongsProvider::SelectRow(INT row){	/*BOOLEAN rc = ((row >= 0) && (row < m_handler.GetRowCount()));	if (rc) {		m_handler.LoadRecord(row, &m_record);		m_commit_record = m_record;		m_status = Provider::updated;	}	return rc;*/	return TRUE;}	// SelectRow/*	------------------------------------------------------------------------	Commit	------------------------------------------------------------------------ */BOOLEAN MP3PlayerSongsProvider::CommitRow(INT row){	/*BOOLEAN rc = ((row >= 0) && (row < m_handler.GetRowCount()));	if (rc) {		rc = m_handler.StoreRecord(row, &m_commit_record);		m_record = m_commit_record;		m_status = Provider::changed;	}	return rc;*/	return TRUE;}	// CommitRow/*	------------------------------------------------------------------------	RowCount	------------------------------------------------------------------------ */INT MP3PlayerSongsProvider::RowCount(){	/*return c_max_mp3player_stations_records;*/	// CALL FUNCTION TO HAVE MP3 FILE COUNT	return 10;}	// RowCount/*	------------------------------------------------------------------------	RestoreFactorySettings	------------------------------------------------------------------------ */void MP3PlayerSongsProvider::RestoreFactorySettings(){	/*MP3PlayerStationsRecord rec;	for(UINT8 i = 0; i < c_max_mp3player_stations_records; i++)		m_handler.StoreRecord(i, &rec);	m_status = Provider::changed;	m_record = rec;*/}	// RestoreFactorySettings/*	------------------------------------------------------------------------	Update	------------------------------------------------------------------------ */BOOLEAN MP3PlayerSongsProvider::Update(ProviderListener * ){	m_status = Provider::updated;	return TRUE;}	// Update

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -