~ubuntu-branches/debian/squeeze/stellarium/squeeze

« back to all changes in this revision

Viewing changes to src/script_mgr.h

  • Committer: Bazaar Package Importer
  • Author(s): Cédric Delfosse
  • Date: 2008-05-19 21:28:23 UTC
  • mfrom: (3.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080519212823-m5nfiuntxstxzxj7
Tags: 0.9.1-4
Add libxcursor-dev, libxfixes-dev, libxinerama-dev, libqt4-opengl-dev to
build-deps (Closes: #479906)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#ifndef _SCRIPT_MGR_H_
25
25
#define _SCRIPT_MGR_H_
26
26
 
27
 
#include <iostream>
 
27
using namespace std;
 
28
 
 
29
#include <string>
28
30
#include <fstream>
29
 
#include "stel_command_interface.h"
30
 
#include "script.h"
 
31
#include "StelModule.hpp"
31
32
 
32
33
// predeclaration
33
34
class StelCommandInterface;
34
35
class Script;
35
36
 
36
 
class ScriptMgr
 
37
class ScriptMgr : public StelModule
37
38
{
38
39
 
39
40
 public:
40
 
  ScriptMgr(StelCommandInterface * command_interface, string _data_dir);
41
 
  ~ScriptMgr();
42
 
  bool play_script(string script_file, string script_path);
 
41
  ScriptMgr(StelCommandInterface * command_interface);
 
42
  virtual ~ScriptMgr();
 
43
  
 
44
  virtual void init(const InitParser& conf);
 
45
  virtual double draw(StelCore* core) {return 0;}
 
46
  
 
47
  bool play_script(const QString& script_file, const QString& QScript_path);
43
48
  bool play_startup_script();
44
49
  void cancel_script();  // stop playing current script
45
50
  void pause_script();
50
55
  bool is_playing() { return playing; };     // is a script playing? 
51
56
  bool is_paused() { return play_paused; };     // is a script paused?
52
57
  bool is_recording() { return recording; };    // is a script being recorded? 
53
 
  void update(int delta_time);  // execute commands in running script
54
 
  string get_script_list(string directory);  // get list of scripts in a directory
55
 
  string get_script_path();
 
58
  virtual void update(double delta_time);  // execute commands in running script
 
59
  string get_script_list(QString directory);  // get list of scripts in a directory
 
60
  QString get_script_path();
56
61
  string get_record_filename() { return rec_filename; }  // file record is writing to
57
62
  void set_allow_ui(bool _aui) { allow_ui = _aui; }
58
63
  bool get_allow_ui() { return allow_ui; }
59
64
  void set_gui_debug(bool _gdebug) { gui_debug = _gdebug; }  // Should script errors be shown onscreen?
60
65
  bool get_gui_debug() { return gui_debug; }
 
66
  void set_removable_media_path(const QString& path) { RemoveableScriptDirectory = path; };
 
67
  const QString& get_removable_media_path(void) { return RemoveableScriptDirectory; };
 
68
  const bool can_write_files(void) { return scripts_can_write_files; };
61
69
 
62
70
 private:
63
71
 
71
79
  bool play_paused;// is script playback paused?
72
80
  fstream rec_file;
73
81
  string rec_filename;
74
 
  string RemoveableScriptDirectory;
 
82
  QString RemoveableScriptDirectory;
75
83
  bool RemoveableDirectoryMounted;
76
 
  string DataDir;  
77
84
  bool allow_ui;    // Allow user interface to function during scripts 
78
85
                    // (except for time related keys which control script playback)
79
86
  bool gui_debug;
 
87
  bool scripts_can_write_files;
80
88
};
81
89
 
82
90