LINUX下的混音软件

源代码在线查看: transpose.cpp

软件大小: 8553 K
上传用户: jun604001464
关键词: LINUX 混音 软件
下载地址: 免注册下载 普通下载 VIP

相关代码

				// -*- c-basic-offset: 4 -*-								#include "NotationTypes.h"								using namespace Rosegarden;				using std::cout;								// Unit test-ish tests for transposition.				// 				// Returns -1 (or crashes :)) on error, 0 on success								/**				 * should be in Pitch eventually				 */				void testAisDisplayAccidentalInCmaj()				{				    Pitch ais(70, Accidentals::Sharp);				    Key cmaj ("C major");				    Accidental accidental = ais.getDisplayAccidental(cmaj);				    if (accidental != Accidentals::Sharp)				    {				        std::cout 				        exit(-1);				    }				}								/** 				 * transpose an A# up by a major second, should 				 * yield a B# (as C would be a minor triad) 				 */				void testAisToBis()				{				    std::cout 				    Pitch ais(70, Accidentals::Sharp);				    Key cmaj ("C major");								    Pitch result = ais.transpose(cmaj, 2, 1);								    Accidental resultAccidental = result.getAccidental(cmaj);				    int resultPitch = result.getPerformancePitch();				    if (resultAccidental != Accidentals::Sharp || resultPitch != 72)				    {				        std::cout 				        exit(-1);				    }				    std::cout 				}								/**				 * Transpose G to D in the key of D major.				 */				void testGToD()				{				    std::cout 				    Pitch g(67, Accidentals::Natural);				    Key* dmaj = new Key("D major");								    Pitch result = g.transpose(*dmaj, 7, 4);								    Accidental resultAccidental = result.getAccidental(*dmaj);				    int resultPitch = result.getPerformancePitch();				    if (resultAccidental != Accidentals::NoAccidental || resultPitch != 74)				    {				        std::cout 				        exit(-1);				    }				    std::cout 				}								void testKeyTransposition()				{								}								int main(int argc, char **argv)				{				    testAisDisplayAccidentalInCmaj();				    testAisToBis();				    testGToD();				    testKeyTransposition();								    return 0;    				}							

相关资源