Commit | Line | Data |
---|---|---|
663d7943 L |
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 | ||
addfb453 L |
17 | #define play_command_checksum CHECKSUM("play") |
18 | #define progress_command_checksum CHECKSUM("progress") | |
19 | #define abort_command_checksum CHECKSUM("abort") | |
38776a0b | 20 | #define cd_command_checksum CHECKSUM("cd") |
addfb453 L |
21 | #define on_boot_gcode_checksum CHECKSUM("on_boot_gcode") |
22 | #define on_boot_gcode_enable_checksum CHECKSUM("on_boot_gcode_enable") | |
663d7943 L |
23 | |
24 | class Player : public Module { | |
25 | public: | |
26 | Player(){} | |
27 | ||
28 | void on_module_loaded(); | |
29 | void on_console_line_received( void* argument ); | |
30 | void on_main_loop( void* argument ); | |
63888663 | 31 | void on_second_tick(void* argument); |
35089dc7 JM |
32 | void on_get_public_data(void* argument); |
33 | void on_set_public_data(void* argument); | |
34 | ||
addfb453 L |
35 | string absolute_from_relative( string path ); |
36 | void cd_command( string parameters, StreamOutput* stream ); | |
663d7943 | 37 | void play_command( string parameters, StreamOutput* stream ); |
addfb453 L |
38 | void progress_command( string parameters, StreamOutput* stream ); |
39 | void abort_command( string parameters, StreamOutput* stream ); | |
663d7943 | 40 | |
b41aedba | 41 | private: |
addfb453 L |
42 | string current_path; |
43 | ||
7a42f8a2 | 44 | bool on_boot_gcode_enable; |
addfb453 | 45 | bool booted; |
7a42f8a2 | 46 | string on_boot_gcode; |
663d7943 L |
47 | bool playing_file; |
48 | StreamOutput* current_stream; | |
49 | FILE* current_file_handler; | |
b41aedba | 50 | long file_size, played_cnt; |
63888663 | 51 | int elapsed_secs; |
663d7943 L |
52 | }; |
53 | ||
54 | #endif // PLAYER_H |