1631 lines
65 KiB
C
1631 lines
65 KiB
C
//---------------------------------------------------------------------------
|
||
#ifndef GlobalUnitH
|
||
#define GlobalUnitH
|
||
|
||
//---------------------------------------------------------------------------
|
||
#include "ProCommon.h"
|
||
#include "Instruments.h"
|
||
#include "MessageDef.h"
|
||
#include "Compose.h"
|
||
#include "AudioTrack.h"
|
||
|
||
/***************************************************************************************/
|
||
// 全局定义
|
||
/***************************************************************************************/
|
||
#ifdef _LITE_
|
||
#define SOFTWARE_ID e_Pro_Lite
|
||
#else
|
||
#define SOFTWARE_ID e_Pro_Windows
|
||
#endif
|
||
#define APPNAME "唱作魔方专业版\0"
|
||
#define MAX_PATH 260
|
||
|
||
#define DLLAPI __stdcall
|
||
|
||
#define CS_VERSION MAKELONG( 3, 4 )
|
||
#define MM_VERSION MAKELONG( 2, 2 )
|
||
#define CM_VERSION MAKELONG( 3, 1 )
|
||
|
||
#define STATE_HEIGHT 40 //Main窗口底部高度
|
||
#define PANEL_TOP 74 //Main窗口顶部高度
|
||
|
||
#define URL_HOMEPAGE 0 //网站主页
|
||
#define URL_USERCENTER 1 //用户中心页
|
||
#define URL_SONGMANAGE 2 //歌曲管理页
|
||
#define URL_SOFTWARE 3 //软件下载页
|
||
#define URL_USERNOTICE 4 //用户消息页
|
||
#define URL_TECHFORUM 5 //技术论坛
|
||
#define URL_SHAREPLAY 6 //分享播放页
|
||
#define URL_JASONQUERY 7 //JASON
|
||
#define URL_RECHARGE 8 //充值页
|
||
#define URL_VIPMEMBER 9 //VIP会员页
|
||
#define URL_SONGPLAY 10 //歌曲播放页
|
||
#define URL_COINSPEC 11 //唱作音符说明页
|
||
#define URL_EXTFONT 12 //扩展音色库下载页
|
||
#define URL_USERAGREEMENT 13 //用户协议页
|
||
#define URL_REGCODE 14 //注册验证码接口
|
||
#define URL_RESETPASS 15 //重置密码页
|
||
|
||
#define CELL_ABSORB_WIDTH 5
|
||
#define CHORD_WHOLE_BAR 1
|
||
#define CHORD_HALF_BAR 0
|
||
#define ID_INITIAL_BAR 1
|
||
//#define CHORD_TYPE_NUM 4
|
||
#define KEY_NUM 12
|
||
|
||
#define COMPOSE_INTRO_1 0x100 //前奏1
|
||
#define COMPOSE_ENDING_1 0x110 //尾奏1
|
||
|
||
#define MAX_INTRO_NUM 4
|
||
#define MAX_ENDING_NUM 4
|
||
#define STAGE_FILL_NUM 4
|
||
#define STAGE_VAR_NUM 4
|
||
|
||
#define PAGE_RECORDONLY 0x2
|
||
#define PAGE_SETUPRECORD 0x3
|
||
#define PAGE_COMPLETEONLY 0x10
|
||
#define PAGE_ALL 0x1F
|
||
|
||
#define LIST_RAWAUDIO 0x01
|
||
#define LIST_OPUSAUDIOS 0x02
|
||
#define LIST_THEME 0x10
|
||
#define LIST_OPUSSTAGES 0x20
|
||
#define LIST_UNDO 0x40
|
||
#define LIST_ALL 0xFF
|
||
|
||
#define TIMER_ACCURACY 1
|
||
#define TIMER_PLAY_INTERVAL 25 //媒体时间间隔
|
||
#define POINT_RECORD_BLANK 2 //录音延迟2个点(50ms)
|
||
#define TIME_HINT 500
|
||
#define CHANNEL_MELODY 0
|
||
#define MELODY_DEF_VOLUMN 90
|
||
#define MIDI_EVENT_INSTRUMENT 2
|
||
#define MIDI_EVENT_VOLUME 12
|
||
|
||
#define INPUT_TYPE_UNDEF 0x00
|
||
#define INPUT_TYPE_DIGITAL 0x01
|
||
#define INPUT_TYPE_LINE 0x02
|
||
#define INPUT_TYPE_MIC 0x03
|
||
#define INPUT_TYPE_SYNTH 0x04
|
||
#define INPUT_TYPE_CD 0x05
|
||
#define INPUT_TYPE_PHONE 0x06
|
||
#define INPUT_TYPE_SPEAKER 0x07
|
||
#define INPUT_TYPE_WAVE 0x08
|
||
#define INPUT_TYPE_AUX 0x09
|
||
#define INPUT_TYPE_ANALOG 0x0a
|
||
|
||
#define SAVE_PROJECT 0x100
|
||
#define SAVE_COMPOSE 0x200
|
||
#define SAVE_AUDIO 0x400
|
||
#define SAVE_ALL 0x700
|
||
|
||
#define TYPE_BASECOMPOSE 0x01
|
||
#define TYPE_COMPOSE 0x02
|
||
#define TYPE_AUDIO 0x04
|
||
#define TYPE_SONG 0x08
|
||
#define TYPE_BEAT 0x10
|
||
#define TYPE_AUDIO_BASECOMPOSE 0x05
|
||
#define TYPE_SONG_COMPOSE 0x0A
|
||
#define TYPE_MUTEBEAT 0x100
|
||
#define TYPE_LOOPPLAY 0x200
|
||
#define TYPE_PREDEFINE 0x400
|
||
#define TYPE_AUDIOFX 0x800
|
||
|
||
#define MAX_RECENT_PROJECT 6
|
||
#define MAX_MENU_STRLEN 80
|
||
|
||
#define AUTOSAVE_FILENAME "temp\\~last.sav"
|
||
|
||
#define FILETYPE_CPJ 0
|
||
#define FILETYPE_MP3 1
|
||
#define FILETYPE_WAVE 2
|
||
#define FILETYPE_MIDI 3
|
||
|
||
#define VIEW_INIT 0
|
||
#define VIEW_TRACK 1
|
||
#define VIEW_CHORD 2
|
||
#define VIEW_STYLE 3
|
||
|
||
#define STOP_SELF 0x00
|
||
#define STOP_CONTENT 0x01
|
||
#define STOP_USESTYLE 0x02
|
||
#define STOP_PRESTYLE 0x04
|
||
#define STOP_AUDSTYLE 0x08
|
||
#define STOP_ALL 0x0F
|
||
|
||
#define SAFE_FREE(p) { if(p) { free(p); (p)=NULL; } }
|
||
#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
|
||
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
|
||
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
|
||
|
||
#ifdef _LITE_
|
||
#define REGKEY_SOFTWARE L"SOFTWARE\\iChangzuo\\AC_ProLite"
|
||
#else
|
||
#define REGKEY_SOFTWARE L"SOFTWARE\\iChangzuo\\AC_Pro"
|
||
#endif
|
||
#define REGKEY_AUTOLOG L"{0DF44EAA-FF21-4412-828E-260A8728E7F1}"
|
||
|
||
#define VST_DIRNAME L"VSTPlugins\\"
|
||
|
||
/***************************************************************************************/
|
||
// 全局常量
|
||
/***************************************************************************************/
|
||
extern const char *g_strDefaultSoundSet,
|
||
*g_strSoundSetExt,
|
||
*g_strMelodyKey[KEY_NUM],
|
||
*g_strTimeSignature[4],
|
||
*g_strTSName[4],
|
||
*g_strSegment[4],
|
||
*NAME_SEG[4],
|
||
*g_strIntro[MAX_INTRO_NUM],
|
||
*g_strEnding[MAX_ENDING_NUM],
|
||
*g_strStage,
|
||
*g_strStageVar[STAGE_VAR_NUM],
|
||
*g_strFill[STAGE_FILL_NUM];
|
||
|
||
/***************************************************************************************/
|
||
// 全局变量
|
||
/***************************************************************************************/
|
||
#define MAX_FONTS_NUM 128
|
||
#define MAX_VST_NUM 64
|
||
|
||
extern STYLELIST g_aOriginStyles,
|
||
g_aLocalStyles,
|
||
g_aShareStyles,
|
||
g_aTempStyles,
|
||
g_aCollectStyles,
|
||
g_aRecomStyles;
|
||
|
||
extern FONTINFOLIST g_lstFonts; //通用音色库列表
|
||
extern FONTINFO* g_lstCZFonts[18]; //扩展音色库
|
||
extern VSTINFOLIST g_lstVSTFx, //VST音效列表
|
||
g_lstVSTi; //VSTi音色库列表
|
||
|
||
extern wstring g_strVSTPath, // VST路径
|
||
g_strVSTiPath, // VSTi路径
|
||
g_strLastSavePath, // 上次保存音乐文件路径
|
||
g_strLastImportFile, // 上次导入旋律文件名
|
||
g_strExecutePath, // 执行文件路径
|
||
g_strUserPath, // 用户路径
|
||
g_strExtFontsPath, // 扩展音色库路径
|
||
g_strSegImportPath; // 导入片段路径
|
||
|
||
|
||
extern char g_strTxtFontName[20], //缺省字体名称
|
||
g_strSoundFont[80], //全局音色库名称
|
||
g_strCurrentVersion[20],
|
||
g_strServerURL[256],
|
||
g_strPlaybackDevice[256], //指定输出设备名
|
||
g_strRecordDevice[256]; //指定录音设备名
|
||
|
||
extern int g_idFont, // 选定音色库序号
|
||
g_iMelodyTimeSignature, // 主旋律拍号
|
||
g_nMelodyTempo, // 主旋律速度
|
||
g_nChordNumPerBar, // 每小节和弦数
|
||
g_nBPM, // 每小节拍数
|
||
g_nPPB, // 每拍点数
|
||
|
||
g_iToolPanelShow, // 工具面板显示方式(0=右边,1=左边, 2=隐藏)
|
||
g_iLastSaveOption, // 上次保存选项
|
||
g_iLastSaveType, // 上次保存文件格式
|
||
g_iViewMode, // 视图模式
|
||
g_iWindowState, // 上次窗口模式
|
||
g_iPlaybackDevice, // 指定播放设备号
|
||
g_iPlaybackOutput, // 指定播放输出源
|
||
g_iRecordDevice, // 指定录音设备号
|
||
g_iRecordInput, // 指定设备输入源
|
||
g_nRecordChannels, // 录音通道数
|
||
g_iPreStageDefault, // 用户预设段落模式
|
||
g_iSegColorMode, // 段落色彩模式(0=风格段号,1=轨道数)
|
||
|
||
g_arrIntroBarNum[MAX_INTRO_NUM],//全局风格前间奏小节数
|
||
g_arrEndingBarNum[MAX_ENDING_NUM]; //全局风格尾奏小节数
|
||
|
||
extern float g_fRecordVolume, //录音音量
|
||
g_fSpeakerVolume; //播放音量
|
||
|
||
extern double g_dblStep, //播放步长
|
||
g_dblTimePerBar; //每小节时间(毫秒)
|
||
|
||
extern bool g_bRecordAutoAdjust, //录音自动音量调节
|
||
g_bRecordMoniter, //启用录音监听
|
||
g_bShowRecordHint, //噪音侦测提示
|
||
g_bUpdateMandatory, //客户端需要强制更新
|
||
g_bMidiMelody, //导入MIDI旋律
|
||
g_bWeakup, //旋律弱起
|
||
g_bShowPlayTick, //显示小节节拍或时间
|
||
g_bPredefine, //预设工程(不自动编曲/接唱)
|
||
// g_bSongSaved, //全曲已保存
|
||
g_bRecProtect, //内录保护
|
||
g_bShowProtectMsg, //是否显示内录保护消息
|
||
g_bShowVSTPath, //是否提示设置VST路径
|
||
g_bAlphaKey, //false,罗马,true,英文
|
||
g_bAutoSave, //自动保存
|
||
g_bAutoDownloadStyle, //自动下载风格
|
||
g_bAutoOpenProject, //自动打开上次工程
|
||
g_bAutoOpenProjectEnable,//自动打开上次工程使能
|
||
g_bProjStylePaid, //工程风格支付更改
|
||
g_bPrebeat, //使用预设风格节拍提示
|
||
g_bExtFontUsable, //扩展音色库可用
|
||
g_bExtFont; //使用扩展音色库
|
||
|
||
//extern int g_aAudioEffects[MAX_FX_NUM], //启用的音效
|
||
//
|
||
//extern DWORD g_iMacAddressNum; //mac地址个数
|
||
extern vector<char *> g_lstMacAddress; //mac地址regedit
|
||
//extern vector<char *> g_lstMacAddressNew;
|
||
|
||
extern const String g_strTable[],
|
||
g_strAlphaTable[];
|
||
|
||
extern UINT g_xDpi, g_yDpi; //High DPI 自适应
|
||
extern int g_szFont7,
|
||
g_szFont8,
|
||
g_szFont9,
|
||
g_szFont10,
|
||
g_szFont11,
|
||
g_szFont12,
|
||
g_szFont16;
|
||
/***************************************************************************************/
|
||
// 全局函数
|
||
/***************************************************************************************/
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
// 风格处理函数段
|
||
//
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CM_GetVersion)();
|
||
//功 能:获取版本信息
|
||
//输 入:无
|
||
//返回值:版本号 LOWORD=major, HIWORD=minor
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*CM_Initialize)();
|
||
//函数名: Initialize
|
||
//功 能: 模块初始化
|
||
//返 回 值: 成功返回0, 否则返回错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*CM_Release)();
|
||
//功 能:释放对象
|
||
//输 入:无
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI bool (*CM_CheckStyle) ( UINT idLoc, UINT idStyle );
|
||
//函数名: CheckStyle
|
||
//功 能: 检测模板的可用性
|
||
//输 入: 风格ID
|
||
//返 回: 成功返回true,失败返回false
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CM_GetStyleRecomIDs)( int iTS, DWORD aStyleIDs[], int *nIDNum );
|
||
//函数名: GetStyleRecomIDs
|
||
//功 能: 获取推荐风格号
|
||
//输 入:
|
||
//返 回: 成功返回0,否则为错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CM_GetStyleInfo)( UINT idLoc, UINT idStyle, TPROSTYLE* tStyle );
|
||
//函数名: GetStyleInfo
|
||
//功 能: 获取指定ID的信息
|
||
//输 入:
|
||
//返 回: 成功返回0,否则为错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CM_GetStyleInfos)( int iType, int iTS, TPROSTYLE aStyleInfos[], int *nInfoNum );
|
||
//函数名: GetStyleInfos
|
||
//功 能: 获取指定节拍的风格信息列表
|
||
//输 入:
|
||
// iType 风格类别 1=发布 2=本地 3=分享
|
||
//返 回: 成功返回0,否则为错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CM_SetMelodyNotes)( int nNoteNum, BYTE aNotes[], WORD aTicks[],
|
||
int nTPB, int iTS, int nTempo );
|
||
//功 能: 针对音符输入,设置音符数组、拍号、TPB等
|
||
//输 入:
|
||
// nNoteNum 音符数组大小
|
||
// aNotes 音符数组
|
||
// aTicks 音符时长数组
|
||
// nTPB 每拍tick数
|
||
// iTS 拍号
|
||
// nTempo 速度
|
||
//返 回: 错误号
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI HRESULT (*CM_AutoChords)( int iKey, int* nBarNum, void* aChords,
|
||
int* nStageNum, int aStages[]);
|
||
//功 能:自动配置段落及和弦
|
||
//输 入:iKey 指定调号
|
||
// nBarNum/aChords和弦小节数组
|
||
// nStageNum/aStages段落数组
|
||
//返回值:错误号
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI HRESULT (*CM_Compose)( int* buffLen, BYTE buffer[], int ts, int tempo,
|
||
int nStageNum, void* aStages,
|
||
bool bSave, int* lenNotes, BYTE notes[] );
|
||
//函数名: Compose
|
||
//功 能: 按指定曲式结构编曲
|
||
//输 入:
|
||
// buffLen/buffer 块内存长度/地址
|
||
// ts/tempo指定节拍速度
|
||
// nStageNum 曲式分段数
|
||
// aStages 曲式分段数组 公用TStage类型
|
||
// bSave 用于播放/保存
|
||
// lenNotes/notes 获取轨道音符的长度/地址
|
||
// bSave 用于播放/保存
|
||
//返 回: 成功返回0, 否则返回错误号
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI UINT (*CM_GetNextLocalID)();
|
||
//函数名: GetNextLocalID
|
||
//功 能: 获取下一个本地风格序号
|
||
//输 入:
|
||
//返 回: 返回序号
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI int (*CM_SaveLocalStyle)( TPROSTYLE* pInfo );
|
||
//函数名: SaveLocalStyle
|
||
//功 能: 保存本地风格
|
||
//输 入:
|
||
// pStyleINfo 风格信息 idLoc/idStyle=0自动分配ID, 否则覆盖
|
||
//返 回: 成功返回0,否则为错误号
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI int (*CM_ChangeLocalStyle)( TPROSTYLE* pInfo );
|
||
//函数名: ChangeLocalStyle
|
||
//功 能: 修改本地风格信息
|
||
//输 入:
|
||
// pStyleINfo 风格信息
|
||
//返 回: 成功返回0,否则为错误号
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI int (*CM_DeleteLocalStyle)( UINT idLoc, UINT idStyle );
|
||
//函数名: DeleteLocalStyle
|
||
//功 能: 删除本地风格
|
||
//输 入: idLoc/idStyle 指定风格ID,0=自动分配ID
|
||
//返 回: 成功返回0,否则为错误号
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI int (*CM_AddTempSegment)( UINT idLoc, UINT idStyle, char* strFileName,
|
||
int iTS, int iTempo, int iSegType,
|
||
int& iSegNo, int& errCode, char tracks[16][3] );
|
||
//函数名: AddTempSegment
|
||
//功 能: 添加临时风格片段
|
||
//输 入: idLoc/idStyle 可能覆盖的风格ID
|
||
// strFileName MIDI文件名
|
||
// iTS 节拍
|
||
// iTempo 速度
|
||
// iSegType 片段类型
|
||
// iSegNo [in][out]片段号
|
||
// errCode [out]文件错误编码
|
||
// tracks [out]片段轨道信息
|
||
//返 回: 成功返回小节数,否则返回-1
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI void (*CM_DeleteTempSegment)( UINT idLoc, UINT idStyle, int iSegType, int iSegNo );
|
||
//函数名: DeleteTempSegment
|
||
//功 能: 删除临时风格片段
|
||
//输 入: idLoc/idStyle 风格ID
|
||
// iSegType 片段类型
|
||
// iSegNo 片段号
|
||
//返 回: 无
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI void (*CM_DeleteTempStyle)( UINT idStyle );
|
||
//函数名: DeleteTempStyle
|
||
//功 能: 删除临时风格
|
||
//输 入: idStyle 风格ID
|
||
//返 回: 无
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI int (*CM_ProjBackupStyle)( UINT idLoc, UINT idStyle, int nSegNum, WORD aSeg[][2],
|
||
int& lenMem, BYTE* pMem );
|
||
//函数名: BackupProjStyle
|
||
//功 能: 本地风格工程备份
|
||
//输 入: idLoc/idStyle 风格ID
|
||
// nSegNo 备份片段数
|
||
// aSeg[] 备份片段数组(LOWORD片段类型,HIWORD片段号)
|
||
// lenMem/pMen 内存区及大小
|
||
//返 回: 成功返回0,失败返回错误号
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI int (*CM_ProjRestoreStyle)( int lenMem, BYTE* pMem );
|
||
//函数名: BackupProjStyle
|
||
//功 能: 工程恢复为临时风格
|
||
//输 入: idLoc/idStyle 待恢复的风格ID
|
||
// nSegNo 备份片段数
|
||
// aSeg[] 备份片段数组(LOWORD片段类型,HIWORD片段号)
|
||
// lenMem/pMen 内存区及大小
|
||
//返 回: 成功返回临时风格ID,失败返回负数
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI int (*CM_GetCollectionIDs)( int iTS, int& nIDNum, UINT aID[][2] );
|
||
//函数名: GetCollectionIDs
|
||
//功 能: 获取收藏等风格ID
|
||
//输 入:
|
||
// iTS 节拍
|
||
// nIDNum 返回风格个数
|
||
// aIDs存放风格ID的数组
|
||
//返 回: 成功返回0,否则为错误号
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
//---------------------------------------------------------------------------------------------
|
||
typedef DLLAPI int (*CM_SetCollectionStyle)( bool bSet, UINT idLoc, UINT idStyle );
|
||
//函数名: SetCollectionStyle
|
||
//功 能: 设置收藏风格
|
||
//输 入:
|
||
// bSet 设置/取消收藏
|
||
//---------------------------------------------------------------------------------------------
|
||
|
||
///////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (* CM_MakeStyle)( UINT idLoc, UINT idStyle, TMAKESTYLEINFO *pStyleInfo,
|
||
int &nBufferLen, BYTE* pBuffer );
|
||
//函数功能: 生成风格文件.
|
||
//参 数:
|
||
// idLoc/idStyle 本地风格ID
|
||
// stAuthorInfo 相关信息
|
||
// nBufferLen 返回风格文件长度
|
||
// pBuffer 接收风格文件数据的缓冲区,外部分配,外部释放
|
||
//返 回 值: 成功返回0, 否则返回错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
extern CM_GetVersion f_CM_GetVersion;
|
||
extern CM_Initialize f_CM_Initialize;
|
||
extern CM_Release f_CM_Release;
|
||
extern CM_CheckStyle f_CM_CheckStyle ;
|
||
extern CM_GetStyleRecomIDs f_CM_GetStyleRecomIDs;
|
||
extern CM_GetStyleInfo f_CM_GetStyleInfo;
|
||
extern CM_GetStyleInfos f_CM_GetStyleInfos;
|
||
extern CM_SetMelodyNotes f_CM_SetMelodyNotes;
|
||
extern CM_AutoChords f_CM_AutoChords;
|
||
extern CM_Compose f_CM_Compose;
|
||
extern CM_GetNextLocalID f_CM_GetNextLocalID;
|
||
extern CM_SaveLocalStyle f_CM_SaveLocalStyle;
|
||
extern CM_ChangeLocalStyle f_CM_ChangeLocalStyle;
|
||
extern CM_DeleteLocalStyle f_CM_DeleteLocalStyle;
|
||
extern CM_AddTempSegment f_CM_AddTempSegment;
|
||
extern CM_DeleteTempSegment f_CM_DeleteTempSegment;
|
||
extern CM_DeleteTempStyle f_CM_DeleteTempStyle;
|
||
extern CM_ProjBackupStyle f_CM_ProjBackupStyle;
|
||
extern CM_ProjRestoreStyle f_CM_ProjRestoreStyle;
|
||
extern CM_GetCollectionIDs f_CM_GetCollectionIDs;
|
||
extern CM_SetCollectionStyle f_CM_SetCollectionStyle;
|
||
extern CM_MakeStyle f_CM_MakeStyle;
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
// MediaModule函数段
|
||
//
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_GetVersion)();
|
||
//功 能:获取模块版本号
|
||
//输 入:无
|
||
//返回值:版本号 LOWORD=major, HIWORD=minor
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_InitialObjects) ( HWND hWnd, char* strRoot );
|
||
//功 能:初始化DirectMusic对象
|
||
//输 入:hWnd 函数调用窗口句柄
|
||
// strRoot 应用程序根目录
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_DestroyObjects) ();
|
||
//功 能:释放对象
|
||
//输 入:无
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
typedef DLLAPI HRESULT (*MM_GetFontInfo)( char* strFileName, char* strFontName,
|
||
int* nInst, void* setInsts,
|
||
int* nDrum, void* setDrums );
|
||
//功 能:获取音色库信息
|
||
//输 入:[IN] strFileName 音色库文件名
|
||
// [OUT]strFontName 音色库名称
|
||
// [OUT]nInst 乐器音色数(bank=0)
|
||
// [OUT]setInsts 乐器音色信息
|
||
// [OUT]nDrum 鼓组音色数(bank=128)
|
||
// [OUT]setDrums 鼓组音色信息
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
/*typedef DLLAPI HRESULT (*MM_SetFont)( char* strFileName );
|
||
//功 能:设置音色库
|
||
//输 入:strFileName 音色库文件名
|
||
//返回值:错误号
|
||
*/
|
||
typedef DLLAPI HRESULT (*MM_SetDefaultFont)( int num, char strFiles[][256] );
|
||
//功 能:设置缺省音色库
|
||
//输 入:
|
||
// num 文件数
|
||
// strFile 音色库文件名数组
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_GetVSTInfo)( char* strFileName, char* strEffName, DWORD& uniqueID,
|
||
int& nPlugins, char strPlugins[][64], UINT idPlugins[] );
|
||
//功 能:获取VST信息
|
||
//输 入:[IN] strFileName VST文件名
|
||
// [OUT]strVSTName VST名称
|
||
// [OUT]uniqueID VST id
|
||
// [INOUT]nPlugins, strPlugins, idPlugins Shell类plugin信息
|
||
//返回值:VST类型 1=VST, 2=VSTi, 4=Shell, 0=无效
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_LoadVSTi)( int iBank, char* strFontFile );
|
||
//功 能:加载VSTi音色库
|
||
//输 入:
|
||
// iBank 音源号
|
||
// strFontFile 音源文件名
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_GetVSTiPrograms)( int iBank, char chan[], char name[][64] );
|
||
//功 能:获取VSTi音色库的音色
|
||
//输 入:
|
||
// iBank 音源号
|
||
// chan 有效通道号
|
||
// name 有效音色名
|
||
//返回值:有效音色数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_HandleVSTiPreset)( int iBank, int& len, BYTE* mem, bool bLoad );
|
||
//功 能:处理VSTi音色库的当前配置(压缩)
|
||
//输 入:
|
||
// iBank 音源号
|
||
// len 数据长度
|
||
// mem 数据块
|
||
// bLoad 加载或保存
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_LoadMidiMelody)( HWND hNotifyWnd, LPCSTR strFileName );
|
||
//功 能:从MIDI文件获取旋律
|
||
//输 入:hNotifyWnd 接收进度消息的窗口句柄
|
||
// strFileName MIDI文件名
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_LoadCompose)( int iFile, LPBYTE lpData, DWORD dwDataSize, int iFont, char* strFontFile );
|
||
//功 能:加载编曲数据
|
||
//输 入:
|
||
// iFile MIDI文件号
|
||
// lpData MIDI数据
|
||
// dwDataSize 数据大小
|
||
// iFont 音源号
|
||
// strFontFile 音源文件名
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI void (*MM_FreeComposes)();
|
||
//功 能:清空编曲数据
|
||
//输 入:
|
||
//返回值:无
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_LoadPrebeat) ( LPBYTE lpData, DWORD dwDataSize );
|
||
//功 能:准备节拍提示数据
|
||
//输 入:lpData 节拍数据
|
||
// dwDataSize 数据大小
|
||
//返回值:错误返回0
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_Play)( HWND hNotifyWnd, DOUBLE dblStartPoint, int iType );
|
||
//功 能:播放
|
||
//输 入:hNotifyWnd 接收播放消息的窗口句柄
|
||
// dwStartPoint 开始位置
|
||
// iChans 播放的通道类型
|
||
// TYPE_BASECOMPOSE=0x01, TYPE_COMPOSE=0x02, TYPE_AUDIO=0x04, TYPE_SONG=0x08
|
||
// TYPE_BEAT=0x10 TYPE_AUDIO_BASECOMPOSE=0x05, TYPE_SONG_COMPOSE=0x0A,
|
||
// TYPE_AUDIOFX=0x800
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_Stop)();
|
||
//功 能:停止播放
|
||
//输 入:
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_CheckIODevice)( int& iOutDevice, char* strOutName,
|
||
int& iInDevice, char* strInName );
|
||
//功 能:检查输入输出设备
|
||
//输 入:
|
||
// iOutDevice 输出设备号
|
||
// strOutName 输出设备名
|
||
// iInDevice 输入设备号
|
||
// strInName 输入设备名
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetIODevice)( int& iPlayDevice, int& iOutput,
|
||
int& iRecDevice, int& iInput );
|
||
//功 能:设置当前录音设备,失败则返回缺省设备
|
||
//输 入:
|
||
// iPlayDevice 播放设备号
|
||
// iOutput 播放输出源
|
||
// iRecDevice 录音设备号
|
||
// iInput 录音输入源
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_GetPlaybackDeviceInfo)( int nSize, PVOID arrInfo );
|
||
//功 能:获取播放设备信息
|
||
//输 入:nSize 数组大小
|
||
// arrInfo 设备信息数组
|
||
//返回值:设备数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_GetPlaybackOutputInfo)( int nSize, PVOID arrInfo );
|
||
//功 能:获取输出源信息
|
||
//输 入:iDevice 设备号
|
||
// nSize 数组大小
|
||
// arrInfo 输入源信息数组
|
||
//返回值:设备数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_GetRecordDeviceInfo)( int nSize, PVOID arrInfo );
|
||
//功 能:获取录音设备信息
|
||
//输 入:nSize 数组大小
|
||
// arrInfo 设备信息数组
|
||
//返回值:设备数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_GetRecordInputInfo)( int nSize, PVOID arrInfo );
|
||
//功 能:获取输入源信息
|
||
//输 入:iDevice 设备号
|
||
// nSize 数组大小
|
||
// arrInfo 输入源信息数组
|
||
//返回值:设备数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_RecordTest)( HWND hNotifyWnd );
|
||
//功 能:录音测试
|
||
//输 入:
|
||
// hNotifyWnd 测试窗口
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetRecordAutoAdjust)( bool bAutoAdjust );
|
||
//功 能:设置自动调节录音音量
|
||
//输 入:bAutoAdjust 自动调节
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetRecordMoniter)( bool bMoniter );
|
||
//功 能:设置录音监听
|
||
//输 入:bMoniter 是否监听
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_GetMidiInBuffer)();
|
||
//功 能:获取MIDI输入缓冲大小
|
||
//输 入:
|
||
//返回值:当前缓冲(ms)
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetMidiInBuffer)( int msLen );
|
||
//功 能:设置MIDI输入缓冲大小
|
||
//输 入:
|
||
// msLen 缓冲大小(ms)
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetRecordProtect)( bool bProtect );
|
||
//功 能:设置内录保护
|
||
//输 入:bProtect 内录保护
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetRecordChannels)( int nChannels );
|
||
//功 能:设置录音通道数
|
||
//输 入:nChannels 通道数 2=立体声, other=单通道
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_ShowAsioPanel)();
|
||
//功 能:显示ASIO控制面板
|
||
//输 入:
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_RestartAsioDevice)();
|
||
//功 能:重启ASIO设备
|
||
//输 入:
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_LoadAudio) ( HWND hNotifyWnd, LPCSTR strAudioFile, int iFileType,
|
||
int iTS, int iTempo );
|
||
//功 能:从WAV文件获取旋律
|
||
//输 入:strAudioFile 文件名
|
||
// iFileType 文件类型(FILETYPE_WAVE/FILETYPE_MP3)
|
||
// iTS 拍号
|
||
// iTempo 速度
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_Save)( HWND hNotifyWnd, int iSaveType, LPCSTR strFileName, int iFileType );
|
||
//功 能:保存到文件
|
||
//输 入:hNotifyWnd 接收消息的窗口句柄
|
||
// iSaveType 保存内容(音频/伴奏/混合)
|
||
// strFileName 文件名
|
||
// iFileType 保存文件类型
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SaveMidi)( HWND hNotifyWnd, LPBYTE lpData, DWORD dwDataSize, int iFont,
|
||
char* strName, int iFileType );
|
||
//功 能:保存MIDI到文件
|
||
//输 入:hNotifyWnd 接收消息的窗口句柄
|
||
// lpData MIDI数据
|
||
// dwDataSize 数据大小
|
||
// iFont 音源号
|
||
// strName 文件名
|
||
// iFileType 保存文件类型(MIDI/WAV/MP3)
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_GetMelodyInfo)( OUT int* iTimeSignature, OUT int* nTempo );
|
||
//功 能:获取旋律信息
|
||
//输 入:iMelodyKey 旋律调号
|
||
// iTimeSignature 旋律拍号
|
||
// nTempo 旋律速度
|
||
//返回值:旋律数组大小,或错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_GetMelodyBars)( OUT int* iOffsetBar, OUT int* nValidBar );
|
||
//功 能:获取旋律长度
|
||
//输 入:
|
||
// iOffsetBars 第一个休止符截取小节数
|
||
// nValidBars 有效小节数
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_GetMelodyNotes)( OUT BYTE keys[], OUT WORD delay[], int* iKey);
|
||
//功 能:获取音符数组
|
||
//输 入:Keys 音符数组
|
||
// delay 音符延时数组
|
||
// iKey [in,out] -1=获取缺省,>0指定调号
|
||
// 由调用模块负责数组的分配和释放
|
||
//返回值:音符数组大小,或错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_CreateRealTimeMIDIStream)( bool bDrum );
|
||
//功 能:创建实时MIDI流
|
||
//输 入:bDrum 鼓通道
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_FreeRealTimeMIDIStream)();
|
||
//功 能:释放实时MIDI流
|
||
//输 入:无
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_RealTimeMIDINoteOn)(unsigned char iNote);
|
||
//功 能:实时MIDI流打开音符
|
||
//输 入:iNote 音符序号
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_RealTimeMIDINoteOff)(unsigned char iNote);
|
||
//功 能:实时MIDI流关闭音符
|
||
//输 入:iNote 音符序号
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
//typedef DLLAPI HRESULT (*MM_PlayStyleDemo)( LPBYTE lpStyleDemoData, DWORD dwDataSize, int nTempo );
|
||
//功 能:播放风格试听
|
||
//输 入:lpStyleDemoData 风格试听数据
|
||
// dwDataSize 数据长度
|
||
// nTempo 播放的速度 0=原速
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_LoadDemo)( LPBYTE lpDemoData, DWORD dwDataSize );
|
||
//功 能:加载乐器通道试听
|
||
//输 入:
|
||
// lpDemoData 试听数据
|
||
// dwDataSize 数据长度
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_PlayDemo)( HWND hNotifyWnd, double dblBarPlay, int iChno, int iProg,
|
||
int iBank, char* strFontFile );
|
||
//功 能:播放乐器通道试听
|
||
//输 入:hNotifyWnd 接收播放消息的窗口句柄
|
||
// dblBarPlay 播放起始小节 -1=循环播放
|
||
// iChno 通道号 -1=不改变
|
||
// iProg 乐器号 -1=不改变
|
||
// iBank 音源号 -1=缺省音源
|
||
// strFontFile 音源文件名
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_ChangeDemoParam)( int iChno, int iProg );
|
||
//功 能:实时改变试听参数
|
||
//输 入:
|
||
// iChno 通道号 -1=不改变
|
||
// iProg 乐器号 -1=不改变
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetTempo)( int nTempo );
|
||
//功 能:设置速度
|
||
//输 入:nTempo 速度(拍/分钟)
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetTimeSignature)( int nTimeSignature );
|
||
//功 能:设置节拍
|
||
//输 入:nTimeSignature 节拍(0=4/4, 1=3/4, 2=2/4, 3=6/8
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI DWORD (*MM_GetAudioVolume)( int iTrack, double dblPoint );
|
||
//功 能:旋律文件输入时获取Audio的音量
|
||
//输 入:
|
||
// iTrack 音频轨道号
|
||
// dblPoint 指定获取音量的小节位置
|
||
//返回值:当前音量 LOWORD左声道,HIWORD右声道
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI DWORD (*MM_GetStreamVolume)( int iStreamType );
|
||
//功 能:获取音频流音量
|
||
//输 入:iStreamType 音频流类型:0=master; 1=Record; 2=Audio; 3=BaseCompose;
|
||
// 4=Compose; 5=Song; 6=Output
|
||
//返回值:当前音量 LOWORD左声道,HIWORD右声道
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetStreamVolume)( int iStreamType, float fVolume );
|
||
//功 能:设置音频流音量
|
||
//输 入:iStreamType 音频流类型:0=master; 1=Record; 2=Audio; 3=BaseCompose;
|
||
// 4=Compose; 5=Song
|
||
// fVolume 音量大小
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI float (*MM_GetLatency)( bool bCountIn );
|
||
//功 能:获取录音延迟时间
|
||
//输 入:bCountIn 是否计算输入延迟
|
||
//返回值:延迟时间(ms)
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_ActiveAPR)( BOOL bActive );
|
||
//功 能:启用APR功能
|
||
//输 入:bActive 激活/关闭
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetTrackEvent)( int iEvent, int iStartBar, int iEndBar,
|
||
int iChan, int nValue, int iStream );
|
||
//功 能:设置通道事件
|
||
//输 入:iEvent 事件号
|
||
// iFirstBar 起始小节
|
||
// iLastBar 结束小节
|
||
// iChan 通道号
|
||
// nValue 参数值
|
||
// iStream -2=Demo, other=编曲音源号
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetMidiTrackParam)( int iStream, int iChan, int iParam, int nValue );
|
||
//功 能:设置MIDI通道参数
|
||
//输 入:
|
||
// iStream 音源号
|
||
// iChan 通道号
|
||
// iParam 参数 0=vol 1=pan 2=gain
|
||
// nValue 参数值
|
||
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI long (*MM_SaveProject)( int iMode, HWND hNotifyWnd, LPCSTR strFileName );
|
||
//功 能:保存工程文件
|
||
//输 入:iMode 工程模式:0=Auto, 1=Normal, 2=Upload
|
||
// hNotifyWnd 接收消息的窗口句柄 iMode==1 时有效
|
||
// strFileName 工程文件名
|
||
//返回值:写入字节数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI DWORD (*MM_LoadProject)( int iMode, HWND hNotifyWnd, LPCSTR strFileName, LONG lBeginPos,
|
||
DWORD dwVersion );
|
||
//功 能:载入工程文件
|
||
//输 入:iMode 工程模式:0=Auto, 1=Normal, 2=Upload
|
||
// hNotifyWnd 接收消息的窗口句柄 iMode==1 时有效
|
||
// strFileName 工程文件名
|
||
// lBeginPos 开始读取的位置
|
||
// dwVersion 载入文件的版本号
|
||
//返回值:全曲参数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI void (*MM_ResetProject)();
|
||
//功 能:重置工程参数
|
||
//输 入:
|
||
//返回值:
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_UserCanceled)();
|
||
//功 能:用户取消媒体文件操作
|
||
//输 入:无
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_ShowVSTEditor)( HWND hNotifyWnd, HWND parentWnd, int* width, int* height,
|
||
int iTrack, int iVST, char* strFileName );
|
||
//功 能:显示VST窗口
|
||
//输 入:
|
||
// hNotifyWnd 接收消息窗口
|
||
// parentWnd 父窗口 NULL=隐藏
|
||
// width, height 窗口大小
|
||
// iTrack 轨道号, -1=VSTi
|
||
// iVST iTrack<0 为VSTi号 否则为音效序号
|
||
// strFileName VSTi文件名
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SaveVSTParams)( int iTrack, int iVST, bool bSave );
|
||
//功 能:保存VST参数
|
||
//输 入:
|
||
// iTrack 轨道号, -1=VSTi
|
||
// iVST iTrack<0 为VSTi号 否则为音效序号
|
||
// bSave true=保存, false=重置
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AudioNewTrack)();
|
||
//功 能:新增音频轨道
|
||
//输 入:
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AudioDeleteTrack)( int iTrack );
|
||
//功 能:删除音频轨道
|
||
//输 入:
|
||
// iTrack 轨道号 0=原始录音
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AudioRecord)( HWND hNotifyWnd, int iTrack, DOUBLE dblPlayStart,
|
||
DOUBLE dblRecStart, DOUBLE dblRecEnd, int iOption );
|
||
//功 能:录音
|
||
//输 入:hNotifyWnd 接收消息的窗口句柄
|
||
// iTrack 轨道号 0=原始录音
|
||
// dblPlayStart 原录音播放小节位置
|
||
// dblRecStart 录音起点小节位置
|
||
// dblRecEnd 录音修改终点小节位置
|
||
// iOption 0=不带伴奏录音,1=基本伴奏,2=曲式伴奏,0x10=自定义,
|
||
// 0x100=节拍静音
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AudioMove)( int iDestTrack, DOUBLE dblPosInsert, int iSrcTrack,
|
||
DOUBLE dblSrcBegin, DOUBLE dblSrcEnd, int iMode );
|
||
//功 能:移动音频
|
||
//输 入:
|
||
// iDestTrack 目标轨道号
|
||
// dblPosInsert 插入位置
|
||
// iSrcTrack 源轨道号
|
||
// dblSrcBegin/dblSrcEnd 移动起始位置
|
||
// iMode 移动模式 INSERT/COPY/MOVE/DELETE/ERASE
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AudioFx)( int iTrack, double dblStart, double dblEnd,
|
||
DWORD iFxType, float fParams[] );
|
||
//功 能:设置音效
|
||
//输 入:
|
||
// iTrack 轨道号
|
||
// dblStart 开始小节位置
|
||
// dblEnd 结束小节位置
|
||
// iFxType 音效号
|
||
// fParams 音效参数
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI DOUBLE (*MM_AudioLoad)( int iTrack, DOUBLE dblEditStart, DOUBLE dblEditEnd, LPCSTR strFile );
|
||
//功 能:载入音频片段
|
||
//输 入:
|
||
// iTrack 轨道号 0=原始录音
|
||
// dblEdiStart 插入起始位置
|
||
// dblEditEnd 插入结束位置
|
||
// strFile 文件名
|
||
//返回值:音轨修改长度
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_AudioGetLength)( int iTrack );
|
||
//功 能:获取音频轨道长度
|
||
//输 入:
|
||
// iTrack 轨道号 0=原始录音
|
||
//返回值:字节数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AddUndoBefore)( int num, int* trks );
|
||
//功 能:添加UNDO前操作
|
||
//输 入:
|
||
// num 轨道数,<0为全部,=0为新增,>0为数组值
|
||
// trks 轨道数组
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AddUndoAfter)( int num, int* trks );
|
||
//功 能:添加UNDO后操作
|
||
//输 入:
|
||
// num 轨道数,<0为全部,=0为删除,>0为数组值
|
||
// trks 轨道数组
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_CancelAddUndo)();
|
||
//功 能:取消添加UNDO操作
|
||
//输 入:
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_Undo)( bool bUndo );
|
||
//功 能:撤销操作
|
||
//输 入:
|
||
// bUndo true=撤销,false=重做
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AudioAddFx)( int iTrack, DWORD iFxType, char* strVstFile,
|
||
int idPlugin, bool bSP );
|
||
//功 能:准备局部音效处理
|
||
//输 入:
|
||
// iTrack 轨道号
|
||
// iFxType 音效号
|
||
// strVstFile VST音效文件名
|
||
// idPlugin VST插件ID
|
||
// bSP 局部音效处理?
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*MM_AudioGetFxParam)( int iTrack, int index, void* params, int nSize );
|
||
//功 能:移动音效顺序
|
||
//输 入:
|
||
// iTrack 轨道号
|
||
// index 音效序号
|
||
// params 音效参数 NULL=获取参数个数
|
||
// nSize 音效参数个数 iFx<FX_VST为6
|
||
//返回值:参数个数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AudioSetFxParam)( int iTrack, int index, void* params, int nSize );
|
||
//功 能:移动音效顺序
|
||
//输 入:
|
||
// iTrack 轨道号
|
||
// index 音效序号
|
||
// params 音效参数
|
||
// nSize 音效参数个数 iFx<FX_VST为6
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AudioMoveFx)( int iTrack, int indFrom, int indTo );
|
||
//功 能:移动音效顺序
|
||
//输 入:
|
||
// iTrack 轨道号
|
||
// indFrom 原序号
|
||
// indTo 新序号 -1=删除
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_AudioFxProcess)( int iTrack, double dblStart, double dblEnd, HWND hNotifyWnd );
|
||
//功 能:应用局部音效处理
|
||
//输 入:
|
||
// iTrack 轨道号
|
||
// dblStart 开始小节位置
|
||
// dblEnd 结束小节位置
|
||
// hNotifyWnd 接收进度窗口
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*MM_SetAudioTrackParam)( int iTrack, int iParam, float fValue );
|
||
//功 能:设置Audio轨道参数
|
||
//输 入:
|
||
// iTrack 轨道号
|
||
// iParam 参数 0=vol 1=pan 2=gain
|
||
// fValue 参数值
|
||
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
extern MM_GetVersion f_MM_GetVersion;
|
||
extern MM_InitialObjects f_MM_InitialObjects;
|
||
extern MM_DestroyObjects f_MM_DestroyObjects;
|
||
extern MM_LoadMidiMelody f_MM_LoadMidiMelody;
|
||
extern MM_GetFontInfo f_MM_GetFontInfo;
|
||
extern MM_SetDefaultFont f_MM_SetDefaultFont;
|
||
extern MM_GetVSTInfo f_MM_GetVSTInfo;
|
||
extern MM_LoadVSTi f_MM_LoadVSTi;
|
||
extern MM_GetVSTiPrograms f_MM_GetVSTiPrograms;
|
||
extern MM_HandleVSTiPreset f_MM_HandleVSTiPreset;
|
||
extern MM_LoadCompose f_MM_LoadCompose;
|
||
extern MM_FreeComposes f_MM_FreeComposes;
|
||
extern MM_LoadPrebeat f_MM_LoadPrebeat;
|
||
extern MM_Play f_MM_Play;
|
||
extern MM_Stop f_MM_Stop;
|
||
extern MM_CheckIODevice f_MM_CheckIODevice;
|
||
extern MM_SetIODevice f_MM_SetIODevice;
|
||
extern MM_GetPlaybackDeviceInfo f_MM_GetPlaybackDeviceInfo;
|
||
extern MM_GetPlaybackOutputInfo f_MM_GetPlaybackOutputInfo;
|
||
extern MM_GetRecordDeviceInfo f_MM_GetRecordDeviceInfo;
|
||
extern MM_GetRecordInputInfo f_MM_GetRecordInputInfo;
|
||
extern MM_RecordTest f_MM_RecordTest;
|
||
extern MM_SetRecordMoniter f_MM_SetRecordMoniter;
|
||
extern MM_GetMidiInBuffer f_MM_GetMidiInBuffer;
|
||
extern MM_SetMidiInBuffer f_MM_SetMidiInBuffer;
|
||
extern MM_SetRecordAutoAdjust f_MM_SetRecordAutoAdjust;
|
||
extern MM_SetRecordProtect f_MM_SetRecordProtect;
|
||
extern MM_ShowAsioPanel f_MM_ShowAsioPanel;
|
||
extern MM_RestartAsioDevice f_MM_RestartAsioDevice;
|
||
extern MM_LoadAudio f_MM_LoadAudio;
|
||
extern MM_GetMelodyInfo f_MM_GetMelodyInfo;
|
||
extern MM_GetMelodyBars f_MM_GetMelodyBars;
|
||
extern MM_GetMelodyNotes f_MM_GetMelodyNotes;
|
||
extern MM_CreateRealTimeMIDIStream f_MM_CreateRealTimeMIDIStream;
|
||
extern MM_FreeRealTimeMIDIStream f_MM_FreeRealTimeMIDIStream;
|
||
extern MM_RealTimeMIDINoteOn f_MM_RealTimeMIDINoteOn;
|
||
extern MM_RealTimeMIDINoteOff f_MM_RealTimeMIDINoteOff;
|
||
//extern MM_PlayStyleDemo f_MM_PlayStyleDemo;
|
||
extern MM_LoadDemo f_MM_LoadDemo;
|
||
extern MM_PlayDemo f_MM_PlayDemo;
|
||
extern MM_ChangeDemoParam f_MM_ChangeDemoParam;
|
||
extern MM_SetTempo f_MM_SetTempo;
|
||
extern MM_SetTimeSignature f_MM_SetTimeSignature;
|
||
extern MM_GetAudioVolume f_MM_GetAudioVolume;
|
||
extern MM_GetStreamVolume f_MM_GetStreamVolume;
|
||
extern MM_SetStreamVolume f_MM_SetStreamVolume;
|
||
extern MM_Save f_MM_Save;
|
||
extern MM_SaveMidi f_MM_SaveMidi;
|
||
extern MM_GetLatency f_MM_GetLatency;
|
||
extern MM_SaveProject f_MM_SaveProject;
|
||
extern MM_LoadProject f_MM_LoadProject;
|
||
extern MM_ResetProject f_MM_ResetProject;
|
||
extern MM_UserCanceled f_MM_UserCanceled;
|
||
extern MM_ActiveAPR f_MM_ActiveAPR;
|
||
extern MM_SetTrackEvent f_MM_SetTrackEvent;
|
||
extern MM_ShowVSTEditor f_MM_ShowVSTEditor;
|
||
extern MM_SaveVSTParams f_MM_SaveVSTParams;
|
||
extern MM_AudioNewTrack f_MM_AudioNewTrack;
|
||
extern MM_AudioDeleteTrack f_MM_AudioDeleteTrack;
|
||
extern MM_AudioRecord f_MM_AudioRecord;
|
||
extern MM_AudioMove f_MM_AudioMove;
|
||
extern MM_AudioFx f_MM_AudioFx;
|
||
extern MM_AudioLoad f_MM_AudioLoad;
|
||
extern MM_AudioGetLength f_MM_AudioGetLength;
|
||
extern MM_AddUndoBefore f_MM_AddUndoBefore;
|
||
extern MM_AddUndoAfter f_MM_AddUndoAfter;
|
||
extern MM_CancelAddUndo f_MM_CancelAddUndo;
|
||
extern MM_Undo f_MM_Undo;
|
||
extern MM_AudioAddFx f_MM_AudioAddFx;
|
||
extern MM_AudioGetFxParam f_MM_AudioGetFxParam;
|
||
extern MM_AudioSetFxParam f_MM_AudioSetFxParam;
|
||
extern MM_AudioMoveFx f_MM_AudioMoveFx;
|
||
extern MM_AudioFxProcess f_MM_AudioFxProcess;
|
||
extern MM_SetMidiTrackParam f_MM_SetMidiTrackParam;
|
||
extern MM_SetAudioTrackParam f_MM_SetAudioTrackParam;
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
string wstr2str(const wstring& _src);
|
||
wstring str2wstr(const string& _src);
|
||
string UTF8ToMBCS(const char *pcUtf8);
|
||
string GBToUTF8(const char* str);
|
||
void DebugPrint(const char * fmt, ...);
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
// ClientService函数段
|
||
//
|
||
extern TSOFTWAREINFO g_infoSoftwareUpdate;
|
||
//extern int g_nBuildVersion;
|
||
extern TUSERINFO g_infoUser;
|
||
extern TSONGINFO g_infoSong;
|
||
extern bool g_bAutoLogin,
|
||
g_bLogon;
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_GetVersion)();
|
||
//功 能:获取版本信息
|
||
//输 入:无
|
||
//返回值:版本号 LOWORD=major, HIWORD=minor
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_InitialService)( HWND hWnd, int iClientType, PTSOFTWAREINFO pSofewareInfo,
|
||
char* strURL, char* strRoot, char idDevice[6] );
|
||
//功 能:初始化客户端服务
|
||
//参 数:hWnd 函数调用窗口句柄
|
||
// iClientType 客户端类型(软件内部编号)
|
||
// pSofewareInfo[in,out] 传入当前版本,获取更新版本
|
||
// strURL 网站服务器名称 http://xxx.xxx.xxx:xx/
|
||
// strRoot 资源文件根目录
|
||
// idDevice 设备号
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_DestroyService)();
|
||
//功 能:解除客户端服务
|
||
//输 入:无
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_Register)( PTUSERINFO pUserInfo, int isEmailOrMobile );
|
||
//功 能:用户注册
|
||
//参 数:pUserInfo[in,out] 传入用户名和密码,输出用户信息
|
||
// isEmailOrMobile 捆绑邮箱或手机号 1=邮箱 2=手机号
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_Login)( PTUSERINFO pUserInfo, BOOL bSync );
|
||
//功 能:用户登录
|
||
//参 数:pUserInfo[in,out] 传入用户名和密码,输出用户信息
|
||
// bSync 同步=TURE,异步=FALSE
|
||
//返回值:错误号
|
||
// 正常登录 = 0
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_Logoff)();
|
||
//功 能:注销或取消登录
|
||
//参 数:无
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_CancelOperation)();
|
||
//功 能:取消操作
|
||
//参 数:
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_AutoDownloadStyle)( bool bSet );
|
||
//功 能:自动下载风格
|
||
//参 数:
|
||
// bSet 设置/取消自动下载
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT(*CS_DownloadStyle)(UINT idStyle, HWND hProcessWnd);
|
||
// 功 能:下载风格数据
|
||
// 参 数:idStyle 风格ID
|
||
// hProcessWnd 消息接收窗口
|
||
// 返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_GetQnA)( int& nQnANum, TSTRINGPAIR arrQnA[], bool bLocal, UINT idUser );
|
||
//功 能:获取问题与回答
|
||
//参 数:nQnANum 返回问题个数
|
||
// arrQnA 返回问题数组
|
||
// bLocal true = 本机提问, false = 常见问题
|
||
// idUser 用户ID
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_SubmitQnA)( UINT idUser, char* strQuestion );
|
||
//功 能:提交问题
|
||
//参 数:
|
||
// idUser 用户ID
|
||
// strQuestion 问题内容
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_GetNotice)( int& nNoticeNum, TSTRINGPAIR arrNotice[], UINT idUser );
|
||
//功 能:获取公告或通知
|
||
//参 数:nNoticeNum 返回通知个数
|
||
// arrNotice 返回通知数组
|
||
// idUser 用户ID
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*CS_GetNewNoticeNum)( int idUser );
|
||
//功 能:获取未读公告或通知数
|
||
//参 数:
|
||
// idUser 用户号,=0为公告
|
||
//返回值:通知个数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_UploadSong)( UINT idUser, TSONGINFO* pSongInfo, HWND hProcessWnd,
|
||
TSHAREINFO* pShareInfo );
|
||
//功 能:上传歌曲
|
||
//参 数:idUser 用户ID
|
||
// pSongInfo 歌曲信息
|
||
// hProcessWnd 进度消息接收窗口
|
||
// pShareInfo 分享信息
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_GetWebPageURL)( int iType, char* strURL );
|
||
//功 能:获取网站操作URL
|
||
//参 数:
|
||
// iType 访问页面:0-首页,1-个人中心,2-歌曲管理
|
||
// strURL 输出URL字符串
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_GetStyleNumsEx)( int& nOrigin, int& nDownloaded, int& nShare, int& nLocal );
|
||
//功 能:获取风格数
|
||
//参 数:
|
||
// nOrigin 发布风格数
|
||
// nDownloaded 已下载发布数
|
||
// nShare 分享风格数
|
||
// nLocal 本地风格数
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_CheckPayment)( UINT idUser, int iOperation, int nStyleNum,
|
||
UINT arrStyleIDs[], int arrCosts[],
|
||
int *pCost, int *pBalance );
|
||
//功 能:检查支付
|
||
//输 入:idUser 用户ID
|
||
//--iOperation[in]:操作 0=使用 1=编辑
|
||
//--nStyleNum[in]:风格个数
|
||
//--arrStyleIDs[in]:风格ID数组
|
||
//--arrCosts[out]:风格当前消耗值
|
||
//--pCost[out]: 定义int接收实际消耗
|
||
//--pBalance[out]: 定义int变量接收用户音符数余额
|
||
//--返 回: 错误值
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_ConfirmPayment)( UINT idUser, int iOperation, int nStyleNum,
|
||
UINT arrStyleIDs[], int *pBalance);
|
||
//功 能:确定支付
|
||
//输 入:idUser 用户ID
|
||
//--iOperation[in]:操作 0=使用 1=编辑
|
||
//--nStyleNum[in]:风格个数
|
||
//--dwStyleID[in]:风格ID数组
|
||
//--pBalance[out]: 定义int变量接收用户音符数余额
|
||
//--返 回: 错误值
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_StyleScore)( UINT idUser, UINT idStyle, int iType, int* pScrUser, int* pScrAverage );
|
||
//功 能:风格评分
|
||
//参 数:idUser 用户ID
|
||
// idStyle 风格ID
|
||
// iType 风格类型 1=发布 3=分享
|
||
// pScrUser 用户评分值( 输入<0 获取以前评分,输出<0 以前未评分 )
|
||
// pScrAverage 返回当前平均分值
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI HRESULT (*CS_UploadStyle)( int iType, UINT idUser, int nDataSize, char* pData,
|
||
HWND hProcessWnd );
|
||
//功 能:上传制作风格文件数据
|
||
//参 数:
|
||
// iType 上传类型 1=批量上传 2=制作上传 3=分享上传
|
||
// idUser 用户ID
|
||
// nDataSize 风格文件数据大小
|
||
// pData 风格文件数据
|
||
// hProcessWnd 进度消息接收窗口
|
||
//返回值:错误号
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*CS_SaveProject)( LPCSTR strFileName );
|
||
//功 能:保存工程文件
|
||
//输 入:
|
||
// strFileName 工程文件名
|
||
//返回值:写入字节数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI int (*CS_LoadProject)( LPCSTR strFileName, UINT lBeginPos, DWORD dwVersion );
|
||
//功 能:载入工程文件
|
||
//输 入:
|
||
// strFileName 工程文件名
|
||
// lBeginPos 开始读取的位置
|
||
// dwVersion 载入文件的版本号
|
||
//返回值:读取字节数
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
typedef DLLAPI void (*CS_ResetProject)();
|
||
//功 能:重置工程参数
|
||
//输 入:
|
||
//返回值:
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
|
||
extern CS_GetVersion f_CS_GetVersion;
|
||
extern CS_InitialService f_CS_InitialService;
|
||
extern CS_DestroyService f_CS_DestroyService;
|
||
extern CS_Register f_CS_Register;
|
||
extern CS_Login f_CS_Login;
|
||
extern CS_Logoff f_CS_Logoff;
|
||
extern CS_CheckPayment f_CS_CheckPayment;
|
||
extern CS_ConfirmPayment f_CS_ConfirmPayment;
|
||
extern CS_CancelOperation f_CS_CancelOperation;
|
||
extern CS_DownloadStyle f_CS_DownloadStyle;
|
||
extern CS_GetQnA f_CS_GetQnA;
|
||
extern CS_SubmitQnA f_CS_SubmitQnA;
|
||
extern CS_GetNotice f_CS_GetNotice;
|
||
extern CS_GetNewNoticeNum f_CS_GetNewNoticeNum;
|
||
extern CS_UploadSong f_CS_UploadSong;
|
||
extern CS_GetWebPageURL f_CS_GetWebPageURL;
|
||
extern CS_GetStyleNumsEx f_CS_GetStyleNumsEx;
|
||
extern CS_StyleScore f_CS_StyleScore;
|
||
extern CS_AutoDownloadStyle f_CS_AutoDownloadStyle;
|
||
extern CS_SaveProject f_CS_SaveProject;
|
||
extern CS_LoadProject f_CS_LoadProject;
|
||
extern CS_ResetProject f_CS_ResetProject;
|
||
extern CS_UploadStyle f_CS_UploadStyle;
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
// QR函数段
|
||
typedef int (*QR_Encode)( const char *string, unsigned char* pData );
|
||
|
||
extern QR_Encode f_QR_Encode;
|
||
|
||
/////////////////////////////////////////////////////////////////////////////////////////
|
||
HRESULT GetCMFunctions( HINSTANCE hDll );
|
||
HRESULT GetMMFunctions( HINSTANCE hDll );
|
||
HRESULT GetCSFunctions( HINSTANCE hDll );
|
||
HRESULT GetQRFunctions( HINSTANCE hDll );
|
||
|
||
void InitFontList();
|
||
bool SetSelectFont();
|
||
void ClearFontList();
|
||
void InitCZFontList( String strPath );
|
||
bool SetCZFonts( char* szFileName, char* szFontName, int nInst, FONTPRESET* setInst,
|
||
int nDrum, FONTPRESET* setDrum );
|
||
|
||
void InitVSTList();
|
||
void ClearVSTList();
|
||
|
||
void InitSegmentColor();
|
||
TColor GetSegmentColor( int iSegType, int iNo, bool bIncrease=true );
|
||
|
||
void SelectStyle();
|
||
void ClearStyleList();
|
||
void ClearStyleMap();
|
||
TPROSTYLE* GetStyleInfo( UINT idLoc, UINT idStyle );
|
||
bool IsCollectedStyle( UINT idLoc, UINT idStyle );
|
||
void DeleteStyleInfo( UINT idLoc, UINT idStyle );
|
||
int DeleteTrkRef( TSTYLELOCAL& origin, UINT idLocDel, UINT idStyleDel );
|
||
|
||
void ClearGlobalVars( int iOperation=LIST_ALL );
|
||
|
||
void SetPlayTimer(bool bStart, UINT& tTimer, UINT& tAccuracy, void* pUser=NULL, int tInterval=TIMER_PLAY_INTERVAL);
|
||
//void GetPlayTime( int iStartBar, double dblStartPoint, char* strTime );
|
||
void GetPlayTime(int iStartBar, double dblStartPoint, int iTime[3] );
|
||
void CALLBACK OnMediaTimer(UINT tTimerID, UINT msg,DWORD dwUser,DWORD dwl,DWORD dw2);
|
||
|
||
void SetInitVar( BOOL bClose=false );
|
||
void GetInitVar();
|
||
void SetAutoLogin( bool bAuto, LPCSTR strName, LPCSTR strPwd );
|
||
bool GetAutoLogin( char* strName, char* strPwd );
|
||
void GetAutoSaveReg();
|
||
void SetAutoSaveReg( bool bAuto );//注册表增加自动保存
|
||
void DisableAutoOpen();//禁用自动打开
|
||
|
||
void CheckVSTScanReg(); //获取扫描状态
|
||
void SetVSTScanReg( int iScanning ); //设置扫描状态 0=完成,1=VST,2=VSTi
|
||
|
||
void SetMelodyTempo( int nTempo, bool bInit=false ); //设置旋律速度
|
||
void SetMelodyTS( int iTS, bool bInit=false ); //设置旋律拍号
|
||
void SetMelodyNotes( int nBarNum );
|
||
bool GenerateCompose();
|
||
int GetComposeData( TOpusStageList lstOpusStages, int iKey, int& nDataSize,
|
||
LPBYTE lpData, bool bSave=false );
|
||
int GetMidiTrackData( int &nLen, BYTE* pData, int iMT, int iSBar, int iEBar, int* piPlayBar, int* piLenBar );
|
||
|
||
|
||
bool IsProtected();
|
||
int ActiveAPR( bool bActive );
|
||
void SetTransparent( TComponent* pCtrl );
|
||
|
||
char* GetMacAdress();
|
||
//bool CrnBrowseDir(HWND hOwner, LPTSTR lpTitle, LPTSTR lpSelectDir);//文件夹路径选择
|
||
#endif
|