Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
827c9e17
Commit
827c9e17
authored
Jun 29, 2020
by
Sashmita Raghav
Browse files
Add class to handle subtitles definition and comparison
parent
077d48b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/definitions.cpp
View file @
827c9e17
...
...
@@ -203,3 +203,61 @@ PlaylistState::ClipState stateFromBool(std::pair<bool, bool> av)
return
PlaylistState
::
Disabled
;
}
}
SubtitledTime
::
SubtitledTime
()
:
m_starttime
(
0
)
,
m_endtime
(
0
)
{
}
SubtitledTime
::
SubtitledTime
(
const
GenTime
&
start
,
QString
sub
,
const
GenTime
&
end
)
:
m_starttime
(
start
)
,
m_subtitle
(
sub
)
,
m_endtime
(
end
)
{
}
QString
SubtitledTime
::
subtitle
()
{
return
m_subtitle
;
}
GenTime
SubtitledTime
::
start
()
{
return
m_starttime
;
}
GenTime
SubtitledTime
::
end
()
{
return
m_endtime
;
}
void
SubtitledTime
::
setSubtitle
(
const
QString
&
sub
)
{
m_subtitle
=
sub
;
}
void
SubtitledTime
::
setEndTime
(
const
GenTime
&
end
)
{
m_endtime
=
end
;
}
bool
SubtitledTime
::
operator
>
(
const
SubtitledTime
&
op
)
const
{
return
(
m_starttime
>
op
.
m_starttime
&&
m_endtime
>
op
.
m_endtime
&&
m_starttime
>
op
.
m_endtime
);
}
bool
SubtitledTime
::
operator
<
(
const
SubtitledTime
&
op
)
const
{
return
(
m_starttime
<
op
.
m_starttime
&&
m_endtime
<
op
.
m_endtime
&&
m_endtime
<
op
.
m_starttime
);
}
bool
SubtitledTime
::
operator
==
(
const
SubtitledTime
&
op
)
const
{
return
(
m_starttime
==
op
.
m_starttime
&&
m_endtime
==
op
.
m_endtime
);
}
bool
SubtitledTime
::
operator
!=
(
const
SubtitledTime
&
op
)
const
{
return
(
m_starttime
!=
op
.
m_starttime
&&
m_endtime
!=
op
.
m_endtime
);
}
src/definitions.h
View file @
827c9e17
...
...
@@ -260,6 +260,34 @@ private:
int
m_type
{
0
};
};
class
SubtitledTime
{
public:
SubtitledTime
();
SubtitledTime
(
const
GenTime
&
start
,
QString
sub
,
const
GenTime
&
end
);
QString
subtitle
();
GenTime
start
();
GenTime
end
();
void
setSubtitle
(
const
QString
&
sub
);
void
setEndTime
(
const
GenTime
&
end
);
/* Implementation of > operator; Works identically as with basic types. */
bool
operator
>
(
const
SubtitledTime
&
op
)
const
;
/* Implementation of < operator; Works identically as with basic types. */
bool
operator
<
(
const
SubtitledTime
&
op
)
const
;
/* Implementation of == operator; Works identically as with basic types. */
bool
operator
==
(
const
SubtitledTime
&
op
)
const
;
/* Implementation of != operator; Works identically as with basic types. */
bool
operator
!=
(
const
SubtitledTime
&
op
)
const
;
private:
GenTime
m_starttime
;
QString
m_subtitle
;
GenTime
m_endtime
;
};
QDebug
operator
<<
(
QDebug
qd
,
const
ItemInfo
&
info
);
// we provide hash function for qstring and QPersistentModelIndex
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment