[sdiy] OT (but very synthy): C question
Noah Vawter
nvawter at media.mit.edu
Mon Mar 28 18:34:09 CEST 2011
fwiw, avoid using the word "this" because it's a keyword in C++. so
that makes it a bad habit to get into (you didn't know) and confusing
for ppl who can help... it'll probably confuse the compiler, too.
p.s. getting paid to make synth code, you da man!
On Mar 28, 2011, at 12:13 PM, Tom Wiltshire wrote:
> Hi all,
>
> Sorry to bother you with a C question, but I'm starting to get
> frustrated 'cos I can't get this straight in my head.
>
> Here's the situation:
>
> I've got four files LFO.h, LFO.c, MIDI.h, and MIDI.c
>
> Now, my LFO header file includes the following:
>
> void LFOCalculate(LFO *this, MIDIHandler *midi);
>
> "this" is a reference to an LFO structure, basically OO by the back
> door. "midi" is a reference to my MIDI handler which I need to be
> able to send MIDI clock pulses from the LFO.
>
> The problem I've hit is putting the following in my MIDI.h:
>
> void MIDIParse(MIDIHandler *this, LFO *lfo);
>
> The reference to "lfo" here is so that received MIDI CC messages can
> set LFO parameters.
>
> Currently I have the LFO structure defined in LFO.h and the
> MIDIHandler structure defined in MIDI.h. But I can't include MIDI.h
> in LFO.h *and* also include LFO.h in MIDI.h.
> Where should I put things to avoid this problem?
>
> I should also mention that I'm being paid for this, so if it bothers
> you to help me out for free, please don't feel you have to.
> Personally, I don't much mind helping folk with their work if I can,
> but I know some people feel differently.
>
> Thanks,
> Tom
>
>
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
More information about the Synth-diy
mailing list