Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
45ecdf1b
Commit
45ecdf1b
authored
Aug 25, 2004
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* skins2: new "playlist.load()" and "playlist.save()" actions
parent
874d5a11
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
193 additions
and
40 deletions
+193
-40
modules/gui/skins2/commands/cmd_change_skin.cpp
modules/gui/skins2/commands/cmd_change_skin.cpp
+2
-1
modules/gui/skins2/commands/cmd_change_skin.hpp
modules/gui/skins2/commands/cmd_change_skin.hpp
+1
-4
modules/gui/skins2/commands/cmd_dialogs.hpp
modules/gui/skins2/commands/cmd_dialogs.hpp
+9
-1
modules/gui/skins2/commands/cmd_playlist.cpp
modules/gui/skins2/commands/cmd_playlist.cpp
+22
-0
modules/gui/skins2/commands/cmd_playlist.hpp
modules/gui/skins2/commands/cmd_playlist.hpp
+40
-0
modules/gui/skins2/parser/interpreter.cpp
modules/gui/skins2/parser/interpreter.cpp
+2
-0
modules/gui/skins2/src/dialogs.cpp
modules/gui/skins2/src/dialogs.cpp
+71
-8
modules/gui/skins2/src/dialogs.hpp
modules/gui/skins2/src/dialogs.hpp
+36
-15
modules/gui/skins2/src/skin_main.cpp
modules/gui/skins2/src/skin_main.cpp
+5
-3
modules/gui/skins2/src/top_window.cpp
modules/gui/skins2/src/top_window.cpp
+5
-8
No files found.
modules/gui/skins2/commands/cmd_change_skin.cpp
View file @
45ecdf1b
...
...
@@ -2,7 +2,7 @@
* cmd_change_skin.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: cmd_change_skin.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -28,6 +28,7 @@
#include "../src/os_loop.hpp"
#include "../src/theme.hpp"
#include "../src/theme_loader.hpp"
#include "../src/window_manager.hpp"
void
CmdChangeSkin
::
execute
()
...
...
modules/gui/skins2/commands/cmd_change_skin.hpp
View file @
45ecdf1b
...
...
@@ -2,7 +2,7 @@
* cmd_change_skin.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: cmd_change_skin.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
...
...
@@ -28,9 +28,6 @@
#include "cmd_generic.hpp"
class
WindowManager
;
/// "Change Skin" command
class
CmdChangeSkin
:
public
CmdGeneric
{
...
...
modules/gui/skins2/commands/cmd_dialogs.hpp
View file @
45ecdf1b
...
...
@@ -2,7 +2,7 @@
* cmd_dialogs.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: cmd_dialogs.hpp,v 1.2 2004/02/01 14:44:11 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -44,6 +44,8 @@ typedef CmdDialogs<8> CmdDlgFileInfo;
typedef
CmdDialogs
<
9
>
CmdDlgShowPopupMenu
;
typedef
CmdDialogs
<
10
>
CmdDlgHidePopupMenu
;
typedef
CmdDialogs
<
11
>
CmdDlgAdd
;
typedef
CmdDialogs
<
12
>
CmdDlgPlaylistLoad
;
typedef
CmdDialogs
<
13
>
CmdDlgPlaylistSave
;
/// Generic "Open dialog" command
...
...
@@ -99,6 +101,12 @@ class CmdDialogs: public CmdGeneric
case
11
:
pDialogs
->
showFile
(
false
);
break
;
case
12
:
pDialogs
->
showPlaylistLoad
();
break
;
case
13
:
pDialogs
->
showPlaylistSave
();
break
;
default:
msg_Warn
(
getIntf
(),
"Unknown dialog type"
);
break
;
...
...
modules/gui/skins2/commands/cmd_playlist.cpp
View file @
45ecdf1b
...
...
@@ -100,3 +100,25 @@ void CmdPlaylistRepeat::execute()
}
}
void
CmdPlaylistLoad
::
execute
()
{
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
if
(
pPlaylist
!=
NULL
)
{
playlist_Import
(
pPlaylist
,
m_file
.
c_str
()
);
}
}
void
CmdPlaylistSave
::
execute
()
{
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
if
(
pPlaylist
!=
NULL
)
{
// FIXME: when the PLS export will be working, we'll need to remove
// this hardcoding...
playlist_Export
(
pPlaylist
,
m_file
.
c_str
(),
"export-m3u"
);
}
}
modules/gui/skins2/commands/cmd_playlist.hpp
View file @
45ecdf1b
...
...
@@ -119,4 +119,44 @@ class CmdPlaylistRepeat: public CmdGeneric
};
/// Command to load a playlist
class
CmdPlaylistLoad
:
public
CmdGeneric
{
public:
CmdPlaylistLoad
(
intf_thread_t
*
pIntf
,
const
string
&
rFile
)
:
CmdGeneric
(
pIntf
),
m_file
(
rFile
)
{}
virtual
~
CmdPlaylistLoad
()
{}
/// This method does the real job of the command
virtual
void
execute
();
/// Return the type of the command
virtual
string
getType
()
const
{
return
"playlist load"
;
}
private:
/// Playlist file to load
string
m_file
;
};
/// Command to save a playlist
class
CmdPlaylistSave
:
public
CmdGeneric
{
public:
CmdPlaylistSave
(
intf_thread_t
*
pIntf
,
const
string
&
rFile
)
:
CmdGeneric
(
pIntf
),
m_file
(
rFile
)
{}
virtual
~
CmdPlaylistSave
()
{}
/// This method does the real job of the command
virtual
void
execute
();
/// Return the type of the command
virtual
string
getType
()
const
{
return
"playlist save"
;
}
private:
/// Playlist file to save
string
m_file
;
};
#endif
modules/gui/skins2/parser/interpreter.cpp
View file @
45ecdf1b
...
...
@@ -55,6 +55,8 @@ Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf )
REGISTER_CMD
(
"dialogs.prefs()"
,
CmdDlgPrefs
)
REGISTER_CMD
(
"dialogs.fileInfo()"
,
CmdDlgFileInfo
)
REGISTER_CMD
(
"dialogs.popup()"
,
CmdDlgShowPopupMenu
)
REGISTER_CMD
(
"playlist.load()"
,
CmdDlgPlaylistLoad
)
REGISTER_CMD
(
"playlist.save()"
,
CmdDlgPlaylistSave
)
REGISTER_CMD
(
"playlist.add()"
,
CmdDlgAdd
)
VarList
&
rVar
=
VlcProc
::
instance
(
getIntf
()
)
->
getPlaylistVar
();
m_commandMap
[
"playlist.del()"
]
=
...
...
modules/gui/skins2/src/dialogs.cpp
View file @
45ecdf1b
...
...
@@ -26,10 +26,11 @@
#include "../commands/async_queue.hpp"
#include "../commands/cmd_change_skin.hpp"
#include "../commands/cmd_quit.hpp"
#include "../commands/cmd_playlist.hpp"
/// Callback called when a new skin is chosen
static
void
showChangeSkinCB
(
intf_dialog_args_t
*
pArg
)
void
Dialogs
::
showChangeSkinCB
(
intf_dialog_args_t
*
pArg
)
{
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
pArg
->
p_arg
;
...
...
@@ -38,8 +39,8 @@ static void showChangeSkinCB( intf_dialog_args_t *pArg )
if
(
pArg
->
psz_results
[
0
]
)
{
// Create a change skin command
CmdChangeSkin
*
pCmd
=
new
CmdChangeSkin
(
pIntf
,
pArg
->
psz_results
[
0
]
);
CmdChangeSkin
*
pCmd
=
new
CmdChangeSkin
(
pIntf
,
pArg
->
psz_results
[
0
]
);
// Push the command in the asynchronous command queue
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pIntf
);
...
...
@@ -57,6 +58,42 @@ static void showChangeSkinCB( intf_dialog_args_t *pArg )
}
void
Dialogs
::
showPlaylistLoadCB
(
intf_dialog_args_t
*
pArg
)
{
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
pArg
->
p_arg
;
if
(
pArg
->
i_results
&&
pArg
->
psz_results
[
0
]
)
{
// Create a Playlist Load command
CmdPlaylistLoad
*
pCmd
=
new
CmdPlaylistLoad
(
pIntf
,
pArg
->
psz_results
[
0
]
);
// Push the command in the asynchronous command queue
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pIntf
);
pQueue
->
remove
(
"load playlist"
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
}
}
void
Dialogs
::
showPlaylistSaveCB
(
intf_dialog_args_t
*
pArg
)
{
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
pArg
->
p_arg
;
if
(
pArg
->
i_results
&&
pArg
->
psz_results
[
0
]
)
{
// Create a Playlist Save command
CmdPlaylistSave
*
pCmd
=
new
CmdPlaylistSave
(
pIntf
,
pArg
->
psz_results
[
0
]
);
// Push the command in the asynchronous command queue
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pIntf
);
pQueue
->
remove
(
"load playlist"
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
}
}
/// Callback called when the popup menu is requested
static
int
PopupMenuCB
(
vlc_object_t
*
p_this
,
const
char
*
psz_variable
,
vlc_value_t
old_val
,
vlc_value_t
new_val
,
void
*
param
)
...
...
@@ -159,7 +196,8 @@ bool Dialogs::init()
}
void
Dialogs
::
showChangeSkin
()
void
Dialogs
::
showFileGeneric
(
const
string
&
rTitle
,
const
string
&
rExtensions
,
DlgCallback
callback
,
int
flags
)
{
if
(
m_pProvider
&&
m_pProvider
->
pf_show_dialog
)
{
...
...
@@ -167,12 +205,14 @@ void Dialogs::showChangeSkin()
(
intf_dialog_args_t
*
)
malloc
(
sizeof
(
intf_dialog_args_t
)
);
memset
(
p_arg
,
0
,
sizeof
(
intf_dialog_args_t
)
);
p_arg
->
psz_title
=
strdup
(
_
(
"Open a skin file"
)
);
p_arg
->
psz_extensions
=
strdup
(
_
(
"Skin files (*.vlt)|*.vlt|Skin files (*.xml)|*.xml|"
)
);
p_arg
->
psz_title
=
strdup
(
rTitle
.
c_str
()
);
p_arg
->
psz_extensions
=
strdup
(
rExtensions
.
c_str
()
);
p_arg
->
b_save
=
flags
&
kSAVE
;
p_arg
->
b_multiple
=
flags
&
kMULTIPLE
;
p_arg
->
p_arg
=
getIntf
();
p_arg
->
pf_callback
=
showChangeSkinCB
;
p_arg
->
pf_callback
=
callback
;
m_pProvider
->
pf_show_dialog
(
m_pProvider
,
INTF_DIALOG_FILE_GENERIC
,
0
,
p_arg
);
...
...
@@ -180,6 +220,29 @@ void Dialogs::showChangeSkin()
}
void
Dialogs
::
showChangeSkin
()
{
showFileGeneric
(
_
(
"Open a skin file"
),
_
(
"Skin files (*.vlt)|*.vlt|Skin files (*.xml)|*.xml|"
),
showChangeSkinCB
,
kOPEN
);
}
void
Dialogs
::
showPlaylistLoad
()
{
showFileGeneric
(
_
(
"Open playlist"
),
_
(
"All playlists|*.pls;*.m3u;*.asx;*.b4s|M3U files|*.m3u"
),
showPlaylistLoadCB
,
kOPEN
);
}
void
Dialogs
::
showPlaylistSave
()
{
showFileGeneric
(
_
(
"Save playlist"
),
_
(
"M3U file|*.m3u"
),
showPlaylistSaveCB
,
kSAVE
);
}
void
Dialogs
::
showFileSimple
(
bool
play
)
{
if
(
m_pProvider
&&
m_pProvider
->
pf_show_dialog
)
...
...
modules/gui/skins2/src/dialogs.hpp
View file @
45ecdf1b
...
...
@@ -2,7 +2,7 @@
* dialogs.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: dialogs.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -33,21 +33,27 @@
class
Dialogs
:
public
SkinObject
{
public:
/// Get the instance of Dialogs
.
/// Get the instance of Dialogs
/// Returns NULL if initialization failed
static
Dialogs
*
instance
(
intf_thread_t
*
pIntf
);
/// Delete the instance of Dialogs
static
void
destroy
(
intf_thread_t
*
pIntf
);
/// Show the Change Skin dialog
.
/// Show the Change Skin dialog
void
showChangeSkin
();
/// Show the Load Playlist dialog
void
showPlaylistLoad
();
/// Show the Save Playlist dialog
void
showPlaylistSave
();
/// Show the Quick Open File dialog.
/// If play is false, just add the item in the playlist
void
showFileSimple
(
bool
play
);
/// Show the Open File dialog
.
/// Show the Open File dialog
/// If play is false, just add the item in the playlist
void
showFile
(
bool
play
);
...
...
@@ -71,28 +77,43 @@ class Dialogs: public SkinObject
/// Show the popup menu
void
showPopupMenu
(
bool
bShow
);
// XXX: This is a kludge! In fact, the file name retrieved when
// changing the skin should be returned directly to the command, but
// the dialog provider mechanism doesn't allow it.
/// Store temporarily a file name
void
setThemeFile
(
const
string
&
themeFile
)
{
m_theme
=
themeFile
;
}
/// Get a previously saved file name
const
string
&
getThemeFile
()
const
{
return
m_theme
;
}
private:
// Private because it's a singleton
Dialogs
(
intf_thread_t
*
pIntf
);
~
Dialogs
();
/// DlgCallback is the type of the callbacks of the open/save dialog
typedef
void
DlgCallback
(
intf_dialog_args_t
*
pArg
);
/// Possible flags for the open/save dialog
typedef
enum
{
kOPEN
=
0x01
,
kSAVE
=
0x02
,
kMULTIPLE
=
0x04
}
flags_t
;
/// Initialization method
bool
init
();
/// Show a generic open/save dialog, initialized with the given
/// parameters
/// The 'flags' parameter is a logical or of the flags_t values
void
showFileGeneric
(
const
string
&
rTitle
,
const
string
&
rExtensions
,
DlgCallback
callback
,
int
flags
);
/// Callback for the Change Skin dialog
static
void
showChangeSkinCB
(
intf_dialog_args_t
*
pArg
);
/// Callback for the Load Playlist dialog
static
void
showPlaylistLoadCB
(
intf_dialog_args_t
*
pArg
);
/// Callback for the Save Playlist dialog
static
void
showPlaylistSaveCB
(
intf_dialog_args_t
*
pArg
);
/// Dialogs provider module
intf_thread_t
*
m_pProvider
;
module_t
*
m_pModule
;
/// Name of a theme file, obtained via the ChangeSkin dialog
string
m_theme
;
};
...
...
modules/gui/skins2/src/skin_main.cpp
View file @
45ecdf1b
...
...
@@ -35,6 +35,7 @@
#include "../parser/interpreter.hpp"
#include "../commands/async_queue.hpp"
#include "../commands/cmd_quit.hpp"
#include "../commands/cmd_dialogs.hpp"
//---------------------------------------------------------------------------
...
...
@@ -198,10 +199,11 @@ static void Run( intf_thread_t *p_intf )
if
(
it
==
resPath
.
end
()
)
{
// Last chance: the user can select a new theme file
Dialogs
*
pDialogs
=
Dialogs
::
instance
(
p_intf
);
if
(
pDialogs
)
if
(
Dialogs
::
instance
(
p_intf
)
)
{
pDialogs
->
showChangeSkin
();
CmdDlgChangeSkin
*
pCmd
=
new
CmdDlgChangeSkin
(
p_intf
);
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
p_intf
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
}
else
{
...
...
modules/gui/skins2/src/top_window.cpp
View file @
45ecdf1b
...
...
@@ -28,9 +28,9 @@
#include "os_window.hpp"
#include "os_factory.hpp"
#include "theme.hpp"
#include "dialogs.hpp"
#include "var_manager.hpp"
#include "../commands/cmd_on_top.hpp"
#include "../commands/cmd_dialogs.hpp"
#include "../controls/ctrl_generic.hpp"
#include "../events/evt_enter.hpp"
#include "../events/evt_focus.hpp"
...
...
@@ -183,20 +183,17 @@ void TopWindow::processEvent( EvtKey &rEvtKey )
// Only do the action when the key is down
if
(
rEvtKey
.
getAsString
().
find
(
"key:down"
)
!=
string
::
npos
)
{
//XXX not to be hardcoded
!
//XXX not to be hardcoded!
// Ctrl-S = Change skin
if
(
(
rEvtKey
.
getMod
()
&
EvtInput
::
kModCtrl
)
&&
rEvtKey
.
getKey
()
==
's'
)
{
Dialogs
*
pDialogs
=
Dialogs
::
instance
(
getIntf
()
);
if
(
pDialogs
!=
NULL
)
{
pDialogs
->
showChangeSkin
();
}
CmdDlgChangeSkin
cmd
(
getIntf
()
);
cmd
.
execute
();
return
;
}
//XXX not to be hardcoded
!
//XXX not to be hardcoded!
// Ctrl-T = Toggle on top
if
(
(
rEvtKey
.
getMod
()
&
EvtInput
::
kModCtrl
)
&&
rEvtKey
.
getKey
()
==
't'
)
...
...
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