Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
827c9e17
Commit
827c9e17
authored
Jun 29, 2020
by
Sashmita Raghav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add class to handle subtitles definition and comparison
parent
077d48b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
0 deletions
+86
-0
src/definitions.cpp
src/definitions.cpp
+58
-0
src/definitions.h
src/definitions.h
+28
-0
No files found.
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