Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
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
videolan
vlc
Commits
507cfc27
Commit
507cfc27
authored
Jun 25, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Playlist model
parent
1b87dba7
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
499 additions
and
3 deletions
+499
-3
modules/gui/qt4/Modules.am
modules/gui/qt4/Modules.am
+4
-0
modules/gui/qt4/components/open.hpp
modules/gui/qt4/components/open.hpp
+1
-3
modules/gui/qt4/playlist_model.cpp
modules/gui/qt4/playlist_model.cpp
+364
-0
modules/gui/qt4/playlist_model.hpp
modules/gui/qt4/playlist_model.hpp
+130
-0
No files found.
modules/gui/qt4/Modules.am
View file @
507cfc27
...
...
@@ -17,6 +17,7 @@ UIH = $(TOUI:%=%.h)
TOMOC
=
main_interface
\
dialogs_provider
\
input_manager
\
playlist_model
dialogs/playlist
\
dialogs/prefs_dialog
\
dialogs/streaminfo
\
...
...
@@ -31,6 +32,7 @@ nodist_SOURCES_qt4 = \
main_interface.moc.cpp
\
dialogs_provider.moc.cpp
\
input_manager.moc.cpp
\
playlist_model.moc.cpp
\
dialogs/playlist.moc.cpp
\
dialogs/streaminfo.moc.cpp
\
dialogs/prefs_dialog.moc.cpp
\
...
...
@@ -61,6 +63,7 @@ SOURCES_qt4 = qt4.cpp \
main_interface.cpp
\
dialogs_provider.cpp
\
input_manager.cpp
\
playlist_model.cpp
\
dialogs/playlist.cpp
\
dialogs/prefs_dialog.cpp
\
dialogs/streaminfo.cpp
\
...
...
@@ -76,6 +79,7 @@ EXTRA_DIST += \
main_interface.hpp
\
dialogs_provider.hpp
\
input_manager.hpp
\
playlist_model.hpp
\
dialogs/playlist.hpp
\
dialogs/streaminfo.hpp
\
dialogs/prefs_dialog.hpp
\
...
...
modules/gui/qt4/components/open.hpp
View file @
507cfc27
...
...
@@ -43,8 +43,6 @@ private:
intf_thread_t
*
p_intf
;
public
slots
:
virtual
void
sendUpdate
()
=
0
;
signals:
virtual
void
dataUpdated
(
QString
,
QString
)
=
0
;
};
class
FileOpenPanel
:
public
OpenPanel
...
...
@@ -59,7 +57,7 @@ private:
public
slots
:
virtual
void
sendUpdate
()
;
signals:
v
irtual
v
oid
dataUpdated
(
QString
,
QString
)
;
void
dataUpdated
(
QString
,
QString
)
;
};
...
...
modules/gui/qt4/playlist_model.cpp
0 → 100644
View file @
507cfc27
This diff is collapsed.
Click to expand it.
modules/gui/qt4/playlist_model.hpp
0 → 100644
View file @
507cfc27
/*****************************************************************************
* playlist_model.hpp : Model for a playlist tree
****************************************************************************
* Copyright (C) 2000-2005 the VideoLAN team
* $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $
*
* Authors: Clément Stenac <zorglub@videolan.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.
*
* 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.
*****************************************************************************/
#ifndef _PLAYLIST_MODEL_H_
#define _PLAYLIST_MODEL_H_
#include <QObject>
#include <QEvent>
#include <vlc/vlc.h>
#include <vlc/input.h>
#include <vlc_playlist.h>
class
PLModel
;
class
PLItem
{
public:
PLItem
(
int
,
int
,
PLItem
*
parent
,
PLModel
*
);
PLItem
(
playlist_item_t
*
,
PLItem
*
parent
,
PLModel
*
);
~
PLItem
();
int
row
()
const
;
void
insertChild
(
PLItem
*
,
int
);
void
appendChild
(
PLItem
*
item
)
{
insertChild
(
item
,
children
.
count
()
);
};
PLItem
*
child
(
int
row
)
{
return
children
.
value
(
row
);
};
int
childCount
()
const
{
return
children
.
count
();
};
QString
columnString
(
int
col
)
{
return
strings
.
value
(
col
);
};
PLItem
*
parent
()
{
return
parentItem
;
};
protected:
QList
<
PLItem
*>
children
;
int
i_id
;
int
i_input_id
;
friend
class
PLModel
;
private:
QList
<
QString
>
strings
;
PLItem
*
parentItem
;
PLModel
*
model
;
};
static
int
ItemUpdate_Type
=
QEvent
::
User
+
2
;
static
int
ItemDelete_Type
=
QEvent
::
User
+
3
;
static
int
ItemAppend_Type
=
QEvent
::
User
+
4
;
class
PLEvent
:
public
QEvent
{
public:
PLEvent
(
int
type
,
int
id
)
:
QEvent
(
(
QEvent
::
Type
)(
type
)
)
{
i_id
=
id
;
p_add
=
NULL
;
};
PLEvent
(
playlist_add_t
*
a
)
:
QEvent
(
(
QEvent
::
Type
)(
ItemAppend_Type
)
)
{
p_add
=
a
;
};
virtual
~
PLEvent
()
{};
int
i_id
;
playlist_add_t
*
p_add
;
};
#include <QAbstractItemModel>
#include <QModelIndex>
#include <QVariant>
class
PLModel
:
public
QAbstractItemModel
{
Q_OBJECT
public:
PLModel
(
playlist_item_t
*
,
int
,
QObject
*
parent
=
0
);
~
PLModel
();
void
customEvent
(
QEvent
*
);
/* QModel stuff */
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
;
Qt
::
ItemFlags
flags
(
const
QModelIndex
&
index
)
const
;
QVariant
headerData
(
int
section
,
Qt
::
Orientation
orientation
,
int
role
=
Qt
::
DisplayRole
)
const
;
QModelIndex
index
(
int
r
,
int
c
,
const
QModelIndex
&
parent
)
const
;
QModelIndex
index
(
PLItem
*
,
int
c
)
const
;
QModelIndex
parent
(
const
QModelIndex
&
index
)
const
;
int
childrenCount
(
const
QModelIndex
&
parent
=
QModelIndex
()
)
const
;
bool
b_need_update
;
int
i_items_to_append
;
private:
PLItem
*
rootItem
;
playlist_t
*
p_playlist
;
/* Update processing */
void
ProcessInputItemUpdate
(
int
i_input_id
);
void
ProcessItemRemoval
(
int
i_id
);
void
ProcessItemAppend
(
playlist_add_t
*
p_add
);
/* Lookups */
PLItem
*
FindById
(
PLItem
*
,
int
);
PLItem
*
FindByInput
(
PLItem
*
,
int
);
PLItem
*
FindInner
(
PLItem
*
,
int
,
bool
);
PLItem
*
p_cached_item
;
PLItem
*
p_cached_item_bi
;
int
i_cached_id
;
int
i_cached_input_id
;
friend
class
PLItem
;
};
#endif
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