]> git.seodisparate.com - MeterForPulseAudio/commitdiff
Fixes to error outputs 1.1
authorStephen Seo <seo.disparate@gmail.com>
Tue, 19 Jun 2018 04:20:07 +0000 (13:20 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Tue, 19 Jun 2018 04:20:07 +0000 (13:20 +0900)
CMakeLists.txt
Changelog.md
src/Main.cpp
src/MfPA/Meter.cpp

index 22274ed50bddb6b58b4d9ccaac0b6ed2c4a1c288..c9efd24608f7a2445884a684c61fc4f8043a56dd 100644 (file)
@@ -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
index 3780382a0f6a203c011c8a409ddfb4c3dc90f055..cb14957966d6a2bb6b9056d57457c1c26e9acbae 100644 (file)
@@ -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.
index 27b4d471e5259991f3e9508458e4339aad354e7d..0073d1ab8c61bfc543600d62569510ddedc91a5e 100644 (file)
@@ -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;
     }
 
index 35191bb7a1b9af0ebbd75e97a193b1951000fc91..dbcd105825fdcd3d751d7f2c7b83041ba87c67b7 100644 (file)
@@ -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;
     }