Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
24d11dc9
Commit
24d11dc9
authored
Apr 17, 2009
by
Ludovic Fauvet
Browse files
TracksView pointer access from a a GraphicsItem.
parent
98511605
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/gui/AbstractGraphicsMediaItem.cpp
0 → 100644
View file @
24d11dc9
/*****************************************************************************
* AbstractGraphicsMediaItem.h: Base class for media representation
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Ludovic Fauvet <etix@l0cal.com>
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "AbstractGraphicsMediaItem.h"
AbstractGraphicsMediaItem
::
AbstractGraphicsMediaItem
()
:
m_tracksView
(
NULL
)
{
}
TracksView
*
AbstractGraphicsMediaItem
::
tracksView
()
{
return
m_tracksView
;
}
src/gui/AbstractGraphicsMediaItem.h
View file @
24d11dc9
...
...
@@ -25,11 +25,14 @@
#include <QGraphicsItem>
#include <QUuid>
#include "TracksView.h"
class
AbstractGraphicsMediaItem
:
public
QObject
,
public
QGraphicsItem
{
Q_OBJECT
friend
class
TracksView
;
public:
AbstractGraphicsMediaItem
();
virtual
~
AbstractGraphicsMediaItem
()
{
}
/// The item length can be expanded or shrinked by the user.
...
...
@@ -40,6 +43,18 @@ public:
/// Should return the unique uid of the contained media.
virtual
const
QUuid
&
uuid
()
const
=
0
;
protected:
/**
* Returns the current tracksView for the item,
* or 0 if the item is not stored in a tracksView.
*/
TracksView
*
tracksView
();
private:
/// This pointer will be set when inserted in the tracksView.
TracksView
*
m_tracksView
;
};
#endif // ABSTRACTGRAPHICSMEDIAITEM_H
src/gui/GraphicsMovieItem.cpp
View file @
24d11dc9
...
...
@@ -21,8 +21,9 @@
*****************************************************************************/
#include "GraphicsMovieItem.h"
#include "TracksView.h"
GraphicsMovieItem
::
GraphicsMovieItem
(
Clip
*
clip
)
:
m_clip
(
clip
)
GraphicsMovieItem
::
GraphicsMovieItem
(
Clip
*
clip
)
:
m_clip
(
clip
)
,
m_tracksView
(
NULL
)
{
}
...
...
@@ -33,5 +34,6 @@ GraphicsMovieItem::~GraphicsMovieItem()
int
GraphicsMovieItem
::
tracksHeight
()
{
//TODO Get this value from the TracksView
if
(
!
m_tracksView
)
return
0
;
return
m_tracksView
->
tracksHeight
();
}
src/gui/GraphicsMovieItem.h
View file @
24d11dc9
...
...
@@ -25,6 +25,7 @@
#include "AbstractGraphicsMediaItem.h"
#include "Clip.h"
#include "TracksView.h"
class
GraphicsMovieItem
:
public
AbstractGraphicsMediaItem
{
...
...
@@ -42,6 +43,7 @@ protected:
private:
Clip
*
m_clip
;
TracksView
*
m_tracksView
;
};
#endif // GRAPHICSMOVIEITEM_H
vlmc.pro
View file @
24d11dc9
...
...
@@ -33,7 +33,8 @@ SOURCES += src/main.cpp \
src
/
MetaDataManager
.
cpp
\
src
/
LibVLCpp
/
VLCMediaList
.
cpp
\
src
/
Library
.
cpp
\
src
/
gui
/
GraphicsMovieItem
.
cpp
src
/
gui
/
GraphicsMovieItem
.
cpp
\
src
/
gui
/
AbstractGraphicsMediaItem
.
cpp
HEADERS
+=
src
/
gui
/
MainWindow
.
h
\
src
/
gui
/
DockWidgetManager
.
h
\
src
/
gui
/
LibraryWidget
.
h
\
...
...
Write
Preview
Supports
Markdown
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