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
ba02e3b2
Commit
ba02e3b2
authored
Sep 26, 2005
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beos/*: update the playlist properly
parent
db913e1c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
269 additions
and
252 deletions
+269
-252
modules/gui/beos/InterfaceWindow.cpp
modules/gui/beos/InterfaceWindow.cpp
+38
-28
modules/gui/beos/InterfaceWindow.h
modules/gui/beos/InterfaceWindow.h
+13
-11
modules/gui/beos/PlayListWindow.cpp
modules/gui/beos/PlayListWindow.cpp
+218
-213
No files found.
modules/gui/beos/InterfaceWindow.cpp
View file @
ba02e3b2
...
@@ -174,6 +174,14 @@ collect_folder_contents( BDirectory& dir, BList& list, bool& deep, bool& asked,
...
@@ -174,6 +174,14 @@ collect_folder_contents( BDirectory& dir, BList& list, bool& deep, bool& asked,
}
}
}
}
static
int
PlaylistChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_variable
,
vlc_value_t
old_val
,
vlc_value_t
new_val
,
void
*
param
)
{
InterfaceWindow
*
w
=
(
InterfaceWindow
*
)
param
;
w
->
UpdatePlaylist
();
return
VLC_SUCCESS
;
}
/*****************************************************************************
/*****************************************************************************
* InterfaceWindow
* InterfaceWindow
...
@@ -193,6 +201,15 @@ InterfaceWindow::InterfaceWindow( intf_thread_t * _p_intf, BRect frame,
...
@@ -193,6 +201,15 @@ InterfaceWindow::InterfaceWindow( intf_thread_t * _p_intf, BRect frame,
fLastUpdateTime
(
system_time
()
),
fLastUpdateTime
(
system_time
()
),
fSettings
(
new
BMessage
(
'
sett
'
)
)
fSettings
(
new
BMessage
(
'
sett
'
)
)
{
{
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
var_AddCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
this
);
var_AddCallback
(
p_playlist
,
"item-change"
,
PlaylistChanged
,
this
);
var_AddCallback
(
p_playlist
,
"item-append"
,
PlaylistChanged
,
this
);
var_AddCallback
(
p_playlist
,
"item-deleted"
,
PlaylistChanged
,
this
);
var_AddCallback
(
p_playlist
,
"playlist-current"
,
PlaylistChanged
,
this
);
char
psz_tmp
[
1024
];
char
psz_tmp
[
1024
];
#define ADD_ELLIPSIS( a ) \
#define ADD_ELLIPSIS( a ) \
memset( psz_tmp, 0, 1024 ); \
memset( psz_tmp, 0, 1024 ); \
...
@@ -416,7 +433,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -416,7 +433,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
playlist_Add
(
p_playlist
,
psz_uri
,
psz_device
,
playlist_Add
(
p_playlist
,
psz_uri
,
psz_device
,
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
}
}
_
UpdatePlaylist
();
UpdatePlaylist
();
}
}
break
;
break
;
...
@@ -731,7 +748,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -731,7 +748,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
}
}
}
}
_
UpdatePlaylist
();
UpdatePlaylist
();
break
;
break
;
}
}
...
@@ -792,12 +809,6 @@ bool InterfaceWindow::QuitRequested()
...
@@ -792,12 +809,6 @@ bool InterfaceWindow::QuitRequested()
*****************************************************************************/
*****************************************************************************/
void
InterfaceWindow
::
UpdateInterface
()
void
InterfaceWindow
::
UpdateInterface
()
{
{
/* Manage the input part */
if
(
!
p_playlist
)
{
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
}
if
(
!
p_input
)
if
(
!
p_input
)
{
{
p_input
=
(
input_thread_t
*
)
p_input
=
(
input_thread_t
*
)
...
@@ -815,6 +826,17 @@ void InterfaceWindow::UpdateInterface()
...
@@ -815,6 +826,17 @@ void InterfaceWindow::UpdateInterface()
return
;
return
;
}
}
if
(
b_playlist_update
)
{
if
(
fPlaylistWindow
->
Lock
()
)
{
fPlaylistWindow
->
UpdatePlaylist
(
true
);
fPlaylistWindow
->
Unlock
();
b_playlist_update
=
false
;
}
p_mediaControl
->
SetEnabled
(
p_playlist
->
i_size
);
}
if
(
p_input
)
if
(
p_input
)
{
{
vlc_value_t
val
;
vlc_value_t
val
;
...
@@ -840,13 +862,6 @@ void InterfaceWindow::UpdateInterface()
...
@@ -840,13 +862,6 @@ void InterfaceWindow::UpdateInterface()
aout_VolumeGet
(
p_intf
,
&
i_volume
);
aout_VolumeGet
(
p_intf
,
&
i_volume
);
p_mediaControl
->
SetAudioEnabled
(
true
);
p_mediaControl
->
SetAudioEnabled
(
true
);
p_mediaControl
->
SetMuted
(
i_volume
);
p_mediaControl
->
SetMuted
(
i_volume
);
// update playlist as well
if
(
fPlaylistWindow
->
LockWithTimeout
(
INTERFACE_LOCKING_TIMEOUT
)
==
B_OK
)
{
fPlaylistWindow
->
UpdatePlaylist
();
fPlaylistWindow
->
Unlock
();
}
}
}
else
else
{
{
...
@@ -877,26 +892,21 @@ void InterfaceWindow::UpdateInterface()
...
@@ -877,26 +892,21 @@ void InterfaceWindow::UpdateInterface()
}
}
/*****************************************************************************
/*****************************************************************************
* InterfaceWindow::
IsStopped
* InterfaceWindow::
UpdatePlaylist
*****************************************************************************/
*****************************************************************************/
bool
void
InterfaceWindow
::
IsStopped
()
const
InterfaceWindow
::
UpdatePlaylist
()
{
{
return
(
system_time
()
-
fLastUpdateTime
>
INTERFACE_UPDATE_TIMEOUT
)
;
b_playlist_update
=
true
;
}
}
/*****************************************************************************
/*****************************************************************************
* InterfaceWindow::
_UpdatePlaylist
* InterfaceWindow::
IsStopped
*****************************************************************************/
*****************************************************************************/
void
bool
InterfaceWindow
::
_UpdatePlaylist
()
InterfaceWindow
::
IsStopped
()
const
{
{
if
(
fPlaylistWindow
->
Lock
()
)
return
(
system_time
()
-
fLastUpdateTime
>
INTERFACE_UPDATE_TIMEOUT
);
{
fPlaylistWindow
->
UpdatePlaylist
(
true
);
fPlaylistWindow
->
Unlock
();
}
p_mediaControl
->
SetEnabled
(
p_playlist
->
i_size
);
}
}
/*****************************************************************************
/*****************************************************************************
...
...
modules/gui/beos/InterfaceWindow.h
View file @
ba02e3b2
...
@@ -102,26 +102,28 @@ class InterfaceWindow : public BWindow
...
@@ -102,26 +102,28 @@ class InterfaceWindow : public BWindow
// InterfaceWindow
// InterfaceWindow
void
UpdateInterface
();
void
UpdateInterface
();
void
UpdatePlaylist
();
bool
IsStopped
()
const
;
bool
IsStopped
()
const
;
MediaControlView
*
p_mediaControl
;
MediaControlView
*
p_mediaControl
;
MessagesWindow
*
fMessagesWindow
;
MessagesWindow
*
fMessagesWindow
;
private:
private:
void
_UpdatePlaylist
();
void
_SetMenusEnabled
(
bool
hasFile
,
void
_SetMenusEnabled
(
bool
hasFile
,
bool
hasChapters
=
false
,
bool
hasChapters
=
false
,
bool
hasTitles
=
false
);
bool
hasTitles
=
false
);
void
_UpdateSpeedMenu
(
int
rate
);
void
_UpdateSpeedMenu
(
int
rate
);
void
_ShowFilePanel
(
uint32
command
,
void
_ShowFilePanel
(
uint32
command
,
const
char
*
windowTitle
);
const
char
*
windowTitle
);
void
_RestoreSettings
();
void
_RestoreSettings
();
void
_StoreSettings
();
void
_StoreSettings
();
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
input_thread_t
*
p_input
;
input_thread_t
*
p_input
;
playlist_t
*
p_playlist
;
playlist_t
*
p_playlist
;
es_descriptor_t
*
p_spu_es
;
es_descriptor_t
*
p_spu_es
;
bool
b_playlist_update
;
BFilePanel
*
fFilePanel
;
BFilePanel
*
fFilePanel
;
PlayListWindow
*
fPlaylistWindow
;
PlayListWindow
*
fPlaylistWindow
;
...
@@ -149,19 +151,19 @@ class InterfaceWindow : public BWindow
...
@@ -149,19 +151,19 @@ class InterfaceWindow : public BWindow
BMenu
*
fSpeedMenu
;
BMenu
*
fSpeedMenu
;
BMenu
*
fShowMenu
;
BMenu
*
fShowMenu
;
bigtime_t
fLastUpdateTime
;
bigtime_t
fLastUpdateTime
;
BMessage
*
fSettings
;
// we keep the message arround
BMessage
*
fSettings
;
// we keep the message arround
// for forward compatibility
// for forward compatibility
};
};
// some global support functions
// some global support functions
status_t
load_settings
(
BMessage
*
message
,
status_t
load_settings
(
BMessage
*
message
,
const
char
*
fileName
,
const
char
*
fileName
,
const
char
*
folder
=
NULL
);
const
char
*
folder
=
NULL
);
status_t
save_settings
(
BMessage
*
message
,
status_t
save_settings
(
BMessage
*
message
,
const
char
*
fileName
,
const
char
*
fileName
,
const
char
*
folder
=
NULL
);
const
char
*
folder
=
NULL
);
#endif // BEOS_INTERFACE_WINDOW_H
#endif // BEOS_INTERFACE_WINDOW_H
modules/gui/beos/PlayListWindow.cpp
View file @
ba02e3b2
This diff is collapsed.
Click to expand it.
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