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

playlist.h

Go to the documentation of this file.
00001 /*
00002 * playlist.h -- SMIL definition
00003 * Copyright (C) 2000 Arne Schirmacher <arne@schirmacher.de>
00004 * Copyright (C) 2001-2007 Dan Dennedy <dan@dennedy.org>
00005 *
00006 * This program is free software; you can redistribute it and/or modify
00007 * it under the terms of the GNU General Public License as published by
00008 * the Free Software Foundation; either version 2 of the License, or
00009 * (at your option) any later version.
00010 *
00011 * This program is distributed in the hope that it will be useful,
00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 * GNU General Public License for more details.
00015 *
00016 * You should have received a copy of the GNU General Public License
00017 * along with this program; if not, write to the Free Software Foundation,
00018 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef _PLAYLIST_H
00022 #define _PLAYLIST_H
00023 
00024 // C++ Include files
00025 #include <vector>
00026 using std::vector;
00027 #include <string>
00028 using std::string;
00029 #include <map>
00030 using std::map;
00031 #include "smiltime.h"
00032 
00033 // C includes
00034 
00035 #include <libxml/xmlmemory.h>
00036 #include <libxml/parser.h>
00037 #include <time.h>
00038 
00039 // forward declarations
00040 
00041 class Frame;
00042 class FileHandler;
00043 
00047 class PlayList
00048 {
00049 public:
00050     PlayList();
00051     PlayList( const PlayList& );
00052     PlayList& operator=( const PlayList& );
00053     ~PlayList();
00054 
00055     xmlNodePtr GetBody( ) const;
00056     int GetNumFrames() const;
00057     char* GetFileNameOfFrame( int frameNum ) const;
00058     bool GetFrame( int frameNum, Frame &frame );
00059     bool GetMediaObject( int frameNum, FileHandler **media );
00060     int GetClipBegin( int frameNum ) const;
00061     int GetClipEnd( int frameNum ) const;
00062     bool SetClipBegin( int frameNum, const char* value );
00063     bool SetClipEnd( int frameNum, const char* value );
00064     int FindStartOfScene( int frameNum ) const;
00065     int FindEndOfScene( int frameNum ) const;
00066     void AutoSplit( int first, int last );
00067     bool SplitSceneBefore( int frameNum );
00068     bool JoinScenesAt( int frameNum );
00069     bool GetPlayList( int first, int last, PlayList &playlist ) const;
00070     bool InsertPlayList( PlayList &playlist, int before );
00071     bool Delete( int first, int last );
00072     bool LoadMediaObject( char *filename );
00073     bool LoadPlayList( char *filename );
00074     bool SavePlayList( char *filename, bool isLegacyFormat = false );
00075     bool SavePlayListEli( char *filename, bool isPAL );
00076     bool SavePlayListSrt( const char *filename );
00077     void CleanPlayList( xmlNodePtr node );
00078     void CleanPlayList( );
00079     bool IsFileUsed( string filename ) const;
00080     bool IsDirty( ) const;
00081     void SetDirty( bool value );
00082     string GetDocName( ) const;
00083     void GetLastCleanPlayList( PlayList &playlist );
00084     void SetDocName( string );
00085     string GetProjectDirectory( );
00086     string GetSeqAttribute( int frameNum, const char* ) const;
00087     bool SetSeqAttribute( int frameNum, const char*, const char* );
00088     bool SetDocId( const char* value );
00089     string GetDocId( ) const;
00090     bool SetDocTitle( const char* value );
00091     string GetDocTitle( ) const;
00092     
00093 protected:
00094     bool dirty;
00095 
00096 private:
00097     void RefreshCount();
00098     void AutoSplit( int first, time_t startTime, int last, time_t endTime, int fps );
00099     string doc_name;
00100     xmlDocPtr doc;
00101     int count;
00102     SMIL::MediaClippingTime time;
00103 };
00104 
00108 class directory_utils
00109 {
00110 public:
00111     static string join_file_to_directory( const string directory, const string &file );
00112     static string get_directory_from_file( const string &file );
00113     static string get_absolute_path_to_file( const string &directory, const string &file );
00114     static string get_relative_path_to_file( const string &directory, const string &file );
00115     static string expand_directory( const string directory );
00116 };
00117 
00121 class EditorBackup
00122 {
00123 private:
00124     int maxUndos;
00125     int position;
00126     vector <PlayList *> backups;
00127 public:
00128     EditorBackup();
00129     ~EditorBackup();
00130     void Store( PlayList *, bool isPersisted = true );
00131     void Undo( PlayList * );
00132     void Redo( PlayList * );
00133     void SetAllDirty( );
00134     void Clear( );
00135     bool Restore( PlayList * );
00136 };
00137 
00141 extern EditorBackup *GetEditorBackup();
00142 
00143 
00147 class FileMap
00148 {
00149 public:
00150     virtual ~FileMap()
00151     { }
00153     virtual map<string, FileHandler*> &GetMap() = 0;
00155     virtual void Clear() = 0;
00157     virtual void GetUnusedFxFiles( PlayList &list, vector< string > &unused ) = 0;
00158 };
00159 
00163 extern FileMap *GetFileMap( );
00164 
00165 
00166 #endif

Generated on Sun Mar 11 22:11:47 2007 for Kino by  doxygen 1.4.2