Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
442
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
e93bed1a
Commit
e93bed1a
authored
17 years ago
by
Jean-Baptiste Kempf
Browse files
Options
Downloads
Patches
Plain Diff
Qt4 - VLM: simplifications.
parent
270d869d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/gui/qt4/dialogs/vlm.cpp
+28
-33
28 additions, 33 deletions
modules/gui/qt4/dialogs/vlm.cpp
modules/gui/qt4/dialogs/vlm.hpp
+8
-13
8 additions, 13 deletions
modules/gui/qt4/dialogs/vlm.hpp
with
36 additions
and
46 deletions
modules/gui/qt4/dialogs/vlm.cpp
+
28
−
33
View file @
e93bed1a
...
...
@@ -47,13 +47,15 @@ static const char *psz_type[] = { "Broadcast", "Schedule", "VOD" };
VLMDialog
*
VLMDialog
::
instance
=
NULL
;
VLMDialog
::
VLMDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCFrame
(
_p_intf
)
{
vlmWrapper
=
new
VLMWrapper
(
p_intf
);
if
(
!
vlmWrapper
->
AttachVLM
()
)
{
p_vlm
=
vlm_New
(
p_intf
);
if
(
!
p_vlm
)
{
msg_Warn
(
p_intf
,
"Couldn't build VLM object "
);
return
;
}
vlmWrapper
=
new
VLMWrapper
(
p_vlm
);
// UI stuff
ui
.
setupUi
(
this
);
...
...
@@ -137,7 +139,10 @@ VLMDialog::VLMDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
VLMDialog
::~
VLMDialog
()
{
delete
vlmWrapper
;
/* FIXME :you have to destroy vlm here to close
* but we shouldn't destroy vlm here in case somebody else wants it */
if
(
p_vlm
)
vlm_Delete
(
p_vlm
);
}
void
VLMDialog
::
showScheduleWidget
(
int
i
)
...
...
@@ -190,13 +195,13 @@ void VLMDialog::addVLMItem()
typeShortName
=
"Bcast"
;
vlmAwidget
=
new
VLMBroadcast
(
name
,
inputText
,
outputText
,
b_checked
,
b_looped
,
this
);
VLMWrapper
::
AddBroadcast
(
vlmWrapper
->
GetVLM
()
,
name
,
inputText
,
outputText
,
b_checked
,
b_looped
);
//
VLMWrapper::AddBroadcast( vlmWrapper->
p_vlc
, name, inputText, outputText, b_checked, b_looped );
break
;
case
QVLM_VOD
:
typeShortName
=
"VOD"
;
vlmAwidget
=
new
VLMVod
(
name
,
inputText
,
outputText
,
b_checked
,
ui
.
muxLedit
->
text
(),
this
);
VLMWrapper
::
AddVod
(
vlmWrapper
->
GetVLM
(),
name
,
inputText
,
outputText
,
b_checked
);
///
VLMWrapper::AddVod( vlmWrapper->GetVLM(), name, inputText, outputText, b_checked );
break
;
case
QVLM_Schedule
:
typeShortName
=
"Sched"
;
...
...
@@ -398,7 +403,7 @@ VLMBroadcast::VLMBroadcast( QString _name, QString _input, QString _output,
void
VLMBroadcast
::
update
()
{
VLMWrapper
::
EditBroadcast
(
THE
VLM
,
name
,
input
,
output
,
b_enabled
,
b_looped
);
//
VLMWrapper::EditBroadcast( VLM
Wrapper::p_vlm
, name, input, output, b_enabled, b_looped );
if
(
b_looped
)
loopButton
->
setIcon
(
QIcon
(
QPixmap
(
":/pixmaps/playlist_repeat_all.png"
)
)
);
else
...
...
@@ -409,12 +414,12 @@ void VLMBroadcast::togglePlayPause()
{
if
(
b_playing
=
true
)
{
VLMWrapper
::
ControlBroadcast
(
THE
VLM
,
name
,
ControlBroadcastPause
);
//
VLMWrapper::ControlBroadcast( VLM
Wrapper::p_vlm
, name, ControlBroadcastPause );
playButton
->
setIcon
(
QIcon
(
QPixmap
(
":/pixmaps/pause_16px.png"
)
)
);
}
else
{
VLMWrapper
::
ControlBroadcast
(
THE
VLM
,
name
,
ControlBroadcastPlay
);
//
VLMWrapper::ControlBroadcast( VLM
Wrapper::p_vlm
, name, ControlBroadcastPlay );
playButton
->
setIcon
(
QIcon
(
QPixmap
(
":/pixmaps/play_16px.png"
)
)
);
}
b_playing
=
!
b_playing
;
...
...
@@ -428,7 +433,7 @@ void VLMBroadcast::toggleLoop()
void
VLMBroadcast
::
stop
()
{
VLMWrapper
::
ControlBroadcast
(
THE
VLM
,
name
,
ControlBroadcastStop
);
//
VLMWrapper::ControlBroadcast( VLM
Wrapper::p_vlm
, name, ControlBroadcastStop );
playButton
->
setIcon
(
QIcon
(
QPixmap
(
":/pixmaps/play_16px.png"
)
)
);
}
...
...
@@ -465,34 +470,24 @@ VLMVod::VLMVod( QString name, QString input, QString output,
void
VLMVod
::
update
()
{
muxLabel
->
setText
(
mux
);
VLMWrapper
::
EditVod
(
THEVLM
,
name
,
input
,
output
,
b_enabled
,
mux
);
//
VLMWrapper::EditVod(
p_vlm
, name, input, output, b_enabled, mux );
}
/*******************
* VLMWrapper
*******************/
VLMWrapper
::
VLMWrapper
(
intf_thread_t
*
_p_intf
)
{
p_intf
=
_p_intf
;
p_vlm
=
vlm_New
(
p_intf
);
}
vlm_t
*
VLMWrapper
::
p_vlm
=
NULL
;
VLMWrapper
::
~
VLMWrapper
()
VLMWrapper
::
VLMWrapper
(
vlm_t
*
_p_vlm
)
{
/* FIXME :you have to destroy vlm here to close
* but we shouldn't destroy vlm here in case somebody else wants it */
if
(
p_vlm
)
vlm_Delete
(
p_vlm
);
p_vlm
=
_p_vlm
;
}
bool
VLMWrapper
::
AttachVLM
()
{
p_vlm
=
vlm_New
(
p_intf
);
return
(
p_vlm
?
true
:
false
);
}
VLMWrapper
::~
VLMWrapper
()
{}
void
VLMWrapper
::
AddBroadcast
(
vlm_t
*
p_vlm
,
const
QString
name
,
QString
input
,
void
VLMWrapper
::
AddBroadcast
(
const
QString
name
,
QString
input
,
QString
output
,
bool
b_enabled
,
bool
b_loop
)
{
...
...
@@ -500,10 +495,10 @@ void VLMWrapper::AddBroadcast( vlm_t *p_vlm, const QString name, QString input,
QString
command
=
"new
\"
"
+
name
+
"
\"
broadcast"
;
vlm_ExecuteCommand
(
p_vlm
,
qtu
(
command
),
&
message
);
vlm_MessageDelete
(
message
);
EditBroadcast
(
p_vlm
,
name
,
input
,
output
,
b_enabled
,
b_loop
);
EditBroadcast
(
name
,
input
,
output
,
b_enabled
,
b_loop
);
}
void
VLMWrapper
::
EditBroadcast
(
vlm_t
*
p_vlm
,
const
QString
name
,
const
QString
input
,
void
VLMWrapper
::
EditBroadcast
(
const
QString
name
,
const
QString
input
,
const
QString
output
,
bool
b_enabled
,
bool
b_loop
)
{
...
...
@@ -536,7 +531,7 @@ void VLMWrapper::EditBroadcast( vlm_t *p_vlm, const QString name, const QString
}
}
void
VLMWrapper
::
ControlBroadcast
(
vlm_t
*
p_vlm
,
const
QString
name
,
int
BroadcastStatus
,
void
VLMWrapper
::
ControlBroadcast
(
const
QString
name
,
int
BroadcastStatus
,
unsigned
int
seek
)
{
vlm_message_t
*
message
;
...
...
@@ -561,7 +556,7 @@ void VLMWrapper::ControlBroadcast( vlm_t *p_vlm, const QString name, int Broadca
vlm_MessageDelete
(
message
);
}
void
VLMWrapper
::
AddVod
(
vlm_t
*
p_vlm
,
const
QString
name
,
const
QString
input
,
void
VLMWrapper
::
AddVod
(
const
QString
name
,
const
QString
input
,
const
QString
output
,
bool
b_enabled
,
const
QString
mux
)
{
...
...
@@ -569,10 +564,10 @@ void VLMWrapper::AddVod( vlm_t *p_vlm, const QString name, const QString input,
QString
command
=
"new
\"
"
+
name
+
"
\"
vod"
;
vlm_ExecuteCommand
(
p_vlm
,
qtu
(
command
),
&
message
);
vlm_MessageDelete
(
message
);
EditVod
(
p_vlm
,
name
,
input
,
output
,
b_enabled
,
mux
);
EditVod
(
name
,
input
,
output
,
b_enabled
,
mux
);
}
void
VLMWrapper
::
EditVod
(
vlm_t
*
p_vlm
,
const
QString
name
,
const
QString
input
,
void
VLMWrapper
::
EditVod
(
const
QString
name
,
const
QString
input
,
const
QString
output
,
bool
b_enabled
,
const
QString
mux
)
...
...
This diff is collapsed.
Click to expand it.
modules/gui/qt4/dialogs/vlm.hpp
+
8
−
13
View file @
e93bed1a
...
...
@@ -60,7 +60,6 @@ class QSpinBox;
class
VLMAWidget
;
class
VLMWrapper
;
#define THEVLM parent->vlmWrapper->GetVLM()
class
VLMDialog
:
public
QVLCFrame
{
...
...
@@ -75,7 +74,7 @@ public:
virtual
~
VLMDialog
();
VLMWrapper
*
vlmWrapper
;
vlm_t
*
p_vlm
;
private
:
VLMDialog
(
intf_thread_t
*
);
static
VLMDialog
*
instance
;
...
...
@@ -105,33 +104,29 @@ private slots:
class
VLMWrapper
{
public:
VLMWrapper
(
intf_thread
_t
*
);
VLMWrapper
(
vlm
_t
*
);
virtual
~
VLMWrapper
();
bool
AttachVLM
();
static
void
AddBroadcast
(
vlm_t
*
,
const
QString
,
const
QString
,
const
QString
,
static
void
AddBroadcast
(
const
QString
,
const
QString
,
const
QString
,
bool
b_enabled
=
true
,
bool
b_loop
=
false
);
static
void
EditBroadcast
(
vlm_t
*
,
const
QString
,
const
QString
,
const
QString
,
static
void
EditBroadcast
(
const
QString
,
const
QString
,
const
QString
,
bool
b_enabled
=
true
,
bool
b_loop
=
false
);
static
void
AddVod
(
vlm_t
*
,
const
QString
,
const
QString
,
const
QString
,
static
void
AddVod
(
const
QString
,
const
QString
,
const
QString
,
bool
b_enabled
=
true
,
QString
mux
=
""
);
static
void
EditVod
(
vlm_t
*
,
const
QString
,
const
QString
,
const
QString
,
static
void
EditVod
(
const
QString
,
const
QString
,
const
QString
,
bool
b_enabled
=
true
,
QString
mux
=
""
);
static
void
ControlBroadcast
(
vlm_t
*
,
const
QString
,
int
,
unsigned
int
seek
=
0
);
static
void
ControlBroadcast
(
const
QString
,
int
,
unsigned
int
seek
=
0
);
vlm_t
*
GetVLM
(){
return
p_vlm
;}
/* We don't have yet the accessors in the core, so the following is commented */
//unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; }
/* vlm_media_t *GetMedia( int i )
{ if( p_vlm ) return p_vlm->media[i]; return NULL; }*/
private:
vlm_t
*
p_vlm
;
intf_thread_t
*
p_intf
;
static
vlm_t
*
p_vlm
;
};
class
VLMAWidget
:
public
QGroupBox
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment