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
2891094d
Commit
2891094d
authored
Jan 22, 2003
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed title / chapter menus
* Clean up
parent
d5fe9f34
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
289 additions
and
504 deletions
+289
-504
modules/gui/beos/InterfaceWindow.cpp
modules/gui/beos/InterfaceWindow.cpp
+42
-246
modules/gui/beos/InterfaceWindow.h
modules/gui/beos/InterfaceWindow.h
+1
-11
modules/gui/beos/ListViews.cpp
modules/gui/beos/ListViews.cpp
+5
-3
modules/gui/beos/ListViews.h
modules/gui/beos/ListViews.h
+5
-2
modules/gui/beos/MediaControlView.cpp
modules/gui/beos/MediaControlView.cpp
+3
-3
modules/gui/beos/PlayListWindow.cpp
modules/gui/beos/PlayListWindow.cpp
+2
-2
modules/gui/beos/VlcWrapper.cpp
modules/gui/beos/VlcWrapper.cpp
+176
-181
modules/gui/beos/VlcWrapper.h
modules/gui/beos/VlcWrapper.h
+55
-56
No files found.
modules/gui/beos/InterfaceWindow.cpp
View file @
2891094d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* InterfaceWindow.cpp: beos interface
* InterfaceWindow.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.cpp,v 1.
19 2003/01/17 18:19:43
titer Exp $
* $Id: InterfaceWindow.cpp,v 1.
20 2003/01/22 01:13:22
titer Exp $
*
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -64,8 +64,7 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
...
@@ -64,8 +64,7 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
p_intf
(
p_interface
),
p_intf
(
p_interface
),
fFilePanel
(
NULL
),
fFilePanel
(
NULL
),
fSubtitlesPanel
(
NULL
),
fSubtitlesPanel
(
NULL
),
fLastUpdateTime
(
system_time
()
),
fLastUpdateTime
(
system_time
()
)
fSettings
(
new
BMessage
(
'
sett
'
)
)
{
{
p_intf
=
p_interface
;
p_intf
=
p_interface
;
p_wrapper
=
p_intf
->
p_sys
->
p_wrapper
;
p_wrapper
=
p_intf
->
p_sys
->
p_wrapper
;
...
@@ -186,8 +185,6 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
...
@@ -186,8 +185,6 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
_SetMenusEnabled
(
false
);
_SetMenusEnabled
(
false
);
p_mediaControl
->
SetEnabled
(
false
);
p_mediaControl
->
SetEnabled
(
false
);
_RestoreSettings
();
Show
();
Show
();
}
}
...
@@ -195,7 +192,6 @@ InterfaceWindow::~InterfaceWindow()
...
@@ -195,7 +192,6 @@ InterfaceWindow::~InterfaceWindow()
{
{
if
(
fPlaylistWindow
)
if
(
fPlaylistWindow
)
fPlaylistWindow
->
ReallyQuit
();
fPlaylistWindow
->
ReallyQuit
();
delete
fSettings
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -260,7 +256,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -260,7 +256,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
if
(
p_message
->
FindString
(
"device"
,
&
psz_device
)
==
B_OK
)
if
(
p_message
->
FindString
(
"device"
,
&
psz_device
)
==
B_OK
)
{
{
BString
device
(
psz_device
);
BString
device
(
psz_device
);
p_wrapper
->
o
penDisc
(
type
,
device
,
0
,
0
);
p_wrapper
->
O
penDisc
(
type
,
device
,
0
,
0
);
}
}
_UpdatePlaylist
();
_UpdatePlaylist
();
}
}
...
@@ -405,8 +401,8 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -405,8 +401,8 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
if
(
playback_status
>
UNDEF_S
)
if
(
playback_status
>
UNDEF_S
)
{
{
int32
index
;
int32
index
;
if
(
p_message
->
FindInt32
(
"index"
,
&
index
)
==
B_OK
)
if
(
p_message
->
FindInt32
(
"index"
,
&
index
)
==
B_OK
)
p_wrapper
->
t
oggleTitle
(
index
);
p_wrapper
->
T
oggleTitle
(
index
);
}
}
break
;
break
;
case
PREV_CHAPTER
:
case
PREV_CHAPTER
:
...
@@ -423,8 +419,8 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -423,8 +419,8 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
if
(
playback_status
>
UNDEF_S
)
if
(
playback_status
>
UNDEF_S
)
{
{
int32
index
;
int32
index
;
if
(
p_message
->
FindInt32
(
"index"
,
&
index
)
==
B_OK
)
if
(
p_message
->
FindInt32
(
"index"
,
&
index
)
==
B_OK
)
p_wrapper
->
t
oggleChapter
(
index
);
p_wrapper
->
T
oggleChapter
(
index
);
}
}
break
;
break
;
case
PREV_FILE
:
case
PREV_FILE
:
...
@@ -435,10 +431,10 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -435,10 +431,10 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
break
;
break
;
// general next/prev functionality (skips to whatever makes most sense)
// general next/prev functionality (skips to whatever makes most sense)
case
NAVIGATE_PREV
:
case
NAVIGATE_PREV
:
p_wrapper
->
n
avigatePrev
();
p_wrapper
->
N
avigatePrev
();
break
;
break
;
case
NAVIGATE_NEXT
:
case
NAVIGATE_NEXT
:
p_wrapper
->
n
avigateNext
();
p_wrapper
->
N
avigateNext
();
break
;
break
;
// drag'n'drop and system messages
// drag'n'drop and system messages
case
B_REFS_RECEIVED
:
case
B_REFS_RECEIVED
:
...
@@ -526,7 +522,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -526,7 +522,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
}
}
}
}
// give the list to VLC
// give the list to VLC
p_wrapper
->
o
penFiles
(
&
files
,
replace
);
p_wrapper
->
O
penFiles
(
&
files
,
replace
);
_UpdatePlaylist
();
_UpdatePlaylist
();
}
}
break
;
break
;
...
@@ -559,8 +555,6 @@ bool InterfaceWindow::QuitRequested()
...
@@ -559,8 +555,6 @@ bool InterfaceWindow::QuitRequested()
p_intf
->
b_die
=
1
;
p_intf
->
b_die
=
1
;
_StoreSettings
();
return
(
true
);
return
(
true
);
}
}
...
@@ -573,7 +567,7 @@ void InterfaceWindow::updateInterface()
...
@@ -573,7 +567,7 @@ void InterfaceWindow::updateInterface()
{
{
if
(
acquire_sem
(
p_mediaControl
->
fScrubSem
)
==
B_OK
)
if
(
acquire_sem
(
p_mediaControl
->
fScrubSem
)
==
B_OK
)
{
{
p_wrapper
->
s
etTimeAsFloat
(
p_mediaControl
->
GetSeekTo
());
p_wrapper
->
S
etTimeAsFloat
(
p_mediaControl
->
GetSeekTo
());
}
}
else
if
(
Lock
()
)
else
if
(
Lock
()
)
{
{
...
@@ -582,7 +576,7 @@ void InterfaceWindow::updateInterface()
...
@@ -582,7 +576,7 @@ void InterfaceWindow::updateInterface()
bool
hasChapters
=
p_wrapper
->
HasChapters
();
bool
hasChapters
=
p_wrapper
->
HasChapters
();
p_mediaControl
->
SetStatus
(
p_wrapper
->
InputStatus
(),
p_mediaControl
->
SetStatus
(
p_wrapper
->
InputStatus
(),
p_wrapper
->
InputRate
()
);
p_wrapper
->
InputRate
()
);
p_mediaControl
->
SetProgress
(
p_wrapper
->
g
etTimeAsFloat
()
);
p_mediaControl
->
SetProgress
(
p_wrapper
->
G
etTimeAsFloat
()
);
_SetMenusEnabled
(
true
,
hasChapters
,
hasTitles
);
_SetMenusEnabled
(
true
,
hasChapters
,
hasTitles
);
_UpdateSpeedMenu
(
p_wrapper
->
InputRate
()
);
_UpdateSpeedMenu
(
p_wrapper
->
InputRate
()
);
...
@@ -590,7 +584,7 @@ void InterfaceWindow::updateInterface()
...
@@ -590,7 +584,7 @@ void InterfaceWindow::updateInterface()
// enable/disable skip buttons
// enable/disable skip buttons
bool
canSkipPrev
;
bool
canSkipPrev
;
bool
canSkipNext
;
bool
canSkipNext
;
p_wrapper
->
g
etNavCapabilities
(
&
canSkipPrev
,
&
canSkipNext
);
p_wrapper
->
G
etNavCapabilities
(
&
canSkipPrev
,
&
canSkipNext
);
p_mediaControl
->
SetSkippable
(
canSkipPrev
,
canSkipNext
);
p_mediaControl
->
SetSkippable
(
canSkipPrev
,
canSkipNext
);
if
(
p_wrapper
->
HasAudio
()
)
if
(
p_wrapper
->
HasAudio
()
)
...
@@ -716,99 +710,11 @@ InterfaceWindow::_UpdateSpeedMenu( int rate )
...
@@ -716,99 +710,11 @@ InterfaceWindow::_UpdateSpeedMenu( int rate )
void
void
InterfaceWindow
::
_InputStreamChanged
()
InterfaceWindow
::
_InputStreamChanged
()
{
{
//printf("InterfaceWindow::_InputStreamChanged()\n");
// TODO: move more stuff from updateInterface() here!
// TODO: move more stuff from updateInterface() here!
snooze
(
400000
);
snooze
(
400000
);
p_wrapper
->
SetVolume
(
p_mediaControl
->
GetVolume
()
);
p_wrapper
->
SetVolume
(
p_mediaControl
->
GetVolume
()
);
}
}
/*****************************************************************************
* InterfaceWindow::_LoadSettings
*****************************************************************************/
status_t
InterfaceWindow
::
_LoadSettings
(
BMessage
*
message
,
const
char
*
fileName
,
const
char
*
folder
)
{
status_t
ret
=
B_BAD_VALUE
;
if
(
message
)
{
BPath
path
;
if
(
(
ret
=
find_directory
(
B_USER_SETTINGS_DIRECTORY
,
&
path
)
)
==
B_OK
)
{
// passing folder is optional
if
(
folder
)
ret
=
path
.
Append
(
folder
);
if
(
ret
==
B_OK
&&
(
ret
=
path
.
Append
(
fileName
)
)
==
B_OK
)
{
BFile
file
(
path
.
Path
(),
B_READ_ONLY
);
if
(
(
ret
=
file
.
InitCheck
()
)
==
B_OK
)
{
ret
=
message
->
Unflatten
(
&
file
);
file
.
Unset
();
}
}
}
}
return
ret
;
}
/*****************************************************************************
* InterfaceWindow::_SaveSettings
*****************************************************************************/
status_t
InterfaceWindow
::
_SaveSettings
(
BMessage
*
message
,
const
char
*
fileName
,
const
char
*
folder
)
{
status_t
ret
=
B_BAD_VALUE
;
if
(
message
)
{
BPath
path
;
if
(
(
ret
=
find_directory
(
B_USER_SETTINGS_DIRECTORY
,
&
path
)
)
==
B_OK
)
{
// passing folder is optional
if
(
folder
&&
(
ret
=
path
.
Append
(
folder
)
)
==
B_OK
)
ret
=
create_directory
(
path
.
Path
(),
0777
);
if
(
ret
==
B_OK
&&
(
ret
=
path
.
Append
(
fileName
)
)
==
B_OK
)
{
BFile
file
(
path
.
Path
(),
B_WRITE_ONLY
|
B_CREATE_FILE
|
B_ERASE_FILE
);
if
(
(
ret
=
file
.
InitCheck
()
)
==
B_OK
)
{
ret
=
message
->
Flatten
(
&
file
);
file
.
Unset
();
}
}
}
}
return
ret
;
}
/*****************************************************************************
* InterfaceWindow::_RestoreSettings
*****************************************************************************/
bool
make_sure_frame_is_on_screen
(
BRect
&
frame
)
{
BScreen
screen
(
B_MAIN_SCREEN_ID
);
if
(
frame
.
IsValid
()
&&
screen
.
IsValid
())
{
if
(
!
screen
.
Frame
().
Contains
(
frame
))
{
// make sure frame fits in the screen
if
(
frame
.
Width
()
>
screen
.
Frame
().
Width
())
frame
.
right
-=
frame
.
Width
()
-
screen
.
Frame
().
Width
()
+
10.0
;
if
(
frame
.
Height
()
>
screen
.
Frame
().
Height
())
frame
.
bottom
-=
frame
.
Height
()
-
screen
.
Frame
().
Height
()
+
30.0
;
// frame is now at the most the size of the screen
if
(
frame
.
right
>
screen
.
Frame
().
right
)
frame
.
OffsetBy
(
-
(
frame
.
right
-
screen
.
Frame
().
right
),
0.0
);
if
(
frame
.
bottom
>
screen
.
Frame
().
bottom
)
frame
.
OffsetBy
(
0.0
,
-
(
frame
.
bottom
-
screen
.
Frame
().
bottom
));
if
(
frame
.
left
<
screen
.
Frame
().
left
)
frame
.
OffsetBy
((
screen
.
Frame
().
left
-
frame
.
left
),
0.0
);
if
(
frame
.
top
<
screen
.
Frame
().
top
)
frame
.
OffsetBy
(
0.0
,
(
screen
.
Frame
().
top
-
frame
.
top
));
}
return
true
;
}
return
false
;
}
void
void
make_sure_frame_is_within_limits
(
BRect
&
frame
,
float
minWidth
,
float
minHeight
,
make_sure_frame_is_within_limits
(
BRect
&
frame
,
float
minWidth
,
float
minHeight
,
float
maxWidth
,
float
maxHeight
)
float
maxWidth
,
float
maxHeight
)
...
@@ -823,87 +729,6 @@ make_sure_frame_is_within_limits( BRect& frame, float minWidth, float minHeight,
...
@@ -823,87 +729,6 @@ make_sure_frame_is_within_limits( BRect& frame, float minWidth, float minHeight,
frame
.
bottom
=
frame
.
top
+
maxHeight
;
frame
.
bottom
=
frame
.
top
+
maxHeight
;
}
}
/*****************************************************************************
* InterfaceWindow::_RestoreSettings
*****************************************************************************/
void
InterfaceWindow
::
_RestoreSettings
()
{
if
(
_LoadSettings
(
fSettings
,
"interface_settings"
,
"VideoLAN Client"
)
==
B_OK
)
{
BRect
mainFrame
;
if
(
fSettings
->
FindRect
(
"main frame"
,
&
mainFrame
)
==
B_OK
)
{
// sanity checks: make sure window is not too big/small
// and that it's not off-screen
float
minWidth
,
maxWidth
,
minHeight
,
maxHeight
;
GetSizeLimits
(
&
minWidth
,
&
maxWidth
,
&
minHeight
,
&
maxHeight
);
make_sure_frame_is_within_limits
(
mainFrame
,
minWidth
,
minHeight
,
maxWidth
,
maxHeight
);
make_sure_frame_is_on_screen
(
mainFrame
);
MoveTo
(
mainFrame
.
LeftTop
()
);
ResizeTo
(
mainFrame
.
Width
(),
mainFrame
.
Height
()
);
}
if
(
fPlaylistWindow
->
Lock
()
)
{
BRect
playlistFrame
;
if
(
fSettings
->
FindRect
(
"playlist frame"
,
&
playlistFrame
)
==
B_OK
)
{
// sanity checks: make sure window is not too big/small
// and that it's not off-screen
float
minWidth
,
maxWidth
,
minHeight
,
maxHeight
;
fPlaylistWindow
->
GetSizeLimits
(
&
minWidth
,
&
maxWidth
,
&
minHeight
,
&
maxHeight
);
make_sure_frame_is_within_limits
(
playlistFrame
,
minWidth
,
minHeight
,
maxWidth
,
maxHeight
);
make_sure_frame_is_on_screen
(
playlistFrame
);
fPlaylistWindow
->
MoveTo
(
playlistFrame
.
LeftTop
()
);
fPlaylistWindow
->
ResizeTo
(
playlistFrame
.
Width
(),
playlistFrame
.
Height
()
);
}
bool
showing
;
if
(
fSettings
->
FindBool
(
"playlist showing"
,
&
showing
)
==
B_OK
)
{
if
(
showing
)
{
if
(
fPlaylistWindow
->
IsHidden
()
)
fPlaylistWindow
->
Show
();
}
else
{
if
(
!
fPlaylistWindow
->
IsHidden
()
)
fPlaylistWindow
->
Hide
();
}
}
fPlaylistWindow
->
Unlock
();
}
}
}
/*****************************************************************************
* InterfaceWindow::_StoreSettings
*****************************************************************************/
void
InterfaceWindow
::
_StoreSettings
()
{
if
(
fSettings
->
ReplaceRect
(
"main frame"
,
Frame
()
)
!=
B_OK
)
fSettings
->
AddRect
(
"main frame"
,
Frame
()
);
if
(
fPlaylistWindow
->
Lock
()
)
{
if
(
fSettings
->
ReplaceRect
(
"playlist frame"
,
fPlaylistWindow
->
Frame
()
)
!=
B_OK
)
fSettings
->
AddRect
(
"playlist frame"
,
fPlaylistWindow
->
Frame
()
);
if
(
fSettings
->
ReplaceBool
(
"playlist showing"
,
!
fPlaylistWindow
->
IsHidden
()
)
!=
B_OK
)
fSettings
->
AddBool
(
"playlist showing"
,
!
fPlaylistWindow
->
IsHidden
()
);
fPlaylistWindow
->
Unlock
();
}
_SaveSettings
(
fSettings
,
"interface_settings"
,
"VideoLAN Client"
);
}
/*****************************************************************************
/*****************************************************************************
* CDMenu::CDMenu
* CDMenu::CDMenu
*****************************************************************************/
*****************************************************************************/
...
@@ -1026,7 +851,7 @@ void LanguageMenu::_GetChannels()
...
@@ -1026,7 +851,7 @@ void LanguageMenu::_GetChannels()
BMenuItem
*
item
;
BMenuItem
*
item
;
BList
*
list
;
BList
*
list
;
if
(
(
list
=
p_wrapper
->
Input
GetChannels
(
kind
)
)
==
NULL
)
if
(
(
list
=
p_wrapper
->
GetChannels
(
kind
)
)
==
NULL
)
return
;
return
;
for
(
int
i
=
0
;
i
<
list
->
CountItems
();
i
++
)
for
(
int
i
=
0
;
i
<
list
->
CountItems
();
i
++
)
...
@@ -1061,36 +886,21 @@ TitleMenu::~TitleMenu()
...
@@ -1061,36 +886,21 @@ TitleMenu::~TitleMenu()
*****************************************************************************/
*****************************************************************************/
void
TitleMenu
::
AttachedToWindow
()
void
TitleMenu
::
AttachedToWindow
()
{
{
// make title menu empty
BMenuItem
*
item
;
while
(
BMenuItem
*
item
=
RemoveItem
(
0L
)
)
BList
*
list
;
delete
item
;
#if 0
while
(
(
item
=
RemoveItem
(
0L
)
)
)
input_thread_t* input = p_intf->p_sys->p_input;
delete
item
;
if ( input )
{
if
(
(
list
=
p_intf
->
p_sys
->
p_wrapper
->
GetTitles
()
)
==
NULL
)
// lock stream access
return
;
vlc_mutex_lock( &input->stream.stream_lock );
// populate menu according to current stream
for
(
int
i
=
0
;
i
<
list
->
CountItems
();
i
++
)
int32 numTitles = input->stream.i_area_nb;
{
if ( numTitles > 1 )
item
=
(
BMenuItem
*
)
list
->
ItemAt
(
i
);
{
AddItem
(
item
);
// disallow title 0!
}
for ( int32 i = 1; i < numTitles; i++ )
{
BMessage* message = new BMessage( TOGGLE_TITLE );
message->AddInt32( "index", i );
BString helper( "" );
helper << i;
BMenuItem* item = new BMenuItem( helper.String(), message );
item->SetMarked( input->stream.p_selected_area->i_id == i );
AddItem( item );
}
}
// done messing with stream
vlc_mutex_unlock( &input->stream.stream_lock );
}
#endif
BMenu
::
AttachedToWindow
();
BMenu
::
AttachedToWindow
();
}
}
...
@@ -1116,35 +926,21 @@ ChapterMenu::~ChapterMenu()
...
@@ -1116,35 +926,21 @@ ChapterMenu::~ChapterMenu()
*****************************************************************************/
*****************************************************************************/
void
ChapterMenu
::
AttachedToWindow
()
void
ChapterMenu
::
AttachedToWindow
()
{
{
// make title menu empty
BMenuItem
*
item
;
while
(
BMenuItem
*
item
=
RemoveItem
(
0L
)
)
BList
*
list
;
delete
item
;
#if 0
while
(
(
item
=
RemoveItem
(
0L
)
)
)
input_thread_t* input = p_intf->p_sys->p_input;
delete
item
;
if ( input )
{
if
(
(
list
=
p_intf
->
p_sys
->
p_wrapper
->
GetChapters
()
)
==
NULL
)
// lock stream access
return
;
vlc_mutex_lock( &input->stream.stream_lock );
// populate menu according to current stream
for
(
int
i
=
0
;
i
<
list
->
CountItems
();
i
++
)
int32 numChapters = input->stream.p_selected_area->i_part_nb;
{
if ( numChapters > 1 )
item
=
(
BMenuItem
*
)
list
->
ItemAt
(
i
);
{
AddItem
(
item
);
for ( int32 i = 0; i < numChapters; i++ )
}
{
BMessage* message = new BMessage( TOGGLE_CHAPTER );
message->AddInt32( "index", i );
BString helper( "" );
helper << i + 1;
BMenuItem* item = new BMenuItem( helper.String(), message );
item->SetMarked( input->stream.p_selected_area->i_part == i );
AddItem( item );
}
}
// done messing with stream
vlc_mutex_unlock( &input->stream.stream_lock );
}
BMenu
::
AttachedToWindow
();
BMenu
::
AttachedToWindow
();
#endif
}
}
modules/gui/beos/InterfaceWindow.h
View file @
2891094d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* InterfaceWindow.h: BeOS interface window class prototype
* InterfaceWindow.h: BeOS interface window class prototype
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.h,v 1.
8 2003/01/14 14:48:55
titer Exp $
* $Id: InterfaceWindow.h,v 1.
9 2003/01/22 01:13:22
titer Exp $
*
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
* Tony Castley <tcastley@mail.powerup.com.au>
...
@@ -114,14 +114,6 @@ class InterfaceWindow : public BWindow
...
@@ -114,14 +114,6 @@ class InterfaceWindow : public BWindow
bool
hasTitles
=
false
);
bool
hasTitles
=
false
);
void
_UpdateSpeedMenu
(
int
rate
);
void
_UpdateSpeedMenu
(
int
rate
);
void
_InputStreamChanged
();
void
_InputStreamChanged
();
status_t
_LoadSettings
(
BMessage
*
message
,
const
char
*
fileName
,
const
char
*
subFolder
=
NULL
);
status_t
_SaveSettings
(
BMessage
*
message
,
const
char
*
fileName
,
const
char
*
subFolder
=
NULL
);
void
_RestoreSettings
();
void
_StoreSettings
();
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
es_descriptor_t
*
p_spu_es
;
es_descriptor_t
*
p_spu_es
;
...
@@ -150,8 +142,6 @@ class InterfaceWindow : public BWindow
...
@@ -150,8 +142,6 @@ class InterfaceWindow : public BWindow
BMenu
*
fSpeedMenu
;
BMenu
*
fSpeedMenu
;
BMenu
*
fSettingsMenu
;
BMenu
*
fSettingsMenu
;
bigtime_t
fLastUpdateTime
;
bigtime_t
fLastUpdateTime
;
BMessage
*
fSettings
;
// we keep the message arround
// for forward compatibility
VlcWrapper
*
p_wrapper
;
VlcWrapper
*
p_wrapper
;
};
};
...
...
modules/gui/beos/ListViews.cpp
View file @
2891094d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ListViews.h: BeOS interface list view class implementation
* ListViews.h: BeOS interface list view class implementation
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: ListViews.cpp,v 1.
1 2002/09/30 18:30:27
titer Exp $
* $Id: ListViews.cpp,v 1.
2 2003/01/22 01:13:22
titer Exp $
*
*
* Authors: Stephan Aßmus <stippi@yellowbites.com>
* Authors: Stephan Aßmus <stippi@yellowbites.com>
*
*
...
@@ -475,7 +475,8 @@ DragSortableListView::DrawItem( BListItem *item, BRect itemFrame, bool complete
...
@@ -475,7 +475,8 @@ DragSortableListView::DrawItem( BListItem *item, BRect itemFrame, bool complete
/*****************************************************************************
/*****************************************************************************
* PlaylistView class
* PlaylistView class
*****************************************************************************/
*****************************************************************************/
PlaylistView
::
PlaylistView
(
BRect
frame
,
InterfaceWindow
*
mainWindow
)
PlaylistView
::
PlaylistView
(
BRect
frame
,
InterfaceWindow
*
mainWindow
,
VlcWrapper
*
p_wrapper
)
:
DragSortableListView
(
frame
,
"playlist listview"
,
:
DragSortableListView
(
frame
,
"playlist listview"
,
B_MULTIPLE_SELECTION_LIST
,
B_FOLLOW_ALL_SIDES
,
B_MULTIPLE_SELECTION_LIST
,
B_FOLLOW_ALL_SIDES
,
B_WILL_DRAW
|
B_NAVIGABLE
|
B_PULSE_NEEDED
B_WILL_DRAW
|
B_NAVIGABLE
|
B_PULSE_NEEDED
...
@@ -484,6 +485,7 @@ PlaylistView::PlaylistView( BRect frame, InterfaceWindow* mainWindow )
...
@@ -484,6 +485,7 @@ PlaylistView::PlaylistView( BRect frame, InterfaceWindow* mainWindow )
fPlaying
(
false
),
fPlaying
(
false
),
fMainWindow
(
mainWindow
)
fMainWindow
(
mainWindow
)
{
{
this
->
p_wrapper
=
p_wrapper
;
}
}
PlaylistView
::~
PlaylistView
()
PlaylistView
::~
PlaylistView
()
...
@@ -516,7 +518,7 @@ PlaylistView::MouseDown( BPoint where )
...
@@ -516,7 +518,7 @@ PlaylistView::MouseDown( BPoint where )
{
{
if
(
clicks
==
2
)
if
(
clicks
==
2
)
{
{
/* Intf_VLCWrapper::playlistJumpTo( i ); */
p_wrapper
->
PlaylistJumpTo
(
i
);
handled
=
true
;
handled
=
true
;
}
}
else
if
(
i
==
fCurrentIndex
)
else
if
(
i
==
fCurrentIndex
)
...
...
modules/gui/beos/ListViews.h
View file @
2891094d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ListViews.h: BeOS interface list view class prototype
* ListViews.h: BeOS interface list view class prototype
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: ListViews.h,v 1.
1 2002/09/30 18:30:27
titer Exp $
* $Id: ListViews.h,v 1.
2 2003/01/22 01:13:22
titer Exp $
*
*
* Authors: Stephan Aßmus <stippi@yellowbites.com>
* Authors: Stephan Aßmus <stippi@yellowbites.com>
*
*
...
@@ -87,7 +87,8 @@ class PlaylistView : public DragSortableListView
...
@@ -87,7 +87,8 @@ class PlaylistView : public DragSortableListView
{
{
public:
public:
PlaylistView
(
BRect
frame
,
PlaylistView
(
BRect
frame
,
InterfaceWindow
*
mainWindow
);
InterfaceWindow
*
mainWindow
,
VlcWrapper
*
p_wrapper
);
~
PlaylistView
();
~
PlaylistView
();
// BListView
// BListView
...
@@ -110,6 +111,8 @@ class PlaylistView : public DragSortableListView
...
@@ -110,6 +111,8 @@ class PlaylistView : public DragSortableListView
int32
fCurrentIndex
;
int32
fCurrentIndex
;
bool
fPlaying
;
bool
fPlaying
;
InterfaceWindow
*
fMainWindow
;
InterfaceWindow
*
fMainWindow
;
VlcWrapper
*
p_wrapper
;
};
};
#endif // LIST_VIEWS_H
#endif // LIST_VIEWS_H
modules/gui/beos/MediaControlView.cpp
View file @
2891094d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* MediaControlView.cpp: beos interface
* MediaControlView.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MediaControlView.cpp,v 1.1
0 2003/01/12 02:08:38
titer Exp $
* $Id: MediaControlView.cpp,v 1.1
1 2003/01/22 01:13:22
titer Exp $
*
*
* Authors: Tony Castley <tony@castley.net>
* Authors: Tony Castley <tony@castley.net>
* Stephan Aßmus <stippi@yellowbites.com>
* Stephan Aßmus <stippi@yellowbites.com>
...
@@ -1311,13 +1311,13 @@ PositionInfoView::Pulse()
...
@@ -1311,13 +1311,13 @@ PositionInfoView::Pulse()
if
(
now
-
fLastPulseUpdate
>
900000
)
if
(
now
-
fLastPulseUpdate
>
900000
)
{
{
int32
index
,
size
;
int32
index
,
size
;
p_intf
->
p_sys
->
p_wrapper
->
g
etPlaylistInfo
(
index
,
size
);
p_intf
->
p_sys
->
p_wrapper
->
G
etPlaylistInfo
(
index
,
size
);
SetFile
(
index
,
size
);
SetFile
(
index
,
size
);
p_intf
->
p_sys
->
p_wrapper
->
TitleInfo
(
index
,
size
);
p_intf
->
p_sys
->
p_wrapper
->
TitleInfo
(
index
,
size
);
SetTitle
(
index
,
size
);
SetTitle
(
index
,
size
);
p_intf
->
p_sys
->
p_wrapper
->
ChapterInfo
(
index
,
size
);
p_intf
->
p_sys
->
p_wrapper
->
ChapterInfo
(
index
,
size
);
SetChapter
(
index
,
size
);
SetChapter
(
index
,
size
);
SetTime
(
p_intf
->
p_sys
->
p_wrapper
->
g
etTimeAsString
()
);
SetTime
(
p_intf
->
p_sys
->
p_wrapper
->
G
etTimeAsString
()
);
fLastPulseUpdate
=
now
;
fLastPulseUpdate
=
now
;
}
}
}
}
...
...
modules/gui/beos/PlayListWindow.cpp
View file @
2891094d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* PlayListWindow.cpp: beos interface
* PlayListWindow.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PlayListWindow.cpp,v 1.
5 2002/12/09 07:57:04
titer Exp $
* $Id: PlayListWindow.cpp,v 1.
6 2003/01/22 01:13:22
titer Exp $
*
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -130,7 +130,7 @@ editMenu->SetEnabled( false );
...
@@ -130,7 +130,7 @@ editMenu->SetEnabled( false );
frame
.
top
+=
fMenuBar
->
Bounds
().
IntegerHeight
()
+
1
;
frame
.
top
+=
fMenuBar
->
Bounds
().
IntegerHeight
()
+
1
;
frame
.
right
-=
B_V_SCROLL_BAR_WIDTH
;
frame
.
right
-=
B_V_SCROLL_BAR_WIDTH
;
fListView
=
new
PlaylistView
(
frame
,
fMainWindow
);
fListView
=
new
PlaylistView
(
frame
,
fMainWindow
,
p_wrapper
);
fBackgroundView
=
new
BScrollView
(
"playlist scrollview"
,
fBackgroundView
=
new
BScrollView
(
"playlist scrollview"
,
fListView
,
B_FOLLOW_ALL_SIDES
,
fListView
,
B_FOLLOW_ALL_SIDES
,
0
,
false
,
true
,
0
,
false
,
true
,
...
...
modules/gui/beos/VlcWrapper.cpp
View file @
2891094d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
* VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: VlcWrapper.cpp,v 1.2
0 2003/01/17 18:19:43
titer Exp $
* $Id: VlcWrapper.cpp,v 1.2
1 2003/01/22 01:13:22
titer Exp $
*
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Jon Lech Johansen <jon-vl@nanocrew.net>
...
@@ -106,11 +106,8 @@ bool VlcWrapper::UpdateInputAndAOut()
...
@@ -106,11 +106,8 @@ bool VlcWrapper::UpdateInputAndAOut()
bool
VlcWrapper
::
HasInput
()
bool
VlcWrapper
::
HasInput
()
{
{
return
(
p_input
!=
NULL
);
return
(
p_input
!=
NULL
);
// return ( PlaylistSize() > 0 );
}
}
/* status (UNDEF_S, PLAYING_S, PAUSE_S, FORWARD_S, BACKWARD_S,
REWIND_S, NOT_STARTED_S, START_S) */
int
VlcWrapper
::
InputStatus
()
int
VlcWrapper
::
InputStatus
()
{
{
if
(
!
p_input
)
if
(
!
p_input
)
...
@@ -145,7 +142,7 @@ void VlcWrapper::InputFaster()
...
@@ -145,7 +142,7 @@ void VlcWrapper::InputFaster()
}
}
}
}
BList
*
VlcWrapper
::
Input
GetChannels
(
int
i_cat
)
BList
*
VlcWrapper
::
GetChannels
(
int
i_cat
)
{
{
if
(
p_input
)
if
(
p_input
)
{
{
...
@@ -219,50 +216,6 @@ BList * VlcWrapper::InputGetChannels( int i_cat )
...
@@ -219,50 +216,6 @@ BList * VlcWrapper::InputGetChannels( int i_cat )
return
NULL
;
return
NULL
;
}
}
void
VlcWrapper
::
openFiles
(
BList
*
o_files
,
bool
replace
)
{
BString
*
o_file
;
int
size
=
PlaylistSize
();
bool
wasEmpty
=
(
size
<
1
);
/* delete current playlist */
if
(
replace
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
playlist_Delete
(
p_playlist
,
0
);
}
}
/* append files */
while
(
(
o_file
=
(
BString
*
)
o_files
->
LastItem
()
)
)
{
playlist_Add
(
p_playlist
,
o_file
->
String
(),
PLAYLIST_APPEND
,
PLAYLIST_END
);
o_files
->
RemoveItem
(
o_files
->
CountItems
()
-
1
);
}
/* eventually restart playing */
if
(
replace
||
wasEmpty
)
{
playlist_Stop
(
p_playlist
);
playlist_Play
(
p_playlist
);
}
}
void
VlcWrapper
::
openDisc
(
BString
o_type
,
BString
o_device
,
int
i_title
,
int
i_chapter
)
{
if
(
p_intf
->
p_sys
->
b_dvdold
)
o_device
.
Prepend
(
"dvdold:"
);
playlist_Add
(
p_playlist
,
o_device
.
String
(),
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
}
void
VlcWrapper
::
LoadSubFile
(
char
*
psz_file
)
{
config_PutPsz
(
p_intf
,
"sub-file"
,
strdup
(
psz_file
)
);
}
void
VlcWrapper
::
ToggleLanguage
(
int
i_language
)
void
VlcWrapper
::
ToggleLanguage
(
int
i_language
)
{
{
es_descriptor_t
*
p_es
=
NULL
;
es_descriptor_t
*
p_es
=
NULL
;
...
@@ -331,7 +284,7 @@ void VlcWrapper::ToggleSubtitle( int i_subtitle )
...
@@ -331,7 +284,7 @@ void VlcWrapper::ToggleSubtitle( int i_subtitle )
}
}
}
}
const
char
*
VlcWrapper
::
g
etTimeAsString
()
const
char
*
VlcWrapper
::
G
etTimeAsString
()
{
{
static
char
psz_currenttime
[
OFFSETTOTIME_MAX_SIZE
];
static
char
psz_currenttime
[
OFFSETTOTIME_MAX_SIZE
];
...
@@ -347,7 +300,7 @@ const char* VlcWrapper::getTimeAsString()
...
@@ -347,7 +300,7 @@ const char* VlcWrapper::getTimeAsString()
return
(
psz_currenttime
);
return
(
psz_currenttime
);
}
}
float
VlcWrapper
::
g
etTimeAsFloat
()
float
VlcWrapper
::
G
etTimeAsFloat
()
{
{
float
f_time
=
0.0
;
float
f_time
=
0.0
;
...
@@ -363,7 +316,7 @@ float VlcWrapper::getTimeAsFloat()
...
@@ -363,7 +316,7 @@ float VlcWrapper::getTimeAsFloat()
return
(
f_time
);
return
(
f_time
);
}
}
void
VlcWrapper
::
setTimeAsFloat
(
float
f_position
)
void
VlcWrapper
::
SetTimeAsFloat
(
float
f_position
)
{
{
if
(
p_input
!=
NULL
)
if
(
p_input
!=
NULL
)
{
{
...
@@ -399,9 +352,49 @@ bool VlcWrapper::IsPlaying()
...
@@ -399,9 +352,49 @@ bool VlcWrapper::IsPlaying()
}
}
/******************************
/************
* playlist infos and control *
* playlist *
******************************/
************/
void
VlcWrapper
::
OpenFiles
(
BList
*
o_files
,
bool
replace
)
{
BString
*
o_file
;
int
size
=
PlaylistSize
();
bool
wasEmpty
=
(
size
<
1
);
/* delete current playlist */
if
(
replace
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
playlist_Delete
(
p_playlist
,
0
);
}
}
/* append files */
while
(
(
o_file
=
(
BString
*
)
o_files
->
LastItem
()
)
)
{
playlist_Add
(
p_playlist
,
o_file
->
String
(),
PLAYLIST_APPEND
,
PLAYLIST_END
);
o_files
->
RemoveItem
(
o_files
->
CountItems
()
-
1
);
}
/* eventually restart playing */
if
(
replace
||
wasEmpty
)
{
playlist_Stop
(
p_playlist
);
playlist_Play
(
p_playlist
);
}
}
void
VlcWrapper
::
OpenDisc
(
BString
o_type
,
BString
o_device
,
int
i_title
,
int
i_chapter
)
{
if
(
p_intf
->
p_sys
->
b_dvdold
)
o_device
.
Prepend
(
"dvdold:"
);
playlist_Add
(
p_playlist
,
o_device
.
String
(),
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
}
int
VlcWrapper
::
PlaylistSize
()
int
VlcWrapper
::
PlaylistSize
()
{
{
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
...
@@ -410,7 +403,7 @@ int VlcWrapper::PlaylistSize()
...
@@ -410,7 +403,7 @@ int VlcWrapper::PlaylistSize()
return
i_size
;
return
i_size
;
}
}
char
*
VlcWrapper
::
PlaylistItemName
(
int
i
)
char
*
VlcWrapper
::
PlaylistItemName
(
int
i
)
{
{
return
p_playlist
->
pp_items
[
i
]
->
psz_name
;
return
p_playlist
->
pp_items
[
i
]
->
psz_name
;
}
}
...
@@ -420,11 +413,6 @@ int VlcWrapper::PlaylistCurrent()
...
@@ -420,11 +413,6 @@ int VlcWrapper::PlaylistCurrent()
return
p_playlist
->
i_index
;
return
p_playlist
->
i_index
;
}
}
int
VlcWrapper
::
PlaylistStatus
()
{
return
p_playlist
->
i_status
;
}
bool
VlcWrapper
::
PlaylistPlay
()
bool
VlcWrapper
::
PlaylistPlay
()
{
{
if
(
PlaylistSize
()
)
if
(
PlaylistSize
()
)
...
@@ -457,48 +445,7 @@ void VlcWrapper::PlaylistPrev()
...
@@ -457,48 +445,7 @@ void VlcWrapper::PlaylistPrev()
playlist_Prev
(
p_playlist
);
playlist_Prev
(
p_playlist
);
}
}
void
VlcWrapper
::
PlaylistSkip
(
int
i
)
void
VlcWrapper
::
GetPlaylistInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
{
playlist_Skip
(
p_playlist
,
i
);
}
void
VlcWrapper
::
PlaylistGoto
(
int
i
)
{
playlist_Goto
(
p_playlist
,
i
);
}
void
VlcWrapper
::
PlaylistLoop
()
{
if
(
p_intf
->
p_sys
->
b_loop
)
{
playlist_Delete
(
p_playlist
,
p_playlist
->
i_size
-
1
);
}
else
{
playlist_Add
(
p_playlist
,
"vlc:loop"
,
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
}
p_intf
->
p_sys
->
b_loop
=
!
p_intf
->
p_sys
->
b_loop
;
}
BList
*
VlcWrapper
::
PlaylistAsArray
()
{
int
i
;
BList
*
p_list
=
new
BList
(
p_playlist
->
i_size
);
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
for
(
i
=
0
;
i
<
p_playlist
->
i_size
;
i
++
)
{
p_list
->
AddItem
(
new
BString
(
p_playlist
->
pp_items
[
i
]
->
psz_name
));
}
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
return
(
p_list
);
}
void
VlcWrapper
::
getPlaylistInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
{
{
currentIndex
=
-
1
;
currentIndex
=
-
1
;
maxIndex
=
-
1
;
maxIndex
=
-
1
;
...
@@ -512,31 +459,12 @@ void VlcWrapper::getPlaylistInfo( int32& currentIndex, int32& maxIndex )
...
@@ -512,31 +459,12 @@ void VlcWrapper::getPlaylistInfo( int32& currentIndex, int32& maxIndex )
}
}
}
}
void
VlcWrapper
::
PlaylistJumpTo
(
int
pos
)
void
VlcWrapper
::
PlaylistJumpTo
(
int
pos
)
{
{
#if 0
playlist_Goto
(
p_playlist
,
pos
);
// sanity checks
}
if ( pos < 0 )
pos = 0;
void
VlcWrapper
::
GetNavCapabilities
(
bool
*
canSkipPrev
,
bool
*
canSkipNext
)
int size = playlistSize();
if (pos >= size)
pos = size - 1;
// weird hack
if( p_input_bank->pp_input[0] != NULL )
pos--;
// stop current stream
playlistStop();
// modify current position in playlist
playlistLock();
p_main->p_playlist->i_index = pos;
playlistUnlock();
// start playing
playlistPlay();
#endif
}
void
VlcWrapper
::
getNavCapabilities
(
bool
*
canSkipPrev
,
bool
*
canSkipNext
)
{
{
if
(
canSkipPrev
&&
canSkipNext
)
if
(
canSkipPrev
&&
canSkipNext
)
{
{
...
@@ -580,7 +508,7 @@ void VlcWrapper::getNavCapabilities( bool *canSkipPrev, bool *canSkipNext )
...
@@ -580,7 +508,7 @@ void VlcWrapper::getNavCapabilities( bool *canSkipPrev, bool *canSkipNext )
}
}
}
}
void
VlcWrapper
::
n
avigatePrev
()
void
VlcWrapper
::
N
avigatePrev
()
{
{
bool
hasSkiped
=
false
;
bool
hasSkiped
=
false
;
...
@@ -607,7 +535,7 @@ void VlcWrapper::navigatePrev()
...
@@ -607,7 +535,7 @@ void VlcWrapper::navigatePrev()
if
(
currentChapter
>=
0
)
if
(
currentChapter
>=
0
)
{
{
t
oggleChapter
(
currentChapter
);
T
oggleChapter
(
currentChapter
);
hasSkiped
=
true
;
hasSkiped
=
true
;
}
}
}
}
...
@@ -619,7 +547,7 @@ void VlcWrapper::navigatePrev()
...
@@ -619,7 +547,7 @@ void VlcWrapper::navigatePrev()
// disallow area 0 since it is used for video_ts.vob
// disallow area 0 since it is used for video_ts.vob
if
(
currentTitle
>
0
)
if
(
currentTitle
>
0
)
{
{
t
oggleTitle
(
currentTitle
);
T
oggleTitle
(
currentTitle
);
hasSkiped
=
true
;
hasSkiped
=
true
;
}
}
}
}
...
@@ -630,7 +558,7 @@ void VlcWrapper::navigatePrev()
...
@@ -630,7 +558,7 @@ void VlcWrapper::navigatePrev()
PlaylistPrev
();
PlaylistPrev
();
}
}
void
VlcWrapper
::
n
avigateNext
()
void
VlcWrapper
::
N
avigateNext
()
{
{
bool
hasSkiped
=
false
;
bool
hasSkiped
=
false
;
...
@@ -656,7 +584,7 @@ void VlcWrapper::navigateNext()
...
@@ -656,7 +584,7 @@ void VlcWrapper::navigateNext()
currentChapter
++
;
currentChapter
++
;
if
(
currentChapter
<
numChapters
)
if
(
currentChapter
<
numChapters
)
{
{
t
oggleChapter
(
currentChapter
);
T
oggleChapter
(
currentChapter
);
hasSkiped
=
true
;
hasSkiped
=
true
;
}
}
}
}
...
@@ -668,7 +596,7 @@ void VlcWrapper::navigateNext()
...
@@ -668,7 +596,7 @@ void VlcWrapper::navigateNext()
// disallow area 0 since it is used for video_ts.vob
// disallow area 0 since it is used for video_ts.vob
if
(
currentTitle
<
numTitles
-
1
)
if
(
currentTitle
<
numTitles
-
1
)
{
{
t
oggleTitle
(
currentTitle
);
T
oggleTitle
(
currentTitle
);
hasSkiped
=
true
;
hasSkiped
=
true
;
}
}
}
}
...
@@ -680,9 +608,14 @@ void VlcWrapper::navigateNext()
...
@@ -680,9 +608,14 @@ void VlcWrapper::navigateNext()
}
}
/***************************
/*********
* audio infos and control *
* audio *
***************************/
*********/
bool
VlcWrapper
::
HasAudio
()
{
return
(
p_aout
!=
NULL
);
}
unsigned
short
VlcWrapper
::
GetVolume
()
unsigned
short
VlcWrapper
::
GetVolume
()
{
{
...
@@ -731,14 +664,10 @@ bool VlcWrapper::IsMuted()
...
@@ -731,14 +664,10 @@ bool VlcWrapper::IsMuted()
return
p_intf
->
p_sys
->
b_mute
;
return
p_intf
->
p_sys
->
b_mute
;
}
}
bool
VlcWrapper
::
HasAudio
()
{
return
(
p_aout
!=
NULL
);
}
/*******
/*******
* DVD *
* DVD *
*******/
*******/
bool
VlcWrapper
::
HasTitles
()
bool
VlcWrapper
::
HasTitles
()
{
{
if
(
!
p_input
)
if
(
!
p_input
)
...
@@ -748,13 +677,41 @@ bool VlcWrapper::HasTitles()
...
@@ -748,13 +677,41 @@ bool VlcWrapper::HasTitles()
return
(
p_input
->
stream
.
i_area_nb
>
1
);
return
(
p_input
->
stream
.
i_area_nb
>
1
);
}
}
BList
*
VlcWrapper
::
GetTitles
()
{
if
(
p_input
)
{
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
BList
*
list
=
new
BList
(
p_input
->
stream
.
i_area_nb
);
BMenuItem
*
menuItem
;
BMessage
*
message
;
for
(
unsigned
int
i
=
1
;
i
<
p_input
->
stream
.
i_area_nb
;
i
++
)
{
message
=
new
BMessage
(
TOGGLE_TITLE
);
message
->
AddInt32
(
"index"
,
i
);
BString
helper
(
""
);
helper
<<
i
;
menuItem
=
new
BMenuItem
(
helper
.
String
(),
message
);
menuItem
->
SetMarked
(
p_input
->
stream
.
p_selected_area
->
i_id
==
i
);
list
->
AddItem
(
menuItem
);
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
return
list
;
}
return
NULL
;
}
void
VlcWrapper
::
PrevTitle
()
void
VlcWrapper
::
PrevTitle
()
{
{
int
i_id
;
int
i_id
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_id
-
1
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_id
-
1
;
if
(
i_id
>
0
)
if
(
i_id
>
0
)
{
{
t
oggleTitle
(
i_id
);
T
oggleTitle
(
i_id
);
}
}
}
}
...
@@ -764,10 +721,41 @@ void VlcWrapper::NextTitle()
...
@@ -764,10 +721,41 @@ void VlcWrapper::NextTitle()
i_id
=
p_input
->
stream
.
p_selected_area
->
i_id
+
1
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_id
+
1
;
if
(
i_id
<
p_input
->
stream
.
i_area_nb
)
if
(
i_id
<
p_input
->
stream
.
i_area_nb
)
{
{
toggleTitle
(
i_id
);
ToggleTitle
(
i_id
);
}
}
void
VlcWrapper
::
ToggleTitle
(
int
i_title
)
{
if
(
p_input
!=
NULL
)
{
input_ChangeArea
(
p_input
,
p_input
->
stream
.
pp_areas
[
i_title
]
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
}
}
}
void
VlcWrapper
::
TitleInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
{
currentIndex
=
-
1
;
maxIndex
=
-
1
;
if
(
p_input
)
{
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
maxIndex
=
p_input
->
stream
.
i_area_nb
-
1
;
if
(
maxIndex
>
0
)
currentIndex
=
p_input
->
stream
.
p_selected_area
->
i_id
;
else
maxIndex
=
-
1
;
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
}
bool
VlcWrapper
::
HasChapters
()
bool
VlcWrapper
::
HasChapters
()
{
{
if
(
!
p_input
)
if
(
!
p_input
)
...
@@ -777,13 +765,42 @@ bool VlcWrapper::HasChapters()
...
@@ -777,13 +765,42 @@ bool VlcWrapper::HasChapters()
return
(
p_input
->
stream
.
p_selected_area
->
i_part_nb
>
1
);
return
(
p_input
->
stream
.
p_selected_area
->
i_part_nb
>
1
);
}
}
BList
*
VlcWrapper
::
GetChapters
()
{
if
(
p_input
)
{
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
BList
*
list
=
new
BList
(
p_input
->
stream
.
p_selected_area
->
i_part_nb
);
BMenuItem
*
menuItem
;
BMessage
*
message
;
for
(
unsigned
int
i
=
1
;
i
<
p_input
->
stream
.
p_selected_area
->
i_part_nb
+
1
;
i
++
)
{
message
=
new
BMessage
(
TOGGLE_CHAPTER
);
message
->
AddInt32
(
"index"
,
i
);
BString
helper
(
""
);
helper
<<
i
;
menuItem
=
new
BMenuItem
(
helper
.
String
(),
message
);
menuItem
->
SetMarked
(
p_input
->
stream
.
p_selected_area
->
i_part
==
i
);
list
->
AddItem
(
menuItem
);
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
return
list
;
}
return
NULL
;
}
void
VlcWrapper
::
PrevChapter
()
void
VlcWrapper
::
PrevChapter
()
{
{
int
i_id
;
int
i_id
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_part
-
1
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_part
-
1
;
if
(
i_id
>=
0
)
if
(
i_id
>=
0
)
{
{
t
oggleChapter
(
i_id
);
T
oggleChapter
(
i_id
);
}
}
}
}
...
@@ -793,26 +810,21 @@ void VlcWrapper::NextChapter()
...
@@ -793,26 +810,21 @@ void VlcWrapper::NextChapter()
i_id
=
p_input
->
stream
.
p_selected_area
->
i_part
+
1
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_part
+
1
;
if
(
i_id
>=
0
)
if
(
i_id
>=
0
)
{
{
t
oggleChapter
(
i_id
);
T
oggleChapter
(
i_id
);
}
}
}
}
void
VlcWrapper
::
T
itleInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
void
VlcWrapper
::
T
oggleChapter
(
int
i_chapter
)
{
{
currentIndex
=
-
1
;
if
(
p_input
!=
NULL
)
maxIndex
=
-
1
;
{
if
(
p_input
)
p_input
->
stream
.
p_selected_area
->
i_part
=
i_chapter
;
{
input_ChangeArea
(
p_input
,
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
p_selected_area
);
maxIndex
=
p_input
->
stream
.
i_area_nb
-
1
;
if
(
maxIndex
>
0
)
currentIndex
=
p_input
->
stream
.
p_selected_area
->
i_id
;
else
maxIndex
=
-
1
;
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
}
}
void
VlcWrapper
::
ChapterInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
void
VlcWrapper
::
ChapterInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
...
@@ -833,28 +845,11 @@ void VlcWrapper::ChapterInfo( int32 ¤tIndex, int32 &maxIndex )
...
@@ -833,28 +845,11 @@ void VlcWrapper::ChapterInfo( int32 ¤tIndex, int32 &maxIndex )
}
}
}
}
void
VlcWrapper
::
toggleTitle
(
int
i_title
)
/****************
{
* Miscellanous *
if
(
p_input
!=
NULL
)
****************/
{
input_ChangeArea
(
p_input
,
void
VlcWrapper
::
LoadSubFile
(
char
*
psz_file
)
p_input
->
stream
.
pp_areas
[
i_title
]
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
}
void
VlcWrapper
::
toggleChapter
(
int
i_chapter
)
{
{
if
(
p_input
!=
NULL
)
config_PutPsz
(
p_intf
,
"sub-file"
,
strdup
(
psz_file
)
);
{
p_input
->
stream
.
p_selected_area
->
i_part
=
i_chapter
;
input_ChangeArea
(
p_input
,
p_input
->
stream
.
p_selected_area
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
}
}
modules/gui/beos/VlcWrapper.h
View file @
2891094d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* VlcWrapper.h: BeOS plugin for vlc (derived from MacOS X port)
* VlcWrapper.h: BeOS plugin for vlc (derived from MacOS X port)
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: VlcWrapper.h,v 1.1
4 2003/01/17 18:19:43
titer Exp $
* $Id: VlcWrapper.h,v 1.1
5 2003/01/22 01:13:22
titer Exp $
*
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Jon Lech Johansen <jon-vl@nanocrew.net>
...
@@ -62,66 +62,66 @@ public:
...
@@ -62,66 +62,66 @@ public:
bool
UpdateInputAndAOut
();
bool
UpdateInputAndAOut
();
/* input */
/* Input */
bool
HasInput
();
bool
HasInput
();
int
InputStatus
();
int
InputStatus
();
int
InputRate
();
int
InputRate
();
void
InputSlower
();
void
InputSlower
();
void
InputFaster
();
void
InputFaster
();
BList
*
InputGetChannels
(
int
i_cat
);
BList
*
GetChannels
(
int
i_cat
);
void
openFiles
(
BList
*
o_files
,
bool
replace
=
true
);
void
ToggleLanguage
(
int
i_language
);
void
openDisc
(
BString
o_type
,
BString
o_device
,
void
ToggleSubtitle
(
int
i_subtitle
);
int
i_title
,
int
i_chapter
);
const
char
*
GetTimeAsString
();
void
LoadSubFile
(
char
*
psz_file
);
float
GetTimeAsFloat
();
void
ToggleLanguage
(
int
i_language
);
void
SetTimeAsFloat
(
float
i_offset
);
void
ToggleSubtitle
(
int
i_subtitle
);
bool
IsPlaying
();
const
char
*
getTimeAsString
();
float
getTimeAsFloat
();
void
setTimeAsFloat
(
float
i_offset
);
bool
IsPlaying
();
/* Playlist */
/* Playlist */
int
PlaylistSize
();
void
OpenFiles
(
BList
*
o_files
,
bool
replace
=
true
);
char
*
PlaylistItemName
(
int
);
void
OpenDisc
(
BString
o_type
,
BString
o_device
,
int
PlaylistCurrent
();
int
i_title
,
int
i_chapter
);
int
PlaylistStatus
();
int
PlaylistSize
();
bool
PlaylistPlay
();
char
*
PlaylistItemName
(
int
);
void
PlaylistPause
();
int
PlaylistCurrent
();
void
PlaylistStop
();
bool
PlaylistPlay
();
void
PlaylistNext
();
void
PlaylistPause
();
void
PlaylistPrev
();
void
PlaylistStop
();
void
PlaylistSkip
(
int
i
);
void
PlaylistNext
();
void
PlaylistGoto
(
int
i
);
void
PlaylistPrev
();
void
PlaylistLoop
();
bool
PlaylistPlaying
();
BList
*
PlaylistAsArray
();
void
GetPlaylistInfo
(
int32
&
currentIndex
,
bool
PlaylistPlaying
();
int32
&
maxIndex
);
void
getPlaylistInfo
(
int32
&
currentIndex
,
void
PlaylistJumpTo
(
int
);
int32
&
maxIndex
);
void
GetNavCapabilities
(
bool
*
canSkipPrev
,
void
PlaylistJumpTo
(
int
);
bool
*
canSkipNext
);
void
getNavCapabilities
(
bool
*
canSkipPrev
,
void
NavigatePrev
();
bool
*
canSkipNext
);
void
NavigateNext
();
void
navigatePrev
();
void
navigateNext
();
/* audio */
/* Audio */
bool
HasAudio
();
unsigned
short
GetVolume
();
unsigned
short
GetVolume
();
void
SetVolume
(
int
value
);
void
SetVolume
(
int
value
);
void
VolumeMute
();
void
VolumeMute
();
void
VolumeRestore
();
void
VolumeRestore
();
bool
IsMuted
();
bool
IsMuted
();
bool
HasAudio
();
/* DVD */
/* DVD */
bool
HasTitles
();
bool
HasTitles
();
void
PrevTitle
();
BList
*
GetTitles
();
void
NextTitle
();
void
PrevTitle
();
bool
HasChapters
();
void
NextTitle
();
void
PrevChapter
();
void
ToggleTitle
(
int
i_title
);
void
NextChapter
();
void
TitleInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
);
void
TitleInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
);
void
ChapterInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
);
bool
HasChapters
();
void
toggleTitle
(
int
i_title
);
BList
*
GetChapters
();
void
toggleChapter
(
int
i_chapter
);
void
PrevChapter
();
void
NextChapter
();
void
ToggleChapter
(
int
i_chapter
);
void
ChapterInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
);
/* Miscellanous */
void
LoadSubFile
(
char
*
psz_file
);
private:
private:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
...
@@ -129,4 +129,3 @@ private:
...
@@ -129,4 +129,3 @@ private:
playlist_t
*
p_playlist
;
playlist_t
*
p_playlist
;
aout_instance_t
*
p_aout
;
aout_instance_t
*
p_aout
;
};
};
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