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
3b078b7b
Commit
3b078b7b
authored
Nov 27, 2002
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* AudioOutput.cpp: fixed a segfault
* ALL: cleaned the VlcWrapper class, removed unused code
parent
c19c673b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
404 additions
and
483 deletions
+404
-483
modules/gui/beos/AudioOutput.cpp
modules/gui/beos/AudioOutput.cpp
+17
-13
modules/gui/beos/Interface.cpp
modules/gui/beos/Interface.cpp
+2
-2
modules/gui/beos/InterfaceWindow.cpp
modules/gui/beos/InterfaceWindow.cpp
+12
-12
modules/gui/beos/InterfaceWindow.h
modules/gui/beos/InterfaceWindow.h
+2
-2
modules/gui/beos/MediaControlView.cpp
modules/gui/beos/MediaControlView.cpp
+3
-3
modules/gui/beos/PlayListWindow.h
modules/gui/beos/PlayListWindow.h
+2
-2
modules/gui/beos/VlcWrapper.cpp
modules/gui/beos/VlcWrapper.cpp
+319
-380
modules/gui/beos/VlcWrapper.h
modules/gui/beos/VlcWrapper.h
+47
-69
No files found.
modules/gui/beos/AudioOutput.cpp
View file @
3b078b7b
/*****************************************************************************
/*****************************************************************************
*
ao
ut.cpp: BeOS audio output
*
AudioOutp
ut.cpp: BeOS audio output
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: AudioOutput.cpp,v 1.1
6 2002/11/22 19:37:25
titer Exp $
* $Id: AudioOutput.cpp,v 1.1
7 2002/11/27 05:36:41
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>
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
#include <aout_internal.h>
#include <aout_internal.h>
#define FRAME_SIZE 2048
#define FRAME_SIZE 2048
#define BUFFER_SIZE 16384
/*****************************************************************************
/*****************************************************************************
* aout_sys_t: BeOS audio output method descriptor
* aout_sys_t: BeOS audio output method descriptor
...
@@ -94,12 +95,12 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
...
@@ -94,12 +95,12 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
#endif
#endif
p_aout
->
output
.
output
.
i_format
=
VLC_FOURCC
(
'f'
,
'l'
,
'3'
,
'2'
);
p_aout
->
output
.
output
.
i_format
=
VLC_FOURCC
(
'f'
,
'l'
,
'3'
,
'2'
);
p_format
->
buffer_size
=
16384
;
p_format
->
buffer_size
=
BUFFER_SIZE
;
p_aout
->
output
.
i_nb_samples
=
FRAME_SIZE
;
p_aout
->
output
.
i_nb_samples
=
FRAME_SIZE
;
p_aout
->
output
.
pf_play
=
DoNothing
;
p_aout
->
output
.
pf_play
=
DoNothing
;
p_sys
->
p_player
=
new
BSoundPlayer
(
p_format
,
"player"
,
p_sys
->
p_player
=
new
BSoundPlayer
(
p_format
,
"player"
,
Play
,
NULL
,
p_
this
);
Play
,
NULL
,
p_
aout
);
p_sys
->
p_player
->
Start
();
p_sys
->
p_player
->
Start
();
p_sys
->
p_player
->
SetHasData
(
true
);
p_sys
->
p_player
->
SetHasData
(
true
);
...
@@ -122,23 +123,26 @@ void E_(CloseAudio) ( vlc_object_t *p_this )
...
@@ -122,23 +123,26 @@ void E_(CloseAudio) ( vlc_object_t *p_this )
/*****************************************************************************
/*****************************************************************************
* Play
* Play
*****************************************************************************/
*****************************************************************************/
static
void
Play
(
void
*
aout
,
void
*
buffer
,
size_t
size
,
static
void
Play
(
void
*
aout
,
void
*
p_buffer
,
size_t
i_
size
,
const
media_raw_audio_format
&
format
)
const
media_raw_audio_format
&
format
)
{
{
aout_buffer_t
*
p_aout_buffer
;
aout_buffer_t
*
p_aout_buffer
;
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
aout
;
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
aout
;
float
*
p_buffer
=
(
float
*
)
buffer
;
p_aout_buffer
=
aout_FifoPop
(
p_aout
,
&
p_aout
->
output
.
fifo
);
p_aout_buffer
=
aout_FifoPop
(
p_aout
,
&
p_aout
->
output
.
fifo
);
if
(
p_aout_buffer
!=
NULL
)
if
(
p_aout_buffer
!=
NULL
)
{
{
memcpy
(
p_buffer
,
/* sometimes p_aout_buffer is not NULL but still isn't valid.
we check i_nb_bytes so we are sure it is */
if
(
p_aout_buffer
->
i_nb_bytes
==
BUFFER_SIZE
)
{
memcpy
(
(
float
*
)
p_buffer
,
p_aout_buffer
->
p_buffer
,
p_aout_buffer
->
p_buffer
,
MIN
(
size
,
p_aout_buffer
->
i_nb_bytes
)
);
BUFFER_SIZE
);
aout_BufferFree
(
p_aout_buffer
);
aout_BufferFree
(
p_aout_buffer
);
}
}
}
}
}
/*****************************************************************************
/*****************************************************************************
...
...
modules/gui/beos/Interface.cpp
View file @
3b078b7b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* intf_beos.cpp: beos interface
* intf_beos.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: Interface.cpp,v 1.
5 2002/11/26 01:06:08
titer Exp $
* $Id: Interface.cpp,v 1.
6 2002/11/27 05:36:41
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>
...
@@ -72,7 +72,7 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
...
@@ -72,7 +72,7 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
return
(
1
);
return
(
1
);
}
}
p_intf
->
p_sys
->
p_wrapper
=
new
Intf_VLC
Wrapper
(
p_intf
);
p_intf
->
p_sys
->
p_wrapper
=
new
Vlc
Wrapper
(
p_intf
);
p_intf
->
pf_run
=
Run
;
p_intf
->
pf_run
=
Run
;
...
...
modules/gui/beos/InterfaceWindow.cpp
View file @
3b078b7b
...
@@ -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.
9 2002/11/26 01:06:08
titer Exp $
* $Id: InterfaceWindow.cpp,v 1.
10 2002/11/27 05:36:41
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>
...
@@ -212,7 +212,7 @@ InterfaceWindow::FrameResized(float width, float height)
...
@@ -212,7 +212,7 @@ InterfaceWindow::FrameResized(float width, float height)
void
InterfaceWindow
::
MessageReceived
(
BMessage
*
p_message
)
void
InterfaceWindow
::
MessageReceived
(
BMessage
*
p_message
)
{
{
int
playback_status
;
// remember playback state
int
playback_status
;
// remember playback state
playback_status
=
p_wrapper
->
inputGe
tStatus
();
playback_status
=
p_wrapper
->
Inpu
tStatus
();
switch
(
p_message
->
what
)
switch
(
p_message
->
what
)
{
{
...
@@ -266,7 +266,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -266,7 +266,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
{
p_wrapper
->
volume_mute
();
p_wrapper
->
volume_mute
();
snooze
(
400000
);
snooze
(
400000
);
p_wrapper
->
p
laylistStop
();
p_wrapper
->
P
laylistStop
();
p_mediaControl
->
SetStatus
(
NOT_STARTED_S
,
DEFAULT_RATE
);
p_mediaControl
->
SetStatus
(
NOT_STARTED_S
,
DEFAULT_RATE
);
}
}
break
;
break
;
...
@@ -283,18 +283,18 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -283,18 +283,18 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
{
p_wrapper
->
volume_mute
();
p_wrapper
->
volume_mute
();
snooze
(
400000
);
snooze
(
400000
);
p_wrapper
->
p
laylistPause
();
p_wrapper
->
P
laylistPause
();
}
}
else
else
{
{
p_wrapper
->
volume_restore
();
p_wrapper
->
volume_restore
();
p_wrapper
->
p
laylistPlay
();
p_wrapper
->
P
laylistPlay
();
}
}
}
}
else
else
{
{
/* Play a new file */
/* Play a new file */
p_wrapper
->
p
laylistPlay
();
p_wrapper
->
P
laylistPlay
();
}
}
break
;
break
;
...
@@ -304,7 +304,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -304,7 +304,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
{
p_wrapper
->
volume_mute
();
p_wrapper
->
volume_mute
();
snooze
(
400000
);
snooze
(
400000
);
p_wrapper
->
play
Faster
();
p_wrapper
->
Input
Faster
();
}
}
break
;
break
;
...
@@ -314,7 +314,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -314,7 +314,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
{
p_wrapper
->
volume_mute
();
p_wrapper
->
volume_mute
();
snooze
(
400000
);
snooze
(
400000
);
p_wrapper
->
play
Slower
();
p_wrapper
->
Input
Slower
();
}
}
break
;
break
;
...
@@ -323,7 +323,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -323,7 +323,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
if
(
playback_status
>
UNDEF_S
)
if
(
playback_status
>
UNDEF_S
)
{
{
p_wrapper
->
volume_restore
();
p_wrapper
->
volume_restore
();
p_wrapper
->
p
laylistPlay
();
p_wrapper
->
P
laylistPlay
();
}
}
break
;
break
;
...
@@ -411,10 +411,10 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -411,10 +411,10 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
}
}
break
;
break
;
case
PREV_FILE
:
case
PREV_FILE
:
p_wrapper
->
p
laylistPrev
();
p_wrapper
->
P
laylistPrev
();
break
;
break
;
case
NEXT_FILE
:
case
NEXT_FILE
:
p_wrapper
->
p
laylistNext
();
p_wrapper
->
P
laylistNext
();
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
:
...
@@ -471,7 +471,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
...
@@ -471,7 +471,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
*****************************************************************************/
*****************************************************************************/
bool
InterfaceWindow
::
QuitRequested
()
bool
InterfaceWindow
::
QuitRequested
()
{
{
p_wrapper
->
p
laylistStop
();
p_wrapper
->
P
laylistStop
();
p_mediaControl
->
SetStatus
(
NOT_STARTED_S
,
DEFAULT_RATE
);
p_mediaControl
->
SetStatus
(
NOT_STARTED_S
,
DEFAULT_RATE
);
p_intf
->
b_die
=
1
;
p_intf
->
b_die
=
1
;
...
...
modules/gui/beos/InterfaceWindow.h
View file @
3b078b7b
...
@@ -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.
5 2002/11/26 01:06:08
titer Exp $
* $Id: InterfaceWindow.h,v 1.
6 2002/11/27 05:36:41
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>
...
@@ -152,7 +152,7 @@ class InterfaceWindow : public BWindow
...
@@ -152,7 +152,7 @@ class InterfaceWindow : public BWindow
BMessage
*
fSettings
;
// we keep the message arround
BMessage
*
fSettings
;
// we keep the message arround
// for forward compatibility
// for forward compatibility
Intf_VLCWrapper
*
p_wrapper
;
VlcWrapper
*
p_wrapper
;
};
};
#endif // BEOS_INTERFACE_WINDOW_H
#endif // BEOS_INTERFACE_WINDOW_H
modules/gui/beos/MediaControlView.cpp
View file @
3b078b7b
...
@@ -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.
7 2002/11/26 01:06:08
titer Exp $
* $Id: MediaControlView.cpp,v 1.
8 2002/11/27 05:36:41
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>
...
@@ -1309,9 +1309,9 @@ PositionInfoView::Pulse()
...
@@ -1309,9 +1309,9 @@ PositionInfoView::Pulse()
int32
index
,
size
;
int32
index
,
size
;
p_intf
->
p_sys
->
p_wrapper
->
getPlaylistInfo
(
index
,
size
);
p_intf
->
p_sys
->
p_wrapper
->
getPlaylistInfo
(
index
,
size
);
SetFile
(
index
,
size
);
SetFile
(
index
,
size
);
p_intf
->
p_sys
->
p_wrapper
->
get
TitleInfo
(
index
,
size
);
p_intf
->
p_sys
->
p_wrapper
->
TitleInfo
(
index
,
size
);
SetTitle
(
index
,
size
);
SetTitle
(
index
,
size
);
p_intf
->
p_sys
->
p_wrapper
->
get
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
->
getTimeAsString
()
);
SetTime
(
p_intf
->
p_sys
->
p_wrapper
->
getTimeAsString
()
);
fLastPulseUpdate
=
now
;
fLastPulseUpdate
=
now
;
...
...
modules/gui/beos/PlayListWindow.h
View file @
3b078b7b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* PlayListWindow.h: BeOS interface window class prototype
* PlayListWindow.h: BeOS interface window class prototype
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PlayListWindow.h,v 1.
4 2002/11/26 01:06:08
titer Exp $
* $Id: PlayListWindow.h,v 1.
5 2002/11/27 05:36:41
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>
...
@@ -59,7 +59,7 @@ class PlayListWindow : public BWindow
...
@@ -59,7 +59,7 @@ class PlayListWindow : public BWindow
InterfaceWindow
*
fMainWindow
;
InterfaceWindow
*
fMainWindow
;
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
Intf_VLC
Wrapper
*
p_wrapper
;
Vlc
Wrapper
*
p_wrapper
;
};
};
#endif // BEOS_PLAY_LIST_WINDOW_H
#endif // BEOS_PLAY_LIST_WINDOW_H
...
...
modules/gui/beos/VlcWrapper.cpp
View file @
3b078b7b
/*****************************************************************************
/*****************************************************************************
*
intf_vlc_wrapper.h: 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.1
1 2002/11/26 01:06:08
titer Exp $
* $Id: VlcWrapper.cpp,v 1.1
2 2002/11/27 05:36:41
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>
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
* along with this program{} if not, write to the Free Software
* along with this program{} if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
*****************************************************************************/
/* VLC headers */
#include <SupportKit.h>
#include <SupportKit.h>
#include <vlc/vlc.h>
#include <vlc/vlc.h>
...
@@ -35,7 +34,7 @@
...
@@ -35,7 +34,7 @@
#include "VlcWrapper.h"
#include "VlcWrapper.h"
/* constructor */
/* constructor */
Intf_VLCWrapper
::
Intf_VLCWrapper
(
intf_thread_t
*
p_interface
)
VlcWrapper
::
VlcWrapper
(
intf_thread_t
*
p_interface
)
{
{
p_intf
=
p_interface
;
p_intf
=
p_interface
;
p_input
=
NULL
;
p_input
=
NULL
;
...
@@ -45,7 +44,7 @@ Intf_VLCWrapper::Intf_VLCWrapper(intf_thread_t *p_interface)
...
@@ -45,7 +44,7 @@ Intf_VLCWrapper::Intf_VLCWrapper(intf_thread_t *p_interface)
}
}
/* destructor */
/* destructor */
Intf_VLCWrapper
::~
Intf_VLC
Wrapper
()
VlcWrapper
::~
Vlc
Wrapper
()
{
{
if
(
p_input
)
if
(
p_input
)
{
{
...
@@ -63,7 +62,7 @@ Intf_VLCWrapper::~Intf_VLCWrapper()
...
@@ -63,7 +62,7 @@ Intf_VLCWrapper::~Intf_VLCWrapper()
/* UpdateInputAndAOut: updates p_input and p_aout, returns true if the
/* UpdateInputAndAOut: updates p_input and p_aout, returns true if the
interface needs to be updated */
interface needs to be updated */
bool
Intf_VLC
Wrapper
::
UpdateInputAndAOut
()
bool
Vlc
Wrapper
::
UpdateInputAndAOut
()
{
{
if
(
p_input
==
NULL
)
if
(
p_input
==
NULL
)
{
{
...
@@ -94,108 +93,252 @@ bool Intf_VLCWrapper::UpdateInputAndAOut()
...
@@ -94,108 +93,252 @@ bool Intf_VLCWrapper::UpdateInputAndAOut()
return
false
;
return
false
;
}
}
int
Intf_VLCWrapper
::
InputStatus
()
/***************************
* input infos and control *
***************************/
/* status (UNDEF_S, PLAYING_S, PAUSE_S, FORWARD_S, BACKWARD_S,
REWIND_S, NOT_STARTED_S, START_S) */
int
VlcWrapper
::
InputStatus
()
{
{
if
(
!
p_input
)
{
return
UNDEF_S
;
}
return
p_input
->
stream
.
control
.
i_status
;
return
p_input
->
stream
.
control
.
i_status
;
}
}
int
Intf_VLC
Wrapper
::
InputRate
()
int
Vlc
Wrapper
::
InputRate
()
{
{
if
(
!
p_input
)
{
return
DEFAULT_RATE
;
}
return
p_input
->
stream
.
control
.
i_rate
;
return
p_input
->
stream
.
control
.
i_rate
;
}
}
int
Intf_VLCWrapper
::
InputTell
()
/* tell: location in the current stream (in arbitrary units) */
int
VlcWrapper
::
InputTell
()
{
{
if
(
!
p_input
)
{
return
-
1
;
}
return
p_input
->
stream
.
p_selected_area
->
i_tell
;
return
p_input
->
stream
.
p_selected_area
->
i_tell
;
}
}
int
Intf_VLCWrapper
::
InputSize
()
/* size: total size of the current stream (in arbitrary units) */
int
VlcWrapper
::
InputSize
()
{
{
if
(
!
p_input
)
{
return
-
1
;
}
return
p_input
->
stream
.
p_selected_area
->
i_size
;
return
p_input
->
stream
.
p_selected_area
->
i_size
;
}
}
int
Intf_VLCWrapper
::
PlaylistSize
()
void
VlcWrapper
::
InputSlower
()
{
{
return
p_playlist
->
i_size
;
if
(
p_input
!=
NULL
)
{
input_SetStatus
(
p_input
,
INPUT_STATUS_SLOWER
);
}
if
(
p_input
->
stream
.
control
.
i_rate
==
DEFAULT_RATE
)
{
toggle_mute
();
}
else
{
toggle_mute
();
}
}
}
char
*
Intf_VLCWrapper
::
PlaylistItemName
(
int
i
)
void
VlcWrapper
::
InputFaster
(
)
{
{
return
p_playlist
->
pp_items
[
i
]
->
psz_name
;
if
(
p_input
!=
NULL
)
{
input_SetStatus
(
p_input
,
INPUT_STATUS_FASTER
);
}
if
(
p_input
->
stream
.
control
.
i_rate
==
DEFAULT_RATE
)
{
toggle_mute
();
}
else
{
toggle_mute
();
}
}
}
int
Intf_VLCWrapper
::
PlaylistCurrent
(
)
void
VlcWrapper
::
openFiles
(
BList
*
o_files
,
bool
replace
)
{
{
return
p_playlist
->
i_index
;
BString
*
o_file
;
while
(
(
o_file
=
(
BString
*
)
o_files
->
LastItem
()
)
)
{
o_files
->
RemoveItem
(
o_files
->
CountItems
()
-
1
);
playlist_Add
(
p_playlist
,
o_file
->
String
(),
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
delete
o_file
;
}
}
}
bool
Intf_VLCWrapper
::
HasTitles
(
)
void
VlcWrapper
::
openDisc
(
BString
o_type
,
BString
o_device
,
int
i_title
,
int
i_chapter
)
{
{
return
(
p_input
->
stream
.
i_area_nb
>
1
);
BString
o_source
(
""
);
o_source
<<
o_type
<<
":"
<<
o_device
;
playlist_Add
(
p_playlist
,
o_source
.
String
(),
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
}
}
void
Intf_VLCWrapper
::
PrevTitle
()
void
VlcWrapper
::
toggleLanguage
(
int
i_language
)
{
{
int
i_id
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_id
-
1
;
int32
i_old
=
-
1
;
if
(
i_id
>
0
)
int
i_cat
=
AUDIO_ES
;
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
for
(
int
i
=
0
;
i
<
p_input
->
stream
.
i_selected_es_number
;
i
++
)
{
{
toggleTitle
(
i_id
);
if
(
p_input
->
stream
.
pp_selected_es
[
i
]
->
i_cat
==
i_cat
)
{
i_old
=
i
;
break
;
}
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
msg_Info
(
p_intf
,
"Old: %d, New: %d"
,
i_old
,
i_language
);
if
(
i_language
!=
-
1
)
{
input_ToggleES
(
p_input
,
p_input
->
stream
.
pp_selected_es
[
i_language
],
VLC_TRUE
);
}
if
(
(
i_old
!=
-
1
)
&&
(
i_old
!=
i_language
)
)
{
input_ToggleES
(
p_input
,
p_input
->
stream
.
pp_selected_es
[
i_old
],
VLC_FALSE
);
}
}
}
}
void
Intf_VLCWrapper
::
NextTitle
(
)
void
VlcWrapper
::
toggleSubtitle
(
int
i_subtitle
)
{
{
int
i_id
;
int32
i_old
=
-
1
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_id
+
1
;
int
i_cat
=
SPU_ES
;
if
(
i_id
<
p_input
->
stream
.
i_area_nb
)
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
for
(
int
i
=
0
;
i
<
p_input
->
stream
.
i_selected_es_number
;
i
++
)
{
{
toggleTitle
(
i_id
);
if
(
p_input
->
stream
.
pp_selected_es
[
i
]
->
i_cat
==
i_cat
)
{
i_old
=
i
;
break
;
}
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
msg_Info
(
p_intf
,
"Old: %d, New: %d"
,
i_old
,
i_subtitle
);
if
(
i_subtitle
!=
-
1
)
{
input_ToggleES
(
p_input
,
p_input
->
stream
.
pp_selected_es
[
i_subtitle
],
VLC_TRUE
);
}
if
(
(
i_old
!=
-
1
)
&&
(
i_old
!=
i_subtitle
)
)
{
input_ToggleES
(
p_input
,
p_input
->
stream
.
pp_selected_es
[
i_old
],
VLC_FALSE
);
}
}
}
}
bool
Intf_VLCWrapper
::
HasChapters
()
const
char
*
VlcWrapper
::
getTimeAsString
()
{
{
return
(
p_input
->
stream
.
p_selected_area
->
i_part_nb
>
1
);
static
char
psz_currenttime
[
OFFSETTOTIME_MAX_SIZE
];
if
(
p_input
==
NULL
)
{
return
(
"-:--:--"
);
}
input_OffsetToTime
(
p_input
,
psz_currenttime
,
p_input
->
stream
.
p_selected_area
->
i_tell
);
return
(
psz_currenttime
);
}
}
void
Intf_VLCWrapper
::
PrevChapter
()
float
VlcWrapper
::
getTimeAsFloat
()
{
{
int
i_id
;
float
f_time
=
0.0
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_part
-
1
;
if
(
i_id
>=
0
)
if
(
p_input
!=
NULL
)
{
{
toggleChapter
(
i_id
);
f_time
=
(
float
)
p_input
->
stream
.
p_selected_area
->
i_tell
/
(
float
)
p_input
->
stream
.
p_selected_area
->
i_size
;
}
}
else
{
f_time
=
0.0
;
}
return
(
f_time
);
}
}
void
Intf_VLCWrapper
::
NextChapter
(
)
void
VlcWrapper
::
setTimeAsFloat
(
float
f_position
)
{
{
int
i_id
;
if
(
p_input
!=
NULL
)
i_id
=
p_input
->
stream
.
p_selected_area
->
i_part
+
1
;
if
(
i_id
>=
0
)
{
{
toggleChapter
(
i_id
);
input_Seek
(
p_input
,
(
long
long
int
)(
p_input
->
stream
.
p_selected_area
->
i_size
*
f_position
/
SEEKSLIDER_RANGE
),
INPUT_SEEK_SET
);
}
}
}
}
/* playlist control */
bool
Intf_VLCWrapper
::
playlistPlay
()
/******************************
* playlist infos and control *
******************************/
int
VlcWrapper
::
PlaylistSize
()
{
{
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
if
(
p_playlist
->
i_size
)
int
i_size
=
p_playlist
->
i_size
;
{
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
playlist_Play
(
p_playlist
);
return
i_size
;
}
}
else
char
*
VlcWrapper
::
PlaylistItemName
(
int
i
)
{
return
p_playlist
->
pp_items
[
i
]
->
psz_name
;
}
int
VlcWrapper
::
PlaylistCurrent
()
{
return
p_playlist
->
i_index
;
}
int
VlcWrapper
::
PlaylistStatus
()
{
return
p_playlist
->
i_status
;
}
bool
VlcWrapper
::
PlaylistPlay
()
{
if
(
PlaylistSize
()
)
{
{
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
playlist_Play
(
p_playlist
);
}
}
return
(
true
);
return
(
true
);
}
}
void
Intf_VLCWrapper
::
p
laylistPause
()
void
VlcWrapper
::
P
laylistPause
()
{
{
toggle_mute
();
toggle_mute
();
if
(
p_input
)
if
(
p_input
)
...
@@ -204,33 +347,79 @@ void Intf_VLCWrapper::playlistPause()
...
@@ -204,33 +347,79 @@ void Intf_VLCWrapper::playlistPause()
}
}
}
}
void
Intf_VLCWrapper
::
p
laylistStop
()
void
VlcWrapper
::
P
laylistStop
()
{
{
volume_mute
();
volume_mute
();
playlist_Stop
(
p_playlist
);
playlist_Stop
(
p_playlist
);
}
}
void
Intf_VLCWrapper
::
p
laylistNext
()
void
VlcWrapper
::
P
laylistNext
()
{
{
playlist_Next
(
p_playlist
);
playlist_Next
(
p_playlist
);
}
}
void
Intf_VLCWrapper
::
p
laylistPrev
()
void
VlcWrapper
::
P
laylistPrev
()
{
{
playlist_Prev
(
p_playlist
);
playlist_Prev
(
p_playlist
);
}
}
void
Intf_VLCWrapper
::
playlistSkip
(
int
i
)
void
VlcWrapper
::
PlaylistSkip
(
int
i
)
{
{
playlist_Skip
(
p_playlist
,
i
);
playlist_Skip
(
p_playlist
,
i
);
}
}
void
Intf_VLCWrapper
::
playlistGoto
(
int
i
)
void
VlcWrapper
::
PlaylistGoto
(
int
i
)
{
{
playlist_Goto
(
p_playlist
,
i
);
playlist_Goto
(
p_playlist
,
i
);
}
}
void
Intf_VLCWrapper
::
playlistJumpTo
(
int
pos
)
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
;
maxIndex
=
-
1
;
if
(
p_playlist
)
{
maxIndex
=
p_playlist
->
i_size
;
if
(
maxIndex
>
0
)
currentIndex
=
p_playlist
->
i_index
+
1
;
else
maxIndex
=
-
1
;
}
}
void
VlcWrapper
::
PlaylistJumpTo
(
int
pos
)
{
{
#if 0
#if 0
// sanity checks
// sanity checks
...
@@ -253,34 +442,7 @@ void Intf_VLCWrapper::playlistJumpTo( int pos )
...
@@ -253,34 +442,7 @@ void Intf_VLCWrapper::playlistJumpTo( int pos )
#endif
#endif
}
}
int
Intf_VLCWrapper
::
playlistCurrentPos
()
void
VlcWrapper
::
getNavCapabilities
(
bool
*
canSkipPrev
,
bool
*
canSkipNext
)
{
playlistLock
();
int
pos
=
p_playlist
->
i_index
;
playlistUnlock
();
return
pos
;
}
int
Intf_VLCWrapper
::
playlistSize
()
{
playlistLock
();
int
size
=
p_playlist
->
i_size
;
playlistUnlock
();
return
size
;
}
void
Intf_VLCWrapper
::
playlistLock
()
{
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
}
void
Intf_VLCWrapper
::
playlistUnlock
()
{
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
}
void
Intf_VLCWrapper
::
getNavCapabilities
(
bool
*
canSkipPrev
,
bool
*
canSkipNext
)
{
{
if
(
canSkipPrev
&&
canSkipNext
)
if
(
canSkipPrev
&&
canSkipNext
)
{
{
...
@@ -288,10 +450,8 @@ void Intf_VLCWrapper::getNavCapabilities( bool* canSkipPrev,
...
@@ -288,10 +450,8 @@ void Intf_VLCWrapper::getNavCapabilities( bool* canSkipPrev,
*
canSkipPrev
=
false
;
*
canSkipPrev
=
false
;
*
canSkipNext
=
false
;
*
canSkipNext
=
false
;
// get playlist info
// get playlist info
playlistLock
();
int
pos
=
PlaylistCurrent
();
int
pos
=
p_playlist
->
i_index
;
int
size
=
PlaylistSize
();
int
size
=
p_playlist
->
i_size
;
playlistUnlock
();
// see if we have got a stream going
// see if we have got a stream going
if
(
p_input
)
if
(
p_input
)
...
@@ -326,26 +486,24 @@ void Intf_VLCWrapper::getNavCapabilities( bool* canSkipPrev,
...
@@ -326,26 +486,24 @@ void Intf_VLCWrapper::getNavCapabilities( bool* canSkipPrev,
}
}
}
}
void
Intf_VLC
Wrapper
::
navigatePrev
()
void
Vlc
Wrapper
::
navigatePrev
()
{
{
#if 0
bool
hasSkiped
=
false
;
bool
hasSkiped
=
false
;
input_thread_t* input = p_input_bank->pp_input[0];
// see if we have got a stream going
// see if we have got a stream going
if ( input )
if
(
p_
input
)
{
{
// get information from stream (lock it while looking at it)
// get information from stream (lock it while looking at it)
vlc_mutex_lock( &input->stream.stream_lock );
vlc_mutex_lock
(
&
p_
input
->
stream
.
stream_lock
);
int currentTitle = input->stream.p_selected_area->i_id;
int
currentTitle
=
p_
input
->
stream
.
p_selected_area
->
i_id
;
int currentChapter = input->stream.p_selected_area->i_part;
int
currentChapter
=
p_
input
->
stream
.
p_selected_area
->
i_part
;
int numTitles = input->stream.i_area_nb;
int
numTitles
=
p_
input
->
stream
.
i_area_nb
;
bool
hasTitles
=
numTitles
>
1
;
bool
hasTitles
=
numTitles
>
1
;
int numChapters = input->stream.p_selected_area->i_part_nb;
int
numChapters
=
p_
input
->
stream
.
p_selected_area
->
i_part_nb
;
bool
hasChapters
=
numChapters
>
1
;
bool
hasChapters
=
numChapters
>
1
;
vlc_mutex_unlock( &input->stream.stream_lock );
vlc_mutex_unlock
(
&
p_
input
->
stream
.
stream_lock
);
// first, look for chapters
// first, look for chapters
if
(
hasChapters
)
if
(
hasChapters
)
...
@@ -375,30 +533,27 @@ void Intf_VLCWrapper::navigatePrev()
...
@@ -375,30 +533,27 @@ void Intf_VLCWrapper::navigatePrev()
}
}
// last but not least, skip to previous file
// last but not least, skip to previous file
if
(
!
hasSkiped
)
if
(
!
hasSkiped
)
playlistPrev();
PlaylistPrev
();
#endif
}
}
void
Intf_VLC
Wrapper
::
navigateNext
()
void
Vlc
Wrapper
::
navigateNext
()
{
{
#if 0
bool
hasSkiped
=
false
;
bool
hasSkiped
=
false
;
input_thread_t* input = p_input_bank->pp_input[0];
// see if we have got a stream going
// see if we have got a stream going
if ( input )
if
(
p_
input
)
{
{
// get information from stream (lock it while looking at it)
// get information from stream (lock it while looking at it)
vlc_mutex_lock( &input->stream.stream_lock );
vlc_mutex_lock
(
&
p_
input
->
stream
.
stream_lock
);
int currentTitle = input->stream.p_selected_area->i_id;
int
currentTitle
=
p_
input
->
stream
.
p_selected_area
->
i_id
;
int currentChapter = input->stream.p_selected_area->i_part;
int
currentChapter
=
p_
input
->
stream
.
p_selected_area
->
i_part
;
int numTitles = input->stream.i_area_nb;
int
numTitles
=
p_
input
->
stream
.
i_area_nb
;
bool
hasTitles
=
numTitles
>
1
;
bool
hasTitles
=
numTitles
>
1
;
int numChapters = input->stream.p_selected_area->i_part_nb;
int
numChapters
=
p_
input
->
stream
.
p_selected_area
->
i_part_nb
;
bool
hasChapters
=
numChapters
>
1
;
bool
hasChapters
=
numChapters
>
1
;
vlc_mutex_unlock( &input->stream.stream_lock );
vlc_mutex_unlock
(
&
p_
input
->
stream
.
stream_lock
);
// first, look for chapters
// first, look for chapters
if
(
hasChapters
)
if
(
hasChapters
)
...
@@ -427,97 +582,15 @@ void Intf_VLCWrapper::navigateNext()
...
@@ -427,97 +582,15 @@ void Intf_VLCWrapper::navigateNext()
}
}
// last but not least, skip to next file
// last but not least, skip to next file
if
(
!
hasSkiped
)
if
(
!
hasSkiped
)
playlistNext();
PlaylistNext
();
#endif
}
}
//void Intf_VLCWrapper::channelNext()
/***************************
//{
* audio infos and control *
// intf_thread_t * p_intf = p_main->p_intf;
***************************/
//
// p_intf->p_sys->i_channel++;
//
// intf_WarnMsg( 3, "intf info: joining channel %d", p_intf->p_sys->i_channel );
//
// vlc_mutex_lock( &p_intf->change_lock );
//
// network_ChannelJoin( p_intf->p_sys->i_channel );
// p_intf->pf_manage( p_intf );
//
// vlc_mutex_unlock( &p_intf->change_lock );
//}
//
//void Intf_VLCWrapper::channelPrev()
//{
// intf_thread_t * p_intf = p_main->p_intf;
//
// if ( p_intf->p_sys->i_channel )
// {
// p_intf->p_sys->i_channel--;
// }
//
// intf_WarnMsg( 3, "intf info: joining channel %d", p_intf->p_sys->i_channel );
//
// vlc_mutex_lock( &p_intf->change_lock );
//
// network_ChannelJoin( p_intf->p_sys->i_channel );
// p_intf->pf_manage( p_intf );
//
// vlc_mutex_unlock( &p_intf->change_lock );
//
//}
void
Intf_VLCWrapper
::
loop
()
{
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
;
}
/* playback control */
void
Intf_VLCWrapper
::
playSlower
()
{
if
(
p_input
!=
NULL
)
{
input_SetStatus
(
p_input
,
INPUT_STATUS_SLOWER
);
}
if
(
p_input
->
stream
.
control
.
i_rate
==
DEFAULT_RATE
)
{
toggle_mute
(
);
}
else
{
toggle_mute
(
);
}
}
void
Intf_VLCWrapper
::
playFaster
()
void
VlcWrapper
::
volume_mute
()
{
if
(
p_input
!=
NULL
)
{
input_SetStatus
(
p_input
,
INPUT_STATUS_FASTER
);
}
if
(
p_input
->
stream
.
control
.
i_rate
==
DEFAULT_RATE
)
{
toggle_mute
(
);
}
else
{
toggle_mute
(
);
}
}
void
Intf_VLCWrapper
::
volume_mute
()
{
{
if
(
p_aout
!=
NULL
)
if
(
p_aout
!=
NULL
)
{
{
...
@@ -531,7 +604,7 @@ void Intf_VLCWrapper::volume_mute()
...
@@ -531,7 +604,7 @@ void Intf_VLCWrapper::volume_mute()
}
}
void
Intf_VLC
Wrapper
::
volume_restore
()
void
Vlc
Wrapper
::
volume_restore
()
{
{
if
(
p_aout
!=
NULL
)
if
(
p_aout
!=
NULL
)
{
{
...
@@ -542,7 +615,7 @@ void Intf_VLCWrapper::volume_restore()
...
@@ -542,7 +615,7 @@ void Intf_VLCWrapper::volume_restore()
}
}
void
Intf_VLC
Wrapper
::
set_volume
(
int
value
)
void
Vlc
Wrapper
::
set_volume
(
int
value
)
{
{
if
(
p_aout
!=
NULL
)
if
(
p_aout
!=
NULL
)
{
{
...
@@ -562,7 +635,7 @@ void Intf_VLCWrapper::set_volume(int value)
...
@@ -562,7 +635,7 @@ void Intf_VLCWrapper::set_volume(int value)
}
}
}
}
void
Intf_VLC
Wrapper
::
toggle_mute
()
void
Vlc
Wrapper
::
toggle_mute
()
{
{
if
(
p_aout
!=
NULL
)
if
(
p_aout
!=
NULL
)
{
{
...
@@ -577,7 +650,7 @@ void Intf_VLCWrapper::toggle_mute()
...
@@ -577,7 +650,7 @@ void Intf_VLCWrapper::toggle_mute()
}
}
}
}
bool
Intf_VLC
Wrapper
::
is_muted
()
bool
Vlc
Wrapper
::
is_muted
()
{
{
bool
muted
=
true
;
bool
muted
=
true
;
...
@@ -595,7 +668,7 @@ bool Intf_VLCWrapper::is_muted()
...
@@ -595,7 +668,7 @@ bool Intf_VLCWrapper::is_muted()
return
muted
;
return
muted
;
}
}
bool
Intf_VLC
Wrapper
::
is_playing
()
bool
Vlc
Wrapper
::
is_playing
()
{
{
bool
playing
=
false
;
bool
playing
=
false
;
...
@@ -620,7 +693,7 @@ bool Intf_VLCWrapper::is_playing()
...
@@ -620,7 +693,7 @@ bool Intf_VLCWrapper::is_playing()
}
}
void
Intf_VLC
Wrapper
::
maxvolume
()
void
Vlc
Wrapper
::
maxvolume
()
{
{
if
(
p_aout
!=
NULL
)
if
(
p_aout
!=
NULL
)
{
{
...
@@ -635,96 +708,73 @@ void Intf_VLCWrapper::maxvolume()
...
@@ -635,96 +708,73 @@ void Intf_VLCWrapper::maxvolume()
}
}
}
}
bool
Intf_VLC
Wrapper
::
has_audio
()
bool
Vlc
Wrapper
::
has_audio
()
{
{
return
(
p_aout
!=
NULL
);
return
(
p_aout
!=
NULL
);
}
}
/* playback info */
/*******
* DVD *
const
char
*
Intf_VLCWrapper
::
getTimeAsString
()
*******/
bool
VlcWrapper
::
HasTitles
()
{
{
static
char
psz_currenttime
[
OFFSETTOTIME_MAX_SIZE
];
if
(
!
p_input
)
if
(
p_input
==
NULL
)
{
{
return
(
"-:--:--"
)
;
return
false
;
}
}
return
(
p_input
->
stream
.
i_area_nb
>
1
);
input_OffsetToTime
(
p_input
,
psz_currenttime
,
p_input
->
stream
.
p_selected_area
->
i_tell
);
return
(
psz_currenttime
);
}
}
float
Intf_VLCWrapper
::
getTimeAsFloat
()
void
VlcWrapper
::
PrevTitle
()
{
{
float
f_time
=
0.0
;
int
i_id
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_id
-
1
;
if
(
p_input
!=
NULL
)
if
(
i_id
>
0
)
{
f_time
=
(
float
)
p_input
->
stream
.
p_selected_area
->
i_tell
/
(
float
)
p_input
->
stream
.
p_selected_area
->
i_size
;
}
else
{
{
f_time
=
0.0
;
toggleTitle
(
i_id
)
;
}
}
return
(
f_time
);
}
}
void
Intf_VLCWrapper
::
setTimeAsFloat
(
float
f_position
)
void
VlcWrapper
::
NextTitle
(
)
{
{
if
(
p_input
!=
NULL
)
int
i_id
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_id
+
1
;
if
(
i_id
<
p_input
->
stream
.
i_area_nb
)
{
{
input_Seek
(
p_input
,
toggleTitle
(
i_id
);
(
long
long
int
)(
p_input
->
stream
.
p_selected_area
->
i_size
*
f_position
/
SEEKSLIDER_RANGE
),
INPUT_SEEK_SET
);
}
}
}
}
/* bool Intf_VLCWrapper::playlistPlaying
()
bool
VlcWrapper
::
HasChapters
()
{
{
return( !p_intf->p_sys->p_playlist->b_stopped );
if
(
!
p_input
)
} */
{
return
false
;
}
return
(
p_input
->
stream
.
p_selected_area
->
i_part_nb
>
1
);
}
BList
*
Intf_VLCWrapper
::
playlistAsArray
()
void
VlcWrapper
::
PrevChapter
()
{
{
int
i
;
int
i_id
;
BList
*
p_list
=
new
BList
(
p_playlist
->
i_size
);
i_id
=
p_input
->
stream
.
p_selected_area
->
i_part
-
1
;
if
(
i_id
>=
0
)
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
)
);
toggleChapter
(
i_id
);
}
}
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
return
(
p_list
);
}
}
// getPlaylistInfo
void
VlcWrapper
::
NextChapter
()
void
Intf_VLCWrapper
::
getPlaylistInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
{
{
currentIndex
=
-
1
;
int
i_id
;
maxIndex
=
-
1
;
i_id
=
p_input
->
stream
.
p_selected_area
->
i_part
+
1
;
if
(
p_playlist
)
if
(
i_id
>=
0
)
{
{
maxIndex
=
p_playlist
->
i_size
;
toggleChapter
(
i_id
);
if
(
maxIndex
>
0
)
currentIndex
=
p_playlist
->
i_index
+
1
;
else
maxIndex
=
-
1
;
}
}
}
}
// getTitleInfo
void
VlcWrapper
::
TitleInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
void
Intf_VLCWrapper
::
getTitleInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
{
{
currentIndex
=
-
1
;
currentIndex
=
-
1
;
maxIndex
=
-
1
;
maxIndex
=
-
1
;
...
@@ -742,9 +792,7 @@ Intf_VLCWrapper::getTitleInfo( int32& currentIndex, int32& maxIndex )
...
@@ -742,9 +792,7 @@ Intf_VLCWrapper::getTitleInfo( int32& currentIndex, int32& maxIndex )
}
}
}
}
// getChapterInfo
void
VlcWrapper
::
ChapterInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
void
Intf_VLCWrapper
::
getChapterInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
)
{
{
currentIndex
=
-
1
;
currentIndex
=
-
1
;
maxIndex
=
-
1
;
maxIndex
=
-
1
;
...
@@ -762,46 +810,7 @@ Intf_VLCWrapper::getChapterInfo( int32& currentIndex, int32& maxIndex )
...
@@ -762,46 +810,7 @@ Intf_VLCWrapper::getChapterInfo( int32& currentIndex, int32& maxIndex )
}
}
}
}
/* open file/disc/network */
void
VlcWrapper
::
toggleTitle
(
int
i_title
)
void
Intf_VLCWrapper
::
openFiles
(
BList
*
o_files
,
bool
replace
)
{
BString
*
o_file
;
while
(
(
o_file
=
(
BString
*
)
o_files
->
LastItem
()
)
)
{
o_files
->
RemoveItem
(
o_files
->
CountItems
()
-
1
);
playlist_Add
(
p_playlist
,
o_file
->
String
(),
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
delete
o_file
;
}
}
void
Intf_VLCWrapper
::
openDisc
(
BString
o_type
,
BString
o_device
,
int
i_title
,
int
i_chapter
)
{
BString
o_source
(
""
);
o_source
<<
o_type
<<
":"
<<
o_device
;
playlist_Add
(
p_playlist
,
o_source
.
String
(),
PLAYLIST_APPEND
|
PLAYLIST_GO
,
PLAYLIST_END
);
}
void
Intf_VLCWrapper
::
openNet
(
BString
o_addr
,
int
i_port
)
{
}
void
Intf_VLCWrapper
::
openNetChannel
(
BString
o_addr
,
int
i_port
)
{
}
void
Intf_VLCWrapper
::
openNetHTTP
(
BString
o_addr
)
{
}
/* menus management */
void
Intf_VLCWrapper
::
toggleProgram
(
int
i_program
){}
void
Intf_VLCWrapper
::
toggleTitle
(
int
i_title
)
{
{
if
(
p_input
!=
NULL
)
if
(
p_input
!=
NULL
)
{
{
...
@@ -814,7 +823,7 @@ void Intf_VLCWrapper::toggleTitle(int i_title)
...
@@ -814,7 +823,7 @@ void Intf_VLCWrapper::toggleTitle(int i_title)
}
}
}
}
void
Intf_VLC
Wrapper
::
toggleChapter
(
int
i_chapter
)
void
Vlc
Wrapper
::
toggleChapter
(
int
i_chapter
)
{
{
if
(
p_input
!=
NULL
)
if
(
p_input
!=
NULL
)
{
{
...
@@ -826,73 +835,3 @@ void Intf_VLCWrapper::toggleChapter(int i_chapter)
...
@@ -826,73 +835,3 @@ void Intf_VLCWrapper::toggleChapter(int i_chapter)
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
}
}
}
void
Intf_VLCWrapper
::
toggleLanguage
(
int
i_language
)
{
int32
i_old
=
-
1
;
int
i_cat
=
AUDIO_ES
;
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
for
(
int
i
=
0
;
i
<
p_input
->
stream
.
i_selected_es_number
;
i
++
)
{
if
(
p_input
->
stream
.
pp_selected_es
[
i
]
->
i_cat
==
i_cat
)
{
i_old
=
i
;
break
;
}
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
msg_Info
(
p_intf
,
"Old: %d, New: %d"
,
i_old
,
i_language
);
if
(
i_language
!=
-
1
)
{
input_ToggleES
(
p_input
,
p_input
->
stream
.
pp_selected_es
[
i_language
],
VLC_TRUE
);
}
if
(
(
i_old
!=
-
1
)
&&
(
i_old
!=
i_language
)
)
{
input_ToggleES
(
p_input
,
p_input
->
stream
.
pp_selected_es
[
i_old
],
VLC_FALSE
);
}
}
void
Intf_VLCWrapper
::
toggleSubtitle
(
int
i_subtitle
)
{
int32
i_old
=
-
1
;
int
i_cat
=
SPU_ES
;
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
for
(
int
i
=
0
;
i
<
p_input
->
stream
.
i_selected_es_number
;
i
++
)
{
if
(
p_input
->
stream
.
pp_selected_es
[
i
]
->
i_cat
==
i_cat
)
{
i_old
=
i
;
break
;
}
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
msg_Info
(
p_intf
,
"Old: %d, New: %d"
,
i_old
,
i_subtitle
);
if
(
i_subtitle
!=
-
1
)
{
input_ToggleES
(
p_input
,
p_input
->
stream
.
pp_selected_es
[
i_subtitle
],
VLC_TRUE
);
}
if
(
(
i_old
!=
-
1
)
&&
(
i_old
!=
i_subtitle
)
)
{
input_ToggleES
(
p_input
,
p_input
->
stream
.
pp_selected_es
[
i_old
],
VLC_FALSE
);
}
}
int
Intf_VLCWrapper
::
inputGetStatus
()
{
return
p_playlist
->
i_status
;
}
modules/gui/beos/VlcWrapper.h
View file @
3b078b7b
/*****************************************************************************
/*****************************************************************************
*
intf_vlc_wrapper.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.
7 2002/11/26 01:06:08
titer Exp $
* $Id: VlcWrapper.h,v 1.
8 2002/11/27 05:36:41
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>
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
#define SEEKSLIDER_RANGE 2048
#define SEEKSLIDER_RANGE 2048
class
InterfaceWindow
;
class
InterfaceWindow
;
class
Intf_VLC
Wrapper
;
class
Vlc
Wrapper
;
/*****************************************************************************
/*****************************************************************************
* intf_sys_t: internal variables of the BeOS interface
* intf_sys_t: internal variables of the BeOS interface
...
@@ -37,7 +37,6 @@ struct intf_sys_t
...
@@ -37,7 +37,6 @@ struct intf_sys_t
{
{
InterfaceWindow
*
p_window
;
InterfaceWindow
*
p_window
;
/* DVD mode */
vlc_bool_t
b_disabled_menus
;
vlc_bool_t
b_disabled_menus
;
vlc_bool_t
b_loop
;
vlc_bool_t
b_loop
;
vlc_bool_t
b_mute
;
vlc_bool_t
b_mute
;
...
@@ -45,76 +44,65 @@ struct intf_sys_t
...
@@ -45,76 +44,65 @@ struct intf_sys_t
int
i_saved_volume
;
int
i_saved_volume
;
int
i_channel
;
int
i_channel
;
Intf_VLC
Wrapper
*
p_wrapper
;
Vlc
Wrapper
*
p_wrapper
;
};
};
/*****************************************************************************
/*****************************************************************************
*
Intf_VLC
Wrapper
*
Vlc
Wrapper
*****************************************************************************
*****************************************************************************
* This class makes the link between the BeOS interface and the vlc core.
* This class makes the link between the BeOS interface and the vlc core.
* There is only one
Intf_VLC
Wrapper instance at any time, which is stored
* There is only one
Vlc
Wrapper instance at any time, which is stored
* in p_intf->p_sys->p_wrapper
* in p_intf->p_sys->p_wrapper
*****************************************************************************/
*****************************************************************************/
class
Intf_VLC
Wrapper
class
Vlc
Wrapper
{
{
public:
public:
Intf_VLC
Wrapper
(
intf_thread_t
*
p_intf
);
Vlc
Wrapper
(
intf_thread_t
*
p_intf
);
~
Intf_VLC
Wrapper
();
~
Vlc
Wrapper
();
bool
UpdateInputAndAOut
();
bool
UpdateInputAndAOut
();
int
inputGetStatus
();
/* input */
int
InputStatus
();
int
InputStatus
();
int
InputRate
();
int
InputRate
();
int
InputTell
();
int
InputTell
();
int
InputSize
();
int
InputSize
();
void
inputSeek
();
void
InputSlower
();
void
InputFaster
();
void
openFiles
(
BList
*
o_files
,
bool
replace
=
true
);
void
openDisc
(
BString
o_type
,
BString
o_device
,
int
i_title
,
int
i_chapter
);
void
toggleLanguage
(
int
i_language
);
void
toggleSubtitle
(
int
i_subtitle
);
const
char
*
getTimeAsString
();
float
getTimeAsFloat
();
void
setTimeAsFloat
(
float
i_offset
);
/* playlist control */
/* Playlist */
int
PlaylistSize
();
int
PlaylistSize
();
char
*
PlaylistItemName
(
int
);
char
*
PlaylistItemName
(
int
);
int
PlaylistCurrent
();
int
PlaylistCurrent
();
int
PlaylistStatus
();
bool
playlistPlay
();
bool
PlaylistPlay
();
void
playlistPause
();
void
PlaylistPause
();
void
playlistStop
();
void
PlaylistStop
();
void
playlistNext
();
void
PlaylistNext
();
void
playlistPrev
();
void
PlaylistPrev
();
void
playlistJumpTo
(
int
);
void
PlaylistSkip
(
int
i
);
int
playlistSize
();
void
PlaylistGoto
(
int
i
);
int
playlistCurrentPos
();
void
PlaylistLoop
();
void
playlistLock
();
BList
*
PlaylistAsArray
();
void
playlistUnlock
();
bool
PlaylistPlaying
();
void
playlistSkip
(
int
i
);
void
playlistGoto
(
int
i
);
void
loop
();
bool
playlistPlaying
();
BList
*
playlistAsArray
();
void
getPlaylistInfo
(
int32
&
currentIndex
,
void
getPlaylistInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
);
int32
&
maxIndex
);
void
getTitleInfo
(
int32
&
currentIndex
,
void
PlaylistJumpTo
(
int
);
int32
&
maxIndex
);
void
getChapterInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
);
void
getNavCapabilities
(
bool
*
canSkipPrev
,
void
getNavCapabilities
(
bool
*
canSkipPrev
,
bool
*
canSkipNext
);
bool
*
canSkipNext
);
void
navigatePrev
();
void
navigatePrev
();
void
navigateNext
();
void
navigateNext
();
/* DVD */
/* audio */
bool
HasTitles
();
void
PrevTitle
();
void
NextTitle
();
bool
HasChapters
();
void
PrevChapter
();
void
NextChapter
();
/* Stream Control */
void
playSlower
();
void
playFaster
();
/* playback control */
void
volume_mute
();
void
volume_mute
();
void
volume_restore
();
void
volume_restore
();
void
set_volume
(
int
value
);
void
set_volume
(
int
value
);
...
@@ -124,27 +112,17 @@ public:
...
@@ -124,27 +112,17 @@ public:
void
maxvolume
();
void
maxvolume
();
bool
has_audio
();
bool
has_audio
();
/* playback info */
/* DVD */
const
char
*
getTimeAsString
();
bool
HasTitles
();
float
getTimeAsFloat
();
void
PrevTitle
();
void
setTimeAsFloat
(
float
i_offset
);
void
NextTitle
();
bool
HasChapters
();
/* open file/disc/network */
void
PrevChapter
();
void
openFiles
(
BList
*
o_files
,
bool
replace
=
true
);
void
NextChapter
();
void
openDisc
(
BString
o_type
,
BString
o_device
,
void
TitleInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
);
int
i_title
,
int
i_chapter
);
void
ChapterInfo
(
int32
&
currentIndex
,
int32
&
maxIndex
);
void
openNet
(
BString
o_addr
,
int
i_port
);
void
openNetChannel
(
BString
o_addr
,
int
i_port
);
void
openNetHTTP
(
BString
o_addr
);
/* menus management */
void
toggleProgram
(
int
i_program
);
void
toggleTitle
(
int
i_title
);
void
toggleTitle
(
int
i_title
);
void
toggleChapter
(
int
i_chapter
);
void
toggleChapter
(
int
i_chapter
);
void
toggleLanguage
(
int
i_language
);
void
toggleSubtitle
(
int
i_subtitle
);
void
channelNext
();
void
channelPrev
();
private:
private:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
...
...
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