This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new d0fa5af39 audioutils: Add RTTTL parsing library
d0fa5af39 is described below

commit d0fa5af39b8eaab9067db0dec45fbbf6f996e120
Author: Jiri Vlasak <[email protected]>
AuthorDate: Mon May 11 09:09:12 2026 +0200

    audioutils: Add RTTTL parsing library
    
    Add a simple library for parsing Ring Tone Text Transfer Language
    (RTTTL).
    
    Signed-off-by: Jiri Vlasak <[email protected]>
---
 audioutils/rtttl-c/.gitignore |  1 +
 audioutils/rtttl-c/Kconfig    | 21 ++++++++++++++++++
 audioutils/rtttl-c/Make.defs  | 25 ++++++++++++++++++++++
 audioutils/rtttl-c/Makefile   | 50 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 97 insertions(+)

diff --git a/audioutils/rtttl-c/.gitignore b/audioutils/rtttl-c/.gitignore
new file mode 100644
index 000000000..554f93513
--- /dev/null
+++ b/audioutils/rtttl-c/.gitignore
@@ -0,0 +1 @@
+/rtttl-c
diff --git a/audioutils/rtttl-c/Kconfig b/audioutils/rtttl-c/Kconfig
new file mode 100644
index 000000000..8ea3355d5
--- /dev/null
+++ b/audioutils/rtttl-c/Kconfig
@@ -0,0 +1,21 @@
+config AUDIOUTILS_RTTTL_C
+       bool "RTTTL parsing library"
+       default n
+       ---help---
+               Simple library for parsing Ring Tone Text Transfer Language 
(RTTTL)
+
+               Define how to make a sound:
+
+                       void
+                       play_tone(struct rtttl_tone tone)
+                       {
+                               /* TODO: Make a sound with
+                                *      tone.frequency_100hz
+                                *      tone.period_us
+                                *      tone.duration_us
+                                */
+                       }
+
+               and then play RTTTL string:
+
+                       rtttl_play("...", play_tone);
diff --git a/audioutils/rtttl-c/Make.defs b/audioutils/rtttl-c/Make.defs
new file mode 100644
index 000000000..fa9aa98f8
--- /dev/null
+++ b/audioutils/rtttl-c/Make.defs
@@ -0,0 +1,25 @@
+############################################################################
+# apps/audioutils/rtttl-c/Make.defs
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+ifneq ($(CONFIG_AUDIOUTILS_RTTTL_C),)
+CONFIGURED_APPS += $(APPDIR)/audioutils/rtttl-c
+endif
diff --git a/audioutils/rtttl-c/Makefile b/audioutils/rtttl-c/Makefile
new file mode 100644
index 000000000..aa290169d
--- /dev/null
+++ b/audioutils/rtttl-c/Makefile
@@ -0,0 +1,50 @@
+############################################################################
+# apps/audioutils/rtttl-c/Makefile
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(APPDIR)/Make.defs
+
+CSRCS = $(RTTTL_C_DIR)/rtttl.c
+
+RTTTL_C_DIR = rtttl-c
+RTTTL_C_VERSION = v0.1.0
+RTTTL_C_RTTTL_H_SHA256 = 
6331174ae34a419ad427d9755f8ba9d3b6a92c09ecc4f36bbe07ec5e4d0cc007
+RTTTL_C_RTTTL_C_SHA256 = 
f0db64ef0b68136bac24616a3d62508bcc54ccdd68265d6447d99b264653b7b9
+
+$(RTTTL_C_DIR):
+       $(Q) echo "Cloning rtttl-c repo..."
+       $(Q) git clone --depth=1 --branch=$(RTTTL_C_VERSION) 
https://git.sr.ht/~qeef/rtttl-c
+       $(Q) touch $(RTTTL_C_DIR)
+       $(Q) echo "Checking rtttl-c hashes..."
+       $(Q) $(APPDIR)/tools/check-hash.sh sha256 $(RTTTL_C_RTTTL_H_SHA256) 
$@/rtttl.h
+       $(Q) $(APPDIR)/tools/check-hash.sh sha256 $(RTTTL_C_RTTTL_C_SHA256) 
$@/rtttl.c
+
+create_includes: $(RTTTL_C_DIR)/rtttl.h
+       $(Q) cp $< $(APPDIR)/include/audioutils
+
+context:: $(RTTTL_C_DIR)
+       $(Q) $(MAKE) create_includes
+
+distclean::
+       $(call DELFILE, $(APPDIR)/include/audioutils/rtttl.h)
+       $(call DELDIR, rtttl-c)
+
+include $(APPDIR)/Application.mk

Reply via email to