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

📄 oggpluginadaptor.h

📁 OggPlay for Symbian 是symbian上的一个媒体播放程序的源码。它支持ogg,wav等等多媒体格式。
💻 H
字号:
/*
*  Copyright (c) 2004 OggPlay Team
*
*  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.
*/

#include <OggOs.h>
#include <badesca.h>
#include "OggRateConvert.h"  // For TGainType
#include "OggMsgEnv.h"
#include "OggAbsPlayback.h"

#include <MdaAudioSampleEditor.h>
#ifndef MMF_AVAILABLE
#include <e32uid.h>
#include <OggPlayPlugin.h>
#endif

#ifndef OGGPLUGINADAPTOR_H
#define OGGPLUGINADAPTOR_H

class COggPluginAdaptor :  public CAbsPlayback,  public MMdaObjectStateChangeObserver
{
 public: 
  COggPluginAdaptor(COggMsgEnv* anEnv, MPlaybackObserver* anObserver);
  virtual ~COggPluginAdaptor();
  void ConstructL();

  virtual TInt   Info(const TDesC& aFileName, TBool silent= EFalse);
  virtual TInt   Open(const TDesC& aFileName);

  virtual void   Pause();
  virtual void   Resume();
  virtual void   Play();
  virtual void   Stop();
  virtual void   SetVolume(TInt aVol);
  virtual void   SetPosition(TInt64 aPos);

  virtual TInt64 Position();
  virtual TInt64 Time();
  virtual TInt   Volume();
#ifdef MDCT_FREQ_ANALYSER
  virtual const TInt32 * GetFrequencyBins();
#else
  virtual const void* GetDataChunk();
#endif
  virtual void SetVolumeGain(TGainType aGain);
  virtual void GetAudioProperties();
  
  virtual CPluginSupportedList& GetPluginListL(); 

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

  // New Functions
  void SearchPluginsL(const TDesC &aName, TBool isEnabled);
  void OpenL(const TDesC& aFileName);
  void ConstructAPlayerL(const TDesC &aFileName);
  void ParseMetaDataValueL(CMMFMetaDataEntry &aMetaData, TDes & aDestinationBuffer);

private:
  COggMsgEnv*               iEnv;
  
  TFileName iFilename;
  TInt iError;

#ifdef MMF_AVAILABLE
  // RecorderUtility is used instead of PlayerUtility to be able to choose which plugin
  // we will use, in case of conflits (2 codecs supporting same type)
  // The PlayerUtility doesn't allow this choice.
  CMdaAudioRecorderUtility *iPlayer; 
  CActiveSchedulerWait iWait;
  TUid iPluginControllerUID;
  TInt32 iFreqBins[16];
#else
  CPseudoMMFController * iPlayer;
  
  CPseudoMMFController * iOggPlayer;
  CPseudoMMFController * iMp3Player;
  // Use RLibrary object to interface to the DLL
  RLibrary iOggLibrary;
  RLibrary iMp3Library;
#endif

  TTimeIntervalMicroSeconds iLastPosition;
  TBool iInterrupted;
  TInt iVolume;

  TGainType iGain;
};

#endif

⌨️ 快捷键说明

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