| 44 | void brkpt_cb(CSOUND *csound, debug_bkpt_info_t *bkpt_info, void *userdata); |
| 45 | |
| 46 | int main(int argc, char **argv) |
| 47 | { |
| 48 | if (argc == 1) { |
| 49 | cout << "Usage:" << endl; |
| 50 | cout << argv[0] << " [filename.csd] [instrument number] [ksmps offset]" |
| 51 | << endl; |
| 52 | return -1; |
| 53 | } |
| 54 | |
| 55 | int ksmpsOffset = atoi(argv[3]); |
| 56 | |
| 57 | Csound* csound = new Csound(); |
| 58 | csound->Compile(2, (const char **)argv); |
| 59 | csound->Start(); |
| 60 | csoundDebuggerInit(csound->GetCsound()); |
| 61 | csoundSetBreakpointCallback(csound->GetCsound(), brkpt_cb, NULL); |
| 62 | |
| 63 | cout << "Csound filename: " << argv[1] << '\n'; |
| 64 | cout << "Instr number:" << argv[2] << '\n'; |
| 65 | |
| 66 | double instr = atof(argv[2]); |
| 67 | if (instr >= 1.0) { |
| 68 | csoundSetInstrumentBreakpoint(csound->GetCsound(), instr, ksmpsOffset); |
| 69 | } else { |
| 70 | cout << "Invalid instrument breakpoint: " << instr; |
| 71 | } |
| 72 | csound->Perform(); |
| 73 | |
| 74 | csoundDebuggerClean(csound->GetCsound()); |
| 75 | delete csound; |
| 76 | } |
| 77 | |
| 78 | void brkpt_cb(CSOUND *csound, debug_bkpt_info_t *bkpt_info, void *userdata) |
| 79 | { |
nothing calls this directly
no test coverage detected