From afe49906e88297092d1515a5fd0f0d91e57e9c6c Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Tue, 19 Jun 2018 13:20:07 +0900 Subject: [PATCH] Fixes to error outputs --- CMakeLists.txt | 2 +- Changelog.md | 4 ++++ src/Main.cpp | 2 ++ src/MfPA/Meter.cpp | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22274ed..c9efd24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0) -project(MeterForPulseAudio VERSION 1.0) +project(MeterForPulseAudio VERSION 1.1) set(MeterForPulseAudio_SOURCES GameDevTools/src/GDT/GameLoop.cpp diff --git a/Changelog.md b/Changelog.md index 3780382..cb14957 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +# Version 1.1 + +Fixed error output on invalid sink/source and invalid arguments to program. + # Version 1.0 Initial working release. Check the help text for usage. diff --git a/src/Main.cpp b/src/Main.cpp index 27b4d47..0073d1a 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -97,6 +97,8 @@ int main(int argc, char** argv) if(!parser.parse(argc, argv)) { + std::cerr << "ERROR: Got invalid arguments! Try '-h' for usage info." + << std::endl; return 1; } diff --git a/src/MfPA/Meter.cpp b/src/MfPA/Meter.cpp index 35191bb..dbcd105 100644 --- a/src/MfPA/Meter.cpp +++ b/src/MfPA/Meter.cpp @@ -198,7 +198,7 @@ void MfPA::Meter::get_sink_info_callback( if(eol != PA_OK) { meter->currentState = MfPA::Meter::FAILED; - std::cerr << pa_strerror(eol) << std::endl; + std::cerr << pa_strerror(pa_context_errno(c)) << std::endl; return; } // get monitor-source of sink @@ -234,7 +234,7 @@ void MfPA::Meter::get_source_info_callback( if(eol != PA_OK) { meter->currentState = MfPA::Meter::FAILED; - std::cerr << pa_strerror(eol) << std::endl; + std::cerr << pa_strerror(pa_context_errno(c)) << std::endl; return; } -- 2.49.0