summaryrefslogtreecommitdiffstats
path: root/libk3b/videodvd/k3bvideodvdtitle.h
blob: 17f31a3ca9a148a39ce85e2950b164823529d459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* 
 *
 * $Id: sourceheader 511311 2006-02-19 14:51:05Z trueg $
 * Copyright (C) 2006 Sebastian Trueg <trueg@k3b.org>
 *
 * This file is part of the K3b project.
 * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * See the file "COPYING" for the exact licensing terms.
 */

#ifndef _K3B_VIDEODVD_TITLE_H_
#define _K3B_VIDEODVD_TITLE_H_

#include <k3b_export.h>

#include <k3bvideodvdtime.h>
#include <k3bvideodvdvideostream.h>
#include <k3bvideodvdaudiostream.h>
#include <k3bvideodvdsubpicturestream.h>
#include <k3bvideodvdptt.h>

#include <qvaluevector.h>


namespace K3bVideoDVD
{
  class LIBK3B_EXPORT Title
    {
    public:
      Title() {}
    
      unsigned int titleNumber() const { return m_titleNum; }
      
      /**
       * \return The number of PTTs (Part of Title), commonly known
       *         as chapters
       */
      unsigned int numPTTs() const { return m_numPTTs; }

      /**
       * This method is just here for convenience. It returns the same as the above.
       */
      unsigned int numChapters() const { return m_numPTTs; }
      unsigned int numAngles() const { return m_numAngles; }

      /**
       * \return The number of the titleset this title is a part of.
       */
      unsigned int titleSet() const { return m_titleSet; }

      /**
       * \return Number of the title in it's titleset.
       */
      unsigned int ttn() const { return m_ttn; }
      
      unsigned int numAudioStreams() const { return m_audioStreams.count(); }
      unsigned int numSubPictureStreams() const { return m_subPictureStreams.count(); }
      
      const VideoStream& videoStream() const { return m_videoStream; }
      const AudioStream& audioStream( unsigned int i ) const { return m_audioStreams[i]; }
      const SubPictureStream& subPictureStream( unsigned int i ) const { return m_subPictureStreams[i]; }

      /**
       * Access to the PTTs of the title
       */
      const PTT& operator[]( int i ) const { return ptt( i ); }

      /**
       * Access to the PTTs of the title
       */
      const PTT& ptt( int i ) const { return m_ptts[i]; }

      /**
       * Access to the PTTs (chapters) of the title
       */
      const PTT& chapter( int i ) const { return ptt( i ); }

      const Time& playbackTime() const { return m_playbackTime; }

      /**
       * \return A video capture
       */
      //      QBitmap videoCapture( const Time& ) const;
      
    private:
      unsigned int m_titleNum;
      unsigned int m_numPTTs;
      unsigned int m_titleSet;
      // FIXME: find a proper name for ttn
      unsigned int m_ttn;
      unsigned int m_numAngles;

      Time m_playbackTime;
      
      VideoStream m_videoStream;
      QValueVector<AudioStream> m_audioStreams;
      QValueVector<SubPictureStream> m_subPictureStreams;

      QValueVector<PTT> m_ptts;

      //      VideoDVD* m_videoDVD;

      friend class VideoDVD;
    };
}

#endif