diff --git a/audioutils/rtttl-c/.gitignore b/audioutils/rtttl-c/.gitignore new file mode 100644 index 00000000000..554f9351380 --- /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 00000000000..8ea3355d53b --- /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 00000000000..fa9aa98f88c --- /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 00000000000..ebedaad2287 --- /dev/null +++ b/audioutils/rtttl-c/Makefile @@ -0,0 +1,44 @@ +############################################################################ +# 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_DIR): + $(Q) echo "Cloning rtttl-c repo..." + $(Q) git clone --depth=1 https://git.sr.ht/~qeef/rtttl-c + $(Q) touch $(RTTTL_C_DIR) + +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