00001 /* 00002 * page_trim.h Notebook Trim Page Object 00003 * Copyright (C) 2001-2007 Dan Dennedy <dan@dennedy.org> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software Foundation, 00017 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef _PAGE_TRIM_H 00021 #define _PAGE_TRIM_H 00022 00023 #ifdef HAVE_CONFIG_H 00024 #include <config.h> 00025 #endif 00026 00027 #include "framedisplayer.h" 00028 #include "kino_common.h" 00029 #include "page.h" 00030 #include "preferences.h" 00031 #include "gtkenhancedscale.h" 00032 #include "filehandler.h" 00033 00034 class AVIFile; 00035 00036 00037 typedef enum { 00038 PAGE_TRIM_MODE_UPDATE, 00039 PAGE_TRIM_MODE_INSERT, 00040 PAGE_TRIM_MODE_UNKNOWN = 99 00041 } PageTrimMode; 00042 00043 typedef enum { 00044 TRIM_INSERT_MODE_BEFORE, 00045 TRIM_INSERT_MODE_AFTER 00046 } TrimInsertMode; 00047 00051 class PageTrim : public Page 00052 { 00053 private: 00054 // Common object 00055 KinoCommon *common; 00056 00057 // GUI Widgets 00058 FrameDisplayer *displayer; 00059 GtkDrawingArea *frameArea; 00060 GtkLabel *positionLabelCurrent; 00061 GtkLabel *positionLabelTotal; 00062 GtkWidget *trim; 00063 GtkButton *reset_in; 00064 GtkButton *reset_out; 00065 00066 // State retention 00067 PlayList playlist; 00068 gint idleCommand; 00069 gboolean idleCommandActive; 00070 int start_orig; 00071 int update_start; 00072 int end_orig; 00073 int in_orig; 00074 int out_orig; 00075 int in; 00076 int out; 00077 int max; // the length of the clip in frames 00078 int pos; // the current frame position relative to the clip 00079 int currentScene; // a frame number valid for the current scene in the (unaltered) playlist 00080 int lastPos; 00081 PageTrimMode mode; 00082 bool changed; 00083 00084 // Playlist for holding the last copy/cut frames 00085 PlayList *g_copiedPlayList; 00086 00087 public: 00088 PageTrim( KinoCommon *common ); 00089 virtual ~PageTrim(); 00090 FrameDisplayer *getFrameDisplayer() 00091 { 00092 return this->displayer; 00093 } 00094 int getInPoint() 00095 { 00096 return this->in; 00097 } 00098 int getOutPoint() 00099 { 00100 return this->out; 00101 } 00102 PlayList &getPlayList() 00103 { 00104 return this->playlist; 00105 } 00106 int getTotalFrames() 00107 { 00108 return this->max + 1; 00109 } 00110 int getPosition() 00111 { 00112 return this->pos; 00113 } 00114 void setInPoint( int value ) 00115 { 00116 this->in = value; 00117 } 00118 void setOutPoint( int value ) 00119 { 00120 this->out = value; 00121 } 00122 void setPosition( int value ) 00123 { 00124 this->pos = value; 00125 } 00126 00127 // Overridden virtuals from Page 00128 gulong activate(); 00129 void newFile(); 00130 void start(); 00131 void clean(); 00132 gboolean processKeyboard( GdkEventKey *event ); 00133 gboolean processCommand( char *cmd ); 00134 void selectScene( int ); 00135 void videoStartOfMovie(); 00136 void videoPreviousScene(); 00137 void videoStartOfScene(); 00138 void videoRewind(); 00139 void videoBack(int step = -1); 00140 void videoPlay(); 00141 void videoForward(int step = 1); 00142 void videoFastForward(); 00143 void videoShuttle( int ); 00144 void videoNextScene(); 00145 void videoEndOfScene(); 00146 void videoEndOfMovie(); 00147 void videoPause(); 00148 void videoStop(); 00149 00150 void startNavigator(); 00151 void stopNavigator(); 00152 00153 void movedToFrame( int frame ); 00154 00155 void showFrame( int, gboolean ); 00156 void showFrame( int, Frame& ); 00157 00158 void windowMoved(); 00159 void showFrameInfo( int ); 00160 void resetInPoint(); 00161 void resetOutPoint(); 00162 int getSceneIndex(); 00163 bool loadFile( const string& ); 00164 void insertScene( TrimInsertMode ); 00165 void loadScene( int currentScene ); 00166 void saveScene(); 00167 void setMode( PageTrimMode ); 00168 void timeFormatChanged(); 00169 std::string getHelpPage() 00170 { 00171 return "trim"; 00172 } 00173 }; 00174 00175 #endif
1.4.2