Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
45956533
Commit
45956533
authored
Dec 03, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Made open and sout QDialogs
* Added a minimal streaming feature
parent
0f360817
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
55 deletions
+83
-55
modules/gui/qt4/dialogs/open.cpp
modules/gui/qt4/dialogs/open.cpp
+21
-16
modules/gui/qt4/dialogs/open.hpp
modules/gui/qt4/dialogs/open.hpp
+5
-5
modules/gui/qt4/dialogs/sout.cpp
modules/gui/qt4/dialogs/sout.cpp
+11
-2
modules/gui/qt4/dialogs/sout.hpp
modules/gui/qt4/dialogs/sout.hpp
+5
-2
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+21
-2
modules/gui/qt4/util/qvlcframe.hpp
modules/gui/qt4/util/qvlcframe.hpp
+20
-28
No files found.
modules/gui/qt4/dialogs/open.cpp
View file @
45956533
...
...
@@ -35,9 +35,11 @@
OpenDialog
*
OpenDialog
::
instance
=
NULL
;
OpenDialog
::
OpenDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCFrame
(
_p_intf
)
OpenDialog
::
OpenDialog
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
,
bool
modal
)
:
QVLCDialog
(
parent
,
_p_intf
)
{
setWindowTitle
(
qtr
(
"Open"
)
);
setModal
(
modal
);
ui
.
setupUi
(
this
);
fileOpenPanel
=
new
FileOpenPanel
(
this
,
p_intf
);
diskOpenPanel
=
new
DiskOpenPanel
(
this
,
p_intf
);
...
...
@@ -96,27 +98,30 @@ void OpenDialog::cancel()
{
fileOpenPanel
->
clear
();
this
->
toggleVisible
();
if
(
isModal
()
)
reject
();
}
void
OpenDialog
::
ok
()
{
QString
mrl
=
ui
.
advancedLineInput
->
text
();
this
->
toggleVisible
();
mrl
=
ui
.
advancedLineInput
->
text
();
QStringList
tempMRL
=
mrl
.
split
(
" "
);
for
(
size_t
i
=
0
;
i
<
tempMRL
.
size
();
i
++
)
if
(
!
isModal
()
)
{
const
char
*
psz_utf8
=
qtu
(
tempMRL
[
i
]
);
/* Play the first one, parse and enqueue the other ones */
playlist_Add
(
THEPL
,
psz_utf8
,
NULL
,
PLAYLIST_APPEND
|
(
i
?
0
:
PLAYLIST_GO
)
|
(
i
?
PLAYLIST_PREPARSE
:
0
),
PLAYLIST_END
,
VLC_TRUE
);
}
this
->
toggleVisible
();
}
for
(
size_t
i
=
0
;
i
<
tempMRL
.
size
();
i
++
)
{
const
char
*
psz_utf8
=
qtu
(
tempMRL
[
i
]
);
/* Play the first one, parse and enqueue the other ones */
playlist_Add
(
THEPL
,
psz_utf8
,
NULL
,
PLAYLIST_APPEND
|
(
i
?
0
:
PLAYLIST_GO
)
|
(
i
?
PLAYLIST_PREPARSE
:
0
),
PLAYLIST_END
,
VLC_TRUE
);
}
void
OpenDialog
::
changedTab
()
{
}
else
accept
();
}
void
OpenDialog
::
toggleAdvancedPanel
()
...
...
@@ -139,7 +144,7 @@ void OpenDialog::toggleAdvancedPanel()
}
void
OpenDialog
::
updateMRL
()
{
QString
mrl
=
mainMRL
;
mrl
=
mainMRL
;
if
(
ui
.
slaveCheckbox
->
isChecked
()
)
{
mrl
+=
" :input-slave="
+
ui
.
slaveText
->
text
();
}
...
...
modules/gui/qt4/dialogs/open.hpp
View file @
45956533
...
...
@@ -34,23 +34,24 @@
#include <QBoxLayout>
#include <QString>
class
OpenDialog
:
public
QVLC
Frame
class
OpenDialog
:
public
QVLC
Dialog
{
Q_OBJECT
;
public:
static
OpenDialog
*
getInstance
(
intf_thread_t
*
p_intf
)
static
OpenDialog
*
getInstance
(
QWidget
*
parent
,
intf_thread_t
*
p_intf
)
{
if
(
!
instance
)
instance
=
new
OpenDialog
(
p
_intf
);
instance
=
new
OpenDialog
(
p
arent
,
p_intf
,
false
);
return
instance
;
}
OpenDialog
(
QWidget
*
parent
,
intf_thread_t
*
,
bool
modal
);
virtual
~
OpenDialog
();
void
showTab
(
int
);
QString
mrl
;
QString
mainMRL
;
private:
OpenDialog
(
intf_thread_t
*
);
static
OpenDialog
*
instance
;
input_thread_t
*
p_input
;
QString
mrlSub
;
...
...
@@ -65,7 +66,6 @@ private:
private
slots
:
void
cancel
();
void
ok
();
void
changedTab
();
void
toggleAdvancedPanel
();
void
updateMRL
(
QString
);
void
updateMRL
();
...
...
modules/gui/qt4/dialogs/sout.cpp
View file @
45956533
...
...
@@ -27,10 +27,11 @@
#include <QFileDialog>
SoutDialog
::
SoutDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCFrame
(
_p_intf
)
SoutDialog
::
SoutDialog
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
)
:
QVLCDialog
(
parent
,
_p_intf
)
{
//setWindowTitle( qtr( "Stream output") );
setModal
(
true
);
/* UI stuff */
ui
.
setupUi
(
this
);
#define ADD_VCODEC( name, fcc) ui.vCodec->addItem( name, QVariant( fcc ) );
...
...
@@ -88,6 +89,9 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
CB
(
soutAll
);
CS
(
ttl
);
CT
(
sapName
);
CT
(
sapGroup
);
CONNECT
(
ui
.
fileSelectButton
,
clicked
(),
this
,
fileBrowse
()
);
BUTTONACT
(
ui
.
okButton
,
ok
());
BUTTONACT
(
ui
.
cancelButton
,
cancel
());
}
void
SoutDialog
::
fileBrowse
()
...
...
@@ -99,9 +103,13 @@ void SoutDialog::fileBrowse()
void
SoutDialog
::
ok
()
{
mrl
=
ui
.
mrlEdit
->
text
();
accept
();
}
void
SoutDialog
::
cancel
()
{
mrl
=
ui
.
mrlEdit
->
text
();
reject
();
}
void
SoutDialog
::
updateMRL
()
...
...
@@ -169,6 +177,7 @@ end:
sout_chain_t
*
p_chain
=
streaming_ChainNew
();
streaming_GuiDescToChain
(
VLC_OBJECT
(
p_intf
),
p_chain
,
&
pd
);
char
*
psz_mrl
=
streaming_ChainToPsz
(
p_chain
);
ui
.
mrlEdit
->
setText
(
qfu
(
strdup
(
psz_mrl
)
)
);
free
(
pd
.
psz_acodec
);
free
(
pd
.
psz_vcodec
);
free
(
pd
.
psz_scodec
);
free
(
pd
.
psz_file
);
free
(
pd
.
psz_http
);
free
(
pd
.
psz_mms
);
...
...
modules/gui/qt4/dialogs/sout.hpp
View file @
45956533
...
...
@@ -31,11 +31,14 @@ class QCheckBox;
class
QGridLayout
;
class
QTextEdit
;
class
SoutDialog
:
public
QVLC
Frame
class
SoutDialog
:
public
QVLC
Dialog
{
Q_OBJECT
;
public:
SoutDialog
(
intf_thread_t
*
);
SoutDialog
(
QWidget
*
parent
,
intf_thread_t
*
);
virtual
~
SoutDialog
()
{}
QString
mrl
;
private:
Ui
::
Sout
ui
;
public
slots
:
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
45956533
...
...
@@ -27,6 +27,7 @@
#include "qt4.hpp"
#include "dialogs_provider.hpp"
#include "main_interface.hpp"
#include "menus.hpp"
#include <vlc_intf_strings.h>
...
...
@@ -119,7 +120,7 @@ void DialogsProvider::MLAppendDialog()
}
void
DialogsProvider
::
openDialog
(
int
i_tab
)
{
OpenDialog
::
getInstance
(
p_intf
)
->
showTab
(
i_tab
);
OpenDialog
::
getInstance
(
p_intf
->
p_sys
->
p_mi
,
p_intf
)
->
showTab
(
i_tab
);
}
void
DialogsProvider
::
doInteraction
(
intf_dialog_args_t
*
p_arg
)
...
...
@@ -167,7 +168,25 @@ void DialogsProvider::MediaInfoDialog()
void
DialogsProvider
::
streamingDialog
()
{
(
new
SoutDialog
(
p_intf
))
->
show
();
OpenDialog
*
o
=
new
OpenDialog
(
p_intf
->
p_sys
->
p_mi
,
p_intf
,
true
);
if
(
o
->
exec
()
==
QDialog
::
Accepted
)
{
SoutDialog
*
s
=
new
SoutDialog
(
p_intf
->
p_sys
->
p_mi
,
p_intf
);
if
(
s
->
exec
()
==
QDialog
::
Accepted
)
{
msg_Err
(
p_intf
,
"mrl %s
\n
"
,
qta
(
s
->
mrl
));
/* Just do it */
int
i_len
=
strlen
(
qtu
(
s
->
mrl
)
)
+
10
;
char
*
psz_option
=
(
char
*
)
malloc
(
i_len
);
snprintf
(
psz_option
,
i_len
-
1
,
":sout=%s"
,
qtu
(
s
->
mrl
));
playlist_AddExt
(
THEPL
,
qtu
(
o
->
mrl
),
"Streaming"
,
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
,
-
1
,
&
psz_option
,
1
,
VLC_TRUE
);
}
delete
s
;
}
delete
o
;
}
void
DialogsProvider
::
prefsDialog
()
...
...
modules/gui/qt4/util/qvlcframe.hpp
View file @
45956533
...
...
@@ -24,6 +24,7 @@
#define _QVLCFRAME_H_
#include <QWidget>
#include <QDialog>
#include <QSpacerItem>
#include <QHBoxLayout>
#include <QApplication>
...
...
@@ -38,28 +39,6 @@
class
QVLCFrame
:
public
QWidget
{
public:
static
void
fixStyle
(
QWidget
*
w
)
{
QStyle
*
style
=
qApp
->
style
();
#if 0
// Plastique is too dark.
/// theming ? getting KDE data ? ?
if( qobject_cast<QPlastiqueStyle *>(style) )
{
QPalette plt( w->palette() );
plt.setColor( QPalette::Active, QPalette::Highlight, Qt::gray );
QColor vlg = (Qt::lightGray);
vlg = vlg.toHsv();
vlg.setHsv( vlg.hue(), vlg.saturation(), 235 );
plt.setColor( QPalette::Active, QPalette::Window, vlg );
plt.setColor( QPalette::Inactive, QPalette::Window, vlg );
plt.setColor( QPalette::Inactive, QPalette::Button, vlg );
plt.setColor( QPalette::Active, QPalette::Button, vlg );
plt.setColor( QPalette::Active, QPalette::Text, Qt::yellow );
w->setPalette( plt );
}
#endif
}
static
QHBoxLayout
*
doButtons
(
QWidget
*
w
,
QBoxLayout
*
l
,
QPushButton
**
defaul
,
char
*
psz_default
,
QPushButton
**
alt
,
char
*
psz_alt
,
...
...
@@ -98,9 +77,7 @@ public:
};
QVLCFrame
(
intf_thread_t
*
_p_intf
)
:
QWidget
(
NULL
),
p_intf
(
_p_intf
)
{
fixStyle
(
this
);
};
{
};
virtual
~
QVLCFrame
()
{};
void
toggleVisible
()
...
...
@@ -129,13 +106,28 @@ protected:
}
};
class
QVLC
MW
:
public
QMainWindow
class
QVLC
Dialog
:
public
QDialog
{
public:
QVLCMW
(
intf_thread_t
*
_p_intf
)
:
QMainWindow
(
NULL
),
p_intf
(
_p_intf
)
QVLCDialog
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
)
:
QDialog
(
parent
),
p_intf
(
_p_intf
)
{}
virtual
~
QVLCDialog
()
{};
void
toggleVisible
()
{
QVLCFrame
::
fixStyle
(
this
);
if
(
isVisible
()
)
hide
();
else
show
();
}
protected:
intf_thread_t
*
p_intf
;
};
class
QVLCMW
:
public
QMainWindow
{
public:
QVLCMW
(
intf_thread_t
*
_p_intf
)
:
QMainWindow
(
NULL
),
p_intf
(
_p_intf
)
{
}
virtual
~
QVLCMW
()
{};
void
toggleVisible
()
{
...
...
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