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

📄 stkcontainer.h

📁 Mobile STK for Symbian OS V0.1
💻 H
字号:
/*
* ============================================================================
*  Name     : CSTKContainer from STKContainer.h
*  Part of  : STK
*  Created  : 07.02.2006 by Georg Essl
*  Description:
*     Declares container control for application.
*  Version  :
*  Copyright: DTL & TU-Berlin
* ============================================================================
*/

#ifndef STKCONTAINER_H
#define STKCONTAINER_H

// INCLUDES
#include <coecntrl.h>
#include <MdaAudioOutputStream.h>
#include "mda/common/audio.h"
#include <e32des8.h>
#include <e32math.h>
#include "Debug.h"
#include "Stk.h"
#include "Plucked.h"
#include "SineWave.h"
#include "BlowBotl.h"
#include "Saxofony.h"
#include "BandedWG.h"
#include "Flute.h"
#include "Noise.h"
#include "Moog.h"
#include "BeeThree.h"

//#undef DEBUG
#define DEBUG

#define SRATE 8000

#define MAX_INST 8
   
// FORWARD DECLARATIONS
class CEikLabel;        // for example labels


// waveform generator buffer size
//const TInt KBufferSize = 8192;
const TInt KBufferSize = 1024;

enum TStreamAppStatus
{
	ENotReady,
	EReadyToPlay,
	EPlaying,
	EStopped
};
// CLASS DECLARATION

/**
*  CSTKContainer  container control class.
*  
*/
class CSTKContainer : public CCoeControl, MCoeControlObserver, public MMdaAudioOutputStreamCallback
    {
    public: // Constructors and destructor
        
		CSTKContainer();

        /**
        * EPOC default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL(const TRect& aRect);

        /**
        * Destructor.
        */
        ~CSTKContainer();

    public: // New functions
		void PlayL();
		void StopL();
		void Excite ();
		int setInstrument(int);
		void Add();

    public: // Functions from base classes

    private: // Functions from base classes

       /**
        * From CoeControl,SizeChanged.
        */
        void SizeChanged();

       /**
        * From CoeControl,CountComponentControls.
        */
        TInt CountComponentControls() const;

       /**
        * From CCoeControl,ComponentControl.
        */
        CCoeControl* ComponentControl(TInt aIndex) const;

       /**
        * From CCoeControl,Draw.
        */
        void Draw(const TRect& aRect) const;

       	
		/**
		* From MCoeControlObserver
		* Acts upon changes in the hosted control's state. 
		*
		* @param	aControl	The control changing its state
		* @param	aEventType	The type of control event 
		*/
        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
        

		virtual void MaoscOpenComplete(TInt aError);
		virtual void MaoscBufferCopied(TInt aError, const TDesC8& );
		virtual void MaoscPlayComplete(TInt aError);

		TUint8 *FillBuffer();


    private: //data
        
//        CEikLabel* iLabel;          // example label
//        CEikLabel* iToDoLabel;      // example label

		CMdaAudioOutputStream*	iAudioStream;
		TStreamAppStatus iStatus;
		TMdaAudioDataSettings iSettings;
		TUint8* aData1; // buffer 1 for generated pcm waves
		TUint8* aData2; // buffer 2 for generated pcm waves
		TPtr8 iDescBuf;     // a descriptor that encapsulates the two buffers
		TInt time;
		TInt dBuffer;
		int excitation;
		BlowBotl *blowbotl;
		Plucked *plucked;
		Delay *delay;
		Saxofony *sax;
		BandedWG *bwg;
		SineWave sinewave;
		Flute *flt;
		BeeThree *beethree;
		Moog *moog;
		Noise noise;
		int instrument_nr;
    };


#endif

// End of File

⌨️ 快捷键说明

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