#include <kino_common.h>
Collaboration diagram for KinoCommon:

Public Member Functions | |
| KinoCommon (GtkWidget *widget) | |
| Constructor for KinoCommon - initialises all GUI widgets. | |
| ~KinoCommon () | |
| Destructor for the kino common object. | |
| GtkWidget * | getWidget () |
| PlayList * | getPlayList () |
| int | getCurrentScene () |
| bool | newFile (bool prompt=true) |
| Carries out a New File request in the kino application. | |
| void | bulkLoad (int, char *[]) |
| Loads all files specified in the command line style arguments. | |
| std::string | importFile (const char *filename) |
| Give option to import a file by transcoding to DV. | |
| void | insertFile () |
| Inserts a file at the current position. | |
| void | appendFile () |
| Appends a file after the current position. | |
| void | loadFile () |
| Opens a file. | |
| bool | savePlayListAs () |
| Save the current play list with a different name to the original loaded (or previously saved as) play list file name. | |
| bool | savePlayList () |
| Save the current play list to the file used to load the playlist originally. | |
| void | saveFrame () |
| Save the current frame as a still frame. | |
| void | publishPlayList () |
| void | publishFrame () |
| void | loadPlayList (char *) |
| void | changePageRequest (int page) |
| Sends change page request to the gui. | |
| void | setCurrentPage (int page) |
| Carries out a change page - this should be triggered by changePageRequest to ensure that the GUI stays in sync with the common structure. | |
| Page * | getCurrentPage () |
| Returns the current Page object. | |
| Page * | getPage (int page) |
| Returns the Page object associated to the specified notebook page. | |
| void | activateWidgets () |
| Activate or deactivate the widgets at the request of the previous page. | |
| PageEditor * | getPageEditor () |
| Returns the Page associated to the Editor page. | |
| PageCapture * | getPageCapture () |
| Returns the Page associated to the Capture page. | |
| PageTimeline * | getPageTimeline () |
| Returns the Page associated to the Timeline page. | |
| PageBttv * | getPageBttv () |
| Returns the 'BTTV' page (test code for extending hardware support). | |
| PageExport * | getPageExport () |
| Returns the Export page. | |
| PageTrim * | getPageTrim () |
| Returns the Trim page. | |
| PageMagick * | getPageMagick () |
| Returns the Magick page. | |
| PageUndefined * | getPageUndefined () |
| Returns the Page associated to the Undefined page. | |
| int | moveToFrame () |
| Move to the current frame. | |
| int | moveToFrame (int) |
| Move to the frame specified. | |
| int | moveByFrames (int) |
| Move the frame relative to the number specified. | |
| void | showFrameInfo (int) |
| Relay the current frame info to the GUI. | |
| void | showFrameMoreInfo (Frame &, FileHandler *) |
| Display detailed information about this frame and its file. | |
| void | keyboardFeedback (const char *, const char *) |
| Relay the current command and any message associated to it. | |
| gboolean | processKeyboard (GdkEventKey *event) |
| Trigger the keyboard action of the current page. | |
| gboolean | processCommand (char *) |
| Trigger a menu command action of the current page. | |
| void | selectScene (int) |
| Trigger the select scene action of the current page. | |
| void | videoStartOfMovie () |
| Trigger the start of movie action of the current page. | |
| void | videoPreviousScene () |
| Trigger the previous scene action of the current page. | |
| void | videoStartOfScene () |
| Trigger the start of scene action of the current page. | |
| void | videoRewind () |
| Trigger the rewind action of the current page. | |
| void | videoBack (int step=-1) |
| Trigger the back action of the current page. | |
| void | videoPlay () |
| Trigger the play action of the current page. | |
| void | videoForward (int step=1) |
| Trigger the forward action of the current page. | |
| void | videoFastForward () |
| Trigger the fast forward action of the current page. | |
| void | videoNextScene () |
| Trigger the next scene action of the current page. | |
| void | videoEndOfScene () |
| Trigger the end of scene action of the current page. | |
| void | videoEndOfMovie () |
| Trigger the end movie action of the current page. | |
| void | videoPause () |
| Trigger the pause action of the current page. | |
| void | videoStop () |
| Trigger the stop action of the current page. | |
| void | videoShuttle (int) |
| Bi-directional variable-speed playback. | |
| void | windowMoved () |
| void | visibilityChanged (gboolean) |
| void | toggleComponents (component_enum, bool) |
| Set the state of toggle buttons. | |
| component_enum | getComponentState () |
| Get the current component state data. | |
| void | commitComponentState (component_enum=(component_enum) 0) |
| Set the component state data and commit it. | |
| char * | getFileToOpen (char *title, bool isDVFile, GtkWidget *widget) |
| Handles the modal dialog for collecting a file to open. | |
| char * | getFileToSaveFormat (char *title, GtkWidget *widget, int &format) |
| char * | getFileToOpen (char *title, bool isDVFile=true) |
| char * | getFileToSave (char *title) |
| char * | getFileToSaveFormat (char *title, int &format) |
| void | setPreviewSize (float factor, bool noWarning=false) |
| Resize the video preview area to a percentage of source image size. | |
| void | loadSplash (GtkDrawingArea *) |
| Load the splash image into the video preview area. | |
| void | clearPreview (GtkDrawingArea *) |
| Make the video preview area black. | |
| void | setWindowTitle () |
| Sets the document name in the window title. | |
| void | saveFrame (int, char *) |
| Save the specified frame to the specified file. | |
| bool | loadMediaObject (char *, int) |
| Loads the specified media file before the specified frame. | |
| void | packIt (const char *, const char *) |
| Set the video display to be fixed size or scalable. | |
| void | setStatusBar (const char *,...) |
| Helper function for the pages. | |
| void | setMoreInfo (bool state) |
| SMIL::Time::TimeFormat | getTimeFormat () const |
| void | setTimeFormat (SMIL::Time::TimeFormat format) |
| SMIL::MediaClippingTime & | getTime () |
| void | setCurrentScene (int frame) |
| string | getLastDirectory () |
| void | setLastDirectory (const string &value) |
| void | updateRecentFiles () |
| bool | exitKino () |
| int | checkFile (char *) |
| Determines the format of the file. | |
Static Public Member Functions | |
| static GtkWindow * | getWidgetWindow (GtkWidget *widget) |
Public Attributes | |
| int | g_currentFrame |
| gboolean | hasListChanged |
Protected Member Functions | |
| void | start () |
| Trigger the start action of the current page. | |
| void | clean () |
| Trigger the clean action of the current page. | |
| void | setFileEditted (char *) |
| void | setCurrentDirectoryFromFile (char *) |
| void | saveAVI (char *) |
| bool | loadPlayList (char *, int) |
| Loads the specified play list before the specified frame. | |
| bool | savePlayList (char *) |
| Saves the playlist. | |
| void | fetchProjectMetadata (const std::string &projectKey) |
| Uses libml2 to fetch the metadata from a CMS. | |
Private Attributes | |
| GtkWidget * | widget |
| GtkWidget * | edit_menu |
| GtkWidget * | view_menu |
| GtkNotebook * | notebook |
| GtkEntry * | command |
| GtkButton * | video_start_movie_button |
| GtkButton * | video_start_scene_button |
| GtkButton * | video_rewind_button |
| GtkButton * | video_back_button |
| GtkButton * | video_play_button |
| GtkButton * | video_stop_button |
| GtkButton * | video_forward_button |
| GtkButton * | video_fast_forward_button |
| GtkButton * | video_end_scene_button |
| GtkButton * | video_end_movie_button |
| GtkRange * | video_shuttle |
| GtkStatusbar * | statusbar |
| PlayList | playlist |
| int | currentPage |
| PageEditor * | editor |
| PageCapture * | capture |
| PageTimeline * | timeline |
| PageBttv * | bttv |
| PageExport * | exportPage |
| PageTrim * | trimPage |
| PageMagick * | magickPage |
| PageUndefined * | undefined |
| char | tempFileName [PATH_MAX+NAME_MAX] |
| char | playlistFileName [PATH_MAX+NAME_MAX] |
| gulong | component_state |
| bool | is_component_state_changing |
| string | last_directory |
| bool | showMoreInfo |
| int | currentScene |
| SMIL::MediaClippingTime | time |
| std::vector< GtkWidget * > | recentMenuItems |
As such it is responsible for providing the functionality for all GUI actions relating to widgets which are outside of an individual notebook page (ie: the menu, scene list, transport controls, command line, frame info and the notebook itself).
It is also responsible for holding the current play list.
NB: I would like to make this class more dynamic, especially in terms of notebook pages. Ideally, a notebook page would become a plug in, with each Page object being registered with this class (and a subsequent notebook page being added to the GUI). Glade (and libglade) could be used in such a scenario, but it would necessitate a separate glade project per page (I think... haven't really looked at how best to do this yet). The advantage would be that not only could third party plug-ins be developed, but irrelevant notebook pages could be discarded (ie: if you have no firewire capture card, then that page could be excluded).
Definition at line 108 of file kino_common.h.
|
|
Constructor for KinoCommon - initialises all GUI widgets.
Definition at line 90 of file kino_common.cc. References bttv, capture, component_state, currentPage, currentScene, edit_menu, editor, exportPage, g_currentFrame, Preferences::getInstance(), hasListChanged, is_component_state_changing, lookup_widget(), magickPage, notebook, setTimeFormat(), statusbar, SMIL::Time::TIME_FORMAT_FRAMES, SMIL::Time::TIME_FORMAT_NONE, timeline, trimPage, undefined, video_back_button, video_end_movie_button, video_end_scene_button, video_fast_forward_button, video_forward_button, video_play_button, video_rewind_button, video_shuttle, video_start_movie_button, video_start_scene_button, VIDEO_STOP, video_stop_button, and view_menu. 00090 : last_directory( "" ) 00091 { 00092 cerr << "> Kino Common being built" << endl; 00093 00094 // Initialise class variables from GUI components 00095 this->widget = widget; 00096 this->edit_menu = lookup_widget( widget, "edit" ); 00097 this->view_menu = lookup_widget( widget, "view1" ); 00098 this->notebook = GTK_NOTEBOOK( lookup_widget( widget, "main_notebook" ) ); 00099 this->video_start_movie_button = GTK_BUTTON( lookup_widget( widget, "video_start_movie_button" ) ); 00100 this->video_start_scene_button = GTK_BUTTON( lookup_widget( widget, "video_start_scene_button" ) ); 00101 this->video_rewind_button = GTK_BUTTON( lookup_widget( widget, "video_rewind_button" ) ); 00102 this->video_back_button = GTK_BUTTON( lookup_widget( widget, "video_back_button" ) ); 00103 this->video_play_button = GTK_BUTTON( lookup_widget( widget, "video_play_button" ) ); 00104 this->video_stop_button = GTK_BUTTON( lookup_widget( widget, "video_stop_button" ) ); 00105 this->video_forward_button = GTK_BUTTON( lookup_widget( widget, "video_forward_button" ) ); 00106 this->video_fast_forward_button = GTK_BUTTON( lookup_widget( widget, "video_fast_forward_button" ) ); 00107 this->video_end_scene_button = GTK_BUTTON( lookup_widget( widget, "video_end_scene_button" ) ); 00108 this->video_end_movie_button = GTK_BUTTON( lookup_widget( widget, "video_end_movie_button" ) ); 00109 this->video_shuttle = GTK_RANGE( lookup_widget( widget, "hscale_shuttle" ) ); 00110 this->statusbar = GTK_STATUSBAR( lookup_widget( widget, "statusbar" ) ); 00111 00112 // Create page objects 00113 this->editor = new PageEditor( this ); 00114 this->capture = new PageCapture( this ); 00115 this->timeline = new PageTimeline( this ); 00116 this->undefined = new PageUndefined( this ); 00117 this->bttv = new PageBttv( this ); 00118 this->exportPage = new PageExport( this ); 00119 this->trimPage = new PageTrim( this ); 00120 this->magickPage = new PageMagick( this ); 00121 00122 // Initialise other class variables 00123 strcpy( this->tempFileName, "" ); 00124 this->g_currentFrame = -1; 00125 this->hasListChanged = TRUE; 00126 this->currentScene = -1; 00127 this->currentPage = -1; 00128 00129 this->component_state = VIDEO_STOP; 00130 this->is_component_state_changing = false; 00131 00132 SMIL::Time::TimeFormat timeFormat = static_cast< SMIL::Time::TimeFormat >( Preferences::getInstance().timeFormat ); 00133 GtkWidget *timemenu = lookup_widget( widget, "optionmenu_time_format" ); 00134 if ( timeFormat == SMIL::Time::TIME_FORMAT_NONE ) 00135 setTimeFormat( SMIL::Time::TIME_FORMAT_FRAMES ); 00136 gtk_option_menu_set_history( GTK_OPTION_MENU( timemenu ), Preferences::getInstance().timeFormat - 1 ); 00137 00138 }
|
|
|
Destructor for the kino common object.
Definition at line 143 of file kino_common.cc. References bttv, capture, clean(), editor, exportPage, GetFileMap(), magickPage, timeline, trimPage, and undefined. 00144 {
00145 cerr << "> Kino Common being destroyed" << endl;
00146 clean();
00147 delete this->editor;
00148 delete this->capture;
00149 delete this->timeline;
00150 delete this->undefined;
00151 delete this->bttv;
00152 delete this->exportPage;
00153 delete this->trimPage;
00154 delete this->magickPage;
00155 GetFileMap() ->Clear();
00156 cerr << "> Kino Common destroyed" << endl;
00157 }
|
|
|
Activate or deactivate the widgets at the request of the previous page. This method is always called immediately after the current pages start method and can be called at the discretion of the page if required. Definition at line 1994 of file kino_common.cc. References EDIT_MENU, getCurrentPage(), GetStoryboard(), lookup_widget(), SCENE_LIST, VIDEO_BACK, video_back_button, video_end_movie_button, VIDEO_END_OF_MOVIE, video_end_scene_button, VIDEO_FAST_FORWARD, video_fast_forward_button, VIDEO_FORWARD, video_forward_button, VIDEO_NEXT_SCENE, VIDEO_PLAY, video_play_button, VIDEO_REWIND, video_rewind_button, VIDEO_SHUTTLE, video_shuttle, video_start_movie_button, VIDEO_START_OF_MOVIE, VIDEO_START_OF_SCENE, video_start_scene_button, VIDEO_STOP, video_stop_button, and widget. Referenced by PageCapture::applyAVCState(), on_preferences_dialog_ok_button_clicked(), PageExport::setCurrentMode(), PageMagick::ShowCurrentStatus(), PageCapture::start(), start(), PageCapture::startCapture(), and PageMagick::StartRender(). 01995 {
01996 component_enum pattern = ( component_enum ) ( this->getCurrentPage()->activate() ^ this->getCurrentPage()->deactivate() );
01997 gtk_widget_set_sensitive( lookup_widget( widget, "undo" ), pattern & EDIT_MENU );
01998 gtk_widget_set_sensitive( lookup_widget( widget, "redo" ), pattern & EDIT_MENU );
01999 gtk_widget_set_sensitive( lookup_widget( widget, "copy_current_scene" ), pattern & EDIT_MENU );
02000 gtk_widget_set_sensitive( lookup_widget( widget, "cut_current_scene" ), pattern & EDIT_MENU );
02001 gtk_widget_set_sensitive( lookup_widget( widget, "paste_before_current_frame" ), pattern & EDIT_MENU );
02002 gtk_widget_set_sensitive( lookup_widget( widget, "split_scene" ), pattern & EDIT_MENU );
02003 gtk_widget_set_sensitive( lookup_widget( widget, "join_scenes" ), pattern & EDIT_MENU );
02004 gtk_widget_set_sensitive( lookup_widget( widget, "button_undo" ), pattern & EDIT_MENU );
02005 gtk_widget_set_sensitive( lookup_widget( widget, "button_redo" ), pattern & EDIT_MENU );
02006 gtk_widget_set_sensitive( lookup_widget( widget, "button_cut" ), pattern & EDIT_MENU );
02007 gtk_widget_set_sensitive( lookup_widget( widget, "button_copy" ), pattern & EDIT_MENU );
02008 gtk_widget_set_sensitive( lookup_widget( widget, "button_paste" ), pattern & EDIT_MENU );
02009 gtk_widget_set_sensitive( lookup_widget( widget, "button_split" ), pattern & EDIT_MENU );
02010 gtk_widget_set_sensitive( lookup_widget( widget, "button_join" ), pattern & EDIT_MENU );
02011 GetStoryboard() ->setSensitive( pattern & SCENE_LIST );
02012 gtk_widget_set_sensitive( GTK_WIDGET( video_start_movie_button ), pattern & VIDEO_START_OF_MOVIE );
02013 gtk_widget_set_sensitive( GTK_WIDGET( video_start_scene_button ), pattern & VIDEO_START_OF_SCENE );
02014 gtk_widget_set_sensitive( GTK_WIDGET( video_rewind_button ), pattern & VIDEO_REWIND );
02015 gtk_widget_set_sensitive( GTK_WIDGET( video_back_button ), pattern & VIDEO_BACK );
02016 gtk_widget_set_sensitive( GTK_WIDGET( video_play_button ), pattern & VIDEO_PLAY );
02017 gtk_widget_set_sensitive( GTK_WIDGET( video_stop_button ), pattern & VIDEO_STOP );
02018 gtk_widget_set_sensitive( GTK_WIDGET( video_forward_button ), pattern & VIDEO_FORWARD );
02019 gtk_widget_set_sensitive( GTK_WIDGET( video_fast_forward_button ), pattern & VIDEO_FAST_FORWARD );
02020 gtk_widget_set_sensitive( GTK_WIDGET( video_end_scene_button ), pattern & VIDEO_NEXT_SCENE );
02021 gtk_widget_set_sensitive( GTK_WIDGET( video_end_movie_button ), pattern & VIDEO_END_OF_MOVIE );
02022 gtk_widget_set_sensitive( GTK_WIDGET( video_shuttle ), pattern & VIDEO_SHUTTLE );
02023 }
|
|
|
Appends a file after the current position.
Definition at line 751 of file kino_common.cc. References AVI, changePageRequest(), checkFile(), g_currentFrame, getFileToOpen(), getPageEditor(), getPlayList(), hasListChanged, importFile(), loadMediaObject(), loadPlayList(), modal_message(), moveToFrame(), PAGE_EDITOR, PLAYLIST, QT, RAW_DV, setWindowTitle(), and UNKNOWN_FORMAT. Referenced by PageEditor::processCommand(). 00752 {
00753 changePageRequest( PAGE_EDITOR );
00754 char * filename = this->getFileToOpen( _( "Choose a DV or SMIL file to append" ) );
00755 if ( filename && strcmp( filename, "" ) )
00756 {
00757 switch ( checkFile( filename ) )
00758 {
00759 case AVI:
00760 case RAW_DV:
00761 case QT:
00762 if ( loadMediaObject( filename, g_currentFrame + 1 ) )
00763 {
00764 g_currentFrame++;
00765 hasListChanged = TRUE;
00766 getPlayList() ->SetDirty( true );
00767 break;
00768 }
00769 // Else, ask to import
00770 case UNKNOWN_FORMAT:
00771 {
00772 const std::string& importedFile = importFile( filename );
00773 if ( loadMediaObject( const_cast<char*>( importedFile.c_str() ), g_currentFrame + 1 ) )
00774 {
00775 g_currentFrame++;
00776 hasListChanged = TRUE;
00777 getPlayList() ->SetDirty( true );
00778 break;
00779 }
00780 else
00781 {
00782 modal_message( _( "Failed to load media file \"%s\"" ), importedFile.c_str() );
00783 }
00784 break;
00785 }
00786 case PLAYLIST:
00787 // Insert the new smil
00788 if ( loadPlayList( filename, g_currentFrame + 1 ) )
00789 {
00790 g_currentFrame++;
00791 hasListChanged = TRUE;
00792 getPlayList() ->SetDirty( true );
00793 getPageEditor() ->snapshot();
00794 }
00795 break;
00796 }
00797 }
00798
00799 setWindowTitle();
00800 moveToFrame( );
00801 }
|
|
||||||||||||
|
Loads all files specified in the command line style arguments.
Definition at line 1433 of file kino_common.cc. References AVI, checkFile(), currentPage, g_currentFrame, getPageEditor(), getPlayList(), hasListChanged, importFile(), loadMediaObject(), loadPlayList(), lookup_widget(), modal_message(), PAGE_TRIM, PLAYLIST, QT, RAW_DV, setWindowTitle(), UNKNOWN_FORMAT, url_decode(), and widget. 01434 {
01435 char temp[ PATH_MAX + NAME_MAX ];
01436 char filename[ PATH_MAX + NAME_MAX ];
01437
01438 for ( int i = 1; i < argc; ++i )
01439 {
01440 /* Get the real name of the file, to make sure that
01441 we store absolute paths in smil files */
01442 if ( NULL != realpath( url_decode( temp, argv[ i ] ), filename ) )
01443 {
01444
01445 switch ( checkFile( filename ) )
01446 {
01447 case AVI:
01448 case RAW_DV:
01449 case QT:
01450 // a little hook to make the trimmer load the clip for insert edting
01451 if ( currentPage == PAGE_TRIM )
01452 {
01453 gtk_entry_set_text( GTK_ENTRY( lookup_widget( widget, "entry_trim_clip" ) ), filename );
01454 }
01455 else if ( loadMediaObject( filename, this->getPlayList() ->GetNumFrames() ) )
01456 {
01457 if ( g_currentFrame == -1 )
01458 g_currentFrame = 0;
01459 this->hasListChanged = TRUE;
01460 }
01461 else
01462 {
01463 cerr << "KinoCommon::bulkLoad: Failed to load " << filename << endl;
01464 }
01465 break;
01466 case PLAYLIST:
01467 {
01468 int last_count = getPlayList( ) ->GetNumFrames( );
01469 string last_doc_name = getPlayList( ) ->GetDocName( );
01470 if ( loadPlayList( filename, last_count ) )
01471 {
01472 if ( last_count == 0 && last_doc_name == "" )
01473 {
01474 getPlayList() ->SetDocName( filename );
01475 getPlayList() ->SetDirty( false );
01476 }
01477 else
01478 {
01479 getPlayList() ->SetDirty( true );
01480 }
01481 getPageEditor() ->snapshot();
01482 if ( g_currentFrame == -1 )
01483 g_currentFrame = 0;
01484 this->hasListChanged = TRUE;
01485 }
01486 }
01487 break;
01488 case UNKNOWN_FORMAT:
01489 {
01490 const std::string& importedFile = importFile( filename );
01491 if ( currentPage == PAGE_TRIM )
01492 {
01493 gtk_entry_set_text( GTK_ENTRY( lookup_widget( widget, "entry_trim_clip" ) ), importedFile.c_str() );
01494 }
01495 else if ( loadMediaObject( const_cast<char*>( importedFile.c_str() ), this->getPlayList() ->GetNumFrames() ) )
01496 {
01497 if ( g_currentFrame == -1 )
01498 g_currentFrame = 0;
01499 hasListChanged = TRUE;
01500 getPlayList() ->SetDirty( true );
01501 }
01502 else
01503 {
01504 modal_message( _( "Failed to load media file \"%s\"" ), importedFile.c_str() );
01505 }
01506 }
01507 break;
01508 }
01509 }
01510 else
01511 {
01512 cerr << "KinoCommon::bulkLoad: Unable to resolve " << filename << endl;
01513 }
01514 }
01515
01516 setWindowTitle( );
01517 }
|
|
|
Sends change page request to the gui.
Definition at line 408 of file kino_common.cc. References notebook. Referenced by appendFile(), insertFile(), loadFile(), newFile(), on_iconview_timeline_item_activated(), on_iconview_timeline_selection_changed(), PageTrim::processCommand(), PageTimeline::processCommand(), PageMagick::processCommand(), PageExport::processCommand(), PageEditor::processCommand(), PageCapture::processCommand(), PageTrim::processKeyboard(), PageTimeline::processKeyboard(), PageMagick::processKeyboard(), PageExport::processKeyboard(), and PageCapture::processKeyboard(). 00409 {
00410 gtk_notebook_set_page( notebook, page );
00411 }
|
|
|
Determines the format of the file. It is required that a file be at least 20 bytes for it to load. Note that it is currently required that mediafiles have either a .dv or .avi suffix since the PlayList uses the suffixes .avi and .dv to determine what FileHandler to create. Smil files are allowed to load without suffixes. (Correct?)
Definition at line 1240 of file kino_common.cc. References AVI, PLAYLIST, QT, RAW_DV, and UNKNOWN_FORMAT. Referenced by appendFile(), bulkLoad(), generate_file_preview(), insertFile(), loadFile(), on_combo_trim_clip_entry_changed(), and on_combo_trim_clip_entry_focus_out_event(). 01241 {
01242 // Try reading a few bytes from the file ...
01243 std::ifstream file( FileName );
01244 std::vector<char> buffer( 22, '\0' );
01245 file.read( &buffer[ 0 ], buffer.size() );
01246
01247 // If it didn't work, we're done ...
01248 if ( file.bad() )
01249 {
01250 cerr << "> Error reading file: " << FileName << endl;
01251 return UNKNOWN_FORMAT;
01252 }
01253
01254 // If the file is shorter than our buffer, we're done ...
01255 if ( file.eof() )
01256 {
01257 cerr << "> File size < " << buffer.size() << " bytes: " << FileName << endl;
01258 return UNKNOWN_FORMAT;
01259 }
01260
01261 // Start looking at file suffixes ...
01262 const std::string filename( FileName );
01263 const std::string suffix( filename.begin() + filename.rfind( "." ), filename.end() );
01264
01265 if ( suffix == ".avi" )
01266 {
01267 return AVI;
01268 }
01269 else if ( suffix == ".dv" || suffix == ".dif" )
01270 {
01271 // This bit of magic brought to you from the dvgrab AVI iso handler ...
01272 const unsigned char * const p = reinterpret_cast<unsigned char*>( &buffer[ 0 ] );
01273 const int section_type = p[ 0 ] >> 5;
01274 const int dif_sequence = p[ 1 ] >> 4;
01275
01276 if ( 0 == section_type && 0 == dif_sequence )
01277 return RAW_DV;
01278
01279 return UNKNOWN_FORMAT;
01280 }
01281 else if ( suffix == ".mov" )
01282 {
01283 return QT;
01284 }
01285
01286 // Check to see if it's SMIL ...
01287 const std::string smil_magic( "<?xml version=\"1.0\"?>" );
01288 if ( std::string( buffer.begin(), buffer.begin() + smil_magic.size() ) == smil_magic )
01289 return PLAYLIST;
01290
01291 // No can do!
01292 return UNKNOWN_FORMAT;
01293 }
|
|
|
Trigger the clean action of the current page.
Definition at line 1747 of file kino_common.cc. References getCurrentPage(). Referenced by newFile(), setCurrentPage(), and ~KinoCommon(). 01748 {
01749 getCurrentPage() ->clean();
01750 }
|
|
|
Make the video preview area black.
Definition at line 2247 of file kino_common.cc. References widget. Referenced by PageTrim::windowMoved(), and PageCapture::windowMoved(). 02248 {
02249 GtkWidget * widget = GTK_WIDGET( drawable );
02250 if ( widget->window && GDK_IS_DRAWABLE( widget->window ) )
02251 {
02252 gdk_draw_rectangle ( widget->window, widget->style->black_gc, TRUE,
02253 widget->allocation.x, widget->allocation.y,
02254 widget->allocation.width, widget->allocation.height );
02255 }
02256 }
|
|
|
Set the component state data and commit it. You can set component state at the same time too. See the toggleComponents() method.
Definition at line 2091 of file kino_common.cc. References component_state, and is_component_state_changing. Referenced by PageCapture::applyAVCState(), PageCapture::start(), start(), PageCapture::startCapture(), PageMagick::StartRender(), videoBack(), videoEndOfMovie(), videoEndOfScene(), videoFastForward(), videoForward(), videoNextScene(), videoPause(), PageMagick::videoPlay(), videoPlay(), videoPreviousScene(), videoRewind(), videoShuttle(), videoStartOfMovie(), videoStartOfScene(), and videoStop(). 02092 {
02093 this->component_state |= pattern;
02094 this->is_component_state_changing = false;
02095 }
|
|
|
Definition at line 2303 of file kino_common.cc. References newFile(). 02304 {
02305 return newFile( false );
02306 }
|
|
|
Uses libml2 to fetch the metadata from a CMS. Added for tagesschau.de. It uses config items newProjectURI to make an HTTP request and newProjectXPath to extract the project ID, and expands metaValues containing xpaths.
Definition at line 168 of file kino_common.cc. References Preferences::getInstance(), getPlayList(), and modal_message(). Referenced by loadFile(), loadPlayList(), and newFile(). 00169 {
00170 if ( projectKey == "" )
00171 return;
00172
00173 // Fetch the project metadata from CMS
00174 char uri[1024];
00175 uri[1023] = '\0';
00176 snprintf( uri, 1023, Preferences::getInstance().newProjectURI, projectKey.c_str() );
00177 cerr << "Composed Project URI " << uri << endl;
00178 xmlNanoHTTPInit();
00179 void *httpContext = xmlNanoHTTPOpen( uri, NULL );
00180 int code = 0;
00181 if ( httpContext && ( code = xmlNanoHTTPReturnCode( httpContext ) ) == 200 )
00182 {
00183 char *buffer = (char*) calloc( 1, 1000 );
00184 int size = 0;
00185 int nread;
00186 while ( ( nread = xmlNanoHTTPRead( httpContext, buffer + size, 999 ) ) > 0 )
00187 {
00188 size += nread;
00189 if ( nread == 999 )
00190 {
00191 buffer = ( char* )realloc( buffer, size + 999 );
00192 buffer[ size + 1 ] = '\0';
00193 }
00194 }
00195
00196 // Parse the response
00197 xmlDocPtr doc = xmlParseMemory( buffer, size );
00198 xmlXPathInit();
00199 xmlXPathContextPtr xpathContext = xmlXPathNewContext( doc );
00200 if ( xpathContext )
00201 {
00202 xmlXPathObjectPtr xpathResult;
00203
00204 // Extract the project ID
00205 if ( strcmp( Preferences::getInstance().newProjectXPath, "" ) )
00206 {
00207 xpathResult = xmlXPathEval( (xmlChar*) Preferences::getInstance().newProjectXPath, xpathContext );
00208 if ( xpathResult )
00209 {
00210 if ( xpathResult->type == XPATH_NODESET && !xmlXPathNodeSetIsEmpty( xpathResult->nodesetval ) )
00211 {
00212 getPlayList()->SetDocId( (char*) xmlXPathCastToString( xpathResult ) );
00213 cerr << "newProject ID = " << xmlXPathCastToString( xpathResult ) << endl;
00214 if ( strcmp( reinterpret_cast< char* >( xmlXPathCastToString( xpathResult ) ), "" ) == 0 )
00215 modal_message( _("The server returned an empty response.\n\nPlease choose File/New to query the server again.") );
00216 }
00217 else
00218 modal_message( _("Failed to parse project metadata:\nthe result of newProjectXPath is empty") );
00219 xmlXPathFreeObject( xpathResult );
00220 }
00221 else
00222 modal_message( _("Failed to parse project metadata:\nbad newProjectXPath expression") );
00223 }
00224
00225 // Expand metaValues
00226 map< string, vector< std::pair< std::string, std::string > > >& metaValuesMap = Preferences::getInstance().metaValues;
00227 map< string, vector< std::pair< std::string, std::string > > >::iterator metaValuesMapIter;
00228 for ( metaValuesMapIter = metaValuesMap.begin(); metaValuesMapIter != metaValuesMap.end(); ++metaValuesMapIter )
00229 {
00230 if ( metaValuesMapIter->second.size() > 0 )
00231 {
00232 const string labelPath = metaValuesMapIter->second[0].first;
00233 const string valuePath = metaValuesMapIter->second[0].second;
00234
00235 // Expand the label
00236 if ( labelPath.length() > 5 && labelPath.substr( 0, 6 ) == "xpath:" )
00237 {
00238 // remove the xpath from the values
00239 metaValuesMapIter->second.erase( metaValuesMapIter->second.begin() );
00240
00241 xpathResult = xmlXPathEval( (xmlChar*) labelPath.substr( 6 ).c_str(), xpathContext );
00242 if ( xpathResult )
00243 {
00244 if ( xpathResult->type == XPATH_NODESET )
00245 {
00246 for ( int i = 0; i < xmlXPathNodeSetGetLength( xpathResult->nodesetval ); i++ )
00247 {
00248 string label( (char *) xmlXPathCastNodeToString( xmlXPathNodeSetItem( xpathResult->nodesetval, i ) ) );
00249 metaValuesMapIter->second.push_back( make_pair( label, label ) );
00250 }
00251 }
00252 xmlXPathFreeObject( xpathResult );
00253 }
00254 else
00255 modal_message( _("Failed to parse project metadata:\nbad metaValues XPath expression") );
00256 }
00257
00258 // Expand the value
00259 if ( valuePath.length() > 5 && valuePath.substr( 0, 6 ) == "xpath:" )
00260 {
00261 xpathResult = xmlXPathEval( (xmlChar*) valuePath.substr( 6 ).c_str(), xpathContext );
00262 if ( xpathResult )
00263 {
00264 if ( xpathResult->type == XPATH_NODESET )
00265 {
00266 for ( int i = 0; i < xmlXPathNodeSetGetLength( xpathResult->nodesetval ); i++ )
00267 metaValuesMapIter->second[ i ].second =
00268 (char *) xmlXPathCastNodeToString( xmlXPathNodeSetItem( xpathResult->nodesetval, i ) );
00269 }
00270 xmlXPathFreeObject( xpathResult );
00271 }
00272 else
00273 modal_message( _("Failed to parse project metadata:\nbad metaValues XPath expression") );
00274 }
00275 }
00276 }
00277
00278 xmlXPathFreeContext( xpathContext );
00279 }
00280
00281 free( buffer );
00282 }
00283 else if ( httpContext )
00284 {
00285 modal_message( "Server responded with error %d", code );
00286 }
00287 if ( httpContext )
00288 xmlNanoHTTPClose( httpContext );
00289
00290 xmlNanoHTTPCleanup();
00291 }
|
|
|
Get the current component state data.
Definition at line 2079 of file kino_common.cc. References component_state. Referenced by PageCapture::applyAVCState(), PageTrim::processKeyboard(), PageCapture::processKeyboard(), start(), PageMagick::StartRender(), PageTrim::videoBack(), PageMagick::videoBack(), PageEditor::videoBack(), PageTrim::videoEndOfMovie(), PageMagick::videoEndOfMovie(), PageEditor::videoEndOfMovie(), PageTrim::videoFastForward(), PageEditor::videoFastForward(), PageTrim::videoForward(), PageMagick::videoForward(), PageEditor::videoForward(), PageMagick::videoNextScene(), PageTrim::videoPause(), PageTrim::videoPlay(), PageMagick::videoPlay(), PageEditor::videoPlay(), PageMagick::videoPreviousScene(), PageTrim::videoRewind(), PageEditor::videoRewind(), videoShuttle(), PageMagick::videoStartOfMovie(), PageTrim::videoStop(), PageMagick::videoStop(), and PageEditor::videoStop(). 02080 {
02081 return ( component_enum ) this->component_state;
02082 }
|
|
|
Returns the current Page object.
Definition at line 475 of file kino_common.cc. References getPage(), and getPageUndefined(). Referenced by activateWidgets(), clean(), loadFile(), loadPlayList(), moveToFrame(), on_preferences_dialog_ok_button_clicked(), processCommand(), processKeyboard(), selectScene(), setTimeFormat(), showFrameInfo(), start(), videoBack(), videoEndOfMovie(), videoEndOfScene(), videoFastForward(), videoForward(), videoNextScene(), videoPause(), videoPlay(), videoPreviousScene(), videoRewind(), videoShuttle(), videoStartOfMovie(), videoStartOfScene(), videoStop(), visibilityChanged(), and windowMoved(). 00476 {
00477 Page * ret = getPage( this->currentPage );
00478 if ( ret == NULL )
00479 ret = getPageUndefined();
00480 return ret;
00481 }
|
|
|
Definition at line 179 of file kino_common.h. References currentScene. Referenced by on_tool_change(), showScenesThread(), and Storyboard::Storyboard(). 00180 {
00181 return this->currentScene;
00182 }
|
|
||||||||||||
|
Definition at line 258 of file kino_common.h. References getFileToOpen(), and getWidget(). 00259 {
00260 return getFileToOpen( title, isDVFile, getWidget() );
00261 }
|
|
||||||||||||||||
|
Handles the modal dialog for collecting a file to open. The file is not opened, but returned by this method.
Definition at line 1079 of file kino_common.cc. References directory_utils::get_directory_from_file(), getPlayList(), getWidgetWindow(), last_directory, tempFileName, and update_preview_cb(). Referenced by appendFile(), getFileToOpen(), insertFile(), loadFile(), ImageCreateFromFile::on_button_file_clicked(), AudioMix::on_button_mix_file_clicked(), AudioDub::on_button_sub_file_clicked(), and on_button_trim_open_clicked(). 01080 {
01081 GtkWidget *dialog;
01082 GtkDrawingArea *preview;
01083 GtkFileFilter *filter;
01084
01085 dialog = gtk_file_chooser_dialog_new( title,
01086 getWidgetWindow(widget),
01087 GTK_FILE_CHOOSER_ACTION_OPEN,
01088 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
01089 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
01090 static_cast<gchar*>( NULL ) );
01091 gtk_dialog_set_alternative_button_order( GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT, GTK_RESPONSE_CANCEL, -1 );
01092 // gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER(dialog), TRUE );
01093
01094 if ( isDVFile )
01095 {
01096 preview = ( GtkDrawingArea* )gtk_drawing_area_new();
01097 gtk_widget_set_size_request( GTK_WIDGET(preview), 160, 120 );
01098 gtk_file_chooser_set_preview_widget( GTK_FILE_CHOOSER(dialog),
01099 GTK_WIDGET(preview) );
01100 g_signal_connect( dialog, "update-preview",
01101 G_CALLBACK(update_preview_cb), preview );
01102
01103 filter = gtk_file_filter_new();
01104 gtk_file_filter_set_name( filter, "All Files" );
01105 gtk_file_filter_add_pattern( filter, "*" );
01106 gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter );
01107
01108 filter = gtk_file_filter_new();
01109 gtk_file_filter_set_name( filter, "SMIL Files (*.smil, *.kino)" );
01110 gtk_file_filter_add_pattern( filter, "*.smil" );
01111 gtk_file_filter_add_pattern( filter, "*.kino" );
01112 gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter );
01113
01114 filter = gtk_file_filter_new();
01115 gtk_file_filter_set_name( filter, "Raw DV Files (*.dv, *.dif)" );
01116 gtk_file_filter_add_pattern( filter, "*.dv" );
01117 gtk_file_filter_add_pattern( filter, "*.dif" );
01118 gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter );
01119
01120 filter = gtk_file_filter_new();
01121 gtk_file_filter_set_name( filter, "AVI Files (*.avi)" );
01122 gtk_file_filter_add_pattern( filter, "*.avi" );
01123 gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter );
01124
01125 #ifdef HAVE_LIBQUICKTIME
01126 filter = gtk_file_filter_new();
01127 gtk_file_filter_set_name( filter, "Quicktime Files (*.mov)" );
01128 gtk_file_filter_add_pattern( filter, "*.mov" );
01129 gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter );
01130 #endif
01131 }
01132
01133 gtk_window_set_modal( GTK_WINDOW( dialog ), TRUE );
01134 if ( last_directory == "" )
01135 {
01136 string directory = getPlayList() ->GetProjectDirectory( );
01137 if ( directory != "" )
01138 gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER( dialog ), ( char * ) ( directory + "/" ).c_str() );
01139 last_directory = directory;
01140 }
01141 else
01142 {
01143 gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER( dialog ), ( char * ) ( last_directory + "/" ).c_str() );
01144 }
01145 if (gtk_dialog_run( GTK_DIALOG( dialog ) ) == GTK_RESPONSE_ACCEPT) {
01146 gchar *filename = gtk_file_chooser_get_filename(
01147 GTK_FILE_CHOOSER( dialog ));
01148 if ( filename )
01149 {
01150 strncpy( tempFileName, filename, sizeof(tempFileName) );
01151 last_directory = directory_utils::get_directory_from_file( filename );
01152 g_free( filename );
01153 }
01154 else
01155 strcpy( tempFileName, "" );
01156 } else
01157 strcpy( tempFileName, "" );
01158
01159 gtk_widget_destroy( dialog );
01160 return tempFileName;
01161 }
|
|
|
Definition at line 262 of file kino_common.h. References getFileToSaveFormat(), and getWidget(). Referenced by on_button_export_audio_file_clicked(), on_button_export_avi_file_clicked(), on_button_export_mjpeg_file_clicked(), on_button_export_pipe_file_clicked(), on_button_export_stills_file_clicked(), on_button_magick_file_clicked(), on_button_v4l_file_clicked(), on_capture_file_button_clicked(), publishFrame(), PageCapture::saveFrame(), and saveFrame(). 00263 {
00264 int format = 0;
00265 return getFileToSaveFormat( title, getWidget(), format );
00266 }
|
|
||||||||||||
|
Definition at line 267 of file kino_common.h. References getFileToSaveFormat(), and getWidget(). 00268 {
00269 return getFileToSaveFormat( title, getWidget(), format );
00270 }
|
|
||||||||||||||||
|
Definition at line 1163 of file kino_common.cc. References getPlayList(), getWidgetWindow(), last_directory, and tempFileName. Referenced by getFileToSave(), getFileToSaveFormat(), on_button_capture_open_clicked(), and savePlayListAs(). 01164 {
01165 GtkWidget *dialog;
01166 GtkComboBox* formatCombo = NULL;
01167
01168 dialog = gtk_file_chooser_dialog_new( title,
01169 getWidgetWindow(widget),
01170 GTK_FILE_CHOOSER_ACTION_SAVE,
01171 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
01172 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
01173 static_cast<gchar*>( NULL ) );
01174 gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, GTK_RESPONSE_CANCEL, -1);
01175 gtk_window_set_modal( GTK_WINDOW( dialog ), TRUE );
01176 gtk_dialog_set_default_response( GTK_DIALOG( dialog ), GTK_RESPONSE_ACCEPT );
01177
01178 if ( format )
01179 {
01180 GtkWidget* hbox = gtk_hbox_new( FALSE, 6 );
01181 GtkWidget* label = gtk_label_new_with_mnemonic( _("F_ormat:") );
01182
01183 formatCombo = GTK_COMBO_BOX( gtk_combo_box_new_text() );
01184 gtk_widget_show( hbox );
01185 gtk_widget_show( label );
01186 gtk_widget_show( GTK_WIDGET( formatCombo ) );
01187
01188 gtk_combo_box_append_text( formatCombo, "SMIL 2.0" );
01189 gtk_combo_box_append_text( formatCombo, "Kino < 0.9.1 XML" );
01190 gtk_combo_box_append_text( formatCombo, "MJPEG Tools ELI" );
01191 gtk_combo_box_append_text( formatCombo, "SRT subtitle" );
01192 gtk_combo_box_set_active( formatCombo, 0 );
01193 gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
01194 gtk_box_pack_start( GTK_BOX(hbox), GTK_WIDGET(formatCombo), FALSE, FALSE, 0 );
01195 gtk_file_chooser_set_extra_widget( GTK_FILE_CHOOSER( dialog ), hbox );
01196 }
01197
01198 if ( last_directory == "" )
01199 {
01200 string directory = getPlayList() ->GetProjectDirectory( );
01201 if ( directory != "" )
01202 gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER( dialog ), ( char * ) ( directory + "/" ).c_str() );
01203 last_directory = directory;
01204 }
01205 else
01206 {
01207 gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER( dialog ), ( char * ) ( last_directory + "/" ).c_str() );
01208 }
01209 if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
01210 char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
01211 if ( filename )
01212 {
01213 strncpy (tempFileName, filename, sizeof(tempFileName));
01214 g_free (filename);
01215 }
01216 else
01217 strcpy( tempFileName, "" );
01218 } else
01219 strcpy(tempFileName, "");
01220 if ( format )
01221 format = gtk_combo_box_get_active( GTK_COMBO_BOX(formatCombo) );
01222
01223 gtk_widget_destroy (dialog);
01224 return tempFileName;
01225 }
|
|
|
Definition at line 295 of file kino_common.h. References PlayList::GetProjectDirectory(), last_directory, and playlist. 00296 {
00297 if ( last_directory == "" )
00298 last_directory = playlist.GetProjectDirectory( );
00299 return ( last_directory + "/" );
00300 }
|
|
|
Returns the Page object associated to the specified notebook page.
Definition at line 438 of file kino_common.cc. References getPageBttv(), getPageCapture(), getPageEditor(), getPageExport(), getPageMagick(), getPageTimeline(), getPageTrim(), PAGE_BTTV, PAGE_CAPTURE, PAGE_EDITOR, PAGE_EXPORT, PAGE_MAGICK, PAGE_TIMELINE, and PAGE_TRIM. Referenced by getCurrentPage(), and newFile(). 00439 {
00440 Page * ret = NULL;
00441
00442 switch ( page )
00443 {
00444 case PAGE_EDITOR:
00445 ret = getPageEditor();
00446 break;
00447 case PAGE_CAPTURE:
00448 ret = getPageCapture();
00449 break;
00450 case PAGE_TIMELINE:
00451 ret = getPageTimeline();
00452 break;
00453 case PAGE_TRIM:
00454 ret = getPageTrim();
00455 break;
00456 case PAGE_EXPORT:
00457 ret = getPageExport();
00458 break;
00459 case PAGE_MAGICK:
00460 ret = getPageMagick();
00461 break;
00462 case PAGE_BTTV:
00463 ret = getPageBttv();
00464 break;
00465 }
00466
00467 return ret;
00468 }
|
|
|
Returns the 'BTTV' page (test code for extending hardware support).
Definition at line 528 of file kino_common.cc. References bttv. Referenced by getPage(), on_v4l_capture_page_record_button_clicked(), and on_v4l_capture_page_stop_button_clicked(). 00529 {
00530 return bttv;
00531 }
|
|
|
Returns the Page associated to the Capture page.
Definition at line 498 of file kino_common.cc. References capture. Referenced by avcThread(), captureThread(), getPage(), on_capture_page_avc_button_clicked(), AVC::ResetHandler(), saveFrame(), setPreviewSize(), and videoThread(). 00499 {
00500 return capture;
00501 }
|
|
|
Returns the Page associated to the Editor page.
Definition at line 488 of file kino_common.cc. References editor. Referenced by appendFile(), audioThread(), bulkLoad(), PageCapture::collectFiles(), ExportMJPEG::createAuthorXml(), ExportAVI::doExport(), getPage(), getSceneFromPath(), PageTrim::getSceneIndex(), insertFile(), PageTrim::insertScene(), loadFile(), loadMediaObject(), loadPlayList(), PageTrim::movedToFrame(), PageMagick::movedToFrame(), Storyboard::moveScene(), newFile(), PageTrim::processCommand(), readThread(), PageTrim::saveScene(), PageTrim::selectScene(), PageTimeline::selectScene(), PageMagick::selectScene(), Export::selectScene(), setCurrentScene(), showScenesThread(), PageTimeline::start(), PageMagick::StartRender(), PageCapture::stopCapture(), and videoThread(). 00489 {
00490 return editor;
00491 }
|
|
|
Returns the Export page.
Definition at line 538 of file kino_common.cc. References exportPage. Referenced by getPage(), on_spinbutton_export_range_start_end_changed(), and Export::selectSection(). 00539 {
00540 return exportPage;
00541 }
|
|
|
|
Returns the Page associated to the Timeline page.
Definition at line 508 of file kino_common.cc. References timeline. Referenced by getPage(), and on_timeline_ok_button_pressed(). 00509 {
00510 return timeline;
00511 }
|
|
|
Returns the Trim page.
Definition at line 548 of file kino_common.cc. References trimPage. Referenced by audioThread(), getPage(), moveByFrames(), moveToFrame(), on_button_trim_in_reset_clicked(), on_button_trim_in_set_clicked(), on_button_trim_insert_after_clicked(), on_button_trim_insert_before_clicked(), on_button_trim_out_reset_clicked(), on_button_trim_out_set_clicked(), on_combo_trim_clip_entry_changed(), on_combo_trim_clip_entry_focus_out_event(), on_menuitem_trim_insert_activate(), on_menuitem_trim_update_activate(), on_trim_value_changed_event(), PageTrim::processCommand(), readThread(), and videoThread(). 00549 {
00550 return trimPage;
00551 }
|
|
|
Returns the Page associated to the Undefined page.
Definition at line 518 of file kino_common.cc. References undefined. Referenced by getCurrentPage(). 00519 {
00520 return undefined;
00521 }
|
|
|
|
|
|
|
Definition at line 74 of file kino_common.cc. Referenced by getFileToOpen(), getFileToSaveFormat(), GetKinoWidgetWindow(), importFile(), modal_confirm_with_parent(), modal_message_with_parent(), and modal_prompt_with_parent(). 00075 {
00076 if(widget)
00077 if(GTK_IS_WINDOW(widget))
00078 return GTK_WINDOW(widget);
00079 else
00080 return getWidgetWindow(widget->parent);
00081 else
00082 return NULL;
00083 }
|
|
|
Give option to import a file by transcoding to DV.
Definition at line 566 of file kino_common.cc. References ASPECT_169, AUDIO_32KHZ, AUDIO_44KHZ, AUDIO_48KHZ, command, g_currentFrame, Frame::GetAudioInfo(), GetFramePool(), Preferences::getInstance(), getPlayList(), getWidget(), getWidgetWindow(), Frame::IsPAL(), lookup_widget(), modal_confirm(), NORM_NTSC, NORM_PAL, NORM_UNSPECIFIED, StringUtils::replaceAll(), and widget. Referenced by appendFile(), bulkLoad(), insertFile(), loadFile(), and on_combo_trim_clip_entry_changed(). 00567 {
00568 std::string importedFile( filename );
00569
00570 if ( modal_confirm( GTK_STOCK_OK, NULL,
00571 _("\"%s\" is not a DV file. Do you want to import it?"), filename )
00572 == GTK_RESPONSE_ACCEPT )
00573 {
00574 char * args[ 7 ];
00575 int pid, status = -1;
00576 GError *gerror = NULL;
00577 gboolean visible = TRUE;
00578 GtkWidget *dialog = lookup_widget( widget, "import_window" );
00579 GtkProgressBar *progressBar = GTK_PROGRESS_BAR( lookup_widget( widget, "progressbar_import" ) );
00580 char *kinoHome = getenv("KINO_HOME");
00581 string homeFile;
00582 int testHomeFile = 0;
00583
00584 if ( kinoHome )
00585 homeFile = string( kinoHome ) + string( "/import/media.sh" );
00586 else
00587 homeFile = string( getenv( "HOME" ) ) + string( "/kino/import/media.sh" );
00588
00589 gtk_window_set_transient_for( GTK_WINDOW( dialog ), GTK_WINDOW( getWidgetWindow( getWidget() ) ) );
00590 gtk_progress_bar_pulse( progressBar );
00591 gtk_widget_show_all( dialog );
00592
00593 // Check if media is loaded
00594 if ( g_currentFrame == -1 )
00595 {
00596 // Use Preferences/Defaults
00597 if ( Preferences::getInstance().defaultNormalisation == NORM_UNSPECIFIED )
00598 {
00599 switch ( modal_confirm( "PAL", "NTSC", _("Please choose a video standard") ) )
00600 {
00601 case GTK_RESPONSE_ACCEPT:
00602 Preferences::getInstance().defaultNormalisation = NORM_PAL;
00603 break;
00604 case GTK_RESPONSE_CLOSE:
00605 Preferences::getInstance().defaultNormalisation = NORM_NTSC;
00606 break;
00607 default:
00608 // Do nothing - action cancelled
00609 gtk_widget_hide( dialog );
00610 return importedFile;
00611 }
00612 }
00613 args[ 3 ] = const_cast<char*>(
00614 Preferences::getInstance().defaultNormalisation == NORM_PAL ? "pal" : "ntsc" );
00615 args[ 4 ] = const_cast<char*>(
00616 Preferences::getInstance().defaultAspect == ASPECT_169 ? "16:9" : "4:3" );
00617 switch ( Preferences::getInstance().defaultAudio )
00618 {
00619 case AUDIO_32KHZ:
00620 args[ 5 ] = "32000";
00621 break;
00622 case AUDIO_44KHZ:
00623 args[ 5 ] = "44100";
00624 break;
00625 case AUDIO_48KHZ:
00626 args[ 5 ] = "48000";
00627 break;
00628 }
00629 }
00630 else
00631 {
00632 // Use first frame
00633 Frame& frame = *GetFramePool()->GetFrame();
00634 AudioInfo ainfo;
00635 std::ostringstream strstream;
00636
00637 this->getPlayList() ->GetFrame( 0, frame );
00638 frame.GetAudioInfo( ainfo );
00639 strstream << ainfo.frequency;
00640 args[ 3 ] = const_cast<char*>( frame.IsPAL() ? "pal" : "ntsc" );
00641 args[ 4 ] = const_cast<char*>( frame.IsWide() ? "16:9" : "4:3" );
00642 args[ 5 ] = const_cast<char*>( strstream.str().c_str() );
00643 GetFramePool()->DoneWithFrame( &frame );
00644 }
00645 importedFile = StringUtils::replaceAll( importedFile, "\"", "\\\"") + std::string( ".dv" );
00646
00647 args[ 0 ] = DATADIR "/kino/scripts/import/media.sh";
00648 args[ 1 ] = const_cast<char*>( filename );
00649 args[ 2 ] = const_cast<char*>( importedFile.c_str() );
00650 args[ 6 ] = NULL;
00651
00652 // Allow a script in home directory to override
00653 testHomeFile = open( homeFile.c_str(), O_RDONLY );
00654 if ( testHomeFile > -1 )
00655 {
00656 close( testHomeFile );
00657 args[ 0 ] = const_cast< char* >( homeFile.c_str() );
00658 }
00659
00660 std::ostringstream command;
00661 command << "\"" << args[0] << "\" \"" << args[1] << "\" \"" << args[2] << "\" " << args[3] << " " << args[4] << " " << args[5];
00662 args[ 0 ] = "/bin/sh";
00663 args[ 1 ] = "-c";
00664 args[ 2 ] = const_cast< char* >( command.str().c_str() );
00665 args[ 3 ] = NULL;
00666
00667 g_spawn_async_with_pipes( ".", args, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
00668 NULL, NULL, &pid, NULL, NULL, NULL, &gerror );
00669
00670 // Check for cancellation or child exit
00671 while ( ! WIFEXITED( status ) && visible )
00672 {
00673 timespec ts = { 0, 100000000L };
00674 while ( gtk_events_pending() )
00675 gtk_main_iteration();
00676 nanosleep( &ts, NULL );
00677 gtk_progress_bar_pulse( progressBar );
00678 g_object_get( G_OBJECT( dialog ), "visible", &visible, static_cast<gchar*>( NULL ) );
00679 waitpid( pid, &status, WNOHANG );
00680 }
00681 if ( ! WIFEXITED( status ) )
00682 {
00683 kill( pid, SIGTERM );
00684 waitpid( pid, &status, WNOHANG );
00685 if ( ! WIFEXITED( status ) )
00686 {
00687 timespec ts = { 0, 100000000L };
00688 nanosleep( &ts, NULL );
00689 kill( pid, SIGKILL );
00690 waitpid( pid, &status, 0 );
00691 }
00692 }
00693 gtk_widget_hide( dialog );
00694 }
00695 return importedFile;
00696 }
|
|
|
Inserts a file at the current position.
Definition at line 701 of file kino_common.cc. References AVI, changePageRequest(), checkFile(), g_currentFrame, getFileToOpen(), getPageEditor(), getPlayList(), hasListChanged, importFile(), loadMediaObject(), loadPlayList(), modal_message(), moveToFrame(), PAGE_EDITOR, PLAYLIST, QT, RAW_DV, setWindowTitle(), and UNKNOWN_FORMAT. Referenced by PageEditor::processCommand(). 00702 {
00703 changePageRequest( PAGE_EDITOR );
00704 char * filename = this->getFileToOpen( _( "Choose a DV or SMIL file to insert" ) );
00705 if ( filename && strcmp( filename, "" ) )
00706 {
00707 switch ( checkFile( filename ) )
00708 {
00709 case AVI:
00710 case RAW_DV:
00711 case QT:
00712 if ( loadMediaObject( filename, g_currentFrame == -1 ? 0 : g_currentFrame ) )
00713 {
00714 hasListChanged = TRUE;
00715 getPlayList() ->SetDirty( true );
00716 break;
00717 }
00718 // Else, ask to import
00719 case UNKNOWN_FORMAT:
00720 {
00721 const std::string& importedFile = importFile( filename );
00722 if ( loadMediaObject( const_cast<char*>( importedFile.c_str() ), g_currentFrame == -1 ? 0 : g_currentFrame ) )
00723 {
00724 hasListChanged = TRUE;
00725 getPlayList() ->SetDirty( true );
00726 }
00727 else
00728 {
00729 modal_message( _( "Failed to load media file \"%s\"" ), importedFile.c_str() );
00730 }
00731 break;
00732 }
00733 case PLAYLIST:
00734 if ( loadPlayList( filename, g_currentFrame ) )
00735 {
00736 hasListChanged = TRUE;
00737 getPlayList() ->SetDirty( true );
00738 getPageEditor() ->snapshot();
00739 }
00740 break;
00741 }
00742 }
00743
00744 setWindowTitle();
00745 moveToFrame( );
00746 }
|
|
||||||||||||
|
Relay the current command and any message associated to it.
Definition at line 1576 of file kino_common.cc. References setStatusBar(). Referenced by PageTrim::processCommand(), PageTimeline::processCommand(), PageMagick::processCommand(), PageExport::processCommand(), PageEditor::processCommand(), PageCapture::processCommand(), PageMagick::processKeyboard(), PageExport::processKeyboard(), PageEditor::processKeyboard(), PageCapture::processKeyboard(), PageTrim::videoShuttle(), and PageEditor::videoShuttle(). 01577 {
01578 char s[ 256 ];
01579
01580 strcpy( s, cmd );
01581 strcat( s, " " );
01582 strcat( s, msg );
01583
01584 setStatusBar( s );
01585 }
|
|
|
Opens a file. An AVI or a PLAYLIST causes a newFile to called prior to the load and a PLAYLIST becomes the currently editted file. Definition at line 807 of file kino_common.cc. References AVI, changePageRequest(), checkFile(), currentScene, fetchProjectMetadata(), g_currentFrame, getCurrentPage(), GetEditorBackup(), getFileToOpen(), getPageEditor(), getPlayList(), hasListChanged, importFile(), loadMediaObject(), loadPlayList(), modal_message(), moveToFrame(), newFile(), PAGE_EDITOR, PLAYLIST, QT, RAW_DV, setWindowTitle(), and UNKNOWN_FORMAT. 00808 {
00809 changePageRequest( PAGE_EDITOR );
00810 char * filename = this->getFileToOpen( _( "Choose a DV or SMIL file" ) );
00811 bool askNewFile = true;
00812
00813 if ( filename && strcmp( filename, "" ) )
00814 {
00815 switch ( checkFile( filename ) )
00816 {
00817 case AVI:
00818 case RAW_DV:
00819 case QT:
00820 askNewFile = false;
00821 if ( newFile( ) )
00822 {
00823 GetEditorBackup() ->Clear();
00824 if ( loadMediaObject( filename, 0 ) )
00825 {
00826 g_currentFrame = 0;
00827 hasListChanged = TRUE;
00828 break;
00829 }
00830 // Else, ask to import
00831 }
00832 else
00833 break;
00834 case UNKNOWN_FORMAT:
00835 if ( ( askNewFile && newFile( ) ) || ! askNewFile )
00836 {
00837 const std::string& importedFile = importFile( filename );
00838 GetEditorBackup() ->Clear();
00839 if ( loadMediaObject( const_cast<char*>( importedFile.c_str() ), 0 ) )
00840 {
00841 g_currentFrame = 0;
00842 hasListChanged = TRUE;
00843 }
00844 else
00845 {
00846 modal_message( _( "Failed to load media file \"%s\"" ), importedFile.c_str() );
00847 }
00848 }
00849 break;
00850 case PLAYLIST:
00851 if ( newFile( false ) )
00852 {
00853 GetEditorBackup() ->Clear();
00854 if ( loadPlayList( filename, 0 ) )
00855 {
00856 g_currentFrame = 0;
00857 hasListChanged = TRUE;
00858 getPageEditor( ) ->snapshot( );
00859 getPlayList( ) ->SetDocName( filename );
00860 getPlayList( ) ->SetDirty( false );
00861 fetchProjectMetadata( getPlayList()->GetDocId() );
00862 }
00863 }
00864 break;
00865 }
00866 }
00867 setWindowTitle();
00868 this->currentScene = 0;
00869 this->getCurrentPage()->clean();
00870 this->getCurrentPage()->start();
00871 moveToFrame( );
00872 }
|
|
||||||||||||
|
Loads the specified media file before the specified frame.
Definition at line 1325 of file kino_common.cc. References getPageEditor(), getPlayList(), and PlayList::LoadMediaObject(). Referenced by appendFile(), bulkLoad(), PageCapture::collectFiles(), insertFile(), loadFile(), and PageCapture::stopCapture(). 01326 {
01327
01328 PlayList newList;
01329 bool result = true;
01330
01331 try
01332 {
01333 if ( newList.LoadMediaObject( file ) )
01334 {
01335 this->getPlayList() ->InsertPlayList( newList, before );
01336 getPageEditor() ->snapshot();
01337 }
01338 else
01339 {
01340 result = false;
01341 }
01342 }
01343 catch ( string s )
01344 {
01345 cerr << "Could not load file " << file << ", because an exception has occurred: " << endl;
01346 cerr << s << endl;
01347 result = false;
01348 }
01349
01350 return result;
01351 }
|
|
||||||||||||
|
Loads the specified play list before the specified frame.
Definition at line 1360 of file kino_common.cc. References PlayList::GetDocId(), PlayList::GetDocTitle(), getPlayList(), PlayList::LoadPlayList(), and modal_message(). 01361 {
01362
01363 PlayList newList;
01364 bool result = newList.LoadPlayList( file );
01365
01366 if ( result )
01367 {
01368 this->getPlayList() ->InsertPlayList( newList, before );
01369
01370 // propogate these new attributes
01371 if ( newList.GetDocId() != "" )
01372 this->getPlayList()->SetDocId( newList.GetDocId().c_str() );
01373 if ( newList.GetDocTitle() != "" )
01374 this->getPlayList()->SetDocTitle( newList.GetDocTitle().c_str() );
01375 }
01376 else
01377 modal_message( _( "Could not load the SMIL file \"%s\"" ), file );
01378
01379 return result;
01380 }
|
|
|
|
Load the splash image into the video preview area.
Definition at line 2215 of file kino_common.cc. References create_pixbuf(). Referenced by PageEditor::newFile(), PageTrim::showFrame(), PageEditor::showFrame(), and PageEditor::windowMoved(). 02216 {
02217 if ( drawable && ( ( GtkWidget* ) drawable )->window )
02218 {
02219 GdkGC *gc = gdk_gc_new( ( ( GtkWidget* ) drawable ) ->window );
02220 if ( gc )
02221 {
02222 GdkPixbuf *splash = create_pixbuf( "about.jpeg" );
02223
02224 if ( splash )
02225 {
02226 int width = ( ( GtkWidget* ) drawable ) ->allocation.width;
02227 int height = ( ( GtkWidget* ) drawable ) ->allocation.height;
02228 GdkPixbuf *image = gdk_pixbuf_scale_simple( splash, width, height, GDK_INTERP_BILINEAR );
02229 if ( image )
02230 {
02231 gdk_draw_pixbuf( ( ( GtkWidget * ) drawable ) ->window, gc, image,
02232 0, 0, 0, 0, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0 );
02233 g_object_unref( image );
02234 }
02235 g_object_unref( splash );
02236 }
02237 g_object_unref( gc );
02238 }
02239 }
02240 }
|
|
|
Move the frame relative to the number specified.
Definition at line 1645 of file kino_common.cc. References currentPage, g_currentFrame, getPageTrim(), moveToFrame(), and PAGE_TRIM. Referenced by PageMagick::processCommand(), PageEditor::processCommand(), PageTrim::videoBack(), PageEditor::videoBack(), PageTrim::videoForward(), and PageEditor::videoForward(). 01646 {
01647 if ( frames == 0 )
01648 return g_currentFrame;
01649
01650 int frame = g_currentFrame + frames;
01651
01652 if ( currentPage == PAGE_TRIM )
01653 frame = getPageTrim() ->getPosition() + frames;
01654
01655 return moveToFrame( frame );
01656 }
|
|
|
Move to the frame specified. Corrects the frame specified to be within the range of the current play list and informs the currently selected page of the change.
Definition at line 1617 of file kino_common.cc. References currentPage, g_currentFrame, getCurrentPage(), getPlayList(), PAGE_MAGICK, and PAGE_TRIM. 01618 {
01619 if ( currentPage == PAGE_TRIM || currentPage == PAGE_MAGICK )
01620 {
01621 getCurrentPage()->movedToFrame( frame );
01622 return frame;
01623 }
01624
01625 if ( frame >= 0 && frame < getPlayList() ->GetNumFrames() )
01626 g_currentFrame = frame;
01627 else if ( frame >= getPlayList() ->GetNumFrames() )
01628 g_currentFrame = getPlayList() ->GetNumFrames() - 1;
01629 else if ( frame < 0 && getPlayList() ->GetNumFrames() > 0 )
01630 g_currentFrame = 0;
01631 else
01632 g_currentFrame = -1;
01633
01634 getCurrentPage() ->movedToFrame( g_currentFrame );
01635
01636 return g_currentFrame;
01637 }
|
|
|
|
Carries out a New File request in the kino application. All notebook pages are informed of the action through their own newFile method. Definition at line 297 of file kino_common.cc. References changePageRequest(), clean(), currentScene, fetchProjectMetadata(), g_currentFrame, GetEditorBackup(), GetFileMap(), Preferences::getInstance(), getPage(), getPageEditor(), getPageMagick(), getPlayList(), GetStoryboard(), modal_confirm(), modal_prompt(), Page::newFile(), PAGE_EDITOR, savePlayList(), setWindowTitle(), and windowMoved(). Referenced by exitKino(), loadFile(), and loadPlayList(). 00298 {
00299 bool result = true;
00300
00301 cerr << ">> Kino Common newFile" << endl;
00302
00303 this->getPageMagick()->Stop();
00304 this->changePageRequest( PAGE_EDITOR );
00305 if ( getPlayList() ->IsDirty() )
00306 {
00307 switch ( modal_confirm( GTK_STOCK_SAVE, GTK_STOCK_CLOSE, _("Save changes to project \"%s\" before closing?"),
00308 getPlayList()->GetDocName() == "" ? _("Untitled") : getPlayList()->GetDocName().c_str() ) )
00309 {
00310 case GTK_RESPONSE_ACCEPT:
00311 result = savePlayList( );
00312 break;
00313 case GTK_RESPONSE_CLOSE:
00314 result = true;
00315 break;
00316 default:
00317 // Do nothing - action cancelled
00318 result = false;
00319 break;
00320 }
00321 }
00322 if ( result )
00323 {
00324 // Specifics for this class
00325 vector <string> list;
00326 PlayList clean;
00327
00328 getPlayList( ) ->GetLastCleanPlayList( clean );
00329 GetFileMap() ->GetUnusedFxFiles( clean, list );
00330
00331 if ( list.begin() != list.end() )
00332 {
00333 string buffer;
00334
00335 buffer = _( "The following fx rendered files are no longer used: \n\n" );
00336 vector < string >::iterator it;
00337 for ( it = list.begin(); it != list.end(); it ++ )
00338 buffer += *it + "\n";
00339 buffer += _( "\nDo you want me to delete them now?" );
00340
00341 switch ( modal_confirm( GTK_STOCK_DELETE, GTK_STOCK_CLOSE, buffer.c_str() ) )
00342 {
00343 case GTK_RESPONSE_ACCEPT:
00344 for ( it = list.begin(); it != list.end(); it ++ )
00345 unlink( ( *it ).c_str() );
00346 result = true;
00347 break;
00348 case GTK_RESPONSE_CLOSE:
00349 // Do nothing - leave files on the system
00350 result = true;
00351 break;
00352 default:
00353 // Do nothing - action cancelled
00354 result = false;
00355 break;
00356 }
00357 }
00358
00359 if ( result )
00360 {
00361 getPlayList() ->CleanPlayList( );
00362 GetFileMap() ->Clear();
00363 this->g_currentFrame = -1;
00364 this->currentScene = -1;
00365 this->setWindowTitle( );
00366
00367 // Call new File for each page
00368 Page *page = NULL;
00369 for ( int index = 0; ( page = getPage( index ) ) != NULL; index ++ )
00370 page->newFile();
00371
00372 GetStoryboard() ->reset();
00373 GetStoryboard() ->redraw();
00374 this->windowMoved();
00375
00376 GetEditorBackup() ->Clear();
00377 getPageEditor() ->snapshot();
00378 }
00379 }
00380
00381 // Prompt for the Project Name/Id if applicable
00382 // added for tagesschau.de
00383 if ( prompt && strcmp( Preferences::getInstance().newProjectURI, "" ) )
00384 {
00385 if ( strstr( Preferences::getInstance().newProjectURI, "%" ) )
00386 {
00387 char *response = modal_prompt( _("Enter a project name") );
00388 if ( response )
00389 {
00390 getPlayList()->SetDocTitle( response );
00391 fetchProjectMetadata( response );
00392 free( response );
00393 }
00394 }
00395 else
00396 {
00397 fetchProjectMetadata( "_" );
00398 }
00399 }
00400 return result;
00401 }
|
|
||||||||||||
|
Set the video display to be fixed size or scalable.
Definition at line 2264 of file kino_common.cc. References Preferences::getInstance(), getWidget(), and lookup_widget(). Referenced by setPreviewSize(), PageTrim::start(), PageEditor::start(), and PageCapture::start(). 02265 {
02266 GdkColor color;
02267 gdk_color_parse ( "black", &color );
02268
02269 GtkWidget *packer = lookup_widget( getWidget(), packerNameOuter );
02270 gtk_widget_modify_bg ( packer, GTK_STATE_NORMAL, &color );
02271
02272 packer = lookup_widget( getWidget(), packerNameInner );
02273 gtk_widget_modify_bg ( packer, GTK_STATE_NORMAL, &color );
02274
02275 GtkWidget *parent = gtk_widget_get_parent( packer );
02276 gtk_box_set_child_packing( GTK_BOX( parent ), packer,
02277 TRUE /* expand */,
02278 Preferences::getInstance().displayFixed ? FALSE : TRUE /* fill */,
02279 0 /* padding */, GTK_PACK_START );
02280 }
|
|
|
Trigger a menu command action of the current page. These can be either keyboard or command line style strings. Definition at line 1764 of file kino_common.cc. References getCurrentPage(). 01765 {
01766 return getCurrentPage() ->processCommand( cmd );
01767 }
|
|
|
Trigger the keyboard action of the current page.
Definition at line 1755 of file kino_common.cc. References getCurrentPage(). 01756 {
01757 return getCurrentPage() ->processKeyboard( event );
01758 }
|
|
|
Definition at line 2378 of file kino_common.cc. References command, common, currentPage, g_currentFrame, getFileToSave(), getPlayList(), modal_message(), PAGE_CAPTURE, and saveFrame(). 02379 {
02380 if ( currentPage == PAGE_CAPTURE )
02381 {
02382 modal_message( _("Sorry, you can not publish still frames from Capture.") );
02383 }
02384 else
02385 {
02386 char * filename = common->getFileToSave( _( "Save Still Frame" ) );
02387 if ( strcmp( filename, "" ) )
02388 {
02389 std::ostringstream command;
02390 GError *gerror = NULL;
02391
02392 common->saveFrame( common->g_currentFrame, filename );
02393
02394 command << "\"" << DATADIR << "/kino/scripts/publish/frame.sh\" ";
02395 command << "\"" << filename << "\" ";
02396 command << "\"" << getPlayList()->GetDocId().c_str() << "\" ";
02397 command << "\"" << getPlayList()->GetSeqAttribute( g_currentFrame, "title" ) << "\" ";
02398 command << "\"" << getPlayList()->GetDocTitle().c_str() << "\" ";
02399 char * args[ 4 ];
02400 args[ 0 ] = "/bin/sh";
02401 args[ 1 ] = "-c";
02402 args[ 2 ] = const_cast< char* >( command.str().c_str() );
02403 args[ 3 ] = NULL;
02404 g_spawn_async_with_pipes( ".", args, NULL, (GSpawnFlags)0, NULL, NULL, NULL, NULL, NULL, NULL, &gerror );
02405 }
02406 }
02407
02408 }
|
|
|
Definition at line 2338 of file kino_common.cc. References command, PlayList::GetDocId(), PlayList::GetDocName(), PlayList::GetDocTitle(), playlist, savePlayList(), and PlayList::SavePlayList(). 02339 {
02340 std::ostringstream command;
02341 GError *gerror = NULL;
02342
02343 if ( playlist.GetDocName() == "" )
02344 {
02345 PlayList* copy = new PlayList( playlist );
02346 char filename[] = "/tmp/kino.XXXXXX";
02347 mkstemp( filename );
02348 copy->SavePlayList( filename );
02349 delete copy;
02350 command << "\"" << DATADIR << "/kino/scripts/publish/project.sh\" ";
02351 command << "\"" << filename << "\" ";
02352 command << "\"" << playlist.GetDocId().c_str() << "\" ";
02353 command << "\"" << playlist.GetDocTitle().c_str() << "\" ";
02354 char * args[ 4 ];
02355 args[ 0 ] = "/bin/sh";
02356 args[ 1 ] = "-c";
02357 args[ 2 ] = const_cast< char* >( command.str().c_str() );
02358 args[ 3 ] = NULL;
02359 g_spawn_sync( ".", args, NULL, (GSpawnFlags)0, NULL, NULL, NULL, NULL, NULL, &gerror );
02360 unlink( filename );
02361 }
02362 else
02363 {
02364 savePlayList();
02365 command << "\"" << DATADIR << "/kino/scripts/publish/project.sh\" ";
02366 command << "\"" << playlist.GetDocName() << "\" ";
02367 command << "\"" << playlist.GetDocId().c_str() << "\" ";
02368 command << "\"" << playlist.GetDocTitle().c_str() << "\" ";
02369 char * args[ 4 ];
02370 args[ 0 ] = "/bin/sh";
02371 args[ 1 ] = "-c";
02372 args[ 2 ] = const_cast< char* >( command.str().c_str() );
02373 args[ 3 ] = NULL;
02374 g_spawn_async_with_pipes( ".", args, NULL, (GSpawnFlags)0, NULL, NULL, NULL, NULL, NULL, NULL, &gerror );
02375 }
02376 }
|
|
|
|
|
||||||||||||
|
Save the specified frame to the specified file.
Definition at line 1525 of file kino_common.cc. References FRAME_MAX_HEIGHT, FRAME_MAX_WIDTH, GetFramePool(), getPlayList(), AspectRatioCalculator::height, Frame::IsPAL(), modal_message(), pixels, and AspectRatioCalculator::width. 01526 {
01527 Frame *frame = GetFramePool()->GetFrame();
01528 if ( frame != NULL )
01529 {
01530 unsigned char pixels[ FRAME_MAX_WIDTH * FRAME_MAX_HEIGHT * 4 ];
01531 GError *gerror = NULL;
01532 this->getPlayList()->GetFrame( this->g_currentFrame, *frame );
01533
01534 frame->ExtractPreviewRGB( pixels );
01535 GdkPixbuf *im = gdk_pixbuf_new_from_data
01536 ( pixels, GDK_COLORSPACE_RGB, FALSE, 8,
01537 frame->GetWidth(), frame->GetHeight(),
01538 frame->GetWidth() * 3, NULL, NULL );
01539
01540 // resample pixel aspect
01541 {
01542 int width = frame->GetWidth();
01543 if ( frame->IsWide() )
01544 width = frame->IsPAL() ? 1024 : 854;
01545 AspectRatioCalculator calc( width, frame->GetHeight(),
01546 frame->GetWidth(), frame->GetHeight(),
01547 frame->IsPAL(), frame->IsWide() );
01548 GdkPixbuf *scaled = gdk_pixbuf_scale_simple( im, calc.width, calc.height, GDK_INTERP_HYPER );
01549 g_object_unref( im );
01550 im = scaled;
01551 }
01552
01553 const std::string FileName( file );
01554 const std::string suffix( FileName.begin() + FileName.rfind( "." ), FileName.end() );
01555 if ( suffix == ".png" )
01556 gdk_pixbuf_save( im, file, "png", &gerror, static_cast<gchar*>( NULL ) );
01557 else
01558 gdk_pixbuf_save( im, file, "jpeg", &gerror, "quality", "80", static_cast<gchar*>( NULL ) );
01559 if ( gerror != NULL )
01560 {
01561 modal_message( gerror->message );
01562 g_error_free( gerror );
01563 }
01564 g_object_unref( im );
01565 GetFramePool()->DoneWithFrame( frame );
01566 }
01567 }
|
|
|
Save the current frame as a still frame.
Definition at line 975 of file kino_common.cc. References common, currentPage, g_currentFrame, getFileToSave(), getPageCapture(), PAGE_CAPTURE, and saveFrame(). Referenced by publishFrame(), and saveFrame(). 00976 {
00977 if ( currentPage == PAGE_CAPTURE )
00978 {
00979 getPageCapture()->saveFrame();
00980 }
00981 else
00982 {
00983 char * filename = common->getFileToSave( _( "Save Still Frame" ) );
00984 if ( filename && strcmp( filename, "" ) )
00985 common->saveFrame( common->g_currentFrame, filename );
00986 }
00987 }
|
|
|
Saves the playlist.
Definition at line 1387 of file kino_common.cc. References getPlayList(), modal_message(), and setWindowTitle(). 01388 {
01389 bool result = false;
01390 result = getPlayList() ->SavePlayList( file );
01391
01392 if ( result )
01393 setWindowTitle( );
01394 else
01395 modal_message( _( "Could not save the SMIL" ) );
01396
01397 return result;
01398 }
|
|
|
Save the current play list to the file used to load the playlist originally. If no file was originally used then use savePlayListAs to obtain one. Definition at line 961 of file kino_common.cc. References getPlayList(), and savePlayListAs(). Referenced by newFile(), PageTrim::processCommand(), PageTimeline::processCommand(), PageMagick::processCommand(), PageExport::processCommand(), PageEditor::processCommand(), PageCapture::processCommand(), publishPlayList(), and savePlayListAs(). 00962 {
00963 bool result = true;
00964 if ( getPlayList() ->GetDocName() == "" )
00965 result = savePlayListAs( );
00966 else
00967 result = savePlayList( ( char * ) ( getPlayList() ->GetDocName().c_str() ) );
00968 return result;
00969 }
|
|
|
Save the current play list with a different name to the original loaded (or previously saved as) play list file name.
Definition at line 878 of file kino_common.cc. References g_currentFrame, getFileToSaveFormat(), GetFramePool(), getPlayList(), Frame::IsPAL(), modal_confirm(), modal_message(), playlist, savePlayList(), and PlayList::SetDocName(). Referenced by savePlayList(). 00879 {
00880 bool result = false;
00881 int format = 1;
00882 char *filename = this->getFileToSaveFormat( _( "Save the movie" ), format );
00883
00884 if ( filename && strcmp( filename, "" ) )
00885 {
00886 // Append an extension if not supplied
00887 char* extension = strrchr( filename, '.' );
00888 switch ( format )
00889 {
00890 case 0: // SMIL
00891 case 1: // Legacy XML
00892 if ( !extension || ( strcmp( extension, ".kino" ) &&
00893 strcmp( extension, ".smil" ) && strcmp( extension, ".xml" ) ) )
00894 strcat( filename, ".kino" );
00895 break;
00896 case 2: // ELI
00897 if ( !extension || strcmp( extension, ".eli" ) )
00898 strcat( filename, ".eli" );
00899 break;
00900 case 3: // SRT - SubRip subtitle
00901 if ( !extension || strcmp( extension, ".srt" ) )
00902 strcat( filename, ".srt" );
00903 break;
00904 }
00905
00906 // See if it exists already and warn user
00907 FILE *f = fopen( filename, "r" );
00908 if ( f )
00909 {
00910 fclose( f );
00911 if ( modal_confirm( GTK_STOCK_SAVE, NULL, _("The file \"%s\" already exists. Do you want to continue?\n"), filename ) != GTK_RESPONSE_ACCEPT )
00912 return result;
00913 }
00914 switch ( format )
00915 {
00916 case 0: // SMIL
00917 playlist.SetDocName( filename );
00918 result = savePlayList( filename );
00919 break;
00920 case 1: // Legacy XML
00921 if ( !this->getPlayList()->SavePlayList( filename, true ) )
00922 {
00923 modal_message( _( "Could not save the XML" ) );
00924 result = false;
00925 }
00926 break;
00927 case 2: // ELI
00928 if ( g_currentFrame != -1 )
00929 {
00930 Frame& frame = *GetFramePool()->GetFrame();
00931 this->getPlayList() ->GetFrame( g_currentFrame, frame );
00932 if ( !this->getPlayList() ->SavePlayListEli( filename, frame.IsPAL() ) )
00933 {
00934 modal_message( _( "Could not save the ELI" ) );
00935 result = false;
00936 }
00937 GetFramePool()->DoneWithFrame( &frame );
00938 }
00939 else
00940 {
00941 modal_message( _( "Could not save the ELI" ) );
00942 result = false;
00943 }
00944 break;
00945 case 3: // SRT - SubRip subtitle
00946 if ( !this->getPlayList()->SavePlayListSrt( filename ) )
00947 {
00948 modal_message( _( "Could not save the subtitle" ) );
00949 result = false;
00950 }
00951 break;
00952 }
00953 }
00954 return result;
00955 }
|
|
|
Trigger the select scene action of the current page.
Definition at line 1772 of file kino_common.cc. References getCurrentPage(). Referenced by tree_view_row_select(). 01773 {
01774 getCurrentPage() ->selectScene( scene );
01775 }
|
|
|
|
|
|
Carries out a change page - this should be triggered by changePageRequest to ensure that the GUI stays in sync with the common structure.
Definition at line 419 of file kino_common.cc. References clean(), currentPage, getWidget(), moveToFrame(), and start(). 00420 {
00421 if ( this->currentPage != page )
00422 {
00423 if ( this->currentPage != -1 )
00424 clean();
00425 this->currentPage = page;
00426 start();
00427 moveToFrame();
00428 gtk_widget_queue_draw( getWidget() );
00429 }
00430 }
|
|
|
Definition at line 2321 of file kino_common.cc. References currentScene, getPageEditor(), GetStoryboard(), and scenes. Referenced by PageTrim::insertScene(), PageTrim::loadScene(), PageTrim::selectScene(), PageTimeline::selectScene(), PageMagick::selectScene(), Export::selectScene(), PageEditor::showFrameInfo(), and PageMagick::StartRender(). 02322 {
02323 if ( frame > -1 )
02324 {
02325 int pos = 0;
02326
02327 vector <int> scenes = getPageEditor() ->GetScene();
02328 for ( pos = 0; pos < ( int ) scenes.size() && frame >= scenes[ pos ]; pos++ )
02329 ;
02330 if ( pos != currentScene && pos > -1 )
02331 {
02332 currentScene = pos;
02333 GetStoryboard() ->select( currentScene );
02334 }
02335 }
02336 }
|
|
|
|
|
|
Definition at line 301 of file kino_common.h. References last_directory. Referenced by loadPlayList(). 00302 {
00303 last_directory = value;
00304 }
|
|
|
Definition at line 281 of file kino_common.h. References showMoreInfo. 00282 {
00283 showMoreInfo = state;
00284 }
|
|
||||||||||||
|
Resize the video preview area to a percentage of source image size.
Definition at line 2106 of file kino_common.cc. References ASPECT_169, currentPage, GetFramePool(), Preferences::getInstance(), getPageCapture(), getPlayList(), getWidget(), AspectRatioCalculator::height, Frame::IsPAL(), lookup_widget(), modal_message(), NORM_PAL, NORM_UNSPECIFIED, packIt(), PAGE_CAPTURE, widget, and AspectRatioCalculator::width. 02107 {
02108 static bool skip = false;
02109 int width = 720;
02110 int height = -1;
02111 bool isWide;
02112 bool isPAL;
02113
02114 if ( skip )
02115 return;
02116
02117 // handle the cycle case
02118 if ( factor < 0 )
02119 {
02120 factor = float( Preferences::getInstance().previewSize ) / 10.0;
02121 factor += 0.5;
02122 if ( factor > 1.0 )
02123 factor = 0.0;
02124 }
02125
02126 // save the new size
02127 Preferences::getInstance().previewSize = int( factor * 10 );
02128
02129 // handle fixed size factors
02130 if ( Preferences::getInstance().displayFixed != ( factor > 0 ) )
02131 {
02132 Preferences::getInstance().displayFixed = ( factor > 0 );
02133 packIt( "packer_edit", "packer_edit_outer" );
02134 packIt( "packer_capture", "packer_capture_outer" );
02135 packIt( "packer_trim", "packer_trim_outer" );
02136 }
02137
02138 skip = true;
02139 // set the menu radio item
02140 if ( factor == 0 )
02141 gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( lookup_widget( widget, "menuitem_zoom_fit" ) ), TRUE );
02142 else if ( factor == 0.5 )
02143 gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( lookup_widget( widget, "menuitem_zoom_50percent" ) ), TRUE );
02144 else
02145 gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( lookup_widget( widget, "menuitem_zoom_100percent" ) ), TRUE );
02146 skip = false;
02147
02148 // this sets a sane factor for zoom to fit
02149 if ( factor == 0 )
02150 factor = 0.5;
02151
02152 if ( currentPage == PAGE_CAPTURE )
02153 {
02154 Frame *frame = getPageCapture()->getFrame();
02155 if ( frame != NULL )
02156 {
02157 width = frame->GetWidth();
02158 if ( frame->IsWide() )
02159 width = frame->IsPAL() ? 1024 : 854;
02160 AspectRatioCalculator calc( width, frame->GetHeight(),
02161 frame->GetWidth(), frame->GetHeight(),
02162 frame->IsPAL(), frame->IsWide() );
02163
02164 width = ( int ) ( calc.width * factor );
02165 height = ( int ) ( calc.height * factor );
02166 }
02167 }
02168 else if ( this->g_currentFrame != -1 )
02169 {
02170 Frame& frame = *GetFramePool()->GetFrame();
02171 this->getPlayList() ->GetFrame( this->g_currentFrame, frame );
02172 width = frame.GetWidth();
02173 if ( frame.IsWide() )
02174 width = frame.IsPAL() ? 1024 : 854;
02175 AspectRatioCalculator calc( width, frame.GetHeight(),
02176 frame.GetWidth(), frame.GetHeight(),
02177 frame.IsPAL(), frame.IsWide() );
02178 GetFramePool()->DoneWithFrame( &frame );
02179
02180 width = ( int ) ( calc.width * factor );
02181 height = ( int ) ( calc.height * factor );
02182 }
02183 else if ( Preferences::getInstance().defaultNormalisation != NORM_UNSPECIFIED )
02184 {
02185 height = Preferences::getInstance().defaultNormalisation == NORM_PAL ? 576 : 480;
02186 isPAL = Preferences::getInstance().defaultNormalisation == NORM_PAL;
02187 isWide = Preferences::getInstance().defaultAspect == ASPECT_169;
02188 AspectRatioCalculator calc( width, height, width, height,
02189 isPAL, isWide );
02190
02191 width = ( int ) ( calc.width * factor );
02192 height = ( int ) ( calc.height * factor );
02193 }
02194
02195 if ( height == -1 && ! noWarning )
02196 {
02197 modal_message( _( "The project is empty and the default preferences for video creation have not been specified." ) );
02198 }
02199 else if ( height != -1 )
02200 {
02201 cerr << "> setting video preview size to " << width << "x" << height << endl;
02202 GtkWidget *frameArea = lookup_widget( getWidget(), "packer_edit" );
02203 gtk_widget_set_size_request( frameArea, width + 4, height + 4 );
02204 frameArea = lookup_widget( getWidget(), "packer_capture" );
02205 gtk_widget_set_size_request( frameArea, width + 4, height + 4 );
02206 frameArea = lookup_widget( getWidget(), "packer_trim" );
02207 gtk_widget_set_size_request( frameArea, width + 4, height + 4 );
02208 }
02209 }
|
|
||||||||||||
|
Helper function for the pages.
Definition at line 2284 of file kino_common.cc. References statusbar. Referenced by PageCapture::applyAVCState(), Export::calculateAdjustedRate(), captureThread(), PageCapture::clean(), Export1394::doExport(), Export::innerLoopUpdate(), keyboardFeedback(), PageTrim::processCommand(), PageEditor::processCommand(), PageTrim::processKeyboard(), PageEditor::processKeyboard(), ExportMJPEG::start(), Export1394::start(), PageCapture::startCapture(), Export::startExport(), PageMagick::StartRender(), PageCapture::stopCapture(), PageMagick::UpdateStatus(), and videoThread(). 02285 {
02286 va_list list;
02287 va_start( list, msg );
02288 static char prevMsg[ 1024 ] = "";
02289
02290 if ( strcmp( msg, "" ) == 0 )
02291 gtk_statusbar_pop( statusbar, 1 );
02292 else if ( strncmp( prevMsg, msg, 1023 ) != 0 )
02293 {
02294 if ( vsnprintf( prevMsg, 1023, msg, list ) != 0 )
02295 {
02296 gtk_statusbar_pop( statusbar, 1 );
02297 gtk_statusbar_push( statusbar, 1, prevMsg );
02298 }
02299 }
02300 }
|
|
|
Definition at line 2308 of file kino_common.cc. References common, g_currentFrame, getCurrentPage(), Preferences::getInstance(), GetStoryboard(), and moveToFrame(). Referenced by KinoCommon(). 02309 {
02310 Preferences::getInstance().timeFormat = static_cast< int >( format );
02311 if ( g_currentFrame != -1 )
02312 {
02313 common->moveToFrame();
02314 GetStoryboard() ->reset();
02315 GetStoryboard() ->redraw();
02316 getCurrentPage() ->timeFormatChanged();
02317 }
02318 }
|
|
|
Sets the document name in the window title.
Definition at line 1297 of file kino_common.cc. References Preferences::getInstance(), getPlayList(), lookup_widget(), and updateRecentFiles(). Referenced by appendFile(), bulkLoad(), PageEditor::DeleteFrames(), insertFile(), PageTrim::insertScene(), loadFile(), loadPlayList(), newFile(), PageEditor::PasteFrames(), PageEditor::processCommand(), savePlayList(), PageTrim::saveScene(), PageEditor::snapshot(), and PageCapture::stopCapture(). 01298 {
01299 GtkWidget * mainWindow = lookup_widget( this->getWidget(), "main_window" );
01300 if ( mainWindow )
01301 {
01302 char strbuf[ 1024 ];
01303 if ( getPlayList() ->GetDocName( ) == "" )
01304 strcpy( strbuf, _( "Untitled" ) );
01305 else
01306 strcpy( strbuf, getPlayList() ->GetDocName( ).c_str() );
01307 if ( getPlayList( ) ->IsDirty( ) )
01308 strcat( strbuf, _(" (modified) ") );
01309 strcat( strbuf, " - Kino" );
01310 gtk_window_set_title( GTK_WINDOW( mainWindow ), strbuf );
01311 }
01312 if ( getPlayList()->GetDocName( ) != "" && !getPlayList()->IsDirty() )
01313 {
01314 Preferences::getInstance().addRecentFile( getPlayList()->GetDocName() );
01315 updateRecentFiles();
01316 }
01317 }
|
|
|
Relay the current frame info to the GUI.
Definition at line 1663 of file kino_common.cc. References getCurrentPage(). Referenced by PageTrim::showFrame(), and PageEditor::showFrame(). 01664 {
01665
01666 getCurrentPage() ->showFrameInfo( i );
01667 }
|
|
||||||||||||
|
Display detailed information about this frame and its file.
Definition at line 1674 of file kino_common.cc. References AVI_DV1_FORMAT, FileHandler::GetExtension(), FileHandler::GetFilename(), AVIHandler::GetFormat(), AVIHandler::GetOpenDML(), lookup_widget(), showMoreInfo, and widget. Referenced by PageTimeline::selectScene(), PageMagick::selectScene(), Export::selectScene(), PageTrim::showFrameInfo(), PageMagick::showFrameInfo(), and PageEditor::showFrameInfo(). 01675 {
01676 if ( showMoreInfo )
01677 {
01678 GtkLabel *label = GTK_LABEL( lookup_widget( widget, "label_properties" ) );
01679 char* s = new char[ 2048 ];
01680
01681 if ( media != NULL )
01682 {
01683 TimeCode tc;
01684 AudioInfo ainfo;
01685 string format;
01686
01687 frame.GetTimeCode( tc );
01688 frame.GetAudioInfo( ainfo );
01689
01690 string ext = media->GetExtension();
01691 if ( ext == ".dv" || ext == ".dif" )
01692 format = "Raw DV";
01693 else if ( ext == ".avi" )
01694 {
01695 AVIHandler * avi = dynamic_cast< AVIHandler* >( media );
01696 format = ( avi->GetFormat() == AVI_DV1_FORMAT ) ? "AVI, Type 1" : "AVI, Type 2";
01697 if ( avi->GetOpenDML() )
01698 format += ", OpenDML";
01699 }
01700 else if ( ext == ".mov" )
01701 format = "Quicktime";
01702 else
01703 format = "unknown";
01704
01705
01706 snprintf( s, 2048, _( "%s\n%s\n%2.2d:%2.2d:%2.2d:%2.2d\n%s\n%d bit, %d KHz, %d samples\n%d x %d, %s, %s, %2.2f fps" ),
01707 basename( media->GetFilename().c_str() ),
01708 frame.GetRecordingDate().c_str(),
01709 tc.hour, tc.min, tc.sec, tc.frame,
01710 format.c_str(),
01711 ainfo.quantization, ainfo.frequency / 1000, ainfo.samples,
01712 frame.GetWidth(), frame.GetHeight(),
01713 frame.IsPAL() ? "PAL" : "NTSC",
01714 frame.IsWide() ? "16:9" : "4:3",
01715 frame.GetFrameRate()
01716 );
01717 }
01718 else
01719 sprintf( s, "\n\n\n" );
01720
01721 gtk_label_set_text( label, s );
01722 delete[] s;
01723 }
01724 }
|
|
|
Trigger the start action of the current page. This method is also responsible for determining the state of the main page buttons and widgets. Definition at line 1730 of file kino_common.cc. References activateWidgets(), commitComponentState(), currentPage, getComponentState(), getCurrentPage(), getWidget(), lookup_widget(), PAGE_MAGICK, toggleComponents(), and VIDEO_STOP. Referenced by setCurrentPage(). 01731 {
01732 gtk_label_set_text( GTK_LABEL( lookup_widget( getWidget(), "position_label_current" ) ), "" );
01733 gtk_label_set_text( GTK_LABEL( lookup_widget( getWidget(), "position_label_total" ) ), "" );
01734
01735 getCurrentPage() ->start();
01736 activateWidgets();
01737
01738 toggleComponents( getComponentState(), false );
01739 if ( currentPage != PAGE_MAGICK )
01740 toggleComponents( VIDEO_STOP, true );
01741 commitComponentState();
01742 }
|
|
||||||||||||
|
Set the state of toggle buttons. The state of the buttons are retained in memory, and this method will set a flag that the state has changed (dirty), but has not yet been committed. The button commands will not respond while the state is dirty. Use commitComponentState() to commit the changes and let the buttons issue their commands once again.
Definition at line 2038 of file kino_common.cc. References component_state, is_component_state_changing, lookup_widget(), VIDEO_BACK, video_back_button, video_end_movie_button, VIDEO_END_OF_MOVIE, video_end_scene_button, VIDEO_FAST_FORWARD, video_fast_forward_button, VIDEO_FORWARD, video_forward_button, VIDEO_NEXT_SCENE, VIDEO_PLAY, video_play_button, VIDEO_REWIND, video_rewind_button, video_start_movie_button, VIDEO_START_OF_MOVIE, VIDEO_START_OF_SCENE, video_start_scene_button, VIDEO_STOP, video_stop_button, and widget. Referenced by PageCapture::applyAVCState(), PageCapture::start(), start(), PageMagick::StartRender(), PageTrim::videoBack(), PageMagick::videoBack(), PageEditor::videoBack(), PageCapture::videoBack(), PageTrim::videoEndOfMovie(), PageMagick::videoEndOfMovie(), PageEditor::videoEndOfMovie(), PageCapture::videoEndOfMovie(), PageTrim::videoEndOfScene(), PageEditor::videoEndOfScene(), PageCapture::videoEndOfScene(), PageTrim::videoFastForward(), PageEditor::videoFastForward(), PageCapture::videoFastForward(), PageTrim::videoForward(), PageMagick::videoForward(), PageEditor::videoForward(), PageCapture::videoForward(), PageTrim::videoNextScene(), PageMagick::videoNextScene(), PageEditor::videoNextScene(), PageCapture::videoNextScene(), PageTrim::videoPause(), PageTrim::videoPlay(), PageMagick::videoPlay(), PageEditor::videoPlay(), PageCapture::videoPlay(), PageTrim::videoPreviousScene(), PageMagick::videoPreviousScene(), PageEditor::videoPreviousScene(), PageCapture::videoPreviousScene(), PageTrim::videoRewind(), PageEditor::videoRewind(), PageCapture::videoRewind(), PageTrim::videoShuttle(), PageEditor::videoShuttle(), videoShuttle(), PageTrim::videoStartOfMovie(), PageMagick::videoStartOfMovie(), PageEditor::videoStartOfMovie(), PageCapture::videoStartOfMovie(), PageTrim::videoStartOfScene(), PageEditor::videoStartOfScene(), PageCapture::videoStartOfScene(), PageTrim::videoStop(), PageMagick::videoStop(), PageEditor::videoStop(), and PageCapture::videoStop(). 02039 {
02040
02041 this->is_component_state_changing = true;
02042
02043 if ( state )
02044 this->component_state |= pattern;
02045 else
02046 this->component_state ^= pattern;
02047
02048 if ( pattern & VIDEO_START_OF_MOVIE )
02049 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_start_movie_button ), state );
02050 if ( pattern & VIDEO_START_OF_SCENE )
02051 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_start_scene_button ), state );
02052 if ( pattern & VIDEO_REWIND )
02053 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_rewind_button ), state );
02054 if ( pattern & VIDEO_BACK )
02055 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_back_button ), state );
02056 if ( pattern & VIDEO_PLAY )
02057 {
02058 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_play_button ), state );
02059 if ( state )
02060 gtk_image_set_from_file( GTK_IMAGE( lookup_widget( widget, "pixmap_play_pause" ) ), DATADIR "/kino/stock_media-pause-16.png" );
02061 else
02062 gtk_image_set_from_file( GTK_IMAGE( lookup_widget( widget, "pixmap_play_pause" ) ), DATADIR "/kino/stock_media-play-16.png" );
02063 }
02064 if ( pattern & VIDEO_STOP )
02065 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_stop_button ), state );
02066 if ( pattern & VIDEO_FORWARD )
02067 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_forward_button ), state );
02068 if ( pattern & VIDEO_FAST_FORWARD )
02069 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_fast_forward_button ), state );
02070 if ( pattern & VIDEO_NEXT_SCENE )
02071 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_end_scene_button ), state );
02072 if ( pattern & VIDEO_END_OF_MOVIE )
02073 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( video_end_movie_button ), state );
02074
02075 }
|
|
|
Definition at line 2439 of file kino_common.cc. References count, Preferences::getInstance(), lookup_widget(), on_open_recent_activate(), recentMenuItems, StringUtils::replaceAll(), and widget. Referenced by setWindowTitle(). 02440 {
02441 GtkWidget* menu = lookup_widget( widget, "file_menu" );
02442 vector< std::string >& recentFiles = Preferences::getInstance().recentFiles;
02443 int count = recentFiles.size();
02444 const int menuPosition = Preferences::getInstance().enablePublish ? 12 : 10;
02445
02446 if ( recentMenuItems.empty() && !recentFiles.empty() )
02447 {
02448 GtkWidget* widget = gtk_separator_menu_item_new();
02449 gtk_menu_shell_insert( GTK_MENU_SHELL( menu ), widget, menuPosition );
02450 gtk_widget_show( widget );
02451 }
02452 for ( vector< GtkWidget* >::iterator i = recentMenuItems.begin(); i != recentMenuItems.end(); i++ )
02453 {
02454 gtk_container_remove( GTK_CONTAINER( menu ), *i );
02455 gtk_widget_destroy( *i );
02456 }
02457 recentMenuItems.clear();
02458 for ( vector< std::string >::iterator i = recentFiles.begin(); i != recentFiles.end(); i++, count-- )
02459 {
02460 std::ostringstream ss;
02461 ss << "_" << count << ". "
02462 << StringUtils::replaceAll( basename( ( *i ).c_str() ), "_", "__" )
02463 << std::ends;
02464 GtkWidget* widget = gtk_menu_item_new_with_mnemonic( ss.str().c_str() );
02465 g_signal_connect( G_OBJECT( widget ), "activate", G_CALLBACK( on_open_recent_activate ), gpointer( (*i).c_str() ) );
02466 gtk_menu_shell_insert( GTK_MENU_SHELL( menu ), widget, menuPosition );
02467 gtk_widget_show( widget );
02468 recentMenuItems.push_back( widget );
02469 }
02470 }
|
|
|
Trigger the back action of the current page.
Definition at line 1836 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageCapture::processCommand(). 01837 {
01838 if ( ! is_component_state_changing )
01839 {
01840
01841 getCurrentPage() ->videoBack(step);
01842
01843 commitComponentState();
01844 }
01845 }
|
|
|
Trigger the end movie action of the current page.
Definition at line 1920 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageTrim::processCommand(), PageMagick::processCommand(), PageEditor::processCommand(), and PageCapture::processCommand(). 01921 {
01922 if ( ! is_component_state_changing )
01923 {
01924
01925 getCurrentPage() ->videoEndOfMovie();
01926
01927 commitComponentState();
01928 }
01929 }
|
|
|
Trigger the end of scene action of the current page.
Definition at line 1906 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageTrim::processCommand(), PageMagick::processCommand(), PageEditor::processCommand(), and PageCapture::processCommand(). 01907 {
01908 if ( ! is_component_state_changing )
01909 {
01910
01911 getCurrentPage() ->videoEndOfScene();
01912
01913 commitComponentState();
01914 }
01915 }
|
|
|
Trigger the fast forward action of the current page.
Definition at line 1878 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageCapture::processCommand(). 01879 {
01880 if ( ! is_component_state_changing )
01881 {
01882
01883 getCurrentPage() ->videoFastForward();
01884
01885 commitComponentState();
01886 }
01887 }
|
|
|
Trigger the forward action of the current page.
Definition at line 1864 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageCapture::processCommand(). 01865 {
01866 if ( ! is_component_state_changing )
01867 {
01868
01869 getCurrentPage() ->videoForward(step);
01870
01871 commitComponentState();
01872 }
01873 }
|
|
|
Trigger the next scene action of the current page.
Definition at line 1892 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageMagick::processCommand(), PageEditor::processCommand(), and PageCapture::processCommand(). 01893 {
01894 if ( ! is_component_state_changing )
01895 {
01896
01897 getCurrentPage() ->videoNextScene();
01898
01899 commitComponentState();
01900 }
01901 }
|
|
|
Trigger the pause action of the current page.
Definition at line 1934 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageTrim::processCommand(), PageMagick::processCommand(), PageEditor::processCommand(), and PageCapture::processCommand(). 01935 {
01936 if ( ! is_component_state_changing )
01937 {
01938
01939 getCurrentPage() ->videoPause();
01940
01941 commitComponentState();
01942 }
01943 }
|
|
|
Trigger the play action of the current page.
Definition at line 1850 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageTrim::processCommand(), PageMagick::processCommand(), PageEditor::processCommand(), and PageCapture::processCommand(). 01851 {
01852 if ( ! is_component_state_changing )
01853 {
01854
01855 getCurrentPage() ->videoPlay();
01856
01857 commitComponentState();
01858 }
01859 }
|
|
|
Trigger the previous scene action of the current page.
Definition at line 1794 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageMagick::processCommand(), PageEditor::processCommand(), and PageCapture::processCommand(). 01795 {
01796 if ( ! is_component_state_changing )
01797 {
01798
01799 getCurrentPage() ->videoPreviousScene();
01800
01801 commitComponentState();
01802 }
01803 }
|
|
|
Trigger the rewind action of the current page.
Definition at line 1822 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageCapture::processCommand(). 01823 {
01824 if ( ! is_component_state_changing )
01825 {
01826
01827 getCurrentPage() ->videoRewind();
01828
01829 commitComponentState();
01830 }
01831 }
|
|
|
Bi-directional variable-speed playback.
Definition at line 1964 of file kino_common.cc. References commitComponentState(), getComponentState(), getCurrentPage(), Preferences::getInstance(), is_component_state_changing, and toggleComponents(). 01965 {
01966 if ( ! is_component_state_changing )
01967 {
01968 toggleComponents( getComponentState(), false );
01969
01970 if ( ! Preferences::getInstance().dropFrame )
01971 // this has bad thread interaction with dropFrame playback
01972 gtk_range_set_value( this->video_shuttle, angle );
01973 getCurrentPage() ->videoShuttle( angle );
01974
01975 commitComponentState();
01976 }
01977 }
|
|
|
Trigger the start of movie action of the current page.
Definition at line 1780 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageTrim::processCommand(), PageMagick::processCommand(), PageEditor::processCommand(), and PageCapture::processCommand(). 01781 {
01782 if ( ! is_component_state_changing )
01783 {
01784
01785 getCurrentPage() ->videoStartOfMovie();
01786
01787 commitComponentState();
01788 }
01789 }
|
|
|
Trigger the start of scene action of the current page.
Definition at line 1808 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageTrim::processCommand(), PageMagick::processCommand(), PageEditor::processCommand(), and PageCapture::processCommand(). 01809 {
01810 if ( ! is_component_state_changing )
01811 {
01812
01813 getCurrentPage() ->videoStartOfScene();
01814
01815 commitComponentState();
01816 }
01817 }
|
|
|
Trigger the stop action of the current page.
Definition at line 1948 of file kino_common.cc. References commitComponentState(), getCurrentPage(), and is_component_state_changing. Referenced by PageTrim::processCommand(), PageMagick::processCommand(), PageEditor::processCommand(), PageCapture::processCommand(), PageMagick::processKeyboard(), PageEditor::processKeyboard(), PageCapture::processKeyboard(), and PageEditor::showFrame(). 01949 {
01950 if ( ! is_component_state_changing )
01951 {
01952
01953 getCurrentPage() ->videoStop();
01954
01955 commitComponentState();
01956 }
01957 }
|
|
|
Definition at line 1984 of file kino_common.cc. References getCurrentPage(). 01985 {
01986 getCurrentPage() ->visibilityChanged( visible );
01987 }
|
|
|
Definition at line 1979 of file kino_common.cc. References getCurrentPage(). Referenced by newFile(). 01980 {
01981 getCurrentPage() ->windowMoved();
01982 }
|
|
|
Definition at line 142 of file kino_common.h. Referenced by getPageBttv(), KinoCommon(), and ~KinoCommon(). |
|
|
Definition at line 140 of file kino_common.h. Referenced by getPageCapture(), KinoCommon(), and ~KinoCommon(). |
|
|
Definition at line 118 of file kino_common.h. Referenced by importFile(), publishFrame(), and publishPlayList(). |
|
|
Definition at line 154 of file kino_common.h. Referenced by commitComponentState(), getComponentState(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 136 of file kino_common.h. Referenced by bulkLoad(), KinoCommon(), moveByFrames(), moveToFrame(), publishFrame(), saveFrame(), setCurrentPage(), setPreviewSize(), and start(). |
|
|
Definition at line 158 of file kino_common.h. Referenced by getCurrentScene(), KinoCommon(), loadFile(), loadPlayList(), newFile(), and setCurrentScene(). |
|
|
Definition at line 115 of file kino_common.h. Referenced by KinoCommon(). |
|
|
Definition at line 139 of file kino_common.h. Referenced by getPageEditor(), KinoCommon(), and ~KinoCommon(). |
|
|
Definition at line 143 of file kino_common.h. Referenced by getPageExport(), KinoCommon(), and ~KinoCommon(). |
|
|
Definition at line 223 of file kino_common.h. Referenced by _getOneSecond(), appendFile(), audioThread(), bulkLoad(), PageCapture::collectFiles(), getOneSecond(), importFile(), PageMagickCreate::Initialise(), insertFile(), PageTrim::insertScene(), KinoCommon(), loadFile(), loadPlayList(), moveByFrames(), PageEditor::movedToFrame(), moveToFrame(), newFile(), PageTrim::processCommand(), PageTimeline::processCommand(), PageEditor::processCommand(), PageCapture::processCommand(), publishFrame(), readThread(), saveFrame(), savePlayListAs(), PageTrim::saveScene(), PageTrim::selectScene(), PageTimeline::selectScene(), PageMagick::selectScene(), setTimeFormat(), PageTrim::showFrame(), PageEditor::showFrame(), PageMagick::showFrameInfo(), PageEditor::showFrameInfo(), PageTrim::start(), PageTimeline::start(), PageMagick::start(), PageEditor::start(), Export::startExport(), PageCapture::stopCapture(), PageEditor::videoEndOfScene(), PageEditor::videoNextScene(), PageEditor::videoPreviousScene(), PageEditor::videoStartOfScene(), videoThread(), and PageEditor::windowMoved(). |
|
|
Definition at line 224 of file kino_common.h. Referenced by appendFile(), bulkLoad(), PageCapture::collectFiles(), PageEditor::DeleteFrames(), PageEditor::DrawBar(), insertFile(), PageTrim::insertScene(), KinoCommon(), loadFile(), loadPlayList(), PageTrim::movedToFrame(), PageMagick::movedToFrame(), PageEditor::PasteFrames(), PageTrim::processCommand(), PageEditor::processCommand(), PageTrim::saveScene(), and PageCapture::stopCapture(). |
|
|
Definition at line 155 of file kino_common.h. Referenced by commitComponentState(), KinoCommon(), toggleComponents(), videoBack(), videoEndOfMovie(), videoEndOfScene(), videoFastForward(), videoForward(), videoNextScene(), videoPause(), videoPlay(), videoPreviousScene(), videoRewind(), videoShuttle(), videoStartOfMovie(), videoStartOfScene(), and videoStop(). |
|
|
Definition at line 156 of file kino_common.h. Referenced by getFileToOpen(), getFileToSaveFormat(), getLastDirectory(), and setLastDirectory(). |
|
|
Definition at line 145 of file kino_common.h. Referenced by getPageMagick(), KinoCommon(), and ~KinoCommon(). |
|
|
Definition at line 117 of file kino_common.h. Referenced by changePageRequest(), and KinoCommon(). |
|
|
Definition at line 133 of file kino_common.h. Referenced by getLastDirectory(), getPlayList(), moveToFrame(), publishPlayList(), and savePlayListAs(). |
|
|
Definition at line 150 of file kino_common.h. |
|
|
Definition at line 160 of file kino_common.h. Referenced by updateRecentFiles(). |
|
|
Definition at line 157 of file kino_common.h. Referenced by setMoreInfo(), and showFrameMoreInfo(). |
|
|
Definition at line 130 of file kino_common.h. Referenced by KinoCommon(), and setStatusBar(). |
|
|
Definition at line 149 of file kino_common.h. Referenced by getFileToOpen(), and getFileToSaveFormat(). |
|
|
Definition at line 159 of file kino_common.h. Referenced by getTime(). |
|
|
Definition at line 141 of file kino_common.h. Referenced by getPageTimeline(), KinoCommon(), and ~KinoCommon(). |
|
|
Definition at line 144 of file kino_common.h. Referenced by getPageTrim(), KinoCommon(), and ~KinoCommon(). |
|
|
Definition at line 146 of file kino_common.h. Referenced by getPageUndefined(), KinoCommon(), and ~KinoCommon(). |
|
|
Definition at line 122 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 128 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 127 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 126 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 125 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 123 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 121 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 129 of file kino_common.h. Referenced by activateWidgets(), and KinoCommon(). |
|
|
Definition at line 119 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 120 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 124 of file kino_common.h. Referenced by activateWidgets(), KinoCommon(), and toggleComponents(). |
|
|
Definition at line 116 of file kino_common.h. Referenced by KinoCommon(). |
|
|
Definition at line 114 of file kino_common.h. Referenced by activateWidgets(), bulkLoad(), clearPreview(), getWidget(), importFile(), setPreviewSize(), showFrameMoreInfo(), toggleComponents(), and updateRecentFiles(). |
1.4.2