亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ansphoneengine.h

?? s60 接打電話代碼,很有學(xué)習(xí)價(jià)值的,可以移植到不同平臺(tái)
?? H
字號(hào):
#ifndef __ANSPHONEENGINE_H__
#define __ANSPHONEENGINE_H__

#include <MdaAudioSampleEditor.h>
#include <mda\common\base.h>
#include "AnsPhoneTimer.h"
#include "AnsPhoneCallWatcher.h"
#include "AnsPhoneCallMaker.h"
#include "AnsPhoneCallLog.h"
#include "AnsPhonePhone.h"

class CAnsPhoneMessageHolder;

_LIT(KAnsPhoneEngine, "CAnsPhoneEngine");
const TInt KNumberMaxLength = 20;


class MAnsPhoneEngineObserver
	{
	public:
		virtual void HandlePlayMessageOverL() = 0;
		virtual void HandleCallChangeL(const RCall::TStatus& aStatus) = 0;
		virtual void HandleNewMessageL() = 0;
	};

/**
*
* @class	CAnsPhoneEngine AnsPhoneEngine.h
* @brief	This can record & play messages
*
*	When recording there is a difference between local messages which is the
*	users voice message and non-local messages which are messages that are being
*	recorded over the telephony line
*
*	When playing there is a difference between local messages which are
*	on the phone and playing to the user and non-local messages which are messages that
*	are being played over the telephony line
*	There is one further difference when playing, in that the message can be either
*	the user's voice message or a message that has been recorded by the answering phone.
*
*	In order to play a message PlayMessageL() is called and the parameters determine if
*	the message is local or non-local, the user's or not and the index into the messages list,
*	if one of those is to be played.
*	In order to record a message RecordMessageL() is called and the parameter determines
*	if the message is local or non-local.
*
*	In order to play/record, a CMdaAudioRecorderUtility object is used.
*	This allows recording to and playing of files, using RecordL() and PlayL().
*
*	There are several stages in recording/playing.
*	The file is opened 1st, when this state is set to either ERecordInit or EPlayInit,
*	using one of the OpenL() functions. This call is asynchronous and when complete
*	MoscoStateChangeEvent() is called. Depending upon the state, the playing/recording
*	is then begun, using either RecordL() or PlayL().
*
*
*	Notes:
*
*	It will be noted that the CMdaAudioRecorderUtility allows playing of files,
*	which would be adequate for playing the user's message locally.
*	However, this class does not also contain any ability to notify an observer
*	when the file stops playing.
*	This is an answering phone and so must know when the file has stopped playing,
*	so that recording can take place.
*	Therefore, we could use a CMdaAudioPlayerUtility to play messages, which takes an observer
*	that would be notified once the file has finished playing.
*
*	Unfortunately, CMdaAudioPlayerUtility does not allow playing to the telephony line,
*	so we're going to stick with the CMdaAudioRecorderUtility and have a timer that will run
*	for the duration of the sound file. When it has finished, this class' TimerCompleteL()
*	function will be called by the timer's RunL(). The recording can then be started.
*
*
*	How the engine stores messages:
*
*	Messages are stored in files.
*	In order to display a message, there are 2 things that need to be known:
*	->	the number of the person that left the message;
*		this is handled by naming the file the message is stored under as the phone number
*	->	the time the message was left
*		this is handled by the time the message file was created
*
*	The engine stores a list of TMessage objects; it constructs this and populates it
*	from the files that are in the "messages" folder, when this object is constructed.
*
*	Because the name of the file is the phone number, if there are multiple messages by the same
*	phone number, there has to be a way to differentiate them. This is done by appending a number to the
*	end of the file, e.g. "07779238045" could become "07779238045 1.wav" or "07779238045 11.wav"
*	depending upon the highest index of the files there. Thus, if there is a "1", "3" and "5", the file
*	would have an index of "6"
*
*
*	How the engine handles telephony
*
*	The engine uses a connection to the telephony server, RTelServer, in order to get handles on
*	lines, phones and calls for accessing calls made using the telephony server. It stores a handle
*	to a voice line, RLine, so that it can pass this to the other call objects that will need it for
*	obtaining RCall handles.
*
*	There are two principle functions that are addressed:
*	->	Answer phone calls
*		This is handled by the CAnsPhoneCallWatcher object. It asks the line to notify it when an
*		call comes in. It alerts the engine (its observer) so that the voice message can be started and then
*		recording begun. Meanwhile the call watcher watches the call until it is hung up, at which
*		point it alerts the engine. It then restarts its line notify so that it waits for another incoming
*		call.
*		When the call is hung up, the CAnsPhoneCallLog object is asked to get the number of the
*		call that just came in. When it completes the message that was just recorded is renamed using
*		the phone number to compose the file name. The request for the phone number completes very
*		quickly and there is no danger that if the user selects the messages list, they will see the
*		messages before the file name has been updated.
*
*	->	Make phone calls
*		This is handled by the CAnsPhoneCallMaker object. It dials a number and waits for that
*		call to be hung up. When it has, it tells the engine (its observer).
*
* Copyright (c) EMCC Software Ltd 2003
* @version	1.0
*
*/

class CAnsPhoneEngine	:	public CBase,
							public MMdaObjectStateChangeObserver,
							public MAnsPhoneTimerObserver,
							public MAnsPhoneCallWatcherObserver,
							public MAnsPhoneCallMakerObserver,
							public MAnsPhoneCallLogObserver
	{
	public:
		enum TState		{ ENoState, ERecordInit, ERecord, EPlayInit, EPlay };

	public:
		class TMessage
			{
			public:
				TMessage()	{ iNumber.Zero(); }
			public:
				TBuf<KNumberMaxLength>	iNumber;	// this includes index, e.g. "07779238045 5"
				TTime					iTime;
			};

	public:
		static CAnsPhoneEngine* NewL(MAnsPhoneEngineObserver& aObserver);
		~CAnsPhoneEngine();

	public:					// MMdaObjectStateChangeObserver
		virtual void MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode);

	public:					// MAnsPhoneTimerObserver
		virtual void TimerCompleteL();

	public:					// MAnsPhoneCallWatcherObserver
		virtual void HandleCallInChangeL(const RCall::TStatus& aStatus);

	public:					// MAnsPhoneCallMakerObserver
		virtual void HandleCallHungUpL();

	public:					// MAnsPhoneCallLogObserver
		virtual void HandlePhoneNumberL(const TDesC& aNumber);

	public:
		void PlayMessageL(TBool aIsLocal, TInt aIndex, TBool aIsUsers);
		void RecordMessageL(TBool aIsLocal);
		void Stop();
		void DeleteMessage(TInt aIndex);

		void AnsweringStartL();
		void AnsweringStop();

		void DialNumberL(TInt aIndex);

	public:
		void TrimIndex(const TDesC& aBuffer, TDes& aNumber, TInt& aIndex);

	public:
		inline const TState& State() const;
		inline const CArrayFixSeg<TMessage>& MessageList() const;

	private:
		CAnsPhoneEngine(MAnsPhoneEngineObserver& aObserver);
		void ConstructL();

	private:
		void MoscoStateChangeEventL(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode);

		void TelStartL();
		void SoundCleanup();
		void TelephonyCleanup();
		void GetNextMessageFileName(TDes& aFileName, const TDesC& aNumber);


	private:
		enum TPanicCode { EWrongState, ERecordInitError, EPlayInitError, EPlayError };
		inline void Panic(TPanicCode aReason) const;

	private:
		MAnsPhoneEngineObserver&	iObserver;
		CMdaAudioRecorderUtility*	iSound;
		TState						iState;
		TBool						iIsLocal;

		// recording message settings
		TMdaFileClipLocation	iMessageLocation;
		TMdaAudioDataSettings	iMessageSettings;
		TMdaWavClipFormat		iMessageFormat;
		TMdaPcmWavCodec			iMessageCodec;

		CAnsPhoneTimer*			iTimer;

		// telephony
		RTelServer					iSession;
		RLine						iLine;
		RAnsPhonePhone				iPhone;
		CAnsPhoneCallWatcher*		iCallWatcher;
		CAnsPhoneCallMaker*			iCallMaker;
		CAnsPhoneCallLog*			iCallLog;


		CArrayFixSeg<TMessage>*		iMessageList;

        RFs                         iFs;
	};

// inline functions
const CAnsPhoneEngine::TState& CAnsPhoneEngine::State() const						{ return iState; }
const CArrayFixSeg<CAnsPhoneEngine::TMessage>& CAnsPhoneEngine::MessageList() const	{ return *iMessageList; }

void CAnsPhoneEngine::Panic(TPanicCode aReason) const								{ User::Panic(KAnsPhoneEngine, aReason); };

#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级搡bbbb搡bbbb| 久久综合久久综合亚洲| 亚洲一区二区三区四区不卡| 69堂成人精品免费视频| 国产精品一卡二卡在线观看| 综合分类小说区另类春色亚洲小说欧美| 在线一区二区三区四区五区| 麻豆久久久久久久| 亚洲日本丝袜连裤袜办公室| 欧美一区二区高清| 色综合天天狠狠| 精品制服美女久久| 樱桃国产成人精品视频| 久久伊人蜜桃av一区二区| 色8久久精品久久久久久蜜| 极品少妇一区二区| 一区二区国产视频| 久久久久一区二区三区四区| 色婷婷狠狠综合| 国产一区二区三区不卡在线观看| 亚洲成人黄色影院| 国产精品理论片在线观看| 日韩一区二区在线看| 91蜜桃免费观看视频| 国产黑丝在线一区二区三区| 亚洲福中文字幕伊人影院| 国产精品久久久一区麻豆最新章节| 欧美精品123区| 色成年激情久久综合| 国产馆精品极品| 麻豆国产欧美日韩综合精品二区| 亚洲激情网站免费观看| 国产农村妇女毛片精品久久麻豆 | 欧美一区二区三区精品| av成人老司机| 国产高清在线观看免费不卡| 天堂在线亚洲视频| 一区二区三区四区乱视频| 国产精品久久久久影院亚瑟| 久久久777精品电影网影网| 日韩视频在线一区二区| 欧美日韩中文一区| 色哟哟一区二区在线观看| 不卡一区二区在线| 波多野结衣中文字幕一区二区三区 | 一区二区三区四区激情| 中文字幕综合网| 亚洲欧洲在线观看av| 国产精品午夜电影| 亚洲国产精品二十页| 中文字幕免费一区| 91精品国产91久久综合桃花| 91精品办公室少妇高潮对白| 97超碰欧美中文字幕| 91视频免费观看| 日本韩国欧美一区二区三区| 色综合天天狠狠| 在线视频观看一区| 91久久精品国产91性色tv| 91麻豆国产福利精品| 91香蕉视频黄| 色综合久久综合| 欧美亚洲日本国产| 制服丝袜在线91| 5月丁香婷婷综合| 日韩欧美中文一区二区| 精品蜜桃在线看| 久久精子c满五个校花| 国产欧美一区二区三区网站| 国产精品家庭影院| 亚洲精品五月天| 亚洲18色成人| 久久国产精品99久久久久久老狼| 久久国产精品免费| 丁香六月综合激情| 色综合久久综合中文综合网| 色又黄又爽网站www久久| 成人av资源在线| 在线免费观看不卡av| 欧美精品色综合| 精品国产乱码久久久久久免费| 久久久精品蜜桃| 中文字幕日韩av资源站| 亚洲韩国一区二区三区| 日韩专区欧美专区| 国产精品亚洲第一| 91国偷自产一区二区三区观看| 欧美日韩你懂的| 精品国产乱码久久久久久闺蜜| 中文字幕第一区二区| 亚洲色欲色欲www| 香港成人在线视频| 国产乱人伦偷精品视频不卡| 99精品国产91久久久久久| 欧美日韩免费观看一区三区| 欧美成人a视频| 中文字幕一区二区不卡| 亚洲1区2区3区视频| 国产乱人伦偷精品视频不卡| 色就色 综合激情| 日韩免费一区二区| 欧美激情一区三区| 日日嗨av一区二区三区四区| 成人网在线播放| 欧美三级蜜桃2在线观看| 久久综合成人精品亚洲另类欧美| 久久久综合视频| 午夜久久福利影院| 99精品视频免费在线观看| 欧美一区二区三区爱爱| 亚洲男同1069视频| 激情图片小说一区| 欧美性感一类影片在线播放| 久久精品水蜜桃av综合天堂| 亚洲国产视频网站| 播五月开心婷婷综合| 欧美va亚洲va国产综合| 亚洲午夜精品网| 不卡av免费在线观看| www国产精品av| 亚洲成av人片一区二区梦乃| 99精品视频在线观看免费| 久久综合色8888| 欧美aaaaaa午夜精品| 91蝌蚪porny九色| 日韩女优电影在线观看| 亚洲制服丝袜av| 国产精品99久久久久| 在线看国产一区二区| 国产精品免费视频网站| 久久99精品国产麻豆婷婷| 欧美日韩一区小说| 一区二区理论电影在线观看| 不卡的电视剧免费网站有什么| 精品国偷自产国产一区| 日韩avvvv在线播放| 欧美色图第一页| 亚洲天堂精品在线观看| 成人美女在线视频| 国产情人综合久久777777| 激情综合一区二区三区| 欧美一级二级三级乱码| 日韩福利视频导航| 欧美丰满一区二区免费视频| 尤物av一区二区| 91亚洲精品久久久蜜桃网站| 国产精品久久久久久久午夜片| 国产一区二区福利| 亚洲精品一区二区三区蜜桃下载| 麻豆精品久久精品色综合| 日韩免费视频线观看| 久久爱www久久做| 欧美一级一区二区| 久久超碰97人人做人人爱| 日韩欧美国产一区二区三区 | 欧美精选一区二区| 天天综合天天做天天综合| 欧美老女人第四色| 日本女人一区二区三区| 欧美一区二区三区啪啪| 久久99久久久欧美国产| 日韩欧美国产麻豆| 国产一区欧美一区| 欧美激情自拍偷拍| 一本色道a无线码一区v| 亚洲在线中文字幕| 欧美一区二区三区在| 久99久精品视频免费观看| 久久蜜桃av一区二区天堂| 国产99久久久国产精品免费看| 国产精品国产自产拍高清av| 在线视频国内自拍亚洲视频| 日本怡春院一区二区| 久久综合网色—综合色88| 成人动漫精品一区二区| 亚洲五月六月丁香激情| 欧美一区二区三区在线观看视频 | 国产揄拍国内精品对白| 国产农村妇女毛片精品久久麻豆| 国产黄色精品网站| 亚洲欧美二区三区| 91精品国产综合久久精品性色 | 国产乱码精品一品二品| 国产欧美日韩三区| 成人av电影在线| 精品剧情在线观看| 99精品国产91久久久久久 | 国产成人午夜电影网| 亚洲午夜精品在线| 国产精品私房写真福利视频| 欧美一区二区黄| 欧美影院一区二区| 成人精品鲁一区一区二区| 性做久久久久久| 亚洲欧美日韩国产综合在线| www日韩大片| 日韩一区二区电影在线| 色婷婷综合久色| 顶级嫩模精品视频在线看| 美女网站在线免费欧美精品|