Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Preferences Class Reference

Load and save user options. More...

#include <preferences.h>

Collaboration diagram for Preferences:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void get (int &var, const char *name, const char *def)
void get (char *var, int size, const char *name, const char *def)
void get (bool &var, const char *name, const char *def)
void set (const char *name, const char *value)
 Save the user preferences.
void set (const char *name, int value)
void set (const char *name, bool value)
void addRecentFile (string filename)
void Save ()
 Save the user preferences.

Static Public Member Functions

static PreferencesgetInstance ()
 Singleton getInstance method.

Public Attributes

int defaultNormalisation
int defaultAudio
int defaultAspect
char file [512]
int fileFormat
bool autoSplit
bool timeStamp
int frames
int every
int interface
int channel
int phyID
char avcGUID [65]
int displayMode
int displayQuality
bool displayFixed
bool enableAudio
int cip_n
int cip_d
int syt_offset
bool preview_capture
bool dropFrame
char audioDevice [512]
bool enableJogShuttle
bool _isGrabbing
map< pair< unsigned short,
unsigned short >, JogShuttleMapping
_JogShuttleMappings
vector< JogShuttleActions_JogShuttleActions
bool enableV4L
bool disableKeyRepeat
int audioRendering
int maxUndos
int dvCaptureBuffers
int dvExportBuffers
bool dvDecoderClampLuma
bool dvDecoderClampChroma
int maxFileSize
bool audioScrub
char v4lVideoDevice [512]
char v4lAudioDevice [512]
char v4lInput [32]
char v4lAudio [32]
bool isOpenDML
char defaultDirectory [512]
int displayExtract
bool relativeSave
char dvCaptureDevice [512]
bool dv1394Preview
char dvExportDevice [512]
int avcPollIntervalMs
int dvExportPrerollSec
bool dvTwoPassEncoder
int windowWidth
int windowHeight
int storyboardPosition
int previewSize
int timeFormat
char metaNames [512]
 metaNames is a comma-delimited list of xml attribute names.
map< string, vector< pair<
string, string > > > 
metaValues
 metaValues is mapped to each metaName.
bool enablePublish
 enablePublish shows the Publish SMIL and Still menu items and toolbar icons.
bool expandStoryboard
char newProjectURI [512]
 If newProjectURI is not empty, then a prompt is displayed on startup when no files on command line or File/New selected.
char newProjectXPath [512]
 newProjectXPath is the XPath expression to locate the project id in the XML response from newProjectURI.
bool trimModeInsert
int exportMjpegAspect
int exportMjpegDeinterlace
int exportMjpegFormat
bool exportMjpegSceneSplit
bool exportMjpegCleanup
int exportMjpegDvdTool
char exportMjpegVideoPipe [512]
char exportMjpegAudioPipe [512]
char exportMjpegMultiplex [512]
bool enableAVC
vector< string > recentFiles

Protected Member Functions

 Preferences ()
 The constructor loads the user preferences.
 ~Preferences ()

Private Member Functions

void JogShuttleInit (void)
 Initialise JogShuttle bindings.
void JogShuttleInitNavigation (int &count)
 Set up JogShuttle navigation bindings.
void JogShuttleInitCut (int &count)
 Set up JogShuttle cut bindings.
void JogShuttleInitCopy (int &count)
 Set up JogShuttle copy bindings.
void JogShuttleInitPaste (int &count)
 Set up JogShuttle paste bindings.
void JogShuttleInitModeSwitching (int &count)
 Set up JogShuttle mode switching bindings.
void JogShuttleInitGeneral (int &count)
 Set up JogShuttle general bindings.
void JogShuttleInitTrim (int &count)
 Set up JogShuttle trim bindings.
void RecentFilesInit ()
void RecentFilesSave ()

Private Attributes

GKeyFile * config

Static Private Attributes

static Preferencesinstance = NULL
 The global prefs object.

Detailed Description

Load and save user options.

Definition at line 72 of file preferences.h.


Constructor & Destructor Documentation

Preferences::Preferences  )  [protected]
 

The constructor loads the user preferences.

Since this uses gnome-config, preferences are typically loaded from ~/.gnome/kino.

Definition at line 125 of file preferences.cc.

References audioDevice, audioRendering, audioScrub, autoSplit, avcGUID, avcPollIntervalMs, channel, cip_d, cip_n, config, defaultAspect, defaultAudio, defaultDirectory, defaultNormalisation, disableKeyRepeat, DISPLAY_XV, displayExtract, displayFixed, displayMode, displayQuality, dropFrame, dv1394Preview, dvCaptureBuffers, dvCaptureDevice, dvDecoderClampChroma, dvDecoderClampLuma, dvExportBuffers, dvExportDevice, dvExportPrerollSec, dvTwoPassEncoder, enableAudio, enableAVC, enablePublish, enableV4L, every, expandStoryboard, exportMjpegAspect, exportMjpegAudioPipe, exportMjpegCleanup, exportMjpegDeinterlace, exportMjpegDvdTool, exportMjpegFormat, exportMjpegMultiplex, exportMjpegSceneSplit, exportMjpegVideoPipe, file, fileFormat, frames, get(), interface, isOpenDML, JogShuttleInit(), kino_config_file(), maxFileSize, maxUndos, metaNames, metaValues, newProjectURI, newProjectXPath, preview_capture, previewSize, RAW_FORMAT, RecentFilesInit(), relativeSave, Save(), StringUtils::split(), storyboardPosition, syt_offset, timeFormat, timeStamp, trimModeInsert, v4lAudio, v4lAudioDevice, v4lInput, v4lVideoDevice, windowHeight, and windowWidth.

00125                          : phyID( -1 )
00126 {
00127     char* key = new char[4096];
00128     string filename;
00129     
00130     // Give the new config file priority, but failover to the old gnome-config one
00131     filename = kino_config_file();
00132     FILE *f = fopen( filename.c_str(), "r" );
00133     if ( f )
00134         fclose( f );
00135     else
00136         // Try to load old config if nothing yet found
00137         filename = string( getenv( "HOME" ) ) + string( "/.gnome2/kino" );
00138     
00139     // Read the config file
00140     config = g_key_file_new();
00141     g_key_file_load_from_file( config, filename.c_str(), G_KEY_FILE_KEEP_COMMENTS, NULL );
00142 
00143     // Put the config entries into member vars with defaults
00144     get( file, sizeof(file), "file", "capture" );
00145     get( defaultNormalisation, "defaultNormalisation", "0" );
00146     get( defaultAudio, "defaultAudio", "2" );
00147     get( defaultAspect, "defaultAspect", "0" );
00148     snprintf( key, 4096, "%d", RAW_FORMAT );
00149     get( fileFormat, "fileFormat", key );
00150     get( autoSplit, "autoSplit", "true" );
00151     get( timeStamp, "timeStamp", "false" );
00152     get( frames, "frames", "0" );
00153     get( every, "every", "1" );
00154     get( interface, "interface", "0" );
00155     get( channel, "channel", "63" );
00156     get( avcGUID, sizeof(avcGUID), "avcGUID", "" );
00157     snprintf( key, 4096, "%d", DISPLAY_XV );
00158     get( displayMode, "displayMode", key );
00159     get( displayQuality, "displayQuality", "2" );
00160     get( displayFixed, "displayFixed", "false" );
00161     get( enableAudio, "enableAudio", "true" );
00162     get( cip_n, "cip_increment", "0" );
00163     get( cip_d, "cip_threshold", "0" );
00164     get( syt_offset, "syt_offset", "0" );
00165     get( preview_capture, "preview_capture", "true" );
00166     get( dropFrame, "dropFrame", "true" );
00167     get( audioDevice, sizeof(audioDevice), "audioDevice", "default" );
00168     get( enableV4L, "enableV4L", "false" );
00169     get( disableKeyRepeat, "disableKeyRepeat", "false" );
00170     get( audioRendering, "audioRendering", "0" );
00171     get( maxUndos, "maxUndos", "50" );
00172     get( dvCaptureBuffers, "dvCaptureBuffers", "50" );
00173     get( dvExportBuffers, "dvExportBuffers", "10" );
00174     get( dvDecoderClampLuma, "dvDecoderClampLuma", "false" );
00175     get( dvDecoderClampChroma, "dvDecoderClampChroma", "false" );
00176     get( maxFileSize, "maxFileSize", "0" );
00177     get( audioScrub, "audioScrub", "false" );
00178     get( v4lVideoDevice, sizeof(v4lVideoDevice), "v4lVideoDevice", "/dev/video0" );
00179     get( v4lAudioDevice, sizeof(v4lAudioDevice), "v4lAudioDevice", "/dev/dsp" );
00180     get( v4lInput, sizeof(v4lInput), "v4lInput", "PAL" );
00181     get( v4lAudio, sizeof(v4lAudio), "v4lAudio", "32000" );
00182     get( isOpenDML, "isOpenDML", "false" );
00183     get( defaultDirectory, sizeof(defaultDirectory), "defaultDirectory", "~/" );
00184     get( displayExtract, "displayExtract", "1" );
00185     get( relativeSave, "relativeSave", "true" );
00186     get( dvCaptureDevice, sizeof(dvCaptureDevice), "dvCaptureDevice", "/dev/dv1394/0" );
00187     get( dv1394Preview, "dv1394Preview", "true" );
00188     get( dvExportDevice, sizeof(dvExportDevice), "dvExportDevice", "/dev/dv1394/0" );
00189     get( avcPollIntervalMs, "avcPollIntervalMs", "200" );
00190     get( dvExportPrerollSec, "dvExportPrerollSec", "4" );
00191     get( dvTwoPassEncoder, "dvTwoPassEncoder", "true" );
00192     get( windowWidth, "windowWidth", "-1" );
00193     get( windowHeight, "windowHeight", "-1" );
00194     get( storyboardPosition, "storyboardPosition", "-1" );
00195     get( previewSize, "previewSize", "0" );
00196     get( timeFormat, "timeFormat", "3" );
00197     get( trimModeInsert, "trimModeInsert", "false" );
00198     get( enablePublish, "enablePublish", "true" );
00199     get( expandStoryboard, "expandStoryboard", "false" );
00200     get( newProjectURI, sizeof(newProjectURI), "newProjectURI", "" );
00201     get( newProjectXPath, sizeof(newProjectXPath), "newProjectXPath", "" );
00202     get( metaNames, sizeof(metaNames), "metaNames", "*title,author,copyright,id,abstract" );
00203     get( enableAVC, "enableAVC", "true" );
00204 
00205     get( exportMjpegFormat, "exportMjpegFormat", "6" );
00206     get( exportMjpegAspect, "exportMjpegAspect", "0" );
00207     get( exportMjpegDeinterlace, "exportMjpegDeinterlace", "0" );
00208     get( exportMjpegSceneSplit, "exportMjpegSceneSplit", "false" );
00209     get( exportMjpegCleanup, "exportMjpegCleanup", "true" );
00210     get( exportMjpegDvdTool, "exportMjpegDvdTool", "1" );
00211     get( exportMjpegVideoPipe, sizeof(exportMjpegVideoPipe), "exportMjpegVideoPipe", "mpeg2enc -v 0" );
00212     get( exportMjpegAudioPipe, sizeof(exportMjpegAudioPipe), "exportMjpegAudioPipe", "mp2enc -v 0" );
00213     get( exportMjpegMultiplex, sizeof(exportMjpegMultiplex), "exportMjpegMultiplex", "mplex -v 0" );
00214 
00215     // build a metaValues key for each metaName
00216     // metaValues is a range of values to pick from
00217     // metaValue * = open-ended, values outside range permitted, can be used alongside values
00218     vector< string > metaNamesList;
00219     vector< string >::iterator metaNamesIter;
00220     
00221     StringUtils::split( metaNames, ",", metaNamesList );
00222     for ( metaNamesIter = metaNamesList.begin(); metaNamesIter != metaNamesList.end(); ++metaNamesIter )
00223     
00224     {
00225         std::ostringstream str;
00226         std::string metaname = *metaNamesIter;
00227 
00228         if ( metaname.at( 0 ) == '*' )
00229             metaname.erase( 0, 1 );
00230 
00231         str << "metaValues_" << metaname;
00232         if ( metaname == "copyright" )
00233             get( key, 4096, str.str().c_str(), "No license (All rights reserved)=-1,Creative Commons Attribution=1,Creative Commons Attribution-NoDerivs=2,Creative Commons Attribution-NonCommercial-NoDerivs=3,Creative Commons Attribution-NonCommercial=4,Creative Commons Attribution-NonCommercial-ShareAlike=5,Creative Commons Attribution-ShareAlike=6,Public Domain=7,*" );
00234         else
00235             get( key, 4096, str.str().c_str(), "*" );
00236         {
00237             vector< string > metaValuesSimpleList;
00238             vector< string >::iterator iter;
00239             vector< pair< string, string > > metaValuesList;
00240 
00241             StringUtils::split( key, ",", metaValuesSimpleList );
00242             for ( iter = metaValuesSimpleList.begin(); iter != metaValuesSimpleList.end(); ++iter )
00243             {
00244                 vector< string > labelValueVector;
00245                 pair< string, string > labelValuePair;
00246                 
00247                 StringUtils::split( *iter, "=", labelValueVector );
00248                 if ( labelValueVector.size() > 1 )
00249                     labelValuePair = make_pair( labelValueVector[0], labelValueVector[1] );
00250                 else
00251                     labelValuePair = make_pair( *iter, *iter );
00252                 metaValuesList.push_back( labelValuePair );
00253             }
00254             metaValues.insert( make_pair( metaname, metaValuesList ) );
00255         }
00256     }
00257 
00258     JogShuttleInit();
00259     RecentFilesInit();
00260     
00261     Save();
00262     delete[] key;
00263 }

Preferences::~Preferences  )  [protected]
 

Definition at line 266 of file preferences.cc.

References config.

00267 {
00268     g_key_file_free( config );
00269 }


Member Function Documentation

void Preferences::addRecentFile string  filename  ) 
 

Definition at line 791 of file preferences.cc.

References recentFiles.

00792 {
00793     vector<std::string>::iterator i;
00794     for ( i = recentFiles.begin(); i != recentFiles.end(); i++ )
00795     {
00796         if ( (*i) == filename )
00797         {
00798             recentFiles.erase( i );
00799             recentFiles.push_back( filename );
00800             break;
00801         }
00802     }
00803     if ( i == recentFiles.end() )
00804     {
00805         if ( recentFiles.size() > 4 )
00806             recentFiles.erase( recentFiles.begin() );
00807         recentFiles.push_back( filename );
00808     }
00809 }

void Preferences::get bool &  var,
const char *  name,
const char *  def
 

Definition at line 107 of file preferences.cc.

References config, and GKEYFILE_GROUP.

00108 {
00109     GError *err = NULL;
00110     var = g_key_file_get_boolean( config, GKEYFILE_GROUP, name, &err );
00111     if ( err != NULL )
00112     {
00113         var = strcmp( def, "false" );
00114         g_key_file_set_boolean( config, GKEYFILE_GROUP, name, var );
00115         g_error_free (err);
00116     }
00117 }

void Preferences::get char *  var,
int  size,
const char *  name,
const char *  def
 

Definition at line 92 of file preferences.cc.

References config, and GKEYFILE_GROUP.

00093 {
00094     gchar *temp = g_key_file_get_string( config, GKEYFILE_GROUP, name, NULL );
00095     if ( temp != NULL )
00096     {
00097         strncpy( var, temp, size - 1 );
00098         g_free( temp );
00099     }
00100     else
00101     {
00102         strncpy( var, def, size - 1 );
00103         g_key_file_set_string( config, GKEYFILE_GROUP, name, def );
00104     }
00105 }

void Preferences::get int &  var,
const char *  name,
const char *  def
 

Definition at line 80 of file preferences.cc.

References config, and GKEYFILE_GROUP.

Referenced by JogShuttleInit(), Preferences(), and RecentFilesInit().

00081 {
00082     GError *err = NULL;
00083     var = g_key_file_get_integer( config, GKEYFILE_GROUP, name, &err );
00084     if ( err != NULL )
00085     {
00086         var = atoi( def );
00087         g_key_file_set_integer( config, GKEYFILE_GROUP, name, var );
00088         g_error_free (err);
00089     }
00090 }

Preferences & Preferences::getInstance  )  [static]
 

Singleton getInstance method.

Standard pattern followed, non threadsafe but not required (at the moment) since it gets called before any threading is activated. Keep an eye on it though.

Returns:
the single instance of Preferences.

Definition at line 71 of file preferences.cc.

References instance.

Referenced by PageCapture::applyAVCState(), AspectRatioCalculator::AspectRatioCalculator(), PageMagick::AudioThread(), audioThread(), avcThread(), JogShuttle::button(), captureThread(), PageCapture::CheckDevices(), PageCapture::clean(), ExportAVI::doExport(), Export1394::doExport(), DvEncoder::DvEncoder(), EditorBackup::EditorBackup(), KinoCommon::fetchProjectMetadata(), Frame::Frame(), FindDisplayer::getDisplayer(), PlayList::GetProjectDirectory(), KinoCommon::getTimeFormat(), handleMouseScroll(), KinoCommon::importFile(), PageMagickInfo::Initialise(), AVC::isPhyIDValid(), KinoCommon::KinoCommon(), kinoDeactivate(), kinoInitialise(), kinoPostInit(), PageTrim::movedToFrame(), PageEditor::movedToFrame(), KinoCommon::newFile(), on_avc_phyid_activate(), on_capture_page_avc_button_clicked(), on_checkbutton_jogshuttle_toggled(), on_name_edited(), on_name_show_popup(), on_optionmenu_jogshuttle_action_clicked(), on_optionmenu_jogshuttle_firstsecond_button_clicked(), on_preferences_activate(), on_preferences_dialog_ok_button_clicked(), on_value_edited(), on_value_show_popup(), KinoCommon::packIt(), PageMagick::PageMagick(), PageMagick::PlayAudio(), PageCapture::processCommand(), PageCapture::processKeyboard(), processKeyboard(), FrameDisplayer::PutSound(), readThread(), PlayList::SavePlayList(), KinoCommon::setPreviewSize(), KinoCommon::setTimeFormat(), KinoCommon::setWindowTitle(), showScenesThread(), PageTrim::start(), ExportAVI::start(), Export1394::start(), PageEditor::start(), PageCapture::start(), PageBttv::start(), JogShuttle::start(), PageCapture::startCapture(), EditorBackup::Store(), PageTimeline::Thread(), KinoCommon::updateRecentFiles(), PageCapture::videoBack(), PageCapture::videoEndOfMovie(), PageCapture::videoEndOfScene(), PageCapture::videoFastForward(), PageCapture::videoForward(), PageCapture::videoNextScene(), PageCapture::videoPause(), PageCapture::videoPlay(), PageCapture::videoPreviousScene(), PageCapture::videoRewind(), PageCapture::videoShuttle(), KinoCommon::videoShuttle(), PageCapture::videoStartOfMovie(), PageCapture::videoStartOfScene(), PageCapture::videoStop(), PageMagick::VideoThread(), and videoThread().

00072 {
00073     if ( instance == NULL )
00074     {
00075         instance = new Preferences;
00076     }
00077     return *instance;
00078 }

void Preferences::JogShuttleInit void   )  [private]
 

Initialise JogShuttle bindings.

Turns out to be an evil resource hog at compile time. So it was split into several smaller functions to lower the memory footprint.

Jogshuttle stuff

Ease moving code around

Definition at line 276 of file preferences.cc.

References _isGrabbing, _JogShuttleActions, _JogShuttleMappings, count, enableJogShuttle, get(), JogShuttleInitCopy(), JogShuttleInitCut(), JogShuttleInitGeneral(), JogShuttleInitModeSwitching(), JogShuttleInitNavigation(), JogShuttleInitPaste(), and JogShuttleInitTrim().

Referenced by Preferences().

00277 {
00279     get( enableJogShuttle, "enableJogShuttle", "false" );
00280     _isGrabbing = false;
00281     /* Fill array of actions */
00282     /* Element 0 is empty */
00283     int count = 0; 
00284     /* "<none>" should always go first */
00285     _JogShuttleActions.push_back(
00286         JogShuttleActions( count++, _( "<none>" ),
00287                            "",
00288                            "" ) );
00289 
00290     _JogShuttleActions.push_back(
00291         JogShuttleActions( count++,
00292                            _( "Toggle play" ),
00293                            _( "Toggle between play and pause" ),
00294                            " " ) );
00295     
00296     JogShuttleInitNavigation(count);
00297     JogShuttleInitCut(count);
00298     JogShuttleInitCopy(count);
00299     JogShuttleInitPaste(count);
00300     JogShuttleInitModeSwitching(count);
00301     JogShuttleInitGeneral(count);
00302     JogShuttleInitTrim(count);
00303 
00304     // TODO: Add more actions?
00305 
00306     /* Actually get the preferences */
00307     get( count, "jogShuttleNumMappings", "0" );
00308     if ( 0 != count )
00309     {
00310         for ( int i = 0; i < count ; i++ )
00311         {
00312             char key[ 512 ];
00313             sprintf( key, "jogShuttleMappingFirstButton%i", i );
00314             int first_code;
00315             get( first_code, key, "0" );
00316             sprintf( key, "jogShuttleMappingSecondButton%i", i );
00317             int second_code;
00318             get( second_code, key, "0" );
00319             sprintf( key, "jogShuttleMappingAction%i", i );
00320             // g_print ( " Key = %s\n", key );
00321             get( key, sizeof(key), key, "" );
00322 
00323             // TODO: Free
00324             // g_print( "tmpstring Read action %s\n", tempString );
00325             string action = string( key );
00326             // g_print( "Read action %s\n", action.c_str() );
00327             /* Insert */
00328             _JogShuttleMappings[ make_pair ( first_code, second_code ) ]
00329             = JogShuttleMapping( action );
00330         }
00331     }
00332     else
00333     {
00334         // Set up defaults manuall, if 0 count
00335         // These are my own default mappings
00336         _JogShuttleMappings[ make_pair ( 0x100, 0x0 ) ]
00337         = JogShuttleMapping( "i" );
00338         _JogShuttleMappings[ make_pair ( 0x101, 0x0 ) ]
00339         = JogShuttleMapping( "o" );
00340         _JogShuttleMappings[ make_pair ( 0x102, 0x0 ) ]
00341         = JogShuttleMapping( "h" );
00342         _JogShuttleMappings[ make_pair ( 0x103, 0x0 ) ]
00343         = JogShuttleMapping( "l" );
00344         
00345         _JogShuttleMappings[ make_pair ( 0x113, 0x0 ) ]
00346         = JogShuttleMapping( "b" );
00347         _JogShuttleMappings[ make_pair ( 0x111, 0x0 ) ]
00348         = JogShuttleMapping( "w" );
00349         _JogShuttleMappings[ make_pair ( 0x110, 0x0 ) ]
00350         = JogShuttleMapping( " " );
00351         _JogShuttleMappings[ make_pair ( 0x112, 0x0 ) ]
00352         = JogShuttleMapping( "k" );
00353         _JogShuttleMappings[ make_pair ( 0x114, 0x0 ) ]
00354         = JogShuttleMapping( "j" );
00355         _JogShuttleMappings[ make_pair ( 0x115, 0x0 ) ]
00356         = JogShuttleMapping( "gg" );
00357         _JogShuttleMappings[ make_pair ( 0x116, 0x0 ) ]
00358         = JogShuttleMapping( "G" );
00359         
00360         _JogShuttleMappings[ make_pair ( 0x10, 0x0 ) ]
00361         = JogShuttleMapping( " " );
00362     }
00363 }

void Preferences::JogShuttleInitCopy int &  count  )  [private]
 

Set up JogShuttle copy bindings.

Definition at line 480 of file preferences.cc.

References _JogShuttleActions.

Referenced by JogShuttleInit().

00481 {
00482     _JogShuttleActions.push_back(
00483         JogShuttleActions( count++, _( "Copy current scene" ),
00484                            _( "Copy current scene" ),
00485                            "yy" ) );
00486 
00487     _JogShuttleActions.push_back(
00488         JogShuttleActions( count++, _( "Copy to end of scene" ),
00489                            _( "Copy to end of scene" ),
00490                            "y$" ) );
00491 
00492     _JogShuttleActions.push_back(
00493         JogShuttleActions( count++, _( "Copy from start of scene" ),
00494                            _( "Cut from start of scene" ),
00495                            "y0" ) );
00496 }

void Preferences::JogShuttleInitCut int &  count  )  [private]
 

Set up JogShuttle cut bindings.

Definition at line 441 of file preferences.cc.

References _JogShuttleActions.

Referenced by JogShuttleInit().

00442 {
00443     _JogShuttleActions.push_back(
00444         JogShuttleActions( count++, _( "Cut current frame" ),
00445                            _( "Cut current frame" ),
00446                            "x" ) );
00447 
00448     _JogShuttleActions.push_back(
00449         JogShuttleActions( count++, _( "Cut a second" ),
00450                            _( "Cut a second" ),
00451                            "dw" ) );
00452 
00453     _JogShuttleActions.push_back(
00454         JogShuttleActions( count++, _( "Cut current scene" ),
00455                            _( "Cut current scene" ),
00456                            "dd" ) );
00457 
00458     _JogShuttleActions.push_back(
00459         JogShuttleActions( count++, _( "Cut to end of current scene" ),
00460                            _( "Cut to end of current scene" ),
00461                            "d$" ) );
00462 
00463     _JogShuttleActions.push_back(
00464         JogShuttleActions( count++, _( "Cut to end of movie" ),
00465                            _( "Cut to end of movie" ),
00466                            "dG" ) );
00467 
00468     _JogShuttleActions.push_back(
00469         JogShuttleActions( count++, _( "Cut from start of current scene" ),
00470                            _( "Cut from start of current scene" ),
00471                            "d0" ) );
00472 
00473     _JogShuttleActions.push_back(
00474         JogShuttleActions( count++, _( "Cut from start of movie" ),
00475                            _( "Cut from start of movie" ),
00476                            "dgg" ) );
00477 }

void Preferences::JogShuttleInitGeneral int &  count  )  [private]
 

Set up JogShuttle general bindings.

Definition at line 547 of file preferences.cc.

References _JogShuttleActions.

Referenced by JogShuttleInit().

00548 {
00549     _JogShuttleActions.push_back(
00550         JogShuttleActions( count++, _( "Repeat last command" ),
00551                            _( "Repeat last command" ),
00552                            "." ) );
00553 
00554     _JogShuttleActions.push_back(
00555         JogShuttleActions( count++, _( "Split scene" ),
00556                            _( "Split scene before current frame" ),
00557                            "Ctrl+J" ) );
00558 
00559     _JogShuttleActions.push_back(
00560         JogShuttleActions( count++, _( "Join scenes" ),
00561                            _( "Join this scene with the following" ),
00562                            "J" ) );
00563 
00564     _JogShuttleActions.push_back(
00565         JogShuttleActions( count++, _( "Undo" ),
00566                            _( "Undo last command" ),
00567                            "u" ) );
00568 
00569     _JogShuttleActions.push_back(
00570         JogShuttleActions( count++, _( "Redo" ),
00571                            _( "Redo last command" ),
00572                            "Ctrl+R" ) );
00573                            
00574     _JogShuttleActions.push_back(
00575         JogShuttleActions( count++, _( "Capture/Overwrite/Export/Render" ),
00576                            _( "Start Capture, Export, or Render or Apply Overwrite" ),
00577                            "Enter" ) );
00578 
00579     _JogShuttleActions.push_back(
00580         JogShuttleActions( count++, _( "Stop" ),
00581                            _( "Stop transport, capture, export, or render" ),
00582                            "Esc" ) );
00583 
00584     _JogShuttleActions.push_back(
00585         JogShuttleActions( count++, _( "Publish SMIL" ),
00586                            _( "Publish SMIL" ),
00587                            "Ctrl+W" ) );
00588 }

void Preferences::JogShuttleInitModeSwitching int &  count  )  [private]
 

Set up JogShuttle mode switching bindings.

Definition at line 513 of file preferences.cc.

References _JogShuttleActions.

Referenced by JogShuttleInit().

00514 {
00515     _JogShuttleActions.push_back(
00516         JogShuttleActions( count++, _( "Switch to Edit" ),
00517                            _( "Switch to the edit interface" ),
00518                            "F2" ) );
00519 
00520     _JogShuttleActions.push_back(
00521         JogShuttleActions( count++, _( "Switch to Capture" ),
00522                            _( "Switch to the capture interface" ),
00523                            "A" ) );
00524 
00525     _JogShuttleActions.push_back(
00526         JogShuttleActions( count++, _( "Switch to Timeline" ),
00527                            _( "Switch to the capture interface" ),
00528                            "v" ) );
00529 
00530     _JogShuttleActions.push_back(
00531         JogShuttleActions( count++, _( "Switch to Export" ),
00532                            _( "Switch to the capture interface" ),
00533                            ":W" ) );
00534 
00535     _JogShuttleActions.push_back(
00536         JogShuttleActions( count++, _( "Switch to FX" ),
00537                            _( "Switch to the capture interface" ),
00538                            "C" ) );
00539 
00540     _JogShuttleActions.push_back(
00541         JogShuttleActions( count++, _( "Switch to Trim" ),
00542                            _( "Switch to trim mode" ),
00543                            "t" ) );
00544 }

void Preferences::JogShuttleInitNavigation int &  count  )  [private]
 

Set up JogShuttle navigation bindings.

Definition at line 366 of file preferences.cc.

References _JogShuttleActions.

Referenced by JogShuttleInit().

00367 {
00368     _JogShuttleActions.push_back(
00369         JogShuttleActions( count++, _( "Forward one frame" ),
00370                            _( "Move one frame forward" ),
00371                            "l" ) );
00372 
00373     _JogShuttleActions.push_back(
00374         JogShuttleActions( count++, _( "Back one frame" ),
00375                            _( "Move one frame backward" ),
00376                            "h" ) );
00377 
00378     _JogShuttleActions.push_back(
00379         JogShuttleActions( count++, _( "Forward one second" ),
00380                            _( "Move one second forward" ),
00381                            "w" ) );
00382 
00383     _JogShuttleActions.push_back(
00384         JogShuttleActions( count++, _( "Forward 30 seconds" ),
00385                            _( "Move 30 seconds forward" ),
00386                            "30w" ) );
00387 
00388     _JogShuttleActions.push_back(
00389         JogShuttleActions( count++, _( "Back one second" ),
00390                            _( "Move one second backward" ),
00391                            "b" ) );
00392 
00393 
00394     _JogShuttleActions.push_back(
00395         JogShuttleActions( count++, _( "Back 30 seconds" ),
00396                            _( "Move 30 seconds backward" ),
00397                            "30b" ) );
00398 
00399     _JogShuttleActions.push_back(
00400         JogShuttleActions( count++, _( "Start of scene" ),
00401                            _( "Move to start of current scene" ),
00402                            "0" ) );
00403 
00404     _JogShuttleActions.push_back(
00405         JogShuttleActions( count++, _( "End of scene" ),
00406                            _( "Move to end of current scene" ),
00407                            "$" ) );
00408 
00409     _JogShuttleActions.push_back(
00410         JogShuttleActions( count++, _( "Previous scene" ),
00411                            _( "Move to start of previous scene" ),
00412                            "k" ) );
00413 
00414     _JogShuttleActions.push_back(
00415         JogShuttleActions( count++, _( "Next scene" ),
00416                            _( "Move to start of next scene" ),
00417                            "j" ) );
00418 
00419     _JogShuttleActions.push_back(
00420         JogShuttleActions( count++, _( "First frame" ),
00421                            _( "Move to beginning of movie" ),
00422                            "gg" ) );
00423 
00424     _JogShuttleActions.push_back(
00425         JogShuttleActions( count++, _( "Last frame" ),
00426                            _( "Move to end of movie" ),
00427                            "G" ) );
00428 
00429     _JogShuttleActions.push_back(
00430         JogShuttleActions( count++, _( "Forward 5 scenes" ),
00431                            _( "Move forward 5 scenes" ),
00432                            "5$" ) );
00433 
00434     _JogShuttleActions.push_back(
00435         JogShuttleActions( count++, _( "Back 5 scene" ),
00436                            _( "Move backward 5 scenes" ),
00437                            "5^" ) );
00438 }

void Preferences::JogShuttleInitPaste int &  count  )  [private]
 

Set up JogShuttle paste bindings.

Definition at line 499 of file preferences.cc.

References _JogShuttleActions.

Referenced by JogShuttleInit().

00500 {
00501     _JogShuttleActions.push_back(
00502         JogShuttleActions( count++, _( "Paste after current frame" ),
00503                            _( "Paste after current frame" ),
00504                            "p" ) );
00505 
00506     _JogShuttleActions.push_back(
00507         JogShuttleActions( count++, _( "Paste before current frame" ),
00508                            _( "Paste before current frame" ),
00509                            "P" ) );
00510 }

void Preferences::JogShuttleInitTrim int &  count  )  [private]
 

Set up JogShuttle trim bindings.

Definition at line 591 of file preferences.cc.

References _JogShuttleActions.

Referenced by JogShuttleInit().

00592 {
00593     _JogShuttleActions.push_back(
00594         JogShuttleActions( count++, _( "Set In" ),
00595                            _( "Set the In Point to current position" ),
00596                            "i" ) );
00597 
00598     _JogShuttleActions.push_back(
00599         JogShuttleActions( count++, _( "Set Out" ),
00600                            _( "Set the Out Point to current position" ),
00601                            "o" ) );
00602 
00603     _JogShuttleActions.push_back(
00604         JogShuttleActions( count++, _( "Insert Before" ),
00605                            _( "Insert Before" ),
00606                            ":r" ) );
00607 
00608     _JogShuttleActions.push_back(
00609         JogShuttleActions( count++, _( "Insert After" ),
00610                            _( "Insert After" ),
00611                            ":a" ) );
00612 
00613     _JogShuttleActions.push_back(
00614         JogShuttleActions( count++, _( "Toggle Insert/Overwrite" ),
00615                            _( "Toggle Insert/Overwrite" ),
00616                            "Ins" ) );
00617                            
00618     _JogShuttleActions.push_back(
00619         JogShuttleActions( count++, _( "Toggle Looping" ),
00620                            _( "Toggle Looping" ),
00621                            "\\" ) );
00622 
00623     _JogShuttleActions.push_back(
00624         JogShuttleActions( count++, _( "Toggle Link" ),
00625                            _( "Toggle Link" ),
00626                            "=" ) );
00627 }

void Preferences::RecentFilesInit  )  [private]
 

Definition at line 760 of file preferences.cc.

References get(), and recentFiles.

Referenced by Preferences().

00761 {
00762     char* key = new char[64];
00763     char* value = new char[ PATH_MAX + NAME_MAX ];
00764 
00765     for ( int i = 0; i < 5 ; i++ )
00766     {
00767         sprintf( key, "recentFile%i", i );
00768         value[0] = 0;
00769         get( value, PATH_MAX + NAME_MAX, key, "" );
00770         if ( strcmp( value, "" ) )
00771             recentFiles.push_back( value );
00772     }
00773     
00774     delete[] key;
00775     delete[] value;
00776 }

void Preferences::RecentFilesSave  )  [private]
 

Definition at line 778 of file preferences.cc.

References count, recentFiles, and set().

Referenced by Save().

00779 {
00780     vector<string>::iterator i;
00781     int count = 0;
00782 
00783     for ( i = recentFiles.begin(); i != recentFiles.end(); i++, count++ )
00784     {
00785         char key[64];
00786         sprintf( key, "recentFile%i", count );
00787         set( key, (*i).c_str() );
00788     }
00789 }

void Preferences::Save  ) 
 

Save the user preferences.

Definition at line 648 of file preferences.cc.

References _JogShuttleMappings, audioDevice, audioRendering, audioScrub, autoSplit, avcGUID, avcPollIntervalMs, channel, cip_d, cip_n, config, count, defaultAspect, defaultAudio, defaultDirectory, defaultNormalisation, disableKeyRepeat, displayExtract, displayFixed, displayMode, displayQuality, dropFrame, dv1394Preview, dvCaptureBuffers, dvCaptureDevice, dvDecoderClampChroma, dvDecoderClampLuma, dvExportBuffers, dvExportDevice, dvExportPrerollSec, dvTwoPassEncoder, enableAudio, enableAVC, enableJogShuttle, enablePublish, enableV4L, every, expandStoryboard, exportMjpegAspect, exportMjpegAudioPipe, exportMjpegCleanup, exportMjpegDeinterlace, exportMjpegDvdTool, exportMjpegFormat, exportMjpegMultiplex, exportMjpegSceneSplit, exportMjpegVideoPipe, file, fileFormat, frames, interface, isOpenDML, kino_config_file(), maxFileSize, maxUndos, metaNames, newProjectURI, newProjectXPath, preview_capture, previewSize, RecentFilesSave(), relativeSave, set(), storyboardPosition, syt_offset, timeFormat, timeStamp, trimModeInsert, v4lAudio, v4lAudioDevice, v4lInput, v4lVideoDevice, windowHeight, and windowWidth.

Referenced by on_preferences_dialog_ok_button_clicked(), and Preferences().

00649 {
00650     set( "defaultNormalisation", defaultNormalisation );
00651     set( "defaultAudio", defaultAudio );
00652     set( "defaultAspect", defaultAspect );
00653     set( "file", file );
00654     set( "fileFormat", fileFormat );
00655     set( "autoSplit", autoSplit );
00656     set( "timeStamp", timeStamp );
00657     set( "frames", frames );
00658     set( "every", every );
00659     set( "interface", interface );
00660     set( "channel", channel );
00661     set( "avcGUID", avcGUID );
00662     set( "displayMode", displayMode );
00663     set( "displayQuality", displayQuality );
00664     set( "displayFixed", displayFixed );
00665     set( "enableAudio", enableAudio );
00666     set( "cip_increment", cip_n );
00667     set( "cip_threshold", cip_d );
00668     set( "syt_offset", syt_offset );
00669