Main Page | File List

xml_dvdauthor.h

00001 
00002 //
00003 // This file contains the import filter for
00004 // dvdauthor-xml files, and spumux-xml files.
00005 //
00007 #ifndef XML_DVDAUTHOR_H
00008 #define XML_DVDAUTHOR_H
00009 
00010 #include <qstring.h>
00011 #include <qdom.h>
00012 
00013 #define DVD_DOCTYPE                     ""
00014 // Here we define all attributes for the structures.
00015 #define DVDAUTHOR_DEST          "dest"
00016 #define DVDAUTHOR_JUMPPAD       "jumppad"
00017 #define MENUS_LANG                      "lang"
00018 #define VIDEO_FORMAT            "format"
00019 #define VIDEO_ASPECT            "aspect"
00020 #define VIDEO_RESOLUTION        "resolution"
00021 #define VIDEO_CAPTION           "caption"
00022 #define VIDEO_WIDESCREEN        "widescreen"
00023 #define AUDIO_FORMAT            "format"
00024 #define AUDIO_CHANNELS          "channels"
00025 #define AUDIO_QUANT                     "quant"
00026 #define AUDIO_DOLBY                     "dolby"
00027 #define AUDIO_LANG                      "lang"
00028 #define SUBPICTURE_LANG         "lang"
00029 #define PGC_ENTRY                       "entry"
00030 #define PGC_PALETTE                     "palette"
00031 #define PGC_PAUSE                       "pause"
00032 #define BUTTON_NAME                     "name"
00033 #define VOB_FILE                        "file"
00034 #define VOB_CHAPTERS            "chapters"
00035 #define VOB_PAUSE                       "pause"
00036 #define CELL_START                      "start"
00037 #define CELL_END                        "end"
00038 #define CELL_CHAPTER            "chapter"
00039 #define CELL_PROGRAM            "program"
00040 #define CELL_PAUSE                      "pause"
00041 // Here are the identifiers for spumux
00042 #define SPU_START                       "start"
00043 #define SPU_END                         "end"
00044 #define SPU_IMAGE                       "image"
00045 #define SPU_HIGHLIGHT           "highlight"
00046 #define SPU_SELECT                      "select"
00047 #define SPU_TRANSPARENT         "transparent"
00048 #define SPU_FORCE                       "force"
00049 #define SPU_AUTOOUTLINE         "autooutline"
00050 #define SPU_OUTLINEWIDTH        "outlinewidth"
00051 #define SPU_AUTOORDER           "autoorder"
00052 #define SPU_XOFFSET                     "xoffset"
00053 #define SPU_YOFFSET                     "yoffset"
00054 #define BUTTON_LABEL            "label"
00055 #define BUTTON_X0                       "x0"
00056 #define BUTTON_Y0                       "y0"
00057 #define BUTTON_X1                       "x1"
00058 #define BUTTON_Y1                       "y1"
00059 #define BUTTON_UP                       "up"
00060 #define BUTTON_DOWN                     "down"
00061 #define BUTTON_LEFT                     "left"
00062 #define BUTTON_RIGHT            "right"
00063 #define ACTION_LABEL            "label"
00064 
00065 
00066 
00067 class CXmlDVDAuthor
00068 {
00069 //private:
00070 public:
00071         class video_struct      {
00072                 public:
00073                 video_struct ()
00074                 {node_name=QString("video");};
00075                 bool readXml (QDomElement *);
00076                 bool writeXml(QDomDocument *, QDomElement *);
00077                 QString node_name;      // Name of this node ...
00078                 QString format;         // [ntsc|pal]
00079                 QString aspect;         // [4:3|16:9]
00080                 QString resolution;     // [XxY]
00081                 QString caption;        // [field1|field2]
00082                 QString widescreen;     // [nopanscan|noletterbox]
00083         };
00084         class audio_struct      {
00085                 public:
00086                 audio_struct ()
00087                 {node_name=QString("audio"); channels=0;};
00088                 bool readXml (QDomElement *);
00089                 bool writeXml(QDomDocument *, QDomElement *);
00090                 QString node_name;      // Name of this node ...
00091                 QString format;         // [mp2|ac3|dts|pcm]
00092                 uint    channels;       // number of channels
00093                 QString quant;          // [16bps|2-bps|24bps|drc]
00094                 QString dolby;          // [surround]
00095                 QString lang;           // language
00096         };
00097         class subpicture_struct {
00098                 public:
00099                 subpicture_struct ()
00100                 {node_name=QString("subpicture");};
00101                 bool readXml (QDomElement *);
00102                 bool writeXml(QDomDocument *, QDomElement *);
00103                 QString node_name;      // Name of this node ...
00104                 QString lang;           // language
00105         };
00106         class pre_struct                {
00107                 public:
00108                 pre_struct ()
00109                 {node_name=QString("pre");};
00110                 bool readXml(QDomElement *);
00111                 bool writeXml(QDomDocument *, QDomElement *);
00112                 QString node_name;      // Name of this node ...
00113                 QString value;          // commands to be executed before.
00114         };
00115         class cell_struct               {
00116                 public:
00117                 cell_struct ()
00118                 {node_name=QString("cell");};
00119                 bool readXml(QDomElement *);
00120                 bool writeXml(QDomDocument *, QDomElement *);
00121                 QString node_name;      // Name of this node ...
00122                 QString start;          // "0:00:00.000"
00123                 QString end;            // "-1"
00124                 QString chapter;        // [1|ON|YES]
00125                 QString program;        // "1"
00126                 QString pause;          // [seconds|inf]
00127         };
00128         class vob_struct                {
00129                 public:
00130                 vob_struct ()
00131                 {node_name=QString("vob");};
00132                 bool readXml(QDomElement *);
00133                 bool writeXml(QDomDocument *, QDomElement *);
00134                 QString node_name;      // Name of this node ...
00135                 QString file;           // file.mpg
00136                 QString chapters;       // chapters - list
00137                 QString pause;          // [seconds|inf]
00138                 cell_struct cell;
00139         };
00140         class button_struct     {
00141                 public:
00142                 button_struct ()
00143                 {node_name=QString("button");};
00144                 bool readXml(QDomElement *);
00145                 bool writeXml(QDomDocument *, QDomElement *);
00146                 QString node_name;      // Name of this node ...
00147                 QString value;          // commands to be executed.
00148                 QString name;           // button name
00149         };
00150         class post_struct               {
00151                 public:
00152                 post_struct ()
00153                 {node_name=QString("post");};
00154                 bool readXml(QDomElement *);
00155                 bool writeXml(QDomDocument *, QDomElement *);
00156                 QString node_name;      // Name of this node ...
00157                 QString value;          // comands to be executed after ...
00158         };
00159         // Okay, the following structs will generate the structure of the xml - file.
00160         class pgc_struct        {
00161                 public:
00162                  pgc_struct ();
00163                 ~pgc_struct ();
00164                 bool readXml(QDomElement *);
00165                 bool writeXml(QDomDocument *, QDomElement *);
00166                 button_struct *addButton();
00167                 vob_struct *addVob();
00168                 // attributes
00169                 QString entry;          // title
00170                 QString palette;        // [yuv-file|rgb-file]
00171                 QString pause;          // [seconds|inf]
00172                 // nodes
00173                 QString                                 node_name;
00174                 pre_struct                              pre;
00175                 vob_struct                              **ppArrayVob;
00176                 button_struct                   **ppArrayButton;
00177                 post_struct                             post;
00178         };
00179         class menus_struct      {
00180                 public:
00181                  menus_struct ();
00182                 ~menus_struct ();
00183                 bool readXml (QDomElement *);
00184                 bool writeXml(QDomDocument *, QDomElement *);
00185                 pgc_struct *addPgc ();
00186 
00187                 QString                                 node_name;      // Name of this node = "menus"
00188                 QString                                 lang;           // language-code
00189                 video_struct                    video;
00190                 audio_struct                    audio[8];
00191                 subpicture_struct               subpicture;
00192                 pgc_struct                              **ppArrayPgc;
00193         };
00194         class titles_struct     {
00195                 public:
00196                  titles_struct ();
00197                 ~titles_struct ();
00198                 bool readXml(QDomElement *);
00199                 bool writeXml(QDomDocument *, QDomElement *);
00200                 pgc_struct *addPgc ();
00201 
00202                 QString                                 node_name;
00203                 QString                                 titles;
00204                 video_struct                    video;
00205                 audio_struct                    audio[8];
00206                 pgc_struct                              **ppArrayPgc;
00207         };
00208         class vmgm_struct       {
00209                 public:
00210                 vmgm_struct ();
00211                 bool readXml (QDomElement *);
00212                 bool writeXml(QDomDocument *, QDomElement *);
00213 
00214                 QString                                 node_name;
00215                 menus_struct                    menus;
00216         };
00217         class titleset_struct   {
00218                 public:
00219                 titleset_struct ();
00220                 bool readXml (QDomElement *);
00221                 bool writeXml(QDomDocument *, QDomElement *);
00222 
00223                 QString                 node_name;
00224                 menus_struct    menus;
00225                 titles_struct   titles;
00226         };
00227         class dvdauthor_struct  {
00228                 public:
00229                  dvdauthor_struct ();
00230                 ~dvdauthor_struct ();
00231                 // public functions ...
00232                 bool readXml (QDomElement *);
00233                 bool writeXml(QDomDocument *);
00234                 titleset_struct *addTitleset ();
00235                 // dvdauthor attributes
00236                 QString node_name;      // Name of this node ...
00237                 QString dest;           // output dir
00238                 QString jumppad;        // [1|on|yes]
00239                 vmgm_struct                             vmgm;
00240                 titleset_struct                 **ppArrayTitleset;
00241         };
00242 public:
00243          CXmlDVDAuthor ();
00244         ~CXmlDVDAuthor ();
00245 
00246         bool readXml  ();
00247         bool writeXml ();
00248         bool writeXml (QString &fileName);
00249 
00250 private:
00251         // Priovate functions
00252 
00253 //private:
00254 public:
00255         dvdauthor_struct        m_dvdauthor;    // This struct holds the whole structure
00256                                                                                 // of the xml file for dvdauthor.
00257 };
00258 
00260 //
00261 // Following is the structure of dvdauthor-xml files.
00262 //
00264 //<dvdauthor [dest="output-dir"] [jumppad="1|on|yes"] >
00265 //   <vmgm>
00266 //     <menus [lang="language-code"] >
00267 //         <video [format="ntsc|pal"] [aspect="4:3|16:9"]
00268 //                [resolution="XxY"] [caption="field1|field2"]
00269 //                [widescreen="nopanscan|noletterbox"] />
00270 //         <audio [format="mp2|ac3|dts|pcm"] [channels="numchannels"]
00271 //                [quant="16bps|20bps|24bps|drc"] [dolby="surround"]
00272 //                [lang="language"] />
00273 //         [<audio ... />]
00274 //         <subpicture lang="language" />
00275 //         <pgc [entry="title"] [palette="yuvfile|rgbfile"]
00276 //              [pause="seconds|inf"]>
00277 //            <pre> commands; </pre>
00278 //            <vob file="file.mpg" [chapters="chapter-list"]
00279 //                 [pause="seconds|inf"] />
00280 //            [<vob ... />]
00281 //            <button [name="buttonname"]> commands; </button>
00282 //            [<button ... />]
00283 //            <post> commands; </post>
00284 //          </pgc>
00285 //         [<pgc ... />]
00286 //      </menus>
00287 //   </vmgm>
00288 //   <titleset>
00289 //      <menus>
00290 //         [<video ... />]
00291 //         [<audio ... />]
00292 //         <pgc [entry="root|subtitle|audio|angle|ptt"]
00293 //              [palette="yuvfile|rgbfile"] [pause="seconds|inf"]>
00294 //            [...]
00295 //         </pgc>
00296 //         [<pgc ... />]
00297 //      </menus>
00298 //      <titles>
00299 //         [<video ... />]
00300 //         [<audio ... />]
00301 //         <pgc [palette="yuvfile|rgbfile"] [pause="seconds|inf"]>
00302 //            [...]
00303 //         </pgc>
00304 //         [<pgc ... />]
00305 //      </titles>
00306 //   </titleset>
00307 //   [<titleset ... />]
00308 //</dvdauthor>
00310 class CXmlSpumux
00311 {
00312 //private:
00313 public:
00314         class button_struct     {
00315                 public:
00316                 button_struct ();
00317                 bool readXml (QDomElement *);
00318                 bool writeXml(QDomDocument *, QDomElement *);
00319                 QString node_name;
00320                 QString label;  // Button text
00321                 int     x0;                     // coordinates.
00322                 int     y0;                     //
00323                 int     x1;                     //
00324                 int     y1;                     //
00325                 QString up;             // Label for up-button
00326                 QString down;   // Label for down-button
00327                 QString left;   // Label for ???
00328                 QString right;  // Label for ???
00329         };
00330         class action_struct     {
00331                 public:
00332                 action_struct ()
00333                 {node_name = QString ("action");}
00334                 bool readXml (QDomElement *);
00335                 bool writeXml(QDomDocument *, QDomElement *);
00336                 QString node_name;
00337                 QString label;  // the label for this action
00338         };
00339         class textsub_struct    {
00340                 public:
00341                 textsub_struct ()
00342                 {node_name = QString ("textsub");}
00343                 bool readXml (QDomElement *);
00344                 bool writeXml(QDomDocument *, QDomElement *);
00345                 QString node_name;
00346                 QString filename;
00347                 QString characterset;
00348                 int             fontsize;
00349                 int             horizontal_alignment;
00350                 int             vertical_alignment;
00351                 int             left_margin;
00352                 int             right_margin;
00353                 int             bottom_margin;
00354                 int             top_margin;
00355                 QString font;
00356                 float   subtitle_fps;
00357                 float   movie_fps;
00358                 int             movie_width;
00359                 int             movie_height;
00360                 QString transparent;
00361         };
00362         // And here we build the file structure of teh xml file for spumux
00363         class spu_struct        {
00364                 public:
00365                  spu_struct ();
00366                 ~spu_struct ();
00367                 bool readXml (QDomElement *);
00368                 bool writeXml(QDomDocument *, QDomElement *);
00369                 button_struct *addButton ();
00370                 action_struct *addAction ();
00371                 QString node_name;
00372                 QString start;                  // [start-time] E.g. 00:00:00.0
00373                 QString end;                    // [end-time]
00374                 QString image;                  // picture.png
00375                 QString highlight;              // picture.png
00376                 QString select;                 // picture.png
00377                 QString transparent;    // [color-code] E.g. 0xRRGGBB
00378                 QString force;                  // [yes/no]
00379                 QString autooutline;    // [infer]
00380                 int     outlinewidth;
00381                 QString autoorder;              // [rows|columns]
00382                 int     xoffset;                        //
00383                 int     yoffset;                        //
00384                 button_struct   **ppArrayButton;
00385                 action_struct   **ppArrayAction;
00386         };
00387         class   stream_struct   {
00388                 public:
00389                  stream_struct ();
00390                 ~stream_struct ();
00391                 bool readXml (QDomElement *);
00392                 bool writeXml(QDomDocument *, QDomElement *);
00393                 QString           node_name;
00394                 spu_struct       *addSpu();
00395                 spu_struct      **ppArraySpu;
00396         };
00397         class subpictures_struct        {
00398                 public:
00399                 subpictures_struct ()
00400                 {node_name = QString ("subpictures");}
00401                 bool readXml (QDomElement *);
00402                 bool writeXml(QDomDocument *);
00403                 QString                 node_name;
00404                 stream_struct   stream;
00405         };
00406 public:
00407          CXmlSpumux ();
00408         ~CXmlSpumux ();
00409 
00410         bool readXml ();
00411         bool writeXml ();
00412         bool writeXml (QString &fileName);
00413 
00414 //private:
00415 public:
00416         subpictures_struct      m_subpictures;  // This struct holds the full xml file for spumux.
00417 };
00418 
00419 
00421 //
00422 // Following is the structure of spumux-xml files.
00423 //
00425 //<subpictures>
00426 //   <stream>
00427 //      <spu start="start-time" [ end="end-time" ] [ image="picture.png" ]
00428 //           [ highlight="picture.png" ] [ select="picture.png" ]
00429 //           [ transparent="color-code" ] [ force="yes" ]
00430 //           [ autooutline="infer" [ outlinewidth="width" ]
00431 //             [ autoorder="rows" | autoorder="columns" ] ]
00432 //           [ xoffset="x-coord" yoffset="y-coord" ] >
00433 //         <button [ label="name" ] [ x0="x0" ] [ y0="y0" ] [ x1="x1" ]
00434 //                 [ y1="y1" ] [ up="label" ] [ down="label" ]
00435 //                 [ left="label" ] [ right="label" ] />
00436 //         <action [ label="name" ] />
00437 //      </spu>
00438 //   </stream>
00439 //</subpictures>
00441 
00442 #endif // XML_DVDAUTHOR_H

Generated on Tue Jan 27 01:01:14 2004 for xml_dvdauthor by doxygen 1.3.2