Fork of Smoothie to port to mbed non-LPC targets.

Dependencies:   mbed

Fork of Smoothie by Stéphane Cachat

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Player.h Source File

Player.h

00001 /*
00002       This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
00003       Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
00004       Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
00005       You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
00006 */
00007 
00008 
00009 #ifndef PLAYER_H
00010 #define PLAYER_H
00011 
00012 #include "libs/Kernel.h"
00013 #include "libs/nuts_bolts.h"
00014 #include "libs/utils.h"
00015 #include "libs/StreamOutput.h"
00016 
00017 
00018 class Player : public Module {
00019     public:
00020         Player(){}
00021 
00022         void on_module_loaded();
00023         void on_console_line_received( void* argument );
00024         void on_main_loop( void* argument );
00025         void on_second_tick(void* argument);
00026         void on_get_public_data(void* argument);
00027         void on_set_public_data(void* argument);
00028         void on_gcode_received(void *argument);
00029 
00030     private:
00031         void play_command( string parameters, StreamOutput* stream );
00032         void progress_command( string parameters, StreamOutput* stream );
00033         void abort_command( string parameters, StreamOutput* stream );
00034 
00035         string filename;
00036 
00037         bool on_boot_gcode_enable;
00038         bool booted;
00039         string on_boot_gcode;
00040         bool playing_file;
00041         StreamOutput* current_stream;
00042         StreamOutput* reply_stream;
00043         FILE* current_file_handler;
00044         unsigned long file_size, played_cnt;
00045         unsigned long elapsed_secs;
00046 };
00047 
00048 #endif // PLAYER_H