Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
0b7d7fe0
Commit
0b7d7fe0
authored
Aug 20, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.20.x'
parents
616abdda
cf961351
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
84 deletions
+49
-84
Makefile.am
Makefile.am
+32
-21
Main.java
android/src/Main.java
+6
-52
configure.ac
configure.ac
+1
-1
Connection.cxx
src/lib/nfs/Connection.cxx
+2
-2
NfsStorage.cxx
src/storage/plugins/NfsStorage.cxx
+8
-8
No files found.
Makefile.am
View file @
0b7d7fe0
...
...
@@ -345,6 +345,7 @@ clean-local:
rm
-rf
android/build
libmpd.so
:
$(filter %.a
,
$(src_mpd_LDADD)) libmain.a
$(AM_V_GEN)
$(AM_V_CXXLD)$(CXXLD)
-shared
-Wl
,--no-undefined,-shared,-Bsymbolic
-llog
-lz
-o
$@
$(AM_CXXFLAGS)
$(CXXFLAGS)
$(LDFLAGS)
src/libmain_a-Main.o
$(src_mpd_LDADD)
$(LIBS)
ANDROID_SDK_BUILD_TOOLS_VERSION
=
27.0.0
...
...
@@ -373,17 +374,19 @@ AIDL_JAVA_FILES = $(patsubst $(srcdir)/android/src/%.aidl,android/build/src/org/
android/build/src/org/musicpd/IMain.java
:
android/build/src/org/musicpd/IMainCallback.java
$(AIDL_JAVA_FILES)
:
android/build/src/org/musicpd/%.java: $(srcdir)/android/src/%.aidl
@
$(MKDIR_P)
$
(
@D
)
@
cp
$<
$
(
@D
)
/
$(AIDL)
-Iandroid
/build/src
-oandroid
/build/src
$
(
patsubst %.java,%.aidl,
$@
)
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P)
$
(
@D
)
$(AM_V_at)
cp
$<
$
(
@D
)
/
$(AM_V_at)$(AIDL)
-Iandroid
/build/src
-oandroid
/build/src
$
(
patsubst %.java,%.aidl,
$@
)
$(ANDROID_XML_RES_COPIES)
:
$(ANDROID_XML_RES)
@
$(MKDIR_P)
$
(
dir
$@
)
cp
$
(
patsubst android/build/%,
$(srcdir)
/android/%,
$@
)
$@
$(AM_V_at)$(MKDIR_P)
$
(
@D
)
$(AM_V_at)
cp
$
(
patsubst android/build/%,
$(srcdir)
/android/%,
$@
)
$@
android/build/resources.apk
:
$(ANDROID_XML_RES_COPIES) android/build/res/drawable/icon.png android/build/res/drawable/notification_icon.png
@
$(MKDIR_P)
android/build/gen
$(AAPT)
package
-f
-m
--auto-add-overlay
\
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P)
android/build/gen
$(AM_V_at)$(AAPT)
package
-f
-m
--auto-add-overlay
\
--custom-package
org.musicpd
\
-M
$(srcdir)
/android/AndroidManifest.xml
\
-S
android/build/res
\
...
...
@@ -395,42 +398,50 @@ android/build/resources.apk: $(ANDROID_XML_RES_COPIES) android/build/res/drawabl
android/build/gen/org/musicpd/R.java
:
android/build/resources.apk
android/build/classes.dex
:
$(JAVA_SOURCE_PATHS) $(AIDL_JAVA_FILES) android/build/gen/org/musicpd/R.java
@
$(MKDIR_P)
$(JAVA_CLASSFILES_DIR)
$(JAVAC)
-source
1.6
-target
1.6
-Xlint
:-options
\
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P)
$(JAVA_CLASSFILES_DIR)
$(AM_V_at)$(JAVAC)
-source
1.6
-target
1.6
-Xlint
:-options
\
-cp
$(ANDROID_SDK_PLATFORM_DIR)
/android.jar:
$(JAVA_CLASSFILES_DIR)
\
-h
android/build/include
\
-d
$(JAVA_CLASSFILES_DIR)
$^
$(DX)
--dex
--output
$@
$(JAVA_CLASSFILES_DIR)
$(
AM_V_at)$(
DX)
--dex
--output
$@
$(JAVA_CLASSFILES_DIR)
android/build/include/org_musicpd_Bridge.h
:
android/build/classes.dex
BUILT_SOURCES
=
android/build/include/org_musicpd_Bridge.h
android/build/lib/$(ANDROID_ABI)/libmpd.so
:
libmpd.so
mkdir
-p
$
(
@D
)
rm
-f
$@
$(STRIP)
-o
$@
$<
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P)
$
(
@D
)
$(AM_V_at)
rm
-f
$@
$(AM_V_at)$(STRIP)
-o
$@
$<
android/build/res/drawable/icon.png
:
mpd.svg
mkdir
-p
$
(
@D
)
rsvg-convert
--width
=
48
--height
=
48
$<
-o
$@
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P)
$
(
@D
)
$(AM_V_at)
rsvg-convert
--width
=
48
--height
=
48
$<
-o
$@
android/build/res/drawable/notification_icon.png
:
android/build/res/drawable/icon.png
convert
$<
-colorspace
Gray
-gamma
2.2
$@
$(AM_V_GEN)
$(AM_V_at)
convert
$<
-colorspace
Gray
-gamma
2.2
$@
.DELETE_ON_ERROR
:
android/build/unsigned.apk
android/build/unsigned.apk
:
android/build/classes.dex android/build/resources.apk android/build/lib/$(ANDROID_ABI)/libmpd.so
cp
android/build/resources.apk
$@
cd
$
(
dir
$@
)
&&
zip
-q
-r
$
(
notdir
$@
)
classes.dex lib
$(AM_V_GEN)
$(AM_V_at)
cp
android/build/resources.apk
$@
$(AM_V_at)
cd
$
(
@D
)
&&
zip
-q
-r
$
(
@F
)
classes.dex lib
android/build/$(APK_NAME)-debug.apk
:
android/build/unsigned.apk
jarsigner
-keystore
$(HOME)
/.android/debug.keystore
-storepass
android
-signedjar
$@
$<
androiddebugkey
$(AM_V_GEN)
$(AM_V_at)
jarsigner
-keystore
$(HOME)
/.android/debug.keystore
-storepass
android
-signedjar
$@
$<
androiddebugkey
android/build/$(APK_NAME)-release-unaligned.apk
:
android/build/unsigned.apk
jarsigner
-digestalg
SHA1
-sigalg
MD5withRSA
-storepass
:env ANDROID_KEYSTORE_PASS
-keystore
$(ANDROID_KEYSTORE)
-signedjar
$@
$<
$(ANDROID_KEY_ALIAS)
$(AM_V_GEN)
$(AM_V_at)
jarsigner
-digestalg
SHA1
-sigalg
MD5withRSA
-storepass
:env ANDROID_KEYSTORE_PASS
-keystore
$(ANDROID_KEYSTORE)
-signedjar
$@
$<
$(ANDROID_KEY_ALIAS)
android/build/$(APK_NAME).apk
:
android/build/$(APK_NAME)-release-unaligned.apk
$(ZIPALIGN)
-f
4
$<
$@
$(AM_V_GEN)
$(AM_V_at)$(ZIPALIGN)
-f
4
$<
$@
endif
...
...
android/src/Main.java
View file @
0b7d7fe0
...
...
@@ -156,38 +156,6 @@ public class Main extends Service implements Runnable {
sendMessage
(
MSG_SEND_STATUS
,
mStatus
,
0
,
mError
);
}
@TargetApi
(
Build
.
VERSION_CODES
.
GINGERBREAD
)
private
Notification
buildNotificationGB
(
int
title
,
int
text
,
int
icon
,
PendingIntent
contentIntent
)
{
final
Notification
notification
=
new
Notification
();
notification
.
icon
=
R
.
drawable
.
icon
;
notification
.
contentView
=
new
RemoteViews
(
getPackageName
(),
R
.
layout
.
custom_notification_gb
);
notification
.
contentView
.
setImageViewResource
(
R
.
id
.
image
,
icon
);
notification
.
contentView
.
setTextViewText
(
R
.
id
.
title
,
getText
(
title
));
notification
.
contentView
.
setTextViewText
(
R
.
id
.
text
,
getText
(
text
));
notification
.
contentIntent
=
contentIntent
;
return
notification
;
}
@TargetApi
(
Build
.
VERSION_CODES
.
HONEYCOMB
)
private
Notification
buildNotificationHC
(
int
title
,
int
text
,
int
icon
,
PendingIntent
contentIntent
)
{
return
new
Notification
.
Builder
(
this
)
.
setContentTitle
(
getText
(
title
))
.
setContentText
(
getText
(
text
))
.
setSmallIcon
(
icon
)
.
setContentIntent
(
contentIntent
)
.
getNotification
();
}
@TargetApi
(
Build
.
VERSION_CODES
.
JELLY_BEAN
)
private
Notification
buildNotificationJB
(
int
title
,
int
text
,
int
icon
,
PendingIntent
contentIntent
)
{
return
new
Notification
.
Builder
(
this
)
.
setContentTitle
(
getText
(
title
))
.
setContentText
(
getText
(
text
))
.
setSmallIcon
(
icon
)
.
setContentIntent
(
contentIntent
)
.
build
();
}
private
void
start
()
{
if
(
mThread
!=
null
)
return
;
...
...
@@ -200,26 +168,12 @@ public class Main extends Service implements Runnable {
final
PendingIntent
contentIntent
=
PendingIntent
.
getActivity
(
this
,
0
,
mainIntent
,
PendingIntent
.
FLAG_CANCEL_CURRENT
);
Notification
notification
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
notification
=
buildNotificationJB
(
R
.
string
.
notification_title_mpd_running
,
R
.
string
.
notification_text_mpd_running
,
R
.
drawable
.
notification_icon
,
contentIntent
);
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
HONEYCOMB
)
notification
=
buildNotificationHC
(
R
.
string
.
notification_title_mpd_running
,
R
.
string
.
notification_text_mpd_running
,
R
.
drawable
.
notification_icon
,
contentIntent
);
else
notification
=
buildNotificationGB
(
R
.
string
.
notification_title_mpd_running
,
R
.
string
.
notification_text_mpd_running
,
R
.
drawable
.
notification_icon
,
contentIntent
);
Notification
notification
=
new
Notification
.
Builder
(
this
)
.
setContentTitle
(
getText
(
R
.
string
.
notification_title_mpd_running
))
.
setContentText
(
getText
(
R
.
string
.
notification_text_mpd_running
))
.
setSmallIcon
(
R
.
drawable
.
notification_icon
)
.
setContentIntent
(
contentIntent
)
.
build
();
startForeground
(
R
.
string
.
notification_title_mpd_running
,
notification
);
startService
(
new
Intent
(
this
,
Main
.
class
));
...
...
configure.ac
View file @
0b7d7fe0
...
...
@@ -743,7 +743,7 @@ MPD_ENABLE_AUTO_PKG_LIB(smbclient, SMBCLIENT, [smbclient >= 0.2],
[smbclient input plugin], [libsmbclient not found])
dnl ----------------------------------- NFS -----------------------------
MPD_ENABLE_AUTO_PKG(nfs, NFS, [libnfs],
MPD_ENABLE_AUTO_PKG(nfs, NFS, [libnfs
>= 1.9.5
],
[NFS input plugin], [libnfs not found])
dnl --------------------------------- Qobuz -----------------------------------
...
...
src/lib/nfs/Connection.cxx
View file @
0b7d7fe0
...
...
@@ -47,9 +47,9 @@ NfsConnection::CancellableCallback::Stat(nfs_context *ctx,
{
assert
(
connection
.
GetEventLoop
().
IsInside
());
int
result
=
nfs_stat_async
(
ctx
,
path
,
Callback
,
this
);
int
result
=
nfs_stat
64
_async
(
ctx
,
path
,
Callback
,
this
);
if
(
result
<
0
)
throw
FormatRuntimeError
(
"nfs_stat_async() failed: %s"
,
throw
FormatRuntimeError
(
"nfs_stat
64
_async() failed: %s"
,
nfs_get_error
(
ctx
));
}
...
...
src/storage/plugins/NfsStorage.cxx
View file @
0b7d7fe0
...
...
@@ -249,19 +249,19 @@ NfsStorage::MapToRelativeUTF8(const char *uri_utf8) const noexcept
}
static
void
Copy
(
StorageFileInfo
&
info
,
const
struct
stat
&
st
)
noexcept
Copy
(
StorageFileInfo
&
info
,
const
struct
nfs_stat_64
&
st
)
noexcept
{
if
(
S_ISREG
(
st
.
st
_mode
))
if
(
S_ISREG
(
st
.
nfs
_mode
))
info
.
type
=
StorageFileInfo
::
Type
::
REGULAR
;
else
if
(
S_ISDIR
(
st
.
st
_mode
))
else
if
(
S_ISDIR
(
st
.
nfs
_mode
))
info
.
type
=
StorageFileInfo
::
Type
::
DIRECTORY
;
else
info
.
type
=
StorageFileInfo
::
Type
::
OTHER
;
info
.
size
=
st
.
st
_size
;
info
.
mtime
=
std
::
chrono
::
system_clock
::
from_time_t
(
st
.
st
_mtime
);
info
.
device
=
st
.
st
_dev
;
info
.
inode
=
st
.
st
_ino
;
info
.
size
=
st
.
nfs
_size
;
info
.
mtime
=
std
::
chrono
::
system_clock
::
from_time_t
(
st
.
nfs
_mtime
);
info
.
device
=
st
.
nfs
_dev
;
info
.
inode
=
st
.
nfs
_ino
;
}
class
NfsGetInfoOperation
final
:
public
BlockingNfsOperation
{
...
...
@@ -282,7 +282,7 @@ protected:
}
void
HandleResult
(
gcc_unused
unsigned
status
,
void
*
data
)
noexcept
override
{
Copy
(
info
,
*
(
const
struct
stat
*
)
data
);
Copy
(
info
,
*
(
const
struct
nfs_stat_64
*
)
data
);
}
};
...
...
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