Main Page | Namespaces | Classes | Compounds | Files | Compound Members | Related SynthGUI.cpp00001 // 00002 // SYNTOPIA. See http://Syntopia.sourceforge.net for details and documentation. 00003 // 00004 // Author of this file: Mikael Hvidtfeldt Christensen (mikaelc@users.sourceforge.net) 00005 // 00006 00007 // Visual C++ compiler warnings: 255 char limit on var names..... 00008 #pragma warning(disable: 4786) 00009 00010 #include "stdafx.h" 00011 #include "Synth.h" 00012 #include <iostream> 00013 #include "math.h" 00014 00015 #include <windows.h> 00016 #include "WinForm.h" 00017 #include <string> 00018 #include "AInput.h" 00019 #include "OscDialog.h" 00020 #include "EnvDialog.h" 00021 #include "MainDialog.h" 00022 #include "FilterDialog.h" 00023 00024 using namespace SynthGUI; 00025 00026 00027 int main(int argc, char* argv[]) 00028 { 00029 Synth * MySynth = new Synth(); 00030 00031 00032 MySynth->noteOn(23); 00033 MySynth->noteOn(24); 00034 MySynth->noteOn(25); 00035 MySynth->noteOn(26); 00036 ofstream outFile("../synth.xml", ios::out); 00037 00038 // Check for error 00039 if (!outFile) 00040 { 00041 cout << "Unable to open the file\n"; 00042 return 1; 00043 } 00044 00045 00046 outFile << MySynth->getXML(); 00047 00048 00049 outFile.close(); 00050 00051 for (int i = 0; i< 1000; i++) {MySynth->update();}; 00052 exit(1); 00053 00054 00055 MySynth->loadXML("../synth.xml"); 00056 00057 00058 00059 exit(1); 00060 00061 00062 00063 00064 exit(0); 00065 00066 GUIControl * myGUIControl = new GUIControl(GetModuleHandle(NULL),SW_SHOW); 00067 mainDialog * mitVindue2 = new mainDialog(MySynth); 00068 myGUIControl->MessageLoop(); 00069 00070 delete(mitVindue2); 00071 00072 delete(myGUIControl); 00073 00074 00075 00076 00077 /* 00078 float t1=-13.0; 00079 float t2=23.3; 00080 float t3=0.0; 00081 int y; 00082 _int64 time1; int measures = 0; _int64 time2; 00083 _int64 elapsed = 0; 00084 00085 for (int t=0; t< 100; t++) { 00086 00087 measures++; time1=prectime(); 00088 00089 for (int i=0; i< 100000; i++) 00090 { 00091 //mySynth->update(); 00092 t3=t1+t2; 00093 } 00094 00095 time1=prectime()-time1; y= 0; 00096 time2=prectime(); 00097 00098 for (int j=0; j< 100000; j++) 00099 { 00100 00101 t3=t1+t2; 00102 //if (t1 > 0.0f) {t1 = -t1;} 00103 //for (int t5=0; t5<400; t5++) modptr[t5]->update(); 00104 mySynth->update(); 00105 00106 00107 } 00108 00109 time2=prectime()-time2; 00110 00111 elapsed += (time2 - time1); 00112 00113 //std::cout << "read " << mySynth->Output1->read() << std::endl; 00114 00115 std::cout << "Mean time: " << ((double)elapsed/100000.0/(double) measures) << "Ticks" << std::endl; 00116 std::cout << "--Last time: " << ((double)(time2 - time1)/100000.0) << "Ticks" << std::endl; 00117 00118 } 00119 */ 00120 //printf("Hello World!\n"); 00121 std::cout << "hello"; 00122 return 0; 00123 } 00124 Docs made by Doxygen. Email: Mikael Christensen |