diff --git a/src/main.vala b/src/main.vala index 8c31254..661a3aa 100644 --- a/src/main.vala +++ b/src/main.vala @@ -25,9 +25,9 @@ string earpiece_mixer; string card_name; private const GLib.OptionEntry[] options = { - { "speaker", 's', OptionFlags.NONE, OptionArg.STRING, ref speaker_mixer, "mixer for speaker mode", "QUAT_MI2S_RX Voice Mixer VoiceMMode1" }, - { "earpiece", 'e', OptionFlags.NONE, OptionArg.STRING, ref earpiece_mixer, "mixer for earpiece mode", "SLIMBUS_0_RX Voice Mixer VoiceMMode1" }, - { "card", 'c', OptionFlags.NONE, OptionArg.STRING, ref card_name, "alsa card", "hw:0" }, + { "speaker", 's', OptionFlags.IN_MAIN, OptionArg.STRING, ref speaker_mixer, "mixer for speaker mode", "QUAT_MI2S_RX Voice Mixer VoiceMMode1" }, + { "earpiece", 'e', OptionFlags.IN_MAIN, OptionArg.STRING, ref earpiece_mixer, "mixer for earpiece mode", "SLIMBUS_0_RX Voice Mixer VoiceMMode1" }, + { "card", 'c', OptionFlags.IN_MAIN, OptionArg.STRING, ref card_name, "alsa card", "hw:0" }, { null } }; @@ -81,6 +81,9 @@ int main (string[] args) { printerr ("Run '%s --help' to see a full list of available command line options.\n", args[0]); return 1; } + if (speaker_mixer == null || earpiece_mixer == null || card_name == null) { + error ("Run --help to get options. You need to specify card, speaker and earpiece"); + } Alsa.Card card; message ("Card open: %d", Alsa.Card.open (out card, card_name, Alsa.CardOpenType.NONBLOCK));