I'm building an audio effect pedal. I need to make a circuit that can either run from DC power or batteries. The key is to disconnect the battery if a DC plug is connected (by using a DC jack with a simple switch) and to disconnect the battery if no mono input plug is connected (with a stereo jack).
I've found this method (and here is a sample schematic). As you can see, when no input plug is connected the negative pole of the battery is disconnected from the circuit's ground, and when there's a mono plug connected it routes the negative pole of the battery through the plug into the ground. This works as expected.
From the other perspective, when a DC plug is connected it disconnects the battery positive pole by opening the switch inside the DC jack. However, this assumes you're using a DC plug with negative polarity (tip negative), but common DC power adaptors use positive polarities, with the tip being positive, so it doesn't works as expected.
I could switch the battery poles to fix the DC switch problem, but that would break the input switch (which would waste the batteries even if no input is connected). So, how to fix it?