mirror of
https://github.com/SuperBFG7/ympd
synced 2025-01-14 11:15:49 +00:00
Document state file option
This commit is contained in:
parent
c11bfa0d1a
commit
2098060765
@ -52,3 +52,4 @@ target_link_libraries(mympd ${LIBMPDCLIENT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
|
|||||||
install(TARGETS mympd DESTINATION bin)
|
install(TARGETS mympd DESTINATION bin)
|
||||||
install(FILES mympd.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)
|
install(FILES mympd.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)
|
||||||
install(DIRECTORY htdocs DESTINATION share/${PROJECT_NAME})
|
install(DIRECTORY htdocs DESTINATION share/${PROJECT_NAME})
|
||||||
|
install(DIRECTORY DESTINATION /var/lib/mympd)
|
||||||
|
@ -16,7 +16,6 @@ UI Components
|
|||||||
- Bootstrap Slider: https://github.com/seiyria/bootstrap-slider
|
- Bootstrap Slider: https://github.com/seiyria/bootstrap-slider
|
||||||
- Material Design Icons: https://material.io/tools/icons/?style=baseline
|
- Material Design Icons: https://material.io/tools/icons/?style=baseline
|
||||||
- jQuery: https://jquery.com/
|
- jQuery: https://jquery.com/
|
||||||
- js-cookie: https://github.com/js-cookie/js-cookie
|
|
||||||
|
|
||||||
Backend
|
Backend
|
||||||
-------
|
-------
|
||||||
@ -36,8 +35,9 @@ Unix Build Instructions
|
|||||||
3. create makefile ```cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=RELEASE```
|
3. create makefile ```cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=RELEASE```
|
||||||
4. build ```make```
|
4. build ```make```
|
||||||
5. install ```sudo make install```
|
5. install ```sudo make install```
|
||||||
6. Link your mpd music directory to ```/usr/share/mympd/htdocs/library``` and put ```folder.jpg``` files in your album directories
|
6. change owner of /var/lib/mympd to user you will run mympd, default nobody (chown nobody /var/lib/mympd)
|
||||||
7. Configure your mpd with http stream output to use the local player
|
7. Link your mpd music directory to ```/usr/share/mympd/htdocs/library``` and put ```folder.jpg``` files in your album directories
|
||||||
|
8. Configure your mpd with http stream output to use the local player
|
||||||
|
|
||||||
Run flags
|
Run flags
|
||||||
---------
|
---------
|
||||||
@ -51,6 +51,7 @@ Usage: ./mympd [OPTION]...
|
|||||||
-u, --user <username> drop priviliges to user after socket bind
|
-u, --user <username> drop priviliges to user after socket bind
|
||||||
-m, --mpdpass <password> specifies the password to use when connecting to mpd
|
-m, --mpdpass <password> specifies the password to use when connecting to mpd
|
||||||
-i, --coverimage <filename> filename for coverimage [folder.jpg]
|
-i, --coverimage <filename> filename for coverimage [folder.jpg]
|
||||||
|
-t, --statefile <filename> filename for mympd state [/var/lib/mympd/mympd.state]
|
||||||
-v, --version get version
|
-v, --version get version
|
||||||
--help this help
|
--help this help
|
||||||
```
|
```
|
||||||
|
@ -5,3 +5,4 @@ MPD_PASSWORD=
|
|||||||
WEB_PORT=80
|
WEB_PORT=80
|
||||||
MYMPD_USER=nobody
|
MYMPD_USER=nobody
|
||||||
COVERIMAGE=--coverimage folder.jpg
|
COVERIMAGE=--coverimage folder.jpg
|
||||||
|
STATEFILE=--statefile /var/lib/mympd/mympd.state
|
@ -9,8 +9,9 @@ Environment=MPD_PASSWORD=
|
|||||||
Environment=WEB_PORT=80
|
Environment=WEB_PORT=80
|
||||||
Environment=MYMPD_USER=nobody
|
Environment=MYMPD_USER=nobody
|
||||||
Environment=COVERIMAGE=--coverimage folder.jpg
|
Environment=COVERIMAGE=--coverimage folder.jpg
|
||||||
|
Envirinment=STATEFILE=--statefile /var/lib/mympd/mympd.state
|
||||||
EnvironmentFile=/etc/default/mympd
|
EnvironmentFile=/etc/default/mympd
|
||||||
ExecStart=/usr/bin/mympd --user $MYMPD_USER --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT $COVERIMAGE
|
ExecStart=/usr/bin/mympd --user $MYMPD_USER --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT $COVERIMAGE $STATEFILE
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -31,7 +31,6 @@ var isTouch = Modernizr.touch ? 1 : 0;
|
|||||||
var playstate = '';
|
var playstate = '';
|
||||||
var progressBar;
|
var progressBar;
|
||||||
var volumeBar;
|
var volumeBar;
|
||||||
var coverImageFile = '';
|
|
||||||
var settings = {};
|
var settings = {};
|
||||||
|
|
||||||
var app = {};
|
var app = {};
|
||||||
@ -213,7 +212,7 @@ app.route=function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
sendAPI({"cmd":"MPD_API_GET_SETTINGS"},parseSettings);
|
getSettings();
|
||||||
sendAPI({"cmd":"MPD_API_GET_OUTPUTNAMES"},parseOutputnames);
|
sendAPI({"cmd":"MPD_API_GET_OUTPUTNAMES"},parseOutputnames);
|
||||||
|
|
||||||
webSocketConnect();
|
webSocketConnect();
|
||||||
@ -432,6 +431,10 @@ function parseSettings(obj) {
|
|||||||
setLocalStream(obj.data.mpdhost,obj.data.streamport);
|
setLocalStream(obj.data.mpdhost,obj.data.streamport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSettings() {
|
||||||
|
sendAPI({"cmd":"MPD_API_GET_SETTINGS"},parseSettings);
|
||||||
|
}
|
||||||
|
|
||||||
function parseOutputnames(obj) {
|
function parseOutputnames(obj) {
|
||||||
$('#btn-outputs-block button').remove();
|
$('#btn-outputs-block button').remove();
|
||||||
if ( Object.keys(obj.data).length ) {
|
if ( Object.keys(obj.data).length ) {
|
||||||
@ -1125,7 +1128,7 @@ function confirmSettings() {
|
|||||||
"mixrampdelay": $('#inputMixrampdelay').val(),
|
"mixrampdelay": $('#inputMixrampdelay').val(),
|
||||||
"notificationWeb": ($('#btnnotifyWeb').hasClass('btn-success') ? 1 : 0),
|
"notificationWeb": ($('#btnnotifyWeb').hasClass('btn-success') ? 1 : 0),
|
||||||
"notificationPage": ($('#btnnotifyPage').hasClass('btn-success') ? 1 : 0)
|
"notificationPage": ($('#btnnotifyPage').hasClass('btn-success') ? 1 : 0)
|
||||||
}});
|
}},getSettings);
|
||||||
$('#settings').modal('hide');
|
$('#settings').modal('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
mympd.1
3
mympd.1
@ -33,6 +33,9 @@ specifies the password to use when connecting to mpd
|
|||||||
\fB-i\fR, \fB\-\-coverimage FILENAME\fR
|
\fB-i\fR, \fB\-\-coverimage FILENAME\fR
|
||||||
filename for coverimage [folder.jpg]
|
filename for coverimage [folder.jpg]
|
||||||
.TP
|
.TP
|
||||||
|
\fB-t\fR, \fB\-\-statefile FILENAME\fR
|
||||||
|
filename for mympd state [/var/lib/mympd/mympd.state]
|
||||||
|
.TP
|
||||||
\fB\-v\fR, \fB\-\-version\fR
|
\fB\-v\fR, \fB\-\-version\fR
|
||||||
print version and exit
|
print version and exit
|
||||||
.TP
|
.TP
|
||||||
|
@ -113,7 +113,8 @@ void callback_mympd(struct mg_connection *nc, const struct mg_str msg)
|
|||||||
mpd_return_pair(mpd.conn, pair);
|
mpd_return_pair(mpd.conn, pair);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(p_charbuf1);
|
free(p_charbuf1);
|
||||||
|
n = snprintf(mpd.buf, MAX_SIZE, "{\"type\":\"result\", \"data\": \"ok\"}");
|
||||||
break;
|
break;
|
||||||
case MPD_API_GET_ARTISTALBUMTITLES:
|
case MPD_API_GET_ARTISTALBUMTITLES:
|
||||||
je = json_scanf(msg.p, msg.len, "{ data: { albumartist:%Q, album:%Q } }", &p_charbuf1, &p_charbuf2);
|
je = json_scanf(msg.p, msg.len, "{ data: { albumartist:%Q, album:%Q } }", &p_charbuf1, &p_charbuf2);
|
||||||
|
Loading…
Reference in New Issue
Block a user