00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _EXPORT_H
00022 #define _EXPORT_H
00023
00024 #ifdef HAVE_CONFIG_H
00025 #include <config.h>
00026 #endif
00027 #include <sys/time.h>
00028
00029 #include <gtk/gtk.h>
00030 #include "page_export.h"
00031 #include "kino_common.h"
00032
00033 extern "C"
00034 {
00035 #include "support.h"
00036 }
00037
00043 typedef enum export_mode {
00044 EXPORT_MODE_1394,
00045 EXPORT_MODE_AVI,
00046 EXPORT_MODE_STILLS,
00047 EXPORT_MODE_AUDIO,
00048 EXPORT_MODE_MJPEG,
00049 EXPORT_MODE_PIPE
00050 };
00051
00057 typedef enum export_result {
00058 EXPORT_RESULT_FAILURE,
00059 EXPORT_RESULT_SUCCESS,
00060 EXPORT_RESULT_ABORT
00061 };
00062
00065 typedef enum export_component_enum {
00066 EXPORT_SCENE_LIST = 2,
00067
00068 EXPORT_PREVIEW = 0x01000000,
00069 EXPORT_EXPORT = 0x02000000,
00070 EXPORT_PAUSE = 0x04000000
00071
00072
00073 };
00074
00080 class Export
00081 {
00082 protected:
00083
00084 gulong actions;
00085
00086
00087
00088
00089
00090 PageExport *exportPage;
00091 KinoCommon *common;
00092
00093
00094 GtkOptionMenu *menuRange;
00095 GtkSpinButton *startSpin;
00096 GtkEntry *startEntry;
00097 GtkSpinButton *endSpin;
00098 GtkEntry *endEntry;
00099 GtkSpinButton *everySpin;
00100
00101
00102
00103 GtkToggleButton *previewButton;
00104 GtkToggleButton *exportButton;
00105 GtkToggleButton *stopButton;
00106 GtkToggleButton *pauseButton;
00107
00109 double startTime;
00110 double pauseTime;
00111 double nextUpdateTime;
00112
00129 void innerLoopUpdate( int progress, int begin, int end, int every,
00130 int currentFrame = -1, const char* activity = _("Exporting") );
00131
00142 double calculateAdjustedRate( PlayList* playlist, double outputRate, int begin,
00143 int end, int every );
00144
00145
00146
00147
00148
00149 virtual void doPause();
00150
00166 virtual enum export_result
00167 doExport( PlayList * playlist, int begin, int end, int every, bool preview ) = 0;
00168
00169
00170 virtual gulong onActivate();
00171 virtual gulong onDeactivate();
00172
00173 public:
00174
00175
00176
00177
00178
00179
00180 static char * formatSecs( char * buf, int size, double seconds );
00181
00182 public:
00183 Export( PageExport *_exportPage, KinoCommon *_common );
00184 virtual ~Export( ) { }
00185
00186
00187
00188
00189
00190
00191 gulong activate();
00192 gulong deactivate();
00193 virtual void start();
00194 virtual void clean();
00195
00196
00197
00198
00199
00200
00201 void startExport( bool preview = false );
00202
00203
00204
00205 virtual void stopExport();
00206
00207
00208
00209
00210
00211
00212 virtual void pauseExport();
00213
00214 virtual void selectScene( int );
00215
00216 virtual void selectSection( int );
00217
00219 void onRangeChange( GtkSpinButton *widget );
00220 };
00221
00222 #endif