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
e69d3141
Commit
e69d3141
authored
Jul 16, 2005
by
Rocky Bernstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cdda/info.c: changes for libcddb 1.1.0 API
rest: Add "Probe" for media function in Open Disc.
parent
efc10b25
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
251 additions
and
7 deletions
+251
-7
configure.ac
configure.ac
+10
-2
modules/access/cdda/info.c
modules/access/cdda/info.c
+5
-4
modules/gui/wxwindows/open.cpp
modules/gui/wxwindows/open.cpp
+231
-0
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+4
-0
po/Makefile.in.in
po/Makefile.in.in
+1
-1
No files found.
configure.ac
View file @
e69d3141
...
...
@@ -3645,8 +3645,16 @@ then
if test "${ac_cv_cxx_fpermissive}" = "yes"; then
VLC_ADD_CXXFLAGS([wxwindows],-fpermissive)
fi
VLC_ADD_CXXFLAGS([wxwindows],[`${WX_CONFIG} --cxxflags`])
VLC_ADD_LDFLAGS([wxwindows],[`${WX_CONFIG} --libs`])
PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.71,
[
AC_DEFINE(HAVE_LIBCDIO, [], [Define for the CD-DA plugin using libcdio])
VLC_ADD_CXXFLAGS([wxwindows],[`${WX_CONFIG} --cxxflags` $LIBCDIO_CFLAGS])
VLC_ADD_LDFLAGS([wxwindows],[`${WX_CONFIG} --libs`] $LIBCDIO_LIBS)],
[AC_MSG_WARN(libcdio library not found - Probe disc disabled)
VLC_ADD_CXXFLAGS([wxwindows],[`${WX_CONFIG} --cxxflags`])
VLC_ADD_LDFLAGS([wxwindows],[`${WX_CONFIG} --libs`])
HAVE_LIBCDIO=no])
# now look for the wxprec.h header
CPPFLAGS="${CPPFLAGS_save} ${CXXFLAGS_wxwindows}"
ac_cv_wx_headers=yes
...
...
modules/access/cdda/info.c
View file @
e69d3141
...
...
@@ -116,13 +116,14 @@ GetCDDBInfo( access_t *p_access, cdda_data_t *p_cdda )
{
track_t
i_track
=
p_cdda
->
i_first_track
+
i
;
cddb_track_t
*
t
=
cddb_track_new
();
t
->
frame_offset
=
cdio_get_track_lba
(
p_cdio
,
i_track
);
cddb_track_set_frame_offset
(
t
,
cdio_get_track_lba
(
p_cdio
,
i_track
));
cddb_disc_add_track
(
p_cdda
->
cddb
.
disc
,
t
);
}
p_cdda
->
cddb
.
disc
->
length
=
cdio_get_track_lba
(
p_cdio
,
CDIO_CDROM_LEADOUT_TRACK
)
/
CDIO_CD_FRAMES_PER_SEC
;
cddb_disc_set_length
(
p_cdda
->
cddb
.
disc
,
cdio_get_track_lba
(
p_cdio
,
CDIO_CDROM_LEADOUT_TRACK
)
/
CDIO_CD_FRAMES_PER_SEC
)
;
if
(
!
cddb_disc_calc_discid
(
p_cdda
->
cddb
.
disc
))
{
...
...
modules/gui/wxwindows/open.cpp
View file @
e69d3141
...
...
@@ -30,6 +30,10 @@
#include <stdio.h>
#include <vlc/vlc.h>
#ifdef HAVE_LIBCDIO
#include <cdio/cdio.h>
#include <cdio/cd_types.h>
#endif
/* HAVE_LIBCDIO */
#include <wx/combobox.h>
#include <wx/statline.h>
...
...
@@ -60,6 +64,9 @@ enum
FileName_Event
,
DiscType_Event
,
#ifdef HAVE_LIBCDIO
DiscProbe_Event
,
#endif
DiscDevice_Event
,
DiscTitle_Event
,
DiscChapter_Event
,
...
...
@@ -99,6 +106,9 @@ BEGIN_EVENT_TABLE(OpenDialog, wxDialog)
/* Events generated by the disc panel */
EVT_RADIOBOX
(
DiscType_Event
,
OpenDialog
::
OnDiscTypeChange
)
#ifdef HAVE_LIBCDIO
EVT_CHECKBOX
(
DiscProbe_Event
,
OpenDialog
::
OnDiscProbe
)
#endif
EVT_TEXT
(
DiscDevice_Event
,
OpenDialog
::
OnDiscDeviceChange
)
EVT_TEXT
(
DiscDevice_Event
,
OpenDialog
::
OnDiscPanelChange
)
EVT_TEXT
(
DiscTitle_Event
,
OpenDialog
::
OnDiscPanelChange
)
...
...
@@ -653,7 +663,13 @@ wxPanel *OpenDialog::DiscPanel( wxWindow* parent )
WXSIZEOF
(
disc_type_array
),
disc_type_array
,
WXSIZEOF
(
disc_type_array
),
wxRA_SPECIFY_COLS
);
#ifdef HAVE_LIBCDIO
disc_probe
=
new
wxCheckBox
(
panel
,
DiscProbe_Event
,
wxU
(
_
(
"Probe Disc"
))
);
#endif
sizer_row
->
Add
(
disc_type
,
i_disc_type_selection
,
wxEXPAND
|
wxALL
,
5
);
sizer_row
->
Add
(
disc_probe
,
0
,
wxEXPAND
|
wxALL
);
wxStaticText
*
label
=
new
wxStaticText
(
panel
,
-
1
,
wxU
(
_
(
"Device name"
))
);
disc_device
=
new
wxTextCtrl
(
panel
,
DiscDevice_Event
,
wxT
(
""
),
...
...
@@ -1225,6 +1241,221 @@ void OpenDialog::OnDiscDeviceChange( wxCommandEvent& event )
UpdateMRL
(
DISC_ACCESS
);
}
#ifdef HAVE_LIBCDIO
/* Return a device that has a DVD in it. The caller needs to free
the returned string.
*/
static
char
*
ProbeDVD
()
{
char
**
ppsz_cd_drives
=
cdio_get_devices
(
DRIVER_DEVICE
);
if
(
ppsz_cd_drives
)
{
char
**
c
;
for
(
c
=
ppsz_cd_drives
;
*
c
!=
NULL
;
c
++
)
{
CdIo_t
*
p_cdio
=
cdio_open
(
*
c
,
DRIVER_UNKNOWN
);
if
(
p_cdio
)
{
discmode_t
discmode
=
cdio_get_discmode
(
p_cdio
);
cdio_destroy
(
p_cdio
);
if
(
cdio_is_discmode_dvd
(
discmode
)
)
{
char
*
psz_drive
=
strdup
(
*
c
);
cdio_free_device_list
(
ppsz_cd_drives
);
return
strdup
(
psz_drive
);
}
}
}
cdio_free_device_list
(
ppsz_cd_drives
);
}
return
NULL
;
}
static
char
*
ProbeDevice
(
char
**
search_devices
,
cdio_fs_anal_t
mask
,
bool
b_any
)
{
char
**
ppsz_devices
;
/* Start out trying the device that has been entered so far. */
ppsz_devices
=
cdio_get_devices_with_cap
(
search_devices
,
mask
,
b_any
);
if
(
ppsz_devices
&&
*
ppsz_devices
)
{
char
*
psz_device
=
strdup
(
*
ppsz_devices
);
cdio_free_device_list
(
ppsz_devices
);
return
psz_device
;
}
/* If there was no device specified on the first try then give up
now. Otherwise accept any CD-ROM in the class (e.g. VCD or DVD).
*/
if
(
!
search_devices
[
0
])
return
NULL
;
ppsz_devices
=
cdio_get_devices_with_cap
(
NULL
,
mask
,
b_any
);
if
(
ppsz_devices
&&
*
ppsz_devices
)
{
char
*
psz_device
=
strdup
(
*
ppsz_devices
);
cdio_free_device_list
(
ppsz_devices
);
return
psz_device
;
}
return
NULL
;
}
/* Return a device that has a CD-DA in it. The caller needs to free
the returned string.
*/
static
char
*
ProbeCDDA
(
const
wxChar
*
device
)
{
char
*
ppsz_device
[
2
];
const
wxWX2MBbuf
tmp_buf
=
wxConvCurrent
->
cWX2MB
(
device
);
char
*
psz_device
=
(
char
*
)
tmp_buf
;
ppsz_device
[
0
]
=
(
device
&&
*
device
)
?
psz_device
:
NULL
;
ppsz_device
[
1
]
=
NULL
;
return
ProbeDevice
(
ppsz_device
,
CDIO_FS_AUDIO
,
false
);
}
/* Return a device that has a VCD in it. The caller needs to free
the returned string.
*/
static
char
*
ProbeVCD
(
const
wxChar
*
device
)
{
char
*
ppsz_device
[
2
];
const
wxWX2MBbuf
tmp_buf
=
wxConvCurrent
->
cWX2MB
(
device
);
char
*
psz_device
=
(
char
*
)
tmp_buf
;
ppsz_device
[
0
]
=
(
device
&&
*
device
)
?
psz_device
:
NULL
;
ppsz_device
[
1
]
=
NULL
;
return
ProbeDevice
(
ppsz_device
,
(
CDIO_FS_ANAL_SVCD
|
CDIO_FS_ANAL_CVD
|
CDIO_FS_ANAL_VIDEOCD
|
CDIO_FS_UNKNOWN
),
true
);
}
/*
Probe (find anywhere) a CD-DA, VCD, or a DVD.
First we try the device name that may have been entered for the media class
selected. If that doesn't work we try any device for the media class.
If that doesn't work the try looking for CD-ROMs or DVD drives and set the
media selection to whatever we find.
*/
void
OpenDialog
::
OnDiscProbe
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
wxCommandEvent
dummy_event
;
char
*
psz_device
=
NULL
;
bool
b_probed_DVD
=
false
;
bool
b_probed_VCD
=
false
;
retry:
switch
(
disc_type
->
GetSelection
()
)
{
case
0
:
/* DVD with menus */
case
1
:
/* DVD without menus */
/* If not a DVD then try for a VCD. If VCD fails it will
try for a CD-DA. */
if
(
!
psz_device
)
psz_device
=
ProbeDVD
();
if
(
!
psz_device
)
{
b_probed_DVD
=
true
;
disc_type
->
SetSelection
(
2
);
OnDiscTypeChange
(
dummy_event
);
goto
retry
;
}
disc_device
->
SetValue
(
wxL2U
(
psz_device
)
);
free
(
psz_device
);
break
;
case
2
:
/* VCD probe of some sort */
if
(
!
psz_device
)
psz_device
=
ProbeVCD
(
disc_device
->
GetValue
());
if
(
psz_device
)
{
CdIo_t
*
p_cdio
=
cdio_open
(
psz_device
,
DRIVER_UNKNOWN
);
disc_device
->
SetValue
(
wxL2U
(
psz_device
)
);
/* Set track range accurately if possible. */
if
(
p_cdio
)
{
track_t
i_last_track
=
cdio_get_last_track_num
(
p_cdio
);
disc_title
->
SetRange
(
0
,
i_last_track
-
1
);
}
free
(
psz_device
);
cdio_destroy
(
p_cdio
);
break
;
}
b_probed_VCD
=
true
;
/* Not a VCD. Try for a DVD unless we've been there before. */
if
(
!
b_probed_DVD
&&
(
psz_device
=
ProbeDVD
())
)
{
disc_type
->
SetSelection
(
0
);
OnDiscTypeChange
(
dummy_event
);
goto
retry
;
}
b_probed_DVD
=
true
;
/* Couldn't find a VCD or DVD. See if we can find a CD-DA. */
psz_device
=
ProbeCDDA
(
disc_device
->
GetValue
());
if
(
psz_device
)
{
disc_type
->
SetSelection
(
3
);
OnDiscTypeChange
(
dummy_event
);
goto
retry
;
}
break
;
case
3
:
/* CD-DA Probe */
if
(
!
psz_device
)
psz_device
=
ProbeCDDA
(
disc_device
->
GetValue
());
if
(
psz_device
)
{
CdIo_t
*
p_cdio
=
cdio_open
(
psz_device
,
DRIVER_UNKNOWN
);
disc_device
->
SetValue
(
wxL2U
(
psz_device
)
);
if
(
p_cdio
)
{
track_t
i_last_track
=
cdio_get_last_track_num
(
p_cdio
);
disc_title
->
SetRange
(
0
,
i_last_track
);
}
free
(
psz_device
);
cdio_destroy
(
p_cdio
);
break
;
}
/* Not a CD-DA. Try for a DVD unless we've been there before. */
if
(
!
b_probed_DVD
&&
(
psz_device
=
ProbeDVD
())
)
{
disc_type
->
SetSelection
(
0
);
OnDiscTypeChange
(
dummy_event
);
goto
retry
;
}
/* Couldn't find a CD-DA or DVD. See if we can find a VCD, unless
we've tried that before. */
if
(
!
b_probed_VCD
)
psz_device
=
ProbeVCD
(
disc_device
->
GetValue
());
if
(
psz_device
)
{
disc_type
->
SetSelection
(
2
);
OnDiscTypeChange
(
dummy_event
);
goto
retry
;
}
break
;
default:
msg_Err
(
p_intf
,
"invalid Disc type selection (%d)"
,
disc_type
->
GetSelection
()
);
break
;
}
disc_probe
->
SetValue
(
FALSE
);
UpdateMRL
(
DISC_ACCESS
);
}
#endif
/* HAVE_LIBCDIO */
void
OpenDialog
::
OnDiscTypeChange
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
char
*
psz_device
=
NULL
;
...
...
modules/gui/wxwindows/wxwindows.h
View file @
e69d3141
...
...
@@ -480,6 +480,9 @@ private:
void
OnDiscPanelChangeSpin
(
wxSpinEvent
&
event
);
void
OnDiscPanelChange
(
wxCommandEvent
&
event
);
void
OnDiscTypeChange
(
wxCommandEvent
&
event
);
#ifdef HAVE_LIBCDIO
void
OnDiscProbe
(
wxCommandEvent
&
event
);
#endif
void
OnDiscDeviceChange
(
wxCommandEvent
&
event
);
/* Event handlers for the net page */
...
...
@@ -519,6 +522,7 @@ private:
/* Controls for the disc panel */
wxRadioBox
*
disc_type
;
wxCheckBox
*
disc_probe
;
wxTextCtrl
*
disc_device
;
wxSpinCtrl
*
disc_title
;
int
i_disc_title
;
wxSpinCtrl
*
disc_chapter
;
int
i_disc_chapter
;
...
...
po/Makefile.in.in
View file @
e69d3141
...
...
@@ -32,7 +32,7 @@ mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)"
GMSGFMT
=
@GMSGFMT@
MSGFMT
=
@MSGFMT@
XGETTEXT
=
@XGETTEXT@
MSGMERGE
=
@MSGMERGE@
MSGMERGE
=
msgmerge
MSGMERGE_UPDATE
=
@MSGMERGE@
--update
MSGINIT
=
msginit
MSGCONV
=
msgconv
...
...
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