make play quiet by default added -v for verbose
authorJim Morris <morris@wolfman.com>
Tue, 19 Nov 2013 03:15:01 +0000 (19:15 -0800)
committerJim Morris <morris@wolfman.com>
Tue, 19 Nov 2013 03:15:01 +0000 (19:15 -0800)
src/modules/utils/player/Player.cpp
src/modules/utils/simpleshell/SimpleShell.cpp

index 54f848e..86190ad 100644 (file)
@@ -80,6 +80,7 @@ void Player::on_gcode_received(void *argument) {
             gcode->mark_as_taken();
             if (this->current_file_handler != NULL) {
                 this->playing_file = true;
+                // FIXME this is a problem if the stream goes away before the file has finished
                 this->reply_stream= gcode->stream;
             }
 
@@ -181,11 +182,11 @@ void Player::play_command( string parameters, StreamOutput* stream ){
 
     this->playing_file = true;
 
-    // Do not output to any stream if we were passed the -q ( quiet ) option
-    if( options.find_first_of("Qq") == string::npos ){
-        this->current_stream = stream;
-    }else{
+    // Output to the current stream if we were passed the -v ( verbose ) option
+    if( options.find_first_of("Vv") == string::npos ){
         this->current_stream = &(StreamOutput::NullStream);
+    }else{
+        this->current_stream = stream;
     }
 
     // get size of file
index 0524ff6..c4dc50b 100644 (file)
@@ -450,7 +450,7 @@ void SimpleShell::help_command( string parameters, StreamOutput *stream )
     stream->printf("pwd\r\n");
     stream->printf("cat file [limit]\r\n");
     stream->printf("rm file\r\n");
-    stream->printf("play file [-q]\r\n");
+    stream->printf("play file [-v]\r\n");
     stream->printf("progress - shows progress of current play\r\n");
     stream->printf("abort - abort currently playing file\r\n");
     stream->printf("reset - reset smoothie\r\n");