MCPcopy Create free account
hub / github.com/csound/csound / main

Function main

Frontends/debugger/csdebugger.cpp:46–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44void brkpt_cb(CSOUND *csound, debug_bkpt_info_t *bkpt_info, void *userdata);
45
46int 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
78void brkpt_cb(CSOUND *csound, debug_bkpt_info_t *bkpt_info, void *userdata)
79{

Callers

nothing calls this directly

Calls 6

csoundDebuggerInitFunction · 0.85
csoundDebuggerCleanFunction · 0.85
StartMethod · 0.80
PerformMethod · 0.45

Tested by

no test coverage detected