summaryrefslogtreecommitdiffstats
path: root/k9author/k9avifile.cpp
blob: 32fff6fd4d61f8342d3d293581c6eb09d78272e2 (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
//
// C++ Implementation: k9avifile
//
// Description: 
//
//
// Author: Jean-Michel PETIT <[email protected]>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "k9common.h"
#include "k9avifile.h"
#include "k9title.h"

k9AviFile::k9AviFile(k9Title *parent, const char *name)
 : TQObject(parent, name)
{
    m_num=parent->getFiles()->count();
    setTitle(parent);
    m_previous=NULL;
    m_next=NULL;
    m_breakNext=false;
    m_breakPrevious=false;
}


k9AviFile::~k9AviFile()
{
}


#include "k9avifile.moc"


TQString k9AviFile::getFileName() const
{
	return m_fileName;
}


void k9AviFile::setFileName ( const TQString& _value )
{
	m_fileName = _value;
        emit aviFileUpdated  (this);
}


TQTime k9AviFile::getStart() const
{
	return m_start;
}


void k9AviFile::setStart ( const TQTime& _value )
{
	m_start = _value;
        emit aviFileUpdated  (this);
}


TQTime k9AviFile::getEnd() const
{
	return m_end;
}


void k9AviFile::setEnd ( const TQTime& _value )
{
	m_end = _value;
        emit aviFileUpdated  (this);
}


TQString k9AviFile::getLabel() const
{
	return m_label;
}


void k9AviFile::setLabel ( const TQString& _value )
{
	m_label = _value;
        emit aviFileUpdated  (this);
}


k9Title* k9AviFile::getTitle() const
{
	return m_title;
}


void k9AviFile::setTitle ( k9Title* _value )
{
	m_title = _value;
        m_title->getFiles()->append(this);
        m_title->getFiles()->sort();
}


int k9AviFile::getNum() const
{
	return m_num;
}




k9AviFile* k9AviFile::getPrevious() const
{
	return m_previous;
}


void k9AviFile::setPrevious ( k9AviFile* _value )
{
	m_previous = _value;   
        m_breakPrevious=false;
}


k9AviFile* k9AviFile::getNext() const
{
	return m_next;
}


void k9AviFile::setNext ( k9AviFile* _value )
{
	m_next = _value;
        m_breakPrevious=false;
}

void k9AviFile::setBreakPrevious(bool _state) {
  m_breakPrevious=_state;
  if ( ! _state){
        if (m_previous !=NULL) {
            m_previous->setEnd(this->getStart());
            m_previous->m_breakNext=false;
        }
   } else {  
        if (m_previous!=NULL) {
            m_previous ->m_breakNext=true;
        }    
   }

}

bool k9AviFile::getBreakPrevious() {
    return m_breakPrevious;
}

void k9AviFile::setBreakNext(bool _state) {
  m_breakNext=_state;
  if ( ! _state){
        if (m_next !=NULL) {
            m_next->setStart(this->getEnd());
            m_next->m_breakPrevious=false;
        }
   } else {  
        if (m_next!=NULL) {
            m_next ->m_breakPrevious=true;
        }    
   }


}

bool k9AviFile::getBreakNext() {
    return m_breakNext;
}



TQImage k9AviFile::getImage() const {
    return m_image;
}


void k9AviFile::setImage(const TQImage& _value) {
    m_image = _value;
    emit aviFileUpdated  (this);
    emit imageChanged(_value);
}