Add RTTTL/eMelody/iMelody ringtones and separate notification/SMS sound config
This commit is contained in:
1 parent
c766f6c53b
commit
9c28fa1e4c
46 files changed
+2452
-148
No files matched your search
@@ -1,4 +1,5 @@
|
||||
#include "phone_data.h"
|
||||
#include "monotone.h"
|
||||
#include "../sxmo-dwm/dwm_plugin.h"
|
||||
|
||||
#include <X11/Xatom.h>
|
||||
@@ -104,7 +105,8 @@ bool isStandardAudioExt(const std::string& ext) {
|
||||
}
|
||||
|
||||
bool isSupportedAudioExt(const std::string& ext) {
|
||||
return isStandardAudioExt(ext) || isTrackerFormatExt(ext);
|
||||
return isStandardAudioExt(ext) || isTrackerFormatExt(ext) ||
|
||||
isMonotoneExt(ext);
|
||||
}
|
||||
|
||||
std::string toUpperTag(const std::string& ext) {
|
||||
@@ -504,13 +506,27 @@ int runMusicApp(int argc, char** argv) {
|
||||
"amixer -c 0 cset \"name='RX3 MIX1 INP1'\" 3 >/dev/null 2>&1; "
|
||||
"wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 >/dev/null 2>&1");
|
||||
|
||||
std::string loadTarget = tr.path;
|
||||
if (isMonotoneFile(tr.path)) {
|
||||
loadTarget = "/tmp/xmusic_monotone.wav";
|
||||
MonotoneSong song;
|
||||
if (!synthesizeMonotoneFileToWav(tr.path, loadTarget, 1, &song)) {
|
||||
setBanner("Invalid melody file");
|
||||
isPlaying = false;
|
||||
return;
|
||||
}
|
||||
if (!song.name.empty()) {
|
||||
mediaTitle = song.name;
|
||||
}
|
||||
}
|
||||
|
||||
ensureMpvRunning();
|
||||
if (tryConnectIpc()) {
|
||||
sendIpcRaw("{\"command\":[\"loadfile\",\"" + jsonEscape(tr.path) +
|
||||
sendIpcRaw("{\"command\":[\"loadfile\",\"" + jsonEscape(loadTarget) +
|
||||
"\",\"replace\"]}");
|
||||
sendIpcRaw("{\"command\":[\"set_property\",\"pause\",false]}");
|
||||
} else {
|
||||
pendingLoadPath = tr.path;
|
||||
pendingLoadPath = loadTarget;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -808,7 +824,7 @@ int runMusicApp(int argc, char** argv) {
|
||||
size_t end = line.find('"', start);
|
||||
if (end != std::string::npos && end > start) {
|
||||
std::string t = line.substr(start, end - start);
|
||||
if (!t.empty()) {
|
||||
if (!t.empty() && t.find("xmusic_monotone") == std::string::npos) {
|
||||
mediaTitle = prettifyTrackName(t);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user