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
e51eb917
Commit
e51eb917
authored
Dec 29, 2010
by
Srikanth Raju
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt/ML: VLC Model
Base parent model for playlist
parent
0dff66f4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
0 deletions
+128
-0
modules/gui/qt4/Modules.am
modules/gui/qt4/Modules.am
+3
-0
modules/gui/qt4/components/playlist/vlc_model.cpp
modules/gui/qt4/components/playlist/vlc_model.cpp
+33
-0
modules/gui/qt4/components/playlist/vlc_model.hpp
modules/gui/qt4/components/playlist/vlc_model.hpp
+92
-0
No files found.
modules/gui/qt4/Modules.am
View file @
e51eb917
...
@@ -59,6 +59,7 @@ nodist_SOURCES_qt4 = \
...
@@ -59,6 +59,7 @@ nodist_SOURCES_qt4 = \
components/epg/EPGView.moc.cpp \
components/epg/EPGView.moc.cpp \
components/epg/EPGWidget.moc.cpp \
components/epg/EPGWidget.moc.cpp \
components/playlist/views.moc.cpp \
components/playlist/views.moc.cpp \
components/playlist/vlc_model.moc.cpp \
components/playlist/playlist_model.moc.cpp \
components/playlist/playlist_model.moc.cpp \
components/playlist/playlist.moc.cpp \
components/playlist/playlist.moc.cpp \
components/playlist/standardpanel.moc.cpp \
components/playlist/standardpanel.moc.cpp \
...
@@ -275,6 +276,7 @@ SOURCES_qt4 = qt4.cpp \
...
@@ -275,6 +276,7 @@ SOURCES_qt4 = qt4.cpp \
components/epg/EPGView.cpp \
components/epg/EPGView.cpp \
components/epg/EPGWidget.cpp \
components/epg/EPGWidget.cpp \
components/playlist/views.cpp \
components/playlist/views.cpp \
components/playlist/vlc_model.cpp \
components/playlist/playlist_model.cpp \
components/playlist/playlist_model.cpp \
components/playlist/playlist_item.cpp \
components/playlist/playlist_item.cpp \
components/playlist/standardpanel.cpp \
components/playlist/standardpanel.cpp \
...
@@ -341,6 +343,7 @@ noinst_HEADERS = \
...
@@ -341,6 +343,7 @@ noinst_HEADERS = \
components/epg/EPGView.hpp \
components/epg/EPGView.hpp \
components/epg/EPGWidget.hpp \
components/epg/EPGWidget.hpp \
components/playlist/views.hpp \
components/playlist/views.hpp \
components/playlist/vlc_model.hpp \
components/playlist/playlist_model.hpp \
components/playlist/playlist_model.hpp \
components/playlist/playlist_item.hpp \
components/playlist/playlist_item.hpp \
components/playlist/standardpanel.hpp \
components/playlist/standardpanel.hpp \
...
...
modules/gui/qt4/components/playlist/vlc_model.cpp
0 → 100644
View file @
e51eb917
/*****************************************************************************
* vlc_model.cpp : base for playlist and ml model
****************************************************************************
* Copyright (C) 2010 the VideoLAN team and AUTHORS
* $Id$
*
* Authors: Srikanth Raju <srikiraju#gmail#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 "vlc_model.hpp"
VLCModel
::
VLCModel
(
intf_thread_t
*
_p_intf
,
QObject
*
parent
)
:
p_intf
(
_p_intf
),
QAbstractItemModel
(
parent
)
{
}
VLCModel
::~
VLCModel
()
{
}
modules/gui/qt4/components/playlist/vlc_model.hpp
0 → 100644
View file @
e51eb917
/*****************************************************************************
* vlc_model.hpp : base for playlist and ml model
****************************************************************************
* Copyright (C) 2010 the VideoLAN team and AUTHORS
* $Id$
*
* Authors: Srikanth Raju <srikiraju#gmail#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.
*****************************************************************************/
#ifndef _VLC_MODEL_H_
#define _VLC_MODEL_H_
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "qt4.hpp"
#include "sorting.h"
#include <vlc_input.h>
#include <QModelIndex>
#include <QAbstractItemModel>
class
VLCModel
:
public
QAbstractItemModel
{
Q_OBJECT
public:
enum
{
IsCurrentRole
=
Qt
::
UserRole
,
IsLeafNodeRole
,
IsCurrentsParentNodeRole
};
VLCModel
(
intf_thread_t
*
_p_intf
,
QObject
*
parent
=
0
);
virtual
int
getId
(
QModelIndex
index
)
const
=
0
;
virtual
QModelIndex
currentIndex
()
const
=
0
;
virtual
bool
popup
(
const
QModelIndex
&
index
,
const
QPoint
&
point
,
const
QModelIndexList
&
list
)
=
0
;
virtual
~
VLCModel
();
public
slots
:
virtual
void
activateItem
(
const
QModelIndex
&
index
)
=
0
;
protected:
intf_thread_t
*
p_intf
;
};
static
int
columnToMeta
(
int
_column
)
{
int
meta
=
1
;
int
column
=
0
;
while
(
column
!=
_column
&&
meta
!=
COLUMN_END
)
{
meta
<<=
1
;
column
++
;
}
return
meta
;
}
static
int
columnFromMeta
(
int
meta_col
)
{
int
meta
=
1
;
int
column
=
0
;
while
(
meta
!=
meta_col
&&
meta
!=
COLUMN_END
)
{
meta
<<=
1
;
column
++
;
}
return
column
;
}
#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