00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PREFERENCES_H
00020 #define PREFERENCES_H 1
00021
00022 enum { AVI, PLAYLIST, RAW_DV, QT, UNKNOWN_FORMAT };
00023 enum { PAL_FORMAT, NTSC_FORMAT, AVI_DV1_FORMAT, AVI_DV2_FORMAT, QT_FORMAT, RAW_FORMAT, TEST_FORMAT, UNDEFINED };
00024 enum { DISPLAY_XX, DISPLAY_GDKRGB, DISPLAY_GDKRGB32, DISPLAY_XV, DISPLAY_SDL };
00025
00026 enum { NORM_UNSPECIFIED = 0, NORM_PAL = 1, NORM_NTSC = 2 };
00027 enum { AUDIO_32KHZ = 0, AUDIO_44KHZ = 1, AUDIO_48KHZ = 2 };
00028 enum { ASPECT_43 = 0, ASPECT_169 = 1 };
00029
00030
00031 #include <string>
00032 #include <map>
00033 #include <utility>
00034 #include <vector>
00035 using std::string;
00036 using std::map;
00037 using std::pair;
00038 using std::make_pair;
00039 using std::vector;
00040
00041 #include <glib.h>
00042
00043 class JogShuttleActions
00044 {
00045 public:
00046 int _option_index;
00047 string _short_desc;
00048 string _desc;
00049 string _action;
00050 JogShuttleActions( int option_index, string short_desc,
00051 string desc, string action ) :
00052 _option_index( option_index ), _short_desc( short_desc ),
00053 _desc( desc ), _action( action )
00054 {}
00055 }
00056 ;
00057
00058 class JogShuttleMapping
00059 {
00060 public:
00061 string _action;
00062 JogShuttleMapping( string action )
00063 : _action( action )
00064 {}
00065 JogShuttleMapping() : _action( "" )
00066 {}
00067 }
00068 ;
00069
00071
00072 class Preferences
00073 {
00074 private:
00075 static Preferences *instance;
00076 GKeyFile *config;
00077
00078
00079 void JogShuttleInit(void);
00080 void JogShuttleInitNavigation(int& count);
00081 void JogShuttleInitCut(int& count);
00082 void JogShuttleInitCopy(int& count);
00083 void JogShuttleInitPaste(int& count);
00084 void JogShuttleInitModeSwitching(int& count);
00085 void JogShuttleInitGeneral(int& count);
00086 void JogShuttleInitTrim(int& count);
00087 void RecentFilesInit();
00088 void RecentFilesSave();
00089
00090 protected:
00091 Preferences();
00092 ~Preferences();
00093
00094 public:
00095 static Preferences &getInstance();
00096
00097 void get( int& var, const char* name, const char* def );
00098 void get( char *var, int size, const char* name, const char* def );
00099 void get( bool& var, const char* name, const char* def );
00100 void set( const char *name, const char* value );
00101 void set( const char *name, int value );
00102 void set( const char *name, bool value );
00103 void addRecentFile( string filename );
00104
00105 int defaultNormalisation;
00106 int defaultAudio;
00107 int defaultAspect;
00108 char file[ 512 ];
00109 int fileFormat;
00110 bool autoSplit;
00111 bool timeStamp;
00112 int frames;
00113 int every;
00114 int interface;
00115 int channel;
00116 int phyID;
00117 char avcGUID[ 65 ];
00118 int displayMode;
00119 int displayQuality;
00120 bool displayFixed;
00121 bool enableAudio;
00122 int cip_n;
00123 int cip_d;
00124 int syt_offset;
00125 bool preview_capture;
00126 bool dropFrame;
00127 char audioDevice[ 512 ];
00128
00129
00130 bool enableJogShuttle;
00131 bool _isGrabbing;
00132
00133 map<pair<unsigned short, unsigned short>, JogShuttleMapping>
00134 _JogShuttleMappings;
00135 vector<JogShuttleActions> _JogShuttleActions;
00136
00137
00138 bool enableV4L;
00139 bool disableKeyRepeat;
00140 int audioRendering;
00141 int maxUndos;
00142 int dvCaptureBuffers;
00143 int dvExportBuffers;
00144 bool dvDecoderClampLuma;
00145 bool dvDecoderClampChroma;
00146 int maxFileSize;
00147 bool audioScrub;
00148 char v4lVideoDevice[ 512 ];
00149 char v4lAudioDevice[ 512 ];
00150 char v4lInput[ 32 ];
00151 char v4lAudio[ 32 ];
00152 bool isOpenDML;
00153 char defaultDirectory[ 512 ];
00154 int displayExtract;
00155 bool relativeSave;
00156
00157 char dvCaptureDevice[ 512 ];
00158 bool dv1394Preview;
00159 char dvExportDevice[ 512 ];
00160 int avcPollIntervalMs;
00161 int dvExportPrerollSec;
00162 bool dvTwoPassEncoder;
00163 int windowWidth;
00164 int windowHeight;
00165 int storyboardPosition;
00166 int previewSize;
00167 int timeFormat;
00168
00171
00172 char metaNames[512];
00173
00184
00185 map< string, vector< pair< string, string > > > metaValues;
00186
00188
00189 bool enablePublish;
00190
00191 bool expandStoryboard;
00192
00199
00200 char newProjectURI[512];
00201
00205
00206 char newProjectXPath[512];
00207
00208 bool trimModeInsert;
00209
00210
00211 int exportMjpegAspect;
00212 int exportMjpegDeinterlace;
00213 int exportMjpegFormat;
00214 bool exportMjpegSceneSplit;
00215 bool exportMjpegCleanup;
00216 int exportMjpegDvdTool;
00217 char exportMjpegVideoPipe[512];
00218 char exportMjpegAudioPipe[512];
00219 char exportMjpegMultiplex[512];
00220
00221
00222 bool enableAVC;
00223
00224 vector<string> recentFiles;
00225
00226 void Save();
00227 };
00228
00229 #endif