Initial commit
This commit is contained in:
@@ -0,0 +1,209 @@
|
||||
//---------------------------------------------------------------------------
|
||||
#ifndef RecordFormUnitH
|
||||
#define RecordFormUnitH
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <System.Classes.hpp>
|
||||
#include <Vcl.Controls.hpp>
|
||||
#include <Vcl.StdCtrls.hpp>
|
||||
#include <Vcl.Forms.hpp>
|
||||
#include <Vcl.ExtCtrls.hpp>
|
||||
#include <Vcl.Imaging.pngimage.hpp>
|
||||
#include <Vcl.Imaging.jpeg.hpp>
|
||||
#include "PNGButton.hpp"
|
||||
#include "RecordPanelUnit.h"
|
||||
#include "CommonListboxUnit.h"
|
||||
#include "BackgroundForm.h"
|
||||
#include <Vcl.Buttons.hpp>
|
||||
#include <Vcl.Graphics.hpp>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
class TRecordForm : public TBackgroundForm
|
||||
{
|
||||
__published: // IDE-managed Components
|
||||
// TImage *m_imgRightSide;
|
||||
// TImage *m_imgBk;
|
||||
// TImage *m_imgBottomSide;
|
||||
// TImage *m_imgRightBottomConner;
|
||||
// TImage *m_imgLeftBottomConner;
|
||||
|
||||
TPNGButton *m_btnPrevStep;
|
||||
TPNGButton *m_btnNextStep;
|
||||
|
||||
TPNGButton *m_btnRecord;
|
||||
TPNGButton *m_btnStop;
|
||||
TPNGButton *m_btnPlay;
|
||||
TPNGButton *m_btnPause;
|
||||
|
||||
TPNGButton *m_btnModify;
|
||||
TPNGButton *m_btnBeginPos;
|
||||
TPNGButton *m_btnEndPos;
|
||||
TPNGButton *m_btnWithCompose;
|
||||
RecordPanelUnit::TPanel *m_panelBarsShow;
|
||||
|
||||
Vcl::Extctrls::TPanel *m_panelVolLevel;
|
||||
TImage *m_imgVolLevelBk;
|
||||
TPaintBox *m_pbVolLevel;
|
||||
|
||||
TPNGButton *m_btnShowKeyboard;
|
||||
Vcl::Extctrls::TPanel *m_panelKeyboard;
|
||||
TImage *m_imgKeyboard;
|
||||
TPaintBox *m_pbKeyboard;
|
||||
|
||||
TPNGButton *m_btnVolSpeakerSet;
|
||||
Vcl::Extctrls::TPanel *m_panelSpeakerVolSet;
|
||||
TImage *m_imgSpeakerVolSet;
|
||||
TPNGButton *m_btnSpeakerVolPos;
|
||||
|
||||
TPNGButton *m_btnVolMicrophoneSet;
|
||||
Vcl::Extctrls::TPanel *m_panelMicrophoneVolSet;
|
||||
TImage *m_imgMicVolSet;
|
||||
TPNGButton *m_btnMicrophoneVolPos;
|
||||
|
||||
Vcl::Extctrls::TPanel *m_panelMusicInfo;
|
||||
TImage *m_imgMusicInfoBk;
|
||||
TLabel *m_lblPlayTime;
|
||||
TLabel *m_lblBeat;
|
||||
TLabel *m_lblTempo;
|
||||
TLabel *m_lblKey;
|
||||
TImage *m_imgBreakH;
|
||||
TImage *m_imgBreakR;
|
||||
TImage *m_imgBreakM;
|
||||
TImage *m_imgBreakI;
|
||||
TPNGButton *m_btnKeyChange;
|
||||
CommonListBoxUnit::TListBox *m_lbKeySelect;
|
||||
TPNGButton *m_btnAudioEffect;
|
||||
TPNGButton *m_btnMicSet;
|
||||
TImage *m_imgNotice;
|
||||
|
||||
void __fastcall FormResize(TObject *Sender);
|
||||
void __fastcall StepClick(TObject *Sender);
|
||||
void __fastcall VolLevelPaint(TObject *Sender);
|
||||
void __fastcall ShowKeyboardClick(TObject *Sender);
|
||||
void __fastcall FormCreate(TObject *Sender);
|
||||
void __fastcall KeyboardMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
|
||||
void __fastcall KeyboardPaint(TObject *Sender);
|
||||
void __fastcall KeyboardMouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
|
||||
void __fastcall KeyboardMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
|
||||
void __fastcall BtnVolSetClick(TObject *Sender);
|
||||
void __fastcall ImgVolSetMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
|
||||
void __fastcall BtnVolPosMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
|
||||
void __fastcall BtnVolPosMouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
|
||||
void __fastcall BtnVolPosMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
|
||||
void __fastcall RecordClick(TObject *Sender);
|
||||
void __fastcall StopClick(TObject *Sender);
|
||||
void __fastcall KeyboardMouseEnter(TObject *Sender);
|
||||
void __fastcall KeyboardMouseLeave(TObject *Sender);
|
||||
void __fastcall FormDestroy(TObject *Sender);
|
||||
void __fastcall ModifyClick(TObject *Sender);
|
||||
void __fastcall BarsShowMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
|
||||
void __fastcall BeginPosClick(TObject *Sender);
|
||||
void __fastcall EndPosClick(TObject *Sender);
|
||||
void __fastcall PlayClick(TObject *Sender);
|
||||
void __fastcall FormActivate(TObject *Sender);
|
||||
void __fastcall PauseClick(TObject *Sender);
|
||||
void __fastcall PlayTimeClick(TObject *Sender);
|
||||
void __fastcall BarsShowMouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
|
||||
void __fastcall WithComposeClick(TObject *Sender);
|
||||
void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
|
||||
void __fastcall DeleteBarsClick(TObject *Sender);
|
||||
// void __fastcall BtnKeyChangeClick(TObject *Sender);
|
||||
void __fastcall LBKeySelectMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
|
||||
void __fastcall BarsShowMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift,
|
||||
int X, int Y);
|
||||
void __fastcall FormDeactivate(TObject *Sender);
|
||||
void __fastcall AudioEffectClick(TObject *Sender);
|
||||
void __fastcall MicSetClick(TObject *Sender);
|
||||
void __fastcall BarsShowDblClick(TObject *Sender);
|
||||
void __fastcall KeyChangeMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
|
||||
|
||||
private: // User declarations
|
||||
//音量相关
|
||||
DWORD m_dwLastVol;
|
||||
int m_nVolLevel,
|
||||
m_nSpeakerVolPos,
|
||||
m_nMicrophoneVolPos,
|
||||
m_yPosDragBegin;
|
||||
bool m_bPosDraging;
|
||||
|
||||
//标记是否开始进行重录选择
|
||||
BOOL m_bIsBeginSel;
|
||||
//模拟键盘相关
|
||||
struct {
|
||||
int xPos;
|
||||
TBitmap * pBmp;
|
||||
} m_aKey[12];
|
||||
struct {
|
||||
int x1;
|
||||
int x2;
|
||||
int iKey;
|
||||
} m_aBlackHitTest[5];
|
||||
bool m_bKeyDown;
|
||||
int m_nGroupWidth,
|
||||
m_nWhiteWidth,
|
||||
m_nBlackWidth,
|
||||
m_nBlackHeight,
|
||||
m_iPressGroup,
|
||||
m_iPressKey;
|
||||
|
||||
TBitmap * m_pBmpWhiteDDown,
|
||||
* m_pBmpWhiteLDown,
|
||||
* m_pBmpWhiteRDown,
|
||||
* m_pBmpBlackDown;
|
||||
|
||||
TPngImage * m_imgFirst,
|
||||
* m_imgSecond,
|
||||
* m_imgThird,
|
||||
* m_imgForth;
|
||||
int KeyboardGetPressKey( int X, int Y );
|
||||
|
||||
//录音/播放相关
|
||||
bool m_bFromFile,
|
||||
m_bModifyRecord,
|
||||
m_bAudioModified;
|
||||
int m_iStartBar,
|
||||
m_iLastStartBar,
|
||||
m_iRecordBar;
|
||||
double m_dblStartPoint,
|
||||
m_dblLastStartPoint,
|
||||
m_dblRecordPoint;
|
||||
UINT m_tTimer, m_tAccuracy;
|
||||
|
||||
void ShowPlayTime();
|
||||
void ShowNoticeImg(const int iStepIndex);
|
||||
void ShowKeyboard( bool bShow );
|
||||
void LoadMelodyFromFile();
|
||||
|
||||
//拖动相关
|
||||
int m_iHitBar,m_iHitPoint;
|
||||
int m_iBX;
|
||||
bool m_bDragOrHit;
|
||||
|
||||
void ShowErrorMessage( int errcode );
|
||||
|
||||
MESSAGE void __fastcall OnPlayOver(TMessage &msg);
|
||||
MESSAGE void __fastcall UMMediaTime(TMessage &Message);
|
||||
MESSAGE void __fastcall UMRecordComplete(TMessage &Message);
|
||||
MESSAGE void __fastcall UMRecordVolJust(TMessage &Message);
|
||||
MESSAGE void __fastcall UMSetFontPosition(TMessage &msg);
|
||||
MESSAGE void __fastcall UMHidePopControl(TMessage &msg);
|
||||
// MESSAGE void __fastcall WMEraseBkgnd(Winapi::Messages::TWMEraseBkgnd &Message);
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP
|
||||
MESSAGE_HANDLER(MSG_MEDIATIME, TMessage, UMMediaTime)
|
||||
MESSAGE_HANDLER(MSG_RECORD_COMPLETE, TMessage, UMRecordComplete)
|
||||
MESSAGE_HANDLER(MSG_RECORD_VOLJUST, TMessage, UMRecordVolJust)
|
||||
MESSAGE_HANDLER(MSG_PLAY_END, TMessage, OnPlayOver)
|
||||
MESSAGE_HANDLER(UM_SETFONTPOSITION, TMessage, UMSetFontPosition)
|
||||
MESSAGE_HANDLER(UM_HIDEPOPCONTROL, TMessage, UMHidePopControl)
|
||||
MESSAGE_HANDLER(WM_ERASEBKGND, TWMEraseBkgnd, WMEraseBkgnd)
|
||||
END_MESSAGE_MAP(TForm)
|
||||
|
||||
public: // User declarations
|
||||
__fastcall TRecordForm(TComponent* Owner);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
extern PACKAGE TRecordForm *RecordForm;
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
Reference in New Issue
Block a user