extend gkbeears fix for cd to player.cpp
[clinton/Smoothieware.git] / src / modules / utils / player / Player.h
1 /*
2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 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.
4 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.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8
9 #ifndef PLAYER_H
10 #define PLAYER_H
11
12 #include "libs/Kernel.h"
13 #include "libs/nuts_bolts.h"
14 #include "libs/utils.h"
15 #include "libs/StreamOutput.h"
16
17
18 class Player : public Module {
19 public:
20 Player(){}
21
22 void on_module_loaded();
23 void on_console_line_received( void* argument );
24 void on_main_loop( void* argument );
25 void on_second_tick(void* argument);
26 void on_get_public_data(void* argument);
27 void on_set_public_data(void* argument);
28 void on_gcode_received(void *argument);
29
30 private:
31 void play_command( string parameters, StreamOutput* stream );
32 void progress_command( string parameters, StreamOutput* stream );
33 void abort_command( string parameters, StreamOutput* stream );
34
35 string filename;
36
37 bool on_boot_gcode_enable;
38 bool booted;
39 string on_boot_gcode;
40 bool playing_file;
41 StreamOutput* current_stream;
42 StreamOutput* reply_stream;
43 FILE* current_file_handler;
44 unsigned long file_size, played_cnt;
45 unsigned long elapsed_secs;
46 };
47
48 #endif // PLAYER_H