Merge pull request #259 from NiLuJe/master

Revamp the waveform mode selection logic